Hi,

you can use Ajax.Request of Prototype for it.



Create a Action Link for register the method and call this method by Ajax.


Example:


////////////////////////////////////////////////////////////Page
Class///////////////////////////////////////////////////////////////////////////////
@Property
private String url;

/**
* Register the action Link
*/
void preRender() {

  Link link = recursosComponente.createActionLink("firstTextField",
false, new Object[0]);
  url = link.toAbsoluteURI();

}


/*
* Action Link Event
*/

StreamResponse onFirsTextField() {

 String value = request.getParameter("firstValue");

 // do some thing

 //return a stream response

}


///////////////////////////////////////////////////////TEMPLATE//////////////////////////////////////////////////


<input t:type="TextField" id="first" onBlur="callAjax()"/>
<input t:type="TextField" id="second"/>

<script>

   function callAjax() {
      var parameter = 'firstValue=' + $('first').value;

      new Ajax.Request('${url}',parameters: parameter,  {
        onSuccess: function(transport) {

         // transport has a Stream response returned
         // do some thing
        }
   });

</script>



2010/7/12 tapestry newbie <yang.jerr...@yahoo.ca>

>
> Hi,
>
> I am a Tapestry newbie, using 5.1.
>
> I have two textfields, the second textfield's potential values is dependent
> on the value of the first.  How do I get the value of the first textfield?
> After a validate/submit, there is no problem retrieving this value, but I
> need the content of the first textfield before a validate/submit.
>
> Any help/hints appreciated!
>
>
>
>
> --
> View this message in context:
> http://old.nabble.com/retrieve-textfield-value-prior-to-validate-submit-tp29140392p29140392.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
>
>


-- 
Pablo Henrique dos Reis

Reply via email to