Problem while generating controls dynamically with xforms:switch...

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

Problem while generating controls dynamically with xforms:switch...

Sathish K Mittapelli
Hi all i am trying to generate the controls with xforms:switch like this

<td>
<xforms:switch>
        <xforms:case id="text" selected="true">
            <xforms:input ref="anstype"/>
        </xforms:case>
       
        <xforms:case id="radio" >
                <xforms:select1 ref="anstype" appearance="full" selected="true">
                    <xforms:item>
                        <xforms:label></xforms:label>
                        <xforms:value></xforms:value>
                    </xforms:item>
                </xforms:select1>
        </xforms:case>
       
        <xforms:case id="checkbox">
                <xforms:select1 ref="anstype" appearance="minimal" selected="true">
                    <xforms:item>
                        <xforms:label></xforms:label>
                        <xforms:value></xforms:value>
                    </xforms:item>
                </xforms:select1>
        </xforms:case>
       
        <xforms:case id="textarea">
                <xforms:textarea ref="anstype"/>
        </xforms:case>
       
        </xforms:switch>
</td>

and in model i have binded like this

<xforms:bind nodeset="instance('questionsInstance')">
          <xforms:bind nodeset="question/anstype">
             <xforms:action ev:event="xforms-ready" if="normalize-space(instance('questionsInstance')/question/anstype)= 'Textbox'">
                    <xforms:toggle case="textfield"/>
             </xforms:action>
            
             <xforms:action ev:event="xforms-ready" if="normalize-space(instance('questionsInstance')/question/anstype)= 'Radio'">
                    <xforms:toggle case="radio"/>
             </xforms:action>
             <xforms:action ev:event="xforms-ready" if="normalize-space(instance('questionsInstance')/question/anstype)= 'check'">
                    <xforms:toggle case="checkbox"/>
             </xforms:action>
             <xforms:action ev:event="xforms-ready" if="normalize-space(instance('questionsInstance')/question/anstype)= 'TextArea'">
                    <xforms:toggle case="textarea"/>
             </xforms:action>
         </xforms:bind>


But for all fields it is giving the textbox itself.
What is the way to achieve my requirement.
Please help me.

Thanks In advance........

THANKS & REGARDS
SATHISH K MITTAPELLI  


Unlimited freedom, unlimited storage. Get it now

--
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: Problem while generating controls dynamically with xforms:switch...

Alessandro Vernet
Administrator
On Mon, May 26, 2008 at 6:05 AM, sathish kumar <[hidden email]> wrote:
> But for all fields it is giving the textbox itself.
> What is the way to achieve my requirement.

It looks like your tests
normalize-space(instance('questionsInstance')/question/anstype)=
'Radio' and such are failing. Hard to say why without having a full
example. If you can create a simple example that runs in the XForms
sandbox and reproduces this, please feel free to post it here.

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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Problem while generating controls dynamically with xforms:switch...

Sathish K Mittapelli
Hi Alessandro,
                   i am attaching a sandbox example of my requirement .Please go through it and suggest suitable changes.

THANKS & REGARDS
SATHISH K MITTAPELLI  


--- On Tue, 27/5/08, Alessandro Vernet <[hidden email]> wrote:
From: Alessandro Vernet <[hidden email]>
Subject: [ops-users] Re: Problem while generating controls dynamically with xforms:switch...
To: [hidden email]
Date: Tuesday, 27 May, 2008, 7:58 AM

On Mon, May 26, 2008 at 6:05 AM, sathish kumar <[hidden email]>
wrote:
> But for all fields it is giving the textbox itself.
> What is the way to achieve my requirement.

It looks like your tests
normalize-space(instance('questionsInstance')/question/anstype)=
'Radio' and such are failing. Hard to say why without having a full
example. If you can create a simple example that runs in the XForms
sandbox and reproduces this, please feel free to post it here.

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


Download prohibited? No problem. CHAT from any browser, without download.

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

DynamicControls.xhtml (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Problem while generating controls dynamically with xforms:switch...

Sathish K Mittapelli

Hi Alessandro,

                 The previously attached example has some errors ...i have corrected them and attaching the new one ...please go through this.
THANKS & REGARDS
SATHISH K MITTAPELLI  


--- On Tue, 27/5/08, sathish kumar <[hidden email]> wrote:
From: sathish kumar <[hidden email]>
Subject: [ops-users] Re: Re: Problem while generating controls dynamically with xforms:switch...
To: [hidden email]
Date: Tuesday, 27 May, 2008, 10:48 AM

Hi Alessandro,
                   i am attaching a sandbox example of my requirement .Please go through it and suggest suitable changes.

THANKS & REGARDS
SATHISH K MITTAPELLI  


--- On Tue, 27/5/08, Alessandro Vernet <[hidden email]> wrote:
From: Alessandro Vernet <[hidden email]>
Subject: [ops-users] Re: Problem while generating controls dynamically with xforms:switch...
To: [hidden email]
Date: Tuesday, 27 May, 2008, 7:58 AM

On Mon, May 26, 2008 at 6:05 AM, sathish kumar <[hidden email]>
wrote:
> But for all fields it is giving the textbox itself.
> What is the way to achieve my requirement.

It looks like your tests
normalize-space(instance('questionsInstance')/question/anstype)=
'Radio' and such are failing. Hard to say why without having a full
example. If you can create a simple example that runs in the XForms
sandbox and reproduces this, please feel free to post it here.

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


Download prohibited? No problem. CHAT from any browser, without download.
--
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


BMR - a key player in weight issues. Know more.

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

DynamicControls.xhtml (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Problem while generating controls dynamically with xforms:switch...

Alessandro Vernet
Administrator
On Mon, May 26, 2008 at 10:35 PM, sathish kumar <[hidden email]> wrote:
>                  The previously attached example has some errors ...i have
> corrected them and attaching the new one ...please go through this.

For a follow-up on this, see the thread:

http://www.nabble.com/Dynamic-Controls-generating-issue......-to17505745.html#a17580640

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