Hi George,

The problem is with the "component:shiptoContactName" piece of the expression.
Specifying the property prefix (eg: prop:, component:, validate:, etc.) only
works at the beginning of the expression, and it is applied to the entire 
expression.

The thing to do in this case is:

.tml:

<t:textfield ... t:validate="prop:getFieldValidator(shipttoContactName)"/>

.java:

@InjectComponent
@Property
private TextField shiptoContactName;


Now you've injected the component into the page class and made it a property of 
the class, so you can reference it directly in the property expression.

Cheers,

Robert

On May 21, 2012, at 5/2110:11 AM , George Christman wrote:

> Hello, I'm trying to pass back a component id to a backend method as Thiago
> suggested in another post, however it's resulting in the following exception
> before the method is even called. I have a work around passing back the id
> as a String which works without any issues providing the field id's are
> static. However it breaks if your using add row or any other dynamically
> generated id's.  
> 
> java.lang.RuntimeException
> Error parsing property expression
> 'getFieldValidatorTest(component:shiptoContactName)': line 1:21 no viable
> alternative at input '('.
> java.lang.RuntimeException
> line 1:21 no viable alternative at input '('
> 
> The code I'm using is as followed. 
> 
> <t:TextField t:id="shiptoContactName" value="pr.shiptoContactName"
> t:validate="prop:getFieldValidator(component:shiptoContactName)"/>
> 
> 
> public FieldValidator getFieldValidatorTest(Field field) {
>     return null;
> }
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Pass-component-parameter-back-to-method-Exception-tp5712975.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to