You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Manuel Martin <ma...@med.cornell.edu> on 2004/06/24 17:38:17 UTC

constraint concerning the position of the listEdit's submit listener

Hi,
I was wrong and yes Glen you posted the right answer to my problem. Submit
button or listener MUST be placed after the form within the listEdit
component.
Shouldn't it be mentioned in the component's reference documentation?
Next question is how comes that this listener does work or not depending on
its position within the form in the html file and how one can bypass this?

Thanks,				Manuel

>-----Original Message-----
>From: Glen Stampoultzis [mailto:gstamp@iinet.net.au]
>Sent: Monday, June 21, 2004 7:38 PM
>To: Tapestry users
>Subject: Re: listEdit and ListEditMap update
>
>
>Where is your listener attached?  To a form or submit button?
>
>One easy trap to fall into is attaching to a submit button that's placed
>above the values you're trying to submit.
>
>Regards,
>
>Glen
>
>At 04:59 AM 22/06/2004, you wrote:
> >Hi,
> >I'm using a ListEdit component and am wondering about the
> >submitting/rewinding/rendering/validating sequence. I am currently using
a
> >validation method that is called within the listener attached to the
form.
> >Lets imagine that the client make some changes into the form, and then
> >submit them, my problem is currently that I cannot access these changes
at
> >the moment my validation method is called, but only during the last call
to
> >beginRender(). Here is what happens:
> >
> >     0. Submission of the form by the client.
> >     1. First call to beginRender(), listEditMap is unchanged
> >     2. Call to the processForm listener. There, listEditMap.getValues()
> >still gives me an unchanged form when I'd like to see the changes,
validate
> >them and perform various actions if the validation is successful, like
> >activating another page.
> >     3. Last call to beginRender(), changes are (at least) available.
> >
> >In various examples (Vlib or workBench for instance), the information
> >entered by the user seems to be pushed back to the database When the
> >listener (processForm), is called. I don't clearly see why it should be
> >working in these cases and not in mine.
> >
> >Hope that this make sense and thanks in advance for any hints,
> >
> >
> >
> >Manuel Martin, Phd.
> >Institute for Computational Biomedicine
> >Weill Medical College of Cornell University c/o Rockefeller University,
> >Smith Hall 410 1230 York Avenue New York NY 10021
> >ph: 212-746-4449 fax: 212-327-7344
> >http://icb.med.cornell.edu/
> >
> >
> >-----Original Message-----
> >From: Geoff Longman [mailto:glongman@intelligentworks.com]
> >Sent: Monday, June 14, 2004 10:57 AM
> >To: Tapestry users
> >Subject: Re: Spindle 3.1.1 available
> >
> >Spindle just builds web.xml
> >
> >Geoff
> >----- Original Message -----
> >From: "damar thapa" <da...@yahoo.com>
> >To: "Tapestry users" <ta...@jakarta.apache.org>
> >Sent: Monday, June 14, 2004 10:12 AM
> >Subject: Re: Spindle 3.1.1 available
> >
> >
> > > Hi,
> > >
> > > When I create a tapestry project with Eclipse2.1 and
> > > spindle, it did not generate build.xml or deploy.xml
> > > or     framework of one of those files.  It is normal?
> > > Do I have to write build.xml or deploy.xml manually?
> > >
> > > Thanks,
> > >
> > > Damar
> > >
> > >
> > >
> > > --- Geoff Longman <gl...@intelligentworks.com>
> > > wrote:
> > > >
> > > > http://dorffweb.com/?page=taptutorial
> > > >
> > > > Geoff
> > > > ----- Original Message -----
> > > > From: <sa...@women-at-work.org>
> > > > To: "Tapestry users"
> > > > <ta...@jakarta.apache.org>
> > > > Cc: <sp...@lists.sourceforge.net>
> > > > Sent: Saturday, June 12, 2004 2:10 AM
> > > > Subject: Re: Spindle 3.1.1 available
> > > >
> > > >
> > > > >
> > > > > Is there a tutorial how to use Spindle somewhere ?
> > > > >
> > > > >
> > > > > > Bug Fixes.
> > > > > >
> > > >
> > > http://jroller.com/page/glongman/20040611#spindle_3_1_1_available
> > > > > >
> > > > > > Geoff
> > > > > >
> > > > > > Geoffrey Longman
> > > > > > Intelligent Works Inc.
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> > > > tapestry-user-unsubscribe@jakarta.apache.org
> > > > > > For additional commands, e-mail:
> > > > tapestry-user-help@jakarta.apache.org
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > tapestry-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail:
> > > > tapestry-user-help@jakarta.apache.org
> > > > >
> > > >
> > > >
> > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > > tapestry-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
> > > > tapestry-user-help@jakarta.apache.org
> > > >
> > >
> > >
> > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Friends.  Fun.  Try the all-new Yahoo! Messenger.
> > > http://messenger.yahoo.com/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>Glen Stampoultzis
>gstamp@iinet.net.au
>http://members.iinet.net.au/~gstamp/glen/
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: constraint concerning the position of the listEdit's submit listener

Posted by Robert Zeigler <rd...@u.arizona.edu>.
Manuel Martin wrote:
> Hi,
> I was wrong and yes Glen you posted the right answer to my problem. Submit
> button or listener MUST be placed after the form within the listEdit
> component.
> Shouldn't it be mentioned in the component's reference documentation?
> Next question is how comes that this listener does work or not depending on
> its position within the form in the html file and how one can bypass this?
> 
> Thanks,				Manuel
> 

As I understand it, the tapestry rewind process is essentially an exact 
rerender of the original page, only it reads properties from the page 
and updates objects instead of reading properties from objects to render 
onto the page. Listeners are called during the rewind process. 
Component listeners are called when the component itself is rendered.
Objects are updated when the corresponding component would be rendered.
So if your submit button is before a form component, the form component 
won't have had a chance to update its corresponding object when the 
submit listener is called.  Hence, you won't see the updated values in 
your listener.

As far as how to bypass it... put the submit button after the component? 
;) Otherwise, if you only have a single action on the page (update), you 
can attach a listener to the form instead of to the submit button. The 
form listener gets called last. Another possibility is to use a 
combination of submit button listeners and form listeners. I used a 
solution like this on one of my pages where the submit button would 
essentially dictate what action was /going/ to occur, but the action 
wasn't called until the form listener.

Robert Zeigler

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org