Re: dynamic validation for required / not required

2012-05-18 Thread George Christman
"; } f = (Field)componentResources.getEmbeddedComponent(clientId); return source.createValidator(f, validationString, null); } -- View this message in context: http://tapestry.1045711.n5.nabble.com/dynamic-validation-for-required-not-required-tp4422440p57

Re: dynamic validation for required / not required

2012-05-18 Thread Thiago H. de Paula Figueiredo
On Fri, 18 May 2012 16:40:43 -0300, George Christman wrote: Hi Thiago, do you have any suggestions on my previous question? If I had, I'd have posted it, I guarantee. :) -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instruct

Re: dynamic validation for required / not required

2012-05-18 Thread George Christman
Hi Thiago, do you have any suggestions on my previous question? -- View this message in context: http://tapestry.1045711.n5.nabble.com/dynamic-validation-for-required-not-required-tp4422440p5712101.html Sent from the Tapestry - User mailing list archive at Nabble.com

Re: dynamic validation for required / not required

2012-05-16 Thread George Christman
#x27; -- View this message in context: http://tapestry.1045711.n5.nabble.com/dynamic-validation-for-required-not-required-tp4422440p5710856.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsub

Re: dynamic validation for required / not required

2012-05-16 Thread Thiago H. de Paula Figueiredo
On Wed, 16 May 2012 10:05:47 -0300, George Christman wrote: Thiago, I'm getting the following exception while trying to pass back the parameter. Oops, it should be t:validate="prop:getContactNameValidator(component:contactName)". I forgot the default binding for the validate parameter i

Re: dynamic validation for required / not required

2012-05-16 Thread George Christman
sition 24 of input string: getContactNameValidator(component:contactName) -- View this message in context: http://tapestry.1045711.n5.nabble.com/dynamic-validation-for-required-not-required-tp4422440p5710848.html Sent from the Tapestry - User mailing l

Re: dynamic validation for required / not required

2012-05-15 Thread Thiago H. de Paula Figueiredo
On Tue, 15 May 2012 17:33:06 -0300, George Christman wrote: lol I spoke to soon, I don't remember how to pass it back as a parameter Is it something like this? t:validate="prop:contactNameValidator(literal:contactName)" public FieldValidator getContactNameValidator(String clientId) {

Re: dynamic validation for required / not required

2012-05-15 Thread George Christman
stry.1045711.n5.nabble.com/dynamic-validation-for-required-not-required-tp4422440p5710385.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For addi

Re: dynamic validation for required / not required

2012-05-15 Thread George Christman
Ah yes, I forgot about that solution. Good idea, Thanks -- View this message in context: http://tapestry.1045711.n5.nabble.com/dynamic-validation-for-required-not-required-tp4422440p5710378.html Sent from the Tapestry - User mailing list archive at Nabble.com

Re: dynamic validation for required / not required

2012-05-15 Thread Thiago H. de Paula Figueiredo
On Tue, 15 May 2012 16:22:50 -0300, George Christman wrote: So you can't dynamically get the field id's like you can in mixens with ClientElement.getClientId Yes, but if you're not in a mixin, how do you know which field we're dealing? ;-) Maybe I just didn't understand your question, of

Re: dynamic validation for required / not required

2012-05-15 Thread George Christman
So you can't dynamically get the field id's like you can in mixens with ClientElement.getClientId and use a single method? -- View this message in context: http://tapestry.1045711.n5.nabble.com/dynamic-validation-for-required-not-required-tp4422440p5710318.html Sent from the Tapes

Re: dynamic validation for required / not required

2012-05-15 Thread Thiago H. de Paula Figueiredo
On Tue, 15 May 2012 15:01:57 -0300, George Christman wrote: How could I use one method with multiple fields. Not sure how the method detects the client id. Use different methods for different fields with different logics. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5

Re: dynamic validation for required / not required

2012-05-15 Thread George Christman
urce.createValidator(contactEmail, validationString, null); } http://tapestry.1045711.n5.nabble.com/dynamic-validation-for-required-not-required-tp4422440p5710274.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: dynamic validation for required / not required

2011-05-25 Thread Thiago H. de Paula Figueiredo
On Wed, 25 May 2011 00:41:48 -0300, wrote: Thanks Josh and Thiago! :D Here is what I ended up with in case it helps anyone else: public FieldValidator getFieldValidator() { String validationString = "none"; if(attributeDefinition.isRequired()) { validationSt

Re: dynamic validation for required / not required

2011-05-24 Thread jackkurosaki
: Tuesday, May 24, 2011 9:52pm To: "Tapestry users" Subject: Re: dynamic validation for required / not required On Tue, 24 May 2011 19:13:31 -0300, wrote: >> How do you generate your fields? > > Each event has an ordered list of attribute definitions. When someone > registe

Re: dynamic validation for required / not required

2011-05-24 Thread Thiago H. de Paula Figueiredo
On Tue, 24 May 2011 19:13:31 -0300, wrote: How do you generate your fields? Each event has an ordered list of attribute definitions. When someone registers for the event, the page loops through the list of attributes. If the attribute definition says it is to be a short field, it renders

Re: dynamic validation for required / not required

2011-05-24 Thread jackkurosaki
> How do you generate your fields? The app manages attendees for training events. When the event is defined, the administrator can specify additional attributes that need to be collected when someone registers. So one event might need to keep track of attendee's first and last names and anoth

Re: dynamic validation for required / not required

2011-05-24 Thread Josh Canfield
> Thats helpful, but my problem is that I don't know the field id either, so I > can't inject the field.  The fields are determined at run time (attributes > that the user can add or remove) so it has to be flexible. I'm going to assume that you are not dynamically generating your .tml files and

Re: dynamic validation for required / not required

2011-05-24 Thread Thiago H. de Paula Figueiredo
On Tue, 24 May 2011 17:18:27 -0300, wrote: OK I understand how to do that and it works as long as I know the name of yourField so I can use: @InjectComponent private Field yourField; Not necessarily. See the Component getEmbeddedComponent(String embeddedId) method in ComponentRes

Re: dynamic validation for required / not required

2011-05-24 Thread jackkurosaki
y users" , jackkuros...@w9z.org Subject: Re: dynamic validation for required / not required On Tue, 24 May 2011 16:50:46 -0300, wrote: > Is there a way to tell Tapestry to use: > validate="${validationText}" > so if getValidationText returns the string "required"

Re: dynamic validation for required / not required

2011-05-24 Thread Thiago H. de Paula Figueiredo
On Tue, 24 May 2011 16:50:46 -0300, wrote: Is there a way to tell Tapestry to use: validate="${validationText}" so if getValidationText returns the string "required" it will act the same way as if you wrote: validate="required"? As already stated, you need to pass a FieldValidator instance

Re: dynamic validation for required / not required

2011-05-24 Thread jackkurosaki
24, 2011 2:47pm To: "Tapestry users" Subject: Re: dynamic validation for required / not required Thats helpful, but my problem is that I don't know the field id either, so I can't inject the field. The fields are determined at run time (attributes that the user can add or rem

Re: dynamic validation for required / not required

2011-05-24 Thread jackkurosaki
Thats helpful, but my problem is that I don't know the field id either, so I can't inject the field. The fields are determined at run time (attributes that the user can add or remove) so it has to be flexible. I supposed I could put every TextField in an IF statement where the IF has "required

Re: dynamic validation for required / not required

2011-05-24 Thread Thiago H. de Paula Figueiredo
On Tue, 24 May 2011 13:33:48 -0300, wrote: Hm... I've used this before when I ALWAYS want a field to be required, but I didn't see a way to make a field required or not required based on conditions that are only known when the page is rendered. @Inject FieldValidatorSource and use its Fie

Re: dynamic validation for required / not required

2011-05-24 Thread jackkurosaki
24, 2011 11:44am To: "Tapestry users" Subject: Re: dynamic validation for required / not required Hi Jack, Maybe Bean Validation can help you here http://tapestry.apache.org/bean-validation.html <http://tapestry.apache.org/bean-validation.html> Best, Nikola On Tue, May 24, 2011

Re: dynamic validation for required / not required

2011-05-24 Thread Nikola Milikic
Hi Jack, Maybe Bean Validation can help you here http://tapestry.apache.org/bean-validation.html Best, Nikola On Tue, May 24, 2011 at 5:30 PM, wrote: > I know I can make a field required like this: > > > But how can I make it programmaticall

dynamic validation for required / not required

2011-05-24 Thread jackkurosaki
I know I can make a field required like this: But how can I make it programmatically determine whether or not the field is required? I have tried: public String getValidationText() { if (fieldRequired) { return "required" } else { return ""} But that doesn't seem to work. Tapestry s

Re: [T5 5.0.18] - How to 'turn on' dynamic validation

2008-12-17 Thread kawes
in > another > Form. > > >t:value="toCreate.name" t:validate="required"/> > > > > > >value="Cancel"/> > > > > Marcus > > -- View this message in context: http://www.nabble.com/-T5-5.0.18How-to-%2

Re: [T5 5.0.18] - How to 'turn on' dynamic validation

2008-12-17 Thread Marcus Veloso
Hi Kawes, There is another option, you can put the "Cancel" (submit button) in another Form. Marcus

Re: [T5 5.0.18] - How to 'turn on' dynamic validation

2008-12-16 Thread kawes
his is possible on server side only but maybe I am wrong. >> >> Thanks in advance >> kawes >> -- >> View this message in context: >> http://www.nabble.com/-T5-5.0.18How-to-%27turn-on%27-dynamic-validation-tp21020626p21020626.html >> Sent from the Tapes

Re: [T5 5.0.18] - How to 'turn on' dynamic validation

2008-12-16 Thread Howard Lewis Ship
clicked the T5 > says that field cannot be empty. > > Probably this is possible on server side only but maybe I am wrong. > > Thanks in advance > kawes > -- > View this message in context: > http://www.nabble.com/-T5-5.0.18How-to-%27turn-on%27-dynamic-vali

[T5 5.0.18] - How to 'turn on' dynamic validation

2008-12-15 Thread kawes
y when the textfield is empty and Cancel button is clicked the T5 says that field cannot be empty. Probably this is possible on server side only but maybe I am wrong. Thanks in advance kawes -- View this message in context: http://www.nabble.com/-T5-5.0.18How-to-%27turn-on%

dynamic validation

2008-06-25 Thread Joachim Van der Auwera
I have a page which contains an input component for which the limits should be determined at runtime. Does anybody know how this can be best achieved? I tried something like the following in my template t:validate="min=${value.MinimumValue},max=${value.MaximumValue}"/> But this fails. Any i