is it possible to add model instances at runtime?

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

is it possible to add model instances at runtime?

Jean Luc-2
I haven't found a reference in the doc (you can reload them, but not add new ones).
 
The rationale for the question is that I'd like to have both of the following:
 
- a model instance reloaded on the fly depending on another selection (think of loading the list of "widget attributes" for a widget "type" selected via a drop down box - there are many hundreds of types, each with dozens of attributes, so preloading all of them is not feasible). This is possible today, but I need the 2nd condition as well:
 
- the ability to add new widgets in the form. Each has its own type so it must be mapped to a separate instance, created on the fly.
 
Thank you,
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: is it possible to add model instances at runtime?

Erik Bruchez
Administrator
On May 12, 2008, at 8:42 AM, Jean Luc wrote:

> I haven't found a reference in the doc (you can reload them, but not  
> add new ones).
>
> The rationale for the question is that I'd like to have both of the  
> following:
>
> - a model instance reloaded on the fly depending on another  
> selection (think of loading the list of "widget attributes" for a  
> widget "type" selected via a drop down box - there are many hundreds  
> of types, each with dozens of attributes, so preloading all of them  
> is not feasible). This is possible today, but I need the 2nd  
> condition as well:
>
> - the ability to add new widgets in the form. Each has its own type  
> so it must be mapped to a separate instance, created on the fly.
You can't add new widgets, if by that you mean adding a new  
xforms:input or xforms:textarea after the form has been loaded.

A possibility consists in having all the widgets ready, and enabling  
them as needed, e.g.:

<xforms:input ref=".[instance('my-widget') = 'input']">...
<xforms:textarea ref=".[instance('my-widget') = 'textarea']">...

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
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