Thanks, that'll work indeed.

Do you happen to know whether it's also possible to inject such a field from
the body of a custom component in that custom component? For instance, let's
say we have:

<t:mycomponent>
  <t:textfield t:id="tf1" ... />
</t:mycomponent>

Where I'd like to access the tf1 textfield in mycomponent's java class to
create the validator and store it in a render variable that is then
accessible while rendering, allowing something like this:

<t:mycomponent>
  <t:textfield t:id="tf1" validate="var:validators" ... />
</t:mycomponent>

I tried to add the following in the MyComponent class, which does not seem
to work:

boolean setupRender() {
  TextField tf = resources.getEmbeddedComponent("tf1");
  // construct validators here
 
resources.getPage().getComponentResources().storeRenderVariable("validators",
validators);
}

(the getEmbeddedComponent fails)

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-add-Field-validators-at-render-time-tp5682920p5683187.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

Reply via email to