You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jiju Mathew <Ji...@ibsplc.com> on 2006/12/14 13:09:32 UTC

For loop Rewind problem

Hi All,
I have a list of contacts in MyPage class.Tapestry rendered all the 
contacts
in the list asTextFields using @For Loop component ,I have modified some 
of the 
contact details and submit ,its working fine.

But after the page is rendered if I am adding one more row to the list 
using javascript,
During rewind the new contact is not getting added to the list in the 
MyPage class

is there any mechanism(or parameter setting) to add this newly added 
contact to the  List ?

Thanks

Regards
jiju





Re: For loop Rewind problem

Posted by andyhot <an...@di.uoa.gr>.
Actually i remember thinking (or reading about) yet another way..
Make the loop have 10 more rows, and render them hidden (display:none)

Then, the js can make them visible on demand.



Robert Zeigler wrote:
> One other way to do this is to have a (tapestry component) hidden form
> field (make sure "raw" is set to true). Then when you submit, you can
> use js to save the information from the js-added form fields into your
> hidden field, and parse it server-side.  It would be much more
> /elegant /to have the js-helper functions that were mentioned, but...
> this is, at least, functional. :)
>
> Robert
>
> andyhot wrote:
>> yep, there's no nice Tapestry way in what you're trying to do, esp.
>> if you're trying to *avoid ajax*.
>>
>> Incidentally, this was the most interesting question i got asked while
>> presenting
>> Tapestry in out local JUG. It got me thinking of adding a few js helper
>> functions
>> that would know how to add new fields in tapestry forms, e.t.c. ... it
>> still remains
>> an idea though!
>>
>> Anyway, last time i wanted to do something similar without ajax, i
>> simply handcrafted
>> the generated names of the inputs and used cycle.getParameter in the
>> listener.
>>
>> Karthik N wrote:
>>
>>> also you can consider using Tacos if you're wed to tapestry 4.0.x
>>>
>>> On 12/14/06, Ron Piterman <rp...@gmx.net> wrote:
>>>
>>>> Tapestry traces the rendered components and uses this info on rewind -
>>>> its better not to temper with that.
>>>> If you need JS magic, try using T41 - using Ajax this should be
>>>> possible, though only straight-forward for jesse and other enlightend
>>>> developers :)
>>>> Cheers,
>>>> Ron
>>>>
>>>> Jiju Mathew wrote:
>>>>
>>>>> Hi All,
>>>>> I have a list of contacts in MyPage class.Tapestry rendered all the
>>>>> contacts
>>>>> in the list asTextFields using @For Loop component ,I have modified
>>>>
>>>> some
>>>>
>>>>> of the
>>>>> contact details and submit ,its working fine.
>>>>>
>>>>> But after the page is rendered if I am adding one more row to the
>>>>> list
>>>>> using javascript,
>>>>> During rewind the new contact is not getting added to the list in the
>>>>> MyPage class
>>>>>
>>>>> is there any mechanism(or parameter setting) to add this newly added
>>>>> contact to the  List ?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Regards
>>>>> jiju
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 


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


Re: For loop Rewind problem

Posted by jiju <ji...@ibsplc.com>.
I have created addRows & delete rows using ajax -direct link using tacos, its
working fine 

But still I have a doubt, it will work only when my contactList is stored in
session (@Persist)
i.e during rewind process it will check the values in the hidden fields with
that of the elements 
in the contactList.
If i don't like to store any such objects in my session scope,is it possible
to use a For Component effectively.?
 



karthik.nar wrote:
> 
> yet another option on similar lines is to have display=none for a bunch of
> fields that are actually there in your HTML form and rendered via
> tapestry,
> but show up only when the user clicks on the button to add a row. ( of
> course that would mean that you cannot support "infinite" adds! )
> 
> On 12/14/06, Robert Zeigler <ro...@scazdl.org> wrote:
>>
>> One other way to do this is to have a (tapestry component) hidden form
>> field (make sure "raw" is set to true). Then when you submit, you can
>> use js to save the information from the js-added form fields into your
>> hidden field, and parse it server-side.  It would be much more /elegant
>> /to have the js-helper functions that were mentioned, but... this is, at
>> least, functional. :)
>>
>> Robert
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/For-loop-Rewind-problem-tf2820424.html#a7885990
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: For loop Rewind problem

Posted by Karthik N <ka...@gmail.com>.
yet another option on similar lines is to have display=none for a bunch of
fields that are actually there in your HTML form and rendered via tapestry,
but show up only when the user clicks on the button to add a row. ( of
course that would mean that you cannot support "infinite" adds! )

On 12/14/06, Robert Zeigler <ro...@scazdl.org> wrote:
>
> One other way to do this is to have a (tapestry component) hidden form
> field (make sure "raw" is set to true). Then when you submit, you can
> use js to save the information from the js-added form fields into your
> hidden field, and parse it server-side.  It would be much more /elegant
> /to have the js-helper functions that were mentioned, but... this is, at
> least, functional. :)
>
> Robert
>
>

Re: For loop Rewind problem

Posted by Robert Zeigler <ro...@scazdl.org>.
One other way to do this is to have a (tapestry component) hidden form 
field (make sure "raw" is set to true). Then when you submit, you can 
use js to save the information from the js-added form fields into your 
hidden field, and parse it server-side.  It would be much more /elegant 
/to have the js-helper functions that were mentioned, but... this is, at 
least, functional. :)

Robert

andyhot wrote:
> yep, there's no nice Tapestry way in what you're trying to do, esp.
> if you're trying to *avoid ajax*.
> 
> Incidentally, this was the most interesting question i got asked while
> presenting
> Tapestry in out local JUG. It got me thinking of adding a few js helper
> functions
> that would know how to add new fields in tapestry forms, e.t.c. ... it
> still remains
> an idea though!
> 
> Anyway, last time i wanted to do something similar without ajax, i
> simply handcrafted
> the generated names of the inputs and used cycle.getParameter in the
> listener.
> 
> Karthik N wrote:
> 
>>also you can consider using Tacos if you're wed to tapestry 4.0.x
>>
>>On 12/14/06, Ron Piterman <rp...@gmx.net> wrote:
>>
>>>Tapestry traces the rendered components and uses this info on rewind -
>>>its better not to temper with that.
>>>If you need JS magic, try using T41 - using Ajax this should be
>>>possible, though only straight-forward for jesse and other enlightend
>>>developers :)
>>>Cheers,
>>>Ron
>>>
>>>Jiju Mathew wrote:
>>>
>>>>Hi All,
>>>>I have a list of contacts in MyPage class.Tapestry rendered all the
>>>>contacts
>>>>in the list asTextFields using @For Loop component ,I have modified
>>>
>>>some
>>>
>>>>of the
>>>>contact details and submit ,its working fine.
>>>>
>>>>But after the page is rendered if I am adding one more row to the list
>>>>using javascript,
>>>>During rewind the new contact is not getting added to the list in the
>>>>MyPage class
>>>>
>>>>is there any mechanism(or parameter setting) to add this newly added
>>>>contact to the  List ?
>>>>
>>>>Thanks
>>>>
>>>>Regards
>>>>jiju
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
> 
> 



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


Re: For loop Rewind problem

Posted by andyhot <an...@di.uoa.gr>.
yep, there's no nice Tapestry way in what you're trying to do, esp.
if you're trying to *avoid ajax*.

Incidentally, this was the most interesting question i got asked while
presenting
Tapestry in out local JUG. It got me thinking of adding a few js helper
functions
that would know how to add new fields in tapestry forms, e.t.c. ... it
still remains
an idea though!

Anyway, last time i wanted to do something similar without ajax, i
simply handcrafted
the generated names of the inputs and used cycle.getParameter in the
listener.

Karthik N wrote:
> also you can consider using Tacos if you're wed to tapestry 4.0.x
>
> On 12/14/06, Ron Piterman <rp...@gmx.net> wrote:
>>
>> Tapestry traces the rendered components and uses this info on rewind -
>> its better not to temper with that.
>> If you need JS magic, try using T41 - using Ajax this should be
>> possible, though only straight-forward for jesse and other enlightend
>> developers :)
>> Cheers,
>> Ron
>>
>> Jiju Mathew wrote:
>> >
>> > Hi All,
>> > I have a list of contacts in MyPage class.Tapestry rendered all the
>> > contacts
>> > in the list asTextFields using @For Loop component ,I have modified
>> some
>> > of the
>> > contact details and submit ,its working fine.
>> >
>> > But after the page is rendered if I am adding one more row to the list
>> > using javascript,
>> > During rewind the new contact is not getting added to the list in the
>> > MyPage class
>> >
>> > is there any mechanism(or parameter setting) to add this newly added
>> > contact to the  List ?
>> >
>> > Thanks
>> >
>> > Regards
>> > jiju
>> >
>> >
>> >
>> >
>> >
>> >
>> ------------------------------------------------------------------------
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>


-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 


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


Re: For loop Rewind problem

Posted by Karthik N <ka...@gmail.com>.
also you can consider using Tacos if you're wed to tapestry 4.0.x

On 12/14/06, Ron Piterman <rp...@gmx.net> wrote:
>
> Tapestry traces the rendered components and uses this info on rewind -
> its better not to temper with that.
> If you need JS magic, try using T41 - using Ajax this should be
> possible, though only straight-forward for jesse and other enlightend
> developers :)
> Cheers,
> Ron
>
> Jiju Mathew wrote:
> >
> > Hi All,
> > I have a list of contacts in MyPage class.Tapestry rendered all the
> > contacts
> > in the list asTextFields using @For Loop component ,I have modified some
> > of the
> > contact details and submit ,its working fine.
> >
> > But after the page is rendered if I am adding one more row to the list
> > using javascript,
> > During rewind the new contact is not getting added to the list in the
> > MyPage class
> >
> > is there any mechanism(or parameter setting) to add this newly added
> > contact to the  List ?
> >
> > Thanks
> >
> > Regards
> > jiju
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Thanks, Karthik

Re: For loop Rewind problem

Posted by Ron Piterman <rp...@gmx.net>.
Tapestry traces the rendered components and uses this info on rewind - 
its better not to temper with that.
If you need JS magic, try using T41 - using Ajax this should be 
possible, though only straight-forward for jesse and other enlightend 
developers :)
Cheers,
Ron

Jiju Mathew wrote:
> 
> Hi All,
> I have a list of contacts in MyPage class.Tapestry rendered all the 
> contacts
> in the list asTextFields using @For Loop component ,I have modified some 
> of the
> contact details and submit ,its working fine.
> 
> But after the page is rendered if I am adding one more row to the list 
> using javascript,
> During rewind the new contact is not getting added to the list in the 
> MyPage class
> 
> is there any mechanism(or parameter setting) to add this newly added 
> contact to the  List ?
> 
> Thanks
> 
> Regards
> jiju
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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