How to Render the Controls Dynamically??

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

How to Render the Controls Dynamically??

Sathish K Mittapelli

 Hi All,

This is my Model

<xforms:model>
<xforms:instance id="control types">
    <controlTypes>
          <textBox/>
          <radio/>
    </controlTypes>
</xforms:instance>

<xforms:instance id="control types">
    <controlCode>
          <textBoxCode> <xforms:input ref="instance('controlTypes')/textBox"/></textBoxCode>
          <radioCode><xforms:select1 ref="instance('controlTypes')/radio"/></radioCode>
    </controlCode>
</xforms:instance>
<xforms:model>

In body i am trying to get the controls dynamically by calling like this

<xforms:output ref="instance('controlCode)/textBoxCode"/>
<xforms:output ref="instance('controlCode)/radioCode"/>

But always i am getting the output as shown below in

<xforms:input ref="instance('controlTypes')/textBox"/>
<xforms:select1 ref="instance('controlTypes')/radio"/>





THANKS & REGARDS
SATHISH K MITTAPELLI  



Forgot the famous last words? Access your message archive online. Click here.

--
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: How to Render the Controls Dynamically??

fl.schmitt(ops-users)
hi sathish,

you can use:

<xforms:group ref=".[<condition>]">
[content conditionally shown depending on the evaluation of <condition>]
</xforms:group>

So, to dynamically switch between two controls, you've got to insert
both of them, each in a xforms:group that references the condition that
tells which control to show.

HTH
florian





--
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: Re: How to Render the Controls Dynamically??

Erik Bruchez
Administrator
That's right: you can't dynamically introduce new controls into an  
XForms document, at least this way. You could possibly do this as a  
pre-processing step in XSLT, for example, but that's a completely  
different matter.

Florian's approach below is the one we have been using in many cases.

-Erik

On Mar 19, 2008, at 4:07 AM, Florian Schmitt wrote:

> hi sathish,
>
> you can use:
>
> <xforms:group ref=".[<condition>]">
> [content conditionally shown depending on the evaluation of  
> <condition>]
> </xforms:group>
>
> So, to dynamically switch between two controls, you've got to insert  
> both of them, each in a xforms:group that references the condition  
> that tells which control to show.
>
> HTH
> florian
--
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