Toggle switch within select1 itemset

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

Toggle switch within select1 itemset

Boon Low
Hi,

I've a UI with a pop-up select1 combo box that is based on a switch  
case, i.e. it appears when user interacts with another xforms  
control. This pop-up implements OK, praise to OPS :-)

However, I would also like the application to close (make disappear)  
the combo box automatically after the user have make a selection. I  
tried to do this by having a toggle within the select1 itemset with a  
xform-select event:

<xforms:switch>
<xforms:case id="hide-combo">
</xforms:case>
<xforms:case id="show-combo">
     <xforms:select1 ref="subject" appearance="compact">
     <xforms:itemset nodeset="instance('results')//subject">
         <xforms:label ref="."/>
          <xforms:value ref="."/>
           <xforms:toggle ev:event="xforms-select"  case="hide-combo"/>
      </xforms:itemset>
     </xforms:select1>
</xforms:case>
</xforms:switch>

This doesn't seem to work for me.. I tested the xforms-select event  
using a <setvalue/> action also within the select1 itemset. It didn't  
work. But when I put the <setvalue/> outside <select1/>, it sets the  
value correctly:
<case>
     <select1>...</select1>
     <setvalue ev:event="xforms-select" ref=".."/>
</case>

Questions:
1. Is my toggle/switch approach above correct?
2. Does the current OPS (3.0) support xforms-select event within  
itemset?
3. Any other suggestions or get around??

Regards,

Boon

-----
Boon Low
System Developer, EGEE Training
UK National e-Science Centre
http://homepages.ed.ac.uk/boon




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Toggle switch within select1 itemset

Erik Bruchez
Administrator
Hi Boon,

xforms-select is currently only thrown in OPS for switch and case, but
not select and select1. I just entered a bug to track this:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=304019&group_id=168&atid=350207

I think you can go around this this way:

<xforms:select1 ref="subject" appearance="compact">
     <xforms:itemset>
         ...
     </xforms:itemset>
     <xforms:toggle ev:event="xforms-value-changed" case="hide-combo"/>
</xforms:select1>

That is, this will work unless you want to show/hide different cases
depending on which item is selected, as opposed to just any value
changed.

BTW, you can enable XForms events logging in OPS with these few lines
in your config/log4j.xml:

<category name="org.orbeon.oxf.xforms.XFormsServer">
     <priority value="debug"/>
</category>

So the bottom line:

1. Yes, I think the approach is correct.

2. No, but we should fix this for 3.0 final.

3. See above!

Best,

-Erik

Boon Low wrote:
 > Hi,
 >
 > I've a UI with a pop-up select1 combo box that is based on a switch
 > case, i.e. it appears when user interacts with another xforms  control.
 > This pop-up implements OK, praise to OPS :-)
 >
 > However, I would also like the application to close (make disappear)
 > the combo box automatically after the user have make a selection. I
 > tried to do this by having a toggle within the select1 itemset with a
 > xform-select event:
 >
 > <xforms:switch>
 > <xforms:case id="hide-combo">
 > </xforms:case>
 > <xforms:case id="show-combo">
 >     <xforms:select1 ref="subject" appearance="compact">
 >     <xforms:itemset nodeset="instance('results')//subject">
 >         <xforms:label ref="."/>
 >          <xforms:value ref="."/>
 >           <xforms:toggle ev:event="xforms-select"  case="hide-combo"/>
 >      </xforms:itemset>
 >     </xforms:select1>
 > </xforms:case>
 > </xforms:switch>
 >
 > This doesn't seem to work for me.. I tested the xforms-select event
 > using a <setvalue/> action also within the select1 itemset. It didn't
 > work. But when I put the <setvalue/> outside <select1/>, it sets the
 > value correctly:
 > <case>
 >     <select1>...</select1>
 >     <setvalue ev:event="xforms-select" ref=".."/>
 > </case>
 >
 > Questions:
 > 1. Is my toggle/switch approach above correct?
 > 2. Does the current OPS (3.0) support xforms-select event within
itemset?
 > 3. Any other suggestions or get around??
 >
 > Regards,
 >
 > Boon
 >
 > -----
 > Boon Low
 > System Developer, EGEE Training
 > UK National e-Science Centre
 > http://homepages.ed.ac.uk/boon




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws