You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by sunilmanu <su...@gmail.com> on 2006/11/24 19:50:06 UTC

Form Rewinding - losing component values !

Hello Everyone,

I have a FORM with some editor fields and an Image gallery implemented thr'
Abstract component. 
When the user selects the Image, we do a  reload of page. This causes losing
Data in all the input fields.

Since these are all part of same form I cannot group components into a Form
and nest it inside one another.
I am using hidden parameters to maintain the data but somehow on selecting
the image, we lose it.

Can anyone suggest a way to preserve the values. Is this a case for using
@Client-Persist ?

Thanks,
Sunil
-- 
View this message in context: http://www.nabble.com/Form-Rewinding---losing-component-values-%21-tf2700598.html#a7530549
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: Form Rewinding - losing component values !

Posted by sunilmanu <su...@gmail.com>.
Hi,

Thanks for your reply. I have elaborated it below ;

They are part of the form. Below is the pseudo - code of my HTML..

--- AdminEdit.Html---
<form>

   <input hidden parameters ... />

    
    
   < image gallery -- rendered by my abstract component >
      <each image is a Link /> link is handled by 'DirectLink' inside the
Abstract component (imageGallery.java) and returns the IPage 'AdminEdit'
   </image gallery>

   <input text Field />
   <input TextArea />

   <submit- SAVE /> - form listener handled by the AdminEdit.java
</form>


problem is if I enter the Input text field/ area first and then select an
Image, I lose the input Text /Area values . But Other way is fine i.e.
selecting an image and then enteringtext input and then Save works fine.

currentImage, selectedImage ,input text field, text area are all Properties
of Form and have corresponding abstract setters+getters in the java file.

 I tried your suggestion of retrieving the Hidden parameters like :
cycle.getParameter("currentImage"), but always turned out to be NULL ?
Anything wrong I am doing ?

Please advise. Any help would be greatly appreciated.


thanks,
Sunil




Sam Gendler-2 wrote:
> 
> If I understand you correctly, you have some input fields which aren't
> actually part of the form that gets submitted when the user clicks on
> the image?  If that is the case, presumably you need to copy the
> values back out of the hidden fields and into your input fields when
> the page reloads.  If your input fields are part of the form and the
> values are received during form rewind, then the only thing I can
> imagine is that you have some code which is clearing the value those
> fields are associated with before the render cycle begins.  You don't
> have page initialization code in pageBegindRender() do you?
> 
> --sam
> 
> 
> On 11/24/06, sunilmanu <su...@gmail.com> wrote:
>>
>> Hello Everyone,
>>
>> I have a FORM with some editor fields and an Image gallery implemented
>> thr'
>> Abstract component.
>> When the user selects the Image, we do a  reload of page. This causes
>> losing
>> Data in all the input fields.
>>
>> Since these are all part of same form I cannot group components into a
>> Form
>> and nest it inside one another.
>> I am using hidden parameters to maintain the data but somehow on
>> selecting
>> the image, we lose it.
>>
>> Can anyone suggest a way to preserve the values. Is this a case for using
>> @Client-Persist ?
>>
>> Thanks,
>> Sunil
>> --
>> View this message in context:
>> http://www.nabble.com/Form-Rewinding---losing-component-values-%21-tf2700598.html#a7530549
>> 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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-Rewinding---losing-component-values-%21-tf2700598.html#a7561288
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: Form Rewinding - losing component values !

Posted by sunilmanu <su...@gmail.com>.
Hi,

Thanks for your reply. I have elaborated it below ;

They are part of the form. Below is the pseudo - code of my HTML..

--- AdminEdit.Html---
<form>

   <input hidden parameters ... />

   <image - currentImage />
   <image - selectedImage />
   < image gallery -- rendered by my abstract component >
      <each image is a Link /> link is handled by 'DirectLink' inside the
Abstract component (imageGallery.java) and returns the IPage 'AdminEdit'
   </image gallery>

   <input text Field />
   <input TextArea />

   <submit- SAVE /> - form listener handled by the AdminEdit.java
</form>


problem is if I enter the Input text field/ area first and then select an
Image, I lose the input Text /Area values . But Other way is fine i.e.
selecting an image and then enteringtext input and then Save works fine.

currentImage, selectedImage ,input text field, text area are all Properties
of Form and have corresponding abstract setters+getters in the java file.

 I tried your suggestion of retrieving the Hidden parameters like :
cycle.getParameter("currentImage"), but always turned out to be NULL ?
Anything wrong I am doing ?

Please advise. Any help would be greatly appreciated.


thanks,
Sunil




Sam Gendler-2 wrote:
> 
> If I understand you correctly, you have some input fields which aren't
> actually part of the form that gets submitted when the user clicks on
> the image?  If that is the case, presumably you need to copy the
> values back out of the hidden fields and into your input fields when
> the page reloads.  If your input fields are part of the form and the
> values are received during form rewind, then the only thing I can
> imagine is that you have some code which is clearing the value those
> fields are associated with before the render cycle begins.  You don't
> have page initialization code in pageBegindRender() do you?
> 
> --sam
> 
> 
> On 11/24/06, sunilmanu <su...@gmail.com> wrote:
>>
>> Hello Everyone,
>>
>> I have a FORM with some editor fields and an Image gallery implemented
>> thr'
>> Abstract component.
>> When the user selects the Image, we do a  reload of page. This causes
>> losing
>> Data in all the input fields.
>>
>> Since these are all part of same form I cannot group components into a
>> Form
>> and nest it inside one another.
>> I am using hidden parameters to maintain the data but somehow on
>> selecting
>> the image, we lose it.
>>
>> Can anyone suggest a way to preserve the values. Is this a case for using
>> @Client-Persist ?
>>
>> Thanks,
>> Sunil
>> --
>> View this message in context:
>> http://www.nabble.com/Form-Rewinding---losing-component-values-%21-tf2700598.html#a7530549
>> 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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-Rewinding---losing-component-values-%21-tf2700598.html#a7561288
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: Form Rewinding - losing component values !

Posted by Sam Gendler <sg...@ideasculptor.com>.
If I understand you correctly, you have some input fields which aren't
actually part of the form that gets submitted when the user clicks on
the image?  If that is the case, presumably you need to copy the
values back out of the hidden fields and into your input fields when
the page reloads.  If your input fields are part of the form and the
values are received during form rewind, then the only thing I can
imagine is that you have some code which is clearing the value those
fields are associated with before the render cycle begins.  You don't
have page initialization code in pageBegindRender() do you?

--sam


On 11/24/06, sunilmanu <su...@gmail.com> wrote:
>
> Hello Everyone,
>
> I have a FORM with some editor fields and an Image gallery implemented thr'
> Abstract component.
> When the user selects the Image, we do a  reload of page. This causes losing
> Data in all the input fields.
>
> Since these are all part of same form I cannot group components into a Form
> and nest it inside one another.
> I am using hidden parameters to maintain the data but somehow on selecting
> the image, we lose it.
>
> Can anyone suggest a way to preserve the values. Is this a case for using
> @Client-Persist ?
>
> Thanks,
> Sunil
> --
> View this message in context: http://www.nabble.com/Form-Rewinding---losing-component-values-%21-tf2700598.html#a7530549
> 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
>
>

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