Submitted values lost - view is "refilled" everytime with model values
Got a problem with clay and flowScoped Spring beans. My view is everytime filled with the model values. The submitted values are lost. I can enter some data in my input fields and submit the form - if i left some required input fields empty, a message appears that something is missing, so far so good. However, the same field which i left empty - and all others i may have changed - are now populated again with values from my bean. What might cause this? I thought the component should remember this value and display this instead of the beans model value. Lifecycle stopped processing at Validation phase, so the components should not be cleared, any idea or tipps to debug this? Torsten smime.p7s Description: S/MIME cryptographic signature
Re: Submitted values lost - view is "refilled" everytime with model values
For JSF in general, this can be caused if you have input components in multiple forms (recommended practice is one form per page), or inside of UIData components (t:dataTable and t:dataList have a preserveRowStates=true attribute to handle this). On 4/26/07, Torsten Krah <[EMAIL PROTECTED]> wrote: Got a problem with clay and flowScoped Spring beans. My view is everytime filled with the model values. The submitted values are lost. I can enter some data in my input fields and submit the form - if i left some required input fields empty, a message appears that something is missing, so far so good. However, the same field which i left empty - and all others i may have changed - are now populated again with values from my bean. What might cause this? I thought the component should remember this value and display this instead of the beans model value. Lifecycle stopped processing at Validation phase, so the components should not be cleared, any idea or tipps to debug this? Torsten
Re: Submitted values lost - view is "refilled" everytime with model values
Don't have any of these. Me uses one form and input components in this one form, without UIData. Torsten Am Donnerstag, den 26.04.2007, 10:53 -0400 schrieb Mike Kienenberger: > For JSF in general, this can be caused if you have input components in > multiple forms (recommended practice is one form per page), or inside > of UIData components (t:dataTable and t:dataList have a > preserveRowStates=true attribute to handle this). > > On 4/26/07, Torsten Krah <[EMAIL PROTECTED]> wrote: > > Got a problem with clay and flowScoped Spring beans. > > > > My view is everytime filled with the model values. The submitted values > > are lost. > > > > I can enter some data in my input fields and submit the form - if i left > > some required input fields empty, a message appears that something is > > missing, so far so good. > > However, the same field which i left empty - and all others i may have > > changed - are now populated again with values from my bean. > > > > What might cause this? I thought the component should remember this > > value and display this instead of the beans model value. Lifecycle > > stopped processing at Validation phase, so the components should not be > > cleared, any idea or tipps to debug this? > > > > Torsten > > > > smime.p7s Description: S/MIME cryptographic signature
How to initialize a bean before initial display
How do I initialize a bean before initial display? I want to populate bean values from database table. I can do it in the constructor, phase listener or by adding additional getter method to initialize the bean. But is there any better way? -- View this message in context: http://www.nabble.com/How-to-initialize-a-bean-before-initial-display-tf3652365.html#a10202810 Sent from the Shale - User mailing list archive at Nabble.com.
Re: Submitted values lost - view is "refilled" everytime with model values
>Got a problem with clay and flowScoped Spring beans. > >My view is everytime filled with the model values. The submitted values >are lost. > >I can enter some data in my input fields and submit the form - if i left >some required input fields empty, a message appears that something is >missing, so far so good. >However, the same field which i left empty - and all others i may have >changed - are now populated again with values from my bean. > >What might cause this? I thought the component should remember this >value and display this instead of the beans model value. Lifecycle >stopped processing at Validation phase, so the components should not be >cleared, any idea or tipps to debug this? > I took a look at the webflow javadoc [1]. It looks like they are using a couple tricks for saving the FlowExecution. The FlowPhase listener [2] adds a non-visual component to the view root to keep state. It also adds the flow execution key to the view root.It looks like the flow key is used to restore the FlowExecution. I suspect the problem you are seeing has to do with the state not being resorted for the current flow on the postback. I would try setting some break points in the FlowPhaseListener. [1] http://static.springframework.org/spring-webflow/docs/current/api/overview-summary.html [2] http://opensource.atlassian.com/projects/spring/secure/attachment/12520/FlowExecutionKeyStateHolder.patch >Torsten Gary
Re: Submitted values lost - view is "refilled" everytime with model values
Hm did many Debug Points. My RequestParameterMap got the entered values. They are applied to my components in Phase 2 - setLocalValueSet is called with set = true. Now Phase 3 fails and Lifecycle goes to Phase 6. Now a fresh tree is rendered , because my components does not got a local value set - although the RestoreViewExecutor: Application application = facesContext.getApplication(); ViewHandler viewHandler = application.getViewHandler(); // boolean viewCreated = false; UIViewRoot viewRoot = viewHandler.restoreView(facesContext, viewId); if (viewRoot == null) { viewRoot = viewHandler.createView(facesContext, viewId); viewRoot.setViewId(viewId); facesContext.renderResponse(); // viewCreated = true; } does call the restoreView and the viewRoot is not null. If the view gets restored, why are the components "empty"? I am a little bit confused now, i've missed something, but dont know where to look now. The PhaseListener is doing the flow story and seems to work correct - i hope i did not missunderstand things. Any hints? Torsten Am Donnerstag, den 26.04.2007, 15:51 + schrieb Gary VanMatre: > >Got a problem with clay and flowScoped Spring beans. > > > >My view is everytime filled with the model values. The submitted values > >are lost. > > > >I can enter some data in my input fields and submit the form - if i left > >some required input fields empty, a message appears that something is > >missing, so far so good. > >However, the same field which i left empty - and all others i may have > >changed - are now populated again with values from my bean. > > > >What might cause this? I thought the component should remember this > >value and display this instead of the beans model value. Lifecycle > >stopped processing at Validation phase, so the components should not be > >cleared, any idea or tipps to debug this? > > > I took a look at the webflow javadoc [1]. It looks like they are using a > couple tricks for saving the FlowExecution. The FlowPhase listener [2] adds > a non-visual component to the view root to keep state. It also adds the flow > execution key to the view root.It looks like the flow key is used to restore > the FlowExecution. I suspect the problem you are seeing has to do with the > state not being resorted for the current flow on the postback. I would try > setting some break points in the FlowPhaseListener. > [1] > http://static.springframework.org/spring-webflow/docs/current/api/overview-summary.html > [2] > http://opensource.atlassian.com/projects/spring/secure/attachment/12520/FlowExecutionKeyStateHolder.patch > > >Torsten > > > Gary smime.p7s Description: S/MIME cryptographic signature
SV: How to initialize a bean before initial display
Hi What type of bean? Is it ViewController or what? Hermod -Opprinnelig melding- Fra: AM101 [mailto:[EMAIL PROTECTED] Sendt: 26. april 2007 17:30 Til: user@shale.apache.org Emne: How to initialize a bean before initial display How do I initialize a bean before initial display? I want to populate bean values from database table. I can do it in the constructor, phase listener or by adding additional getter method to initialize the bean. But is there any better way? -- View this message in context: http://www.nabble.com/How-to-initialize-a-bean-before-initial-display-tf3652 365.html#a10202810 Sent from the Shale - User mailing list archive at Nabble.com.
Re: SV: How to initialize a bean before initial display
It is a view backing bean. Hermod Opstvedt wrote: > > Hi > > What type of bean? Is it ViewController or what? > > Hermod > > > -Opprinnelig melding- > Fra: AM101 [mailto:[EMAIL PROTECTED] > Sendt: 26. april 2007 17:30 > Til: user@shale.apache.org > Emne: How to initialize a bean before initial display > > > How do I initialize a bean before initial display? I want to populate bean > values from database table. > > I can do it in the constructor, phase listener or by adding additional > getter method to initialize the bean. But is there any better way? > > -- > View this message in context: > http://www.nabble.com/How-to-initialize-a-bean-before-initial-display-tf3652 > 365.html#a10202810 > Sent from the Shale - User mailing list archive at Nabble.com. > > > > -- View this message in context: http://www.nabble.com/How-to-initialize-a-bean-before-initial-display-tf3652365.html#a10206968 Sent from the Shale - User mailing list archive at Nabble.com.
SV: Submitted values lost - view is "refilled" everytime with model values
Hi I think this is related to [1], since you are missing stuff from scope [1] https://issues.apache.org/struts/browse/SHALE-410 Hermod -Opprinnelig melding- Fra: Gary VanMatre [mailto:[EMAIL PROTECTED] Sendt: 26. april 2007 17:51 Til: user@shale.apache.org Emne: Re: Submitted values lost - view is "refilled" everytime with model values >Got a problem with clay and flowScoped Spring beans. > >My view is everytime filled with the model values. The submitted values >are lost. > >I can enter some data in my input fields and submit the form - if i left >some required input fields empty, a message appears that something is >missing, so far so good. >However, the same field which i left empty - and all others i may have >changed - are now populated again with values from my bean. > >What might cause this? I thought the component should remember this >value and display this instead of the beans model value. Lifecycle >stopped processing at Validation phase, so the components should not be >cleared, any idea or tipps to debug this? > I took a look at the webflow javadoc [1]. It looks like they are using a couple tricks for saving the FlowExecution. The FlowPhase listener [2] adds a non-visual component to the view root to keep state. It also adds the flow execution key to the view root.It looks like the flow key is used to restore the FlowExecution. I suspect the problem you are seeing has to do with the state not being resorted for the current flow on the postback. I would try setting some break points in the FlowPhaseListener. [1] http://static.springframework.org/spring-webflow/docs/current/api/overview-s ummary.html [2] http://opensource.atlassian.com/projects/spring/secure/attachment/12520/Flow ExecutionKeyStateHolder.patch >Torsten Gary
SV: SV: How to initialize a bean before initial display
Hi In that case you can initialize it in the init method or prerender method of the viewcontroller. Hermod -Opprinnelig melding- Fra: AM101 [mailto:[EMAIL PROTECTED] Sendt: 26. april 2007 21:22 Til: user@shale.apache.org Emne: Re: SV: How to initialize a bean before initial display It is a view backing bean. Hermod Opstvedt wrote: > > Hi > > What type of bean? Is it ViewController or what? > > Hermod > > > -Opprinnelig melding- > Fra: AM101 [mailto:[EMAIL PROTECTED] > Sendt: 26. april 2007 17:30 > Til: user@shale.apache.org > Emne: How to initialize a bean before initial display > > > How do I initialize a bean before initial display? I want to populate bean > values from database table. > > I can do it in the constructor, phase listener or by adding additional > getter method to initialize the bean. But is there any better way? > > -- > View this message in context: > http://www.nabble.com/How-to-initialize-a-bean-before-initial-display-tf3652 > 365.html#a10202810 > Sent from the Shale - User mailing list archive at Nabble.com. > > > > -- View this message in context: http://www.nabble.com/How-to-initialize-a-bean-before-initial-display-tf3652 365.html#a10206968 Sent from the Shale - User mailing list archive at Nabble.com.
Re: SV: SV: How to initialize a bean before initial display
Thanks for your reply. I am now extending AbstractViewController and implemented the init() method but this method is never called. do I need to configure anything? I am new to Shale, I appreciate your help. Hermod Opstvedt wrote: > > Hi > > In that case you can initialize it in the init method or prerender method > of > the viewcontroller. > > Hermod > > > -Opprinnelig melding- > Fra: AM101 [mailto:[EMAIL PROTECTED] > Sendt: 26. april 2007 21:22 > Til: user@shale.apache.org > Emne: Re: SV: How to initialize a bean before initial display > > > It is a view backing bean. > > > > Hermod Opstvedt wrote: >> >> Hi >> >> What type of bean? Is it ViewController or what? >> >> Hermod >> >> >> -Opprinnelig melding- >> Fra: AM101 [mailto:[EMAIL PROTECTED] >> Sendt: 26. april 2007 17:30 >> Til: user@shale.apache.org >> Emne: How to initialize a bean before initial display >> >> >> How do I initialize a bean before initial display? I want to populate >> bean >> values from database table. >> >> I can do it in the constructor, phase listener or by adding additional >> getter method to initialize the bean. But is there any better way? >> >> -- >> View this message in context: >> > http://www.nabble.com/How-to-initialize-a-bean-before-initial-display-tf3652 >> 365.html#a10202810 >> Sent from the Shale - User mailing list archive at Nabble.com. >> >> >> >> > > -- > View this message in context: > http://www.nabble.com/How-to-initialize-a-bean-before-initial-display-tf3652 > 365.html#a10206968 > Sent from the Shale - User mailing list archive at Nabble.com. > > > > -- View this message in context: http://www.nabble.com/How-to-initialize-a-bean-before-initial-display-tf3652365.html#a10209745 Sent from the Shale - User mailing list archive at Nabble.com.
SV: SV: SV: How to initialize a bean before initial display
Hi If its not called, you must have placed it in session-scope (it must be request-scoped), or it is not mapped against the view in faces-config.xml Hermod -Opprinnelig melding- Fra: AM101 [mailto:[EMAIL PROTECTED] Sendt: 26. april 2007 23:54 Til: user@shale.apache.org Emne: Re: SV: SV: How to initialize a bean before initial display Thanks for your reply. I am now extending AbstractViewController and implemented the init() method but this method is never called. do I need to configure anything? I am new to Shale, I appreciate your help. Hermod Opstvedt wrote: > > Hi > > In that case you can initialize it in the init method or prerender method > of > the viewcontroller. > > Hermod > > > -Opprinnelig melding- > Fra: AM101 [mailto:[EMAIL PROTECTED] > Sendt: 26. april 2007 21:22 > Til: user@shale.apache.org > Emne: Re: SV: How to initialize a bean before initial display > > > It is a view backing bean. > > > > Hermod Opstvedt wrote: >> >> Hi >> >> What type of bean? Is it ViewController or what? >> >> Hermod >> >> >> -Opprinnelig melding- >> Fra: AM101 [mailto:[EMAIL PROTECTED] >> Sendt: 26. april 2007 17:30 >> Til: user@shale.apache.org >> Emne: How to initialize a bean before initial display >> >> >> How do I initialize a bean before initial display? I want to populate >> bean >> values from database table. >> >> I can do it in the constructor, phase listener or by adding additional >> getter method to initialize the bean. But is there any better way? >> >> -- >> View this message in context: >> > http://www.nabble.com/How-to-initialize-a-bean-before-initial-display-tf3652 >> 365.html#a10202810 >> Sent from the Shale - User mailing list archive at Nabble.com. >> >> >> >> > > -- > View this message in context: > http://www.nabble.com/How-to-initialize-a-bean-before-initial-display-tf3652 > 365.html#a10206968 > Sent from the Shale - User mailing list archive at Nabble.com. > > > > -- View this message in context: http://www.nabble.com/How-to-initialize-a-bean-before-initial-display-tf3652 365.html#a10209745 Sent from the Shale - User mailing list archive at Nabble.com.