You will want to use the following translator binding:
translator="translator:number"
Paul
Howard Lewis Ship wrote:
> At the root of this is that the value comes up as a string, and if you
> don't tell Tapestry otherwise, it stays a string ... but needs to be a
> Number for max and min validator
The NumberTranslator has an omitZero property, which by default is true
(personally, I think the more intuitive default value should be false).
You can override this property in your translator binding like so:
Paul
Lukas Ruetz wrote:
> hello list
>
> I have an integer value that is
The easiest way to handle redirect-after-post in Tapestry 4 is to change
your listener method return an ILink instead of void. Tapestry will
redirect accordingly.
Paul
Marc Ende wrote:
> Hi there,
>
> I'm a completly newbe to tapestry but I've done my first steps and
> everything works great.
>
To override the default implementation of a hivemind service, use the
element in your hivemodule.xml.
e.g.
Paul
Giampaolo Tomassoni wrote:
> Dears,
>
> I need to relay on a session object instead of a client
There are many ways to do this. Perhaps the most standard way is to
register one or more javax.servlet.ServletContextListener objects in
your web.xml.
Details here:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContextListener.html
Alternatively, if your initialization logic requires
in 3.x?
>
> thanks,
>
> Mark
>
>
> -Original Message-
> From: Paul Ferraro [mailto:[EMAIL PROTECTED]
> Sent: Wed 3/15/2006 8:59 AM
> To: Tapestry users
> Subject: Re: Any tips to preload application on startup?
>
> There are many ways to do this. P
Here's one I wrote using Tapestry 3.0:
OrderField.jwc:
http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd";>
OrderField.js:
function selectAll(element, selected) {
for (var i = 0; i < element.length; ++i) {
If you want to bind your field to a number with 10 digits, you should
not need to write your own validator nor use custom logic in your listener.
Try this:
Paul
Kent Tong wrote:
> spm tapestryforums.com> writes:
>
>
>> Here is what I would like:
>>
>>
>>
>> > value="v
Log a bug in Jira
(http://issues.apache.org/jira/secure/BrowseProject.jspa?id=10573) and
select "Documentation" as the component.
Paul
Patrick Yip wrote:
From time to time I browse the API and online documents and noticed some
obvious documentation issues, should I report it so it can be checked
There's no need to modify the Tapestry source:
e.g.
Cookie cookie = new Cookie("myname", "myvalue");
cookie.setSecure(true);
cycle.getRequestContext().addCookie(cookie);
Paul
[EMAIL PROTECTED] wrote:
only way to make cookies secure in Tapestry is to modify source ?
public void addCookie(Cookie co
Andreas Andreou wrote:
To the dev list:
should we all provide our localized version (i have a greek one handy
:) )
of ValidationStrings
to be included in the next Tapestry release???
Yes! Create an entry in Jira and submit your localized validation messages.
Paul
Your url probably indicates a direct link (or similar) that triggers the
onDoSthg listener of PageA, no? If you find this behavior undesirable,
then you should redirect to PageB instead of simply activating it.
Paul
david joffrin wrote:
Hi,
I have just realized something today on my code, reall
ectException(page);
}
}
david joffrin schrieb:
> Hi,
>
> No, my URL does not indicate anything like direct link, this is a
> straight www.mydomain.com/foo/bar.
>
> Just to test, how can I programmaticly have a redirect rather than an
> activation.
>
> Thanks.
> DvJ
&
Other locations that come to mind are: a servlet context listener,
overriding the init() method of the Tapestry servlet, or the global
object facility.
Paul
Erik Hatcher wrote:
On May 2, 2005, at 3:03 PM, sastan wrote:
Hello,
i want to initialize something (e.g. do some work) before the first
, 2005, at 5:15 PM, Paul Ferraro wrote:
Other locations that come to mind are: a servlet context listener,
overriding the init() method of the Tapestry servlet, or the global
object facility.
Global, though, will be instantiated on the first call to getGlobal()
though, not on startup. Right
How are you redirecting in your listener? I suspect that's where the
problem is...
Paul
Alberto Lepe wrote:
Here is the challenge:
I have a List of Image's File name, with an ImageSubmit to delete them, like:
image1.jpg [X]
image2.jpg [X]
Quite simple. I press on the [X] and the image is del
PageRedirectException does not actually redirect. It simply activates
the specified page. Consequently, reloading the page reexecutes the
form submit causing a stale link exception since the number of form
elements has changed between rewind and render.
To actually redirect, try the following:
Ed Cohen wrote:
How do I replace the StringValidator's messages with ones in my own
.property file?
Implement getMyMinimumLengthMessage() accordingly.
Also, a quick ognl question. In a .page file, is there a way to get to
the page's getMessage("xyz") method?
Instead of an ognl expressi
Actually, this is not a license issue at all. The workbench build
script needs to be updated to include ognl as a runtime library (not
just compile-time). I'm in the process of fixing this now.
Paul
seloha . wrote:
It did cross my mind that it was something to do with the license but
I though
Yes - all link components have a "renderer" parameter. Bind this to an
instance of org.apache.tapestry.contrib.link.PopupLinkRenderer.
Paul
Scott F. Walter wrote:
Hi,
Is there a way to have a popup where the url for the popup window is a
@DirectLink. I looked at the PopupLink inside the contri
The Foreach component also accepts an iterator for its source
parameter. I use a custom Iterator implementation to achieve simple
looping behavior:
...
where CounterIterator is defined as:
public class CounterIterator implements Iterator
{
private int index;
private int max;
public Co
I think the easiest way to change this behavior globally is to implement
your own TextField component:
public abstract class TextField extends org.apache.tapestry.form.TextField
{
public void updateValue(String value)
{
getValueBinding().setString(((value != null) && (value.length()
FYI, Tapestry 4.0 will include both:
* an IPropertySelectionModel decorator for adding an initial label row
to your model (exists as of alpha-1).
* a "required" parameter
In the meantime, you can obtain the desired behavior in 3.0 by combining
the LabeledPropertySelectionModel class from the 4.0
To implement POST->Redirect->GET, you need to use RedirectException, NOT
PageRedirectException.
Throwing PageRedirectException simply interrupts the current render
cycle and activates the specified page within the same request.
To generate the url required for RedirectException you will need to u
Yes - you will need to use the binding direction "form" for parameters
that you want read during render and updated during rewind.
More details on binding direction here:
http://jakarta.apache.org/tapestry/doc/TapestryUsersGuide/spec.parameter.html
Check out the Palette component in the contrib l
Check out the section on application state objects:
http://jakarta.apache.org/tapestry/current/UsersGuide/state.html#state.aso
Paul
seloha . wrote:
I am trying to write a Tapestry 4.0 application with reference to the
workbench.
Workbench uses:
Visit visit = (Visit) cycle.getEngine().getVisit();
Is your interceptor set in your Hibernate Configuration object? or when
you created your Hibernate Session?
Ideally, you would set the interceptor when you create your session, so
that your interceptor can be constructed using the current user.
Something like:
Session session = sessionFactory.op
Actually, OGNL /does/ support object indexed properties. Read more
about it here:
http://www.ognl.org/2.6.7/Documentation/html/LanguageGuide/indexing.html#N101C5
Paul
Jijoe Vurghese wrote:
I tried searching this forum, but didn't find anyone running into a similar
situation. Here is what I have
This is because pageEndRender() gets called at the end of both rewind
and render.
Your page should implement PageDetachListener and move your
setMessage(null) code to the pageDetached() method.
Paul
Scott F. Walter wrote:
Hi,
I had a solution for displaying messages at the top of page that I
th
Look at the code for the Form and Body components. They both have this
behavior.
Paul
SG wrote:
Hi,
I wanted to know if there is a way to delay/postpone the rendering of
a particular component programmatically. Here is the scenario -
I have an error component, which works off of a collection of
In 4.0, component parameters have a default binding type. The default
binding type for the "selected" parameter is ognl:
http://jakarta.apache.org/tapestry/current/tapestry/ComponentReference/Submit.html
Try this instead:
selected="whichButton" tag="cancel" onclick="form.onsubmit = null;"/>
Use the ognl syntax for static fields:
http://www.ognl.org/2.6.7/Documentation/html/LanguageGuide/staticFields.html
e.g.
@[EMAIL PROTECTED]
Paul
Schulte Marcus wrote:
Can anyone help me with some ognl-Syntax? I want to init a page property
with an Enum-Constant like this:
type="com.bmw.ext
Yes - you guys are right. I think we should change the default binding
of the tag parameter to literal, instead of ognl.
Hensley, Richard wrote:
or tag="literal:cancel"
-Original Message-
From: Mikaƫl Cluseau [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 26, 2005 2:36 PM
To: Tapes
an expression though seems like a huge source of confusion for an
extraordinarily minor saving in keystrokes.
--- Pat
-Original Message-
From: Paul Ferraro [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 26, 2005 3:20 PM
To: Tapestry users
Subject: Re: Tapestry 4.0 Unable to read
Specifically, the GPL and LGPL have a "copyleft" clause. The Apache
License does not. Read more about that here:
http://www.gnu.org/licenses/licenses.html#WhatIsCopyleft
Read more about Apache/GPL compatibility here:
http://www.apache.org/licenses/GPL-compatibility.html
Paul
David Leangen wr
I'm not sure what you mean... If your application server is configured
to use cookies instead of forcing a session ID in the url, then if a
logged in user closes his/her browser without logging out, and then open
their browser again, the existing cookie will still be valid and the
user's session wi
Correct me if I'm wrong, but if you disable the submit/image button
before submitting the form, then the submit's value (or image submit's
coordinates) will not be submitted as a form value. Since Tapestry
relies on these values to determine which submit/image button was
clicked, then the subm
Yes - but I would not recommend using it. It's part of the
HttpSessionContext object that was deprecated some time ago because of
the potential for abuse.
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSessionContext.html#getSession(java.lang.String)
Paul
Krutyakov Roman wrote:
Yes (assuming that they contain different data), but your
IPropertySelectionModel should ideally present a "view" of your
collection - so you should easily be able to create a implementation
class to handle each type of collection.
Paul
Vinicius Carvalho wrote:
Well, once again I'm confused
examples of this sort of
thing.
Erik
On Jun 4, 2005, at 12:43 AM, Paul Ferraro wrote:
Yes (assuming that they contain different data), but your
IPropertySelectionModel should ideally present a "view" of your
collection - so you should easily be able to create a
implementati
Look at org.apache.tapestry.form.translator.NumberTranslator in the 4.0
branch.
It should be easy enough to adapt this to the 3.0 IValidator interface.
Paul
Eric Schneider wrote:
Hi,
Has anyone created a subclass of NumberValidator that includes a
format attribute similar to the DateValida
This has been an ongoing debate on the dev list. Both committers and
users are split around whether or not this feature causes more confusion
than it helps. There was even a vote (which failed) on whether or not
to remove this feature. Check out the dev list archives and read what
has been s
The changes are fairly straight forward, though I haven't gotten around
to formal documentation yet.
In short, use a TextField in place of ValidField; in place of a single
IValidator, you should specify a Translator (if the default is
insufficient), and zero or more Validators.
Validators and
Scott F. Walter wrote:
So the format for the new validator syntax is :
validator:/name/[,/property/[=/value/]]*
My questions are:
1. If I create my own custom validator what do I specify for "name",
is it the full qualified class path or do I need to some how register
"name" with a full qua
Scott F. Walter wrote:
1. Can I specify more than 1 parameter to a custom validator when you
have multiple validators??? The reason I ask this, because if I
specify validators to component like this:
required,maxLen=4,minLen=1
The validators are sepertored by commas, so if I want multiple
lows you
to specify window 'features' ( like width, height, etc)?
On 1/31/05, Paul Ferraro <[EMAIL PROTECTED]> wrote:
Use a normal DirectLink, but specifiy
org.apache.tapestry.contrib.link.PopupLinkRenderer as the renderer.
Paul
Jordan Redner wrote:
Has anyone impleme
assNotFoundException
org.apache.tapestry.contrib.link.PopupLinkRenderer
On 7/5/05, Paul Ferraro <[EMAIL PROTECTED]> wrote:
Yes - look look at PopupLinkRenderer.setFeatures(...).
e.g.
...
where the popup bean is defined as:
Paul
Jer Kah wrote:
Is there a way to use this technique or a simi
Make sure you run the parameters through
DirectLink.constructServiceParameters(...) so they are properly squeezed
by the DataSqueezer.
e.g.
ILink link =
service.getLink(cycle,cycle.getPage(),DirectLink.constructServiceParameters(params));
Paul
Ralph Churchill wrote:
It wasn't clear to me t
does not exist - all parameters to a given service
have a more structured representation (e.g. ExternalServiceParameter,
DirectServiceParameter, etc.).
Paul
Kent Tong wrote:
Paul Ferraro columbia.edu> writes:
Make sure you run the parameters through
DirectLink.constructServiceParamet
This doesn't answer your question, but...
If you don't need access to the submitted values of your form within
your listener method (as is typically the case) then you can easily (and
more efficiently) implement a cancel button by combining any type of
link component (e.g. DirectLink) with a
o
No - but onchange can be specified as an informal parameter.
e.g.
onchange="doSomething()">
... where doSomething() is a function defined in your IScript.
Paul
Muhariz Jabeer wrote:
hey guys, does the PropertySelection component have something like an
"onchange"
property which you
can bin
'string' refers to a translator, not a validator.
For the complete list of validators contributed to the Validators
configuration point, see
framework/src/descriptor/META-INF/tapestry.form.validator.xml in the
source distribution.
Since StringTranslator is the default translator for TextField
Your .script file should look something like this:
Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd";>
Did you read the documentation section of Application State Objects (ASOs)?
http://jakarta.apache.org/tapestry/UsersGuide/state.html#state.aso
Paul
Henri Dupre wrote:
getEngine().getVisit() has been deprecated and if I understand with
ASO, a call to getVisit() will create the visit. So how to
How does your custom service implement IEngineService.getLink(...)?
If you are closely adhering to the code outlined at
http://wiki.apache.org/jakarta-tapestry/FriendlyUrls then this method
should look something like this:
public static final String SERVICE_NAME = "EnrollmentReportService"
I would expect the template parser to throw an exception in this case.
A tag should not be allowed to specify the same attribute twice.
As far as I know, this has not yet been addressed in 4.0. I would go
ahead and create a jira entry.
In the meantime, it would be great if Spindle could flag
FYI - In 4.0, client-side validation is enabled per form.
e.g.
...
Paul
tapestrycn wrote:
Hi,
The ValidField component can easily enable client scripting and the text field
rendered by the component is always focused,However,after upgrading to
validating TextField in tapestry 4,the two fe
You need to define "logoutToPage" in your component specification as a
parameter, not a property.
Paul
Pickerel Yee wrote:
>I have a component, and define it in the .jwc as below:
>allow-body="no" allow-informal-parameters="no">
>
>
>
>and this component is be used in a page as blow:
>
>
Check out the org.apache.tapestry.link.ButtonLinkRenderer in the 4.0
codebase. You can implement your cancel button like this:
renderer="ognl:beans.buttonRenderer">Cancel
where buttonRenderer is a bean:
class="org.apache.tapestry.link.ButtonLinkRenderer"/>
Paul
Ryan Wynn wrote:
On a side
The validators binding is meant for static initialization parameters
only. If you want to use dynamic initialization parameters, use the
bean approach that you used in Tapestry 3.
e.g.
Jone.hwk wrote:
Hi,
I'd like to change the "maxLength" at runtime for the validator
Ben is right. Currently, values are bound only if translation succeeds
(this is essential), but before validation happens.
This was done purposefully to support "Save" style logic, since
validation errors can optionally be ignored in the triggered form
listener by ignoring the value of IValidat
g
unwanted validation exceptions *inside* your domain objects that will
prevent normal form processing from operating.
On 8/23/05, Paul Ferraro <[EMAIL PROTECTED]> wrote:
Ben is right. Currently, values are bound only if translation succeeds
(this is essential), but before validation happen
Until then, you can still leverage the 3.0 style by specifying an ognl
list to the validators parameter.
e.g.
...
Howard Lewis Ship wrote:
In beta-5, due shortly, you will be able to define your pattern
validator as a managed , and then reference the bean in your
list as $name.
li
The ButtonLinkRenderer is new to Tapestry 4.0. Also, as of beta-5, it
has been refactored to org.apache.tapestry.contrib.link along with the
other link renderers.
Here is the ButtonLinkRenderer class retrofitted for Tapestry 3.0. Note
that since ILinkComponent.getTarget() was not added until 4
The NumberTranslator internally uses java.text.DecimalFormat to
parse/format numbers. Unfortunately, DecimalFormat is only capable of
parsing/formatting numbers with at most double precision or smaller.
To work with BigDecimal (or BigInteger for that matter) you will need to
write your own Tran
Unfortunately, disabling the submit button in this manner will prevent
your submit listener from being invoked since the value of the submit
button (like any disabled form component) is not submitted with the
form. This value is looked for by the submit component to determine
whether or not to inv
A few betas ago, Howard introduced an "omitZero" property to
NumberTranslator. Interestingly, omitZero is true by default. This
means that, by default, 0's will be formatted as "", even though
submitted "0"s are parsed as 0, and submitted ""s are parsed as null. I
disagree that special treatment
There are many approaches one can take depending on your architecture.
For simple web applications, I find it easiest to implement a
javax.servlet.ServletContextListener.
Place your application initialization code in the void
contextInitialized(ServletContextEvent event) method.
Register your l
Off the top of my head, try something like this:
public class UniqueValidator implements IValidator
{
private Set valueSet = new HashSet();
public toObject(IFormComponent field, String input) throws
ValidatorException
{
// Preliminary validation
// Validate uniqueness
i
I suspect that your issue has to do with the way you are generating your
url for RedirectException(). I would guess that the user's session id
is not being encoded properly.
Can you explain how you are generating your redirect url in step 3?
To properly generate a non-SSL redirect to your login
le.getEngine().getService(Tapestry.PAGE_SERVICE).getLink(cycle,
cycle.getPage(), new String[] { "Account" });
throw new RedirectException(link.getAbsoluteURL("http",
request.getServerName(), 80, null, true));
The difference from yours being the second parameter to the call to
getAbso
To use the contrib library, include the following line in your
.application file:
I believe theserverside uses a servlet filter to intercept *.tss
requests to trap and foward these requests to the appropriate Tapestry
uri. Do a search in the user list archives and you'll find plenty on
t
avets wrote:
thanks a lot...and one more thing, .application file needs to be named
same way as application or any name will do?
Paul Ferraro wrote:
To use the contrib library, include the following line in your
.application file:
I believe theserverside uses a servlet filter to intercept
Your MyProtectedPage should implement PageValidateListener. Move this
logic into the corresponding pageValidate(PageEvent) method.
Paul
Scott F. Walter wrote:
I am having a problem with going back to a login page after a session
has timed out. I have a page called MyProtectedPage that all my p
When you submit a form via a submit button, the submit button's name and
value are posted along with the form data. The Submit component relies
on this information to determine whether or not to trigger its own
listener. In HTML, when a form element is disabled, its name and value
are not pos
Yes, but you'll need to define their location relative to the WEB-INF
directory in your .application file.
e.g.
Paul
Mark Stang wrote:
Hi,
Does Tapestry 3.0.2 support putting files in sub-directories? I am starting to get a
lot of .jwc, .page, and .html files? It would be easier if
The url generated by this script is specific to Tapestry's built-in
Direct and Action services. Since FURLs overrides the url
generation/parsing logic of these services, the script breaks.
If you ask me, it would have been a better decision to copy logic from
the getLink() method from Form rath
If your Home.page is mapped to "index", why not map your Login.page to
"admin/index". That way your servlet filter logic is easy.
You might even be able to define "index.htm" as a welcome-file and do
without the filter entirely.
Paul
Zachary Pinter wrote:
I've just installed the FriendlyUrls pa
Unfortunately, no.
Paul
Danny Angus wrote:
Is there a configuration setting (In the servlet params perhaps?) I can use
to change the Shared Janitor Thread "interval"
I want to reduce it to help diagnose the root cause of an issue we have
with stale links, and possibly increase it in production to m
Actually, that's not possible. The shared janitor thread "locks" its
interval after it is created inside getSharedJanitorThread().
setInterval(...) will result in an IllegalStateException() in the code
below.
Paul
Kent Tong wrote:
Danny Angus slc.co.uk> writes:
Is there a configuration sett
Yes - thanks for pointing that out.
Kent Tong wrote:
Paul Ferraro columbia.edu> writes:
Actually, that's not possible. The shared janitor thread "locks" its
interval after it is created inside getSharedJanitorThread().
setInterval(...) will result in an IllegalStateExcep
To summarize...
Prior to 3.0.3, the Asset service, which is responsible for streaming
private assets from the classpath, only required a single service
parameter: the path to the resource. This was problematic since a rogue
user could manipulate the url to fetch any resource such as your
serve
The RedirectException() will forward (i.e. server-side) the request if a
relative uri is specified. If the uri specified is absolute then it
will perform a redirect (as in #2).
When I need to redirect to a page, I perform the following:
throw new
RedirectException(cycle.getEngine().getService(T
That should be configured in your servlet engine, *not* in Tapestry. If
you don't want the servlet context in the url, then you should configure
your servlet engine to use a servlet context of "/".
Paul
Henrik Vendelbo wrote:
I need to do a bit of modification to the friendly urls implementatio
s"
Sent: Friday, April 15, 2005 7:34 PM
Subject: Re: Service construction, friendly urls
I did, but it doesnt seem to work.
- Original Message -
From: "Paul Ferraro" <[EMAIL PROTECTED]>
To: "Tapestry users"
Sent: Friday, April 15, 2005 7:18 PM
Subject: Re: Se
Try this:
Have your MenuBuilder component implement IDirect.
IRequestCycle cycle = this.getPage().getRequestCycle();
Object[] parameters = new Object[] { menuItem }; // Here is where you
would indicate the menu item
String url =
cycle.getEngine().getService(Tapestry.DIRECT_SERVICE).getLink(cycle,
I would recommend writing your own IValidator implementation that uses a
java.text.DecimalFormat object to format and parse your values.
Regrettably, Tapestry 3.0.x is missing some obvious IValidators like
this one. Part of the reason, I think, is that there is so much
duplication across impl
Have you looked at the contrib:MultiplePropertySelection component? It
does exactly this.
Paul
Random Tapestry User wrote:
Hi all,
Not sure if I'm missing something here. I've read the book, and I know
this must be something simple I have overlooked.
I have a survey that the user needs to fill
88 matches
Mail list logo