local data storage in forms?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

local data storage in forms?

Jean Luc-2
A common case, I suppose: you have a transient field in a form that is only used to support a decision or to be copied into a real field. Example: a drop down box with the widgets (in a multi-widget form) near a button "Duplicate Widget". The action behind the button would duplicate the model part of the indicated widget so it will have to reference the currently-selected item in the dropdown box.
 
The orthodox MVC approach would be to store that entry in the model (perhaps a difference instance named 'local-data').
Is there a simpler way, though, for non-submitted data? In this case, I simply want to reference the value chosen in that dropdown box so I can use it in the "origin" attribute of an insert action.
 
Thanks,
JL


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: local data storage in forms?

Alessandro Vernet
Administrator
Jean Luc,

On Fri, Apr 25, 2008 at 7:52 AM, Jean Luc <[hidden email]> wrote:
> A common case, I suppose: you have a transient field in a form that is only
> used to support a decision or to be copied into a real field. Example: a
> drop down box with the widgets (in a multi-widget form) near a button
> "Duplicate Widget". The action behind the button would duplicate the model
> part of the indicated widget so it will have to reference the
> currently-selected item in the dropdown box.

Like you said, using a separate instance for this is the way to go. I
often have an instance called "ui" that stores this type of state
which is very much tied to the way the UI is done, and which is never
sent to services. Plus"ui" has the the additional benefit of being a
short name :).

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws