display dialog when particular item selected

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

display dialog when particular item selected

Alexander Žaťko
How can I make a dialog to be shown when a particular item is selected  
in select1 control? In particular, I need the "insert-place" dialog  
shown when the item labeled "add..." is selected:

<xforms:select1 ref="new-report" appearance="minimal">
     <xforms:label/>
     <xforms:itemset nodeset="nt-start">
         <xforms:label ref="."/>
         <xforms:value ref="@id"/>
     </xforms:itemset>
     <xforms:item>
         <xforms:label>add...</xforms:label>
         <xforms:value value="-1"/>
     </xforms:item>
     <xforms:action ev:event="xforms-value-changed">
         <xxforms:show dialog="insert-place"/>
     </xforms:action>
</xforms:select1>

<xxforms:dialog id="insert-place" appearance="full" level="modeless"  
close="true" draggable="true">
     <xforms:label>Dialog title</xforms:label>
     Content of the dialog
</xxforms:dialog>

The xforms-value-changed event apparently does not address my need.

Thanks

A.


--
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: display dialog when particular item selected

Alessandro Vernet
Administrator
On Jan 21, 2008 9:38 AM, Alexander Zatko <[hidden email]> wrote:
> How can I make a dialog to be shown when a particular item is selected
> in select1 control? In particular, I need the "insert-place" dialog
> shown when the item labeled "add..." is selected:
> [...]

I don't see any problem with this code. Can you create a test case for
the XForms sandbox that shows that dialog does not open with some code
similar to what you have here?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
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
Reply | Threaded
Open this post in threaded view
|

Re: display dialog when particular item selected

Alexander Žaťko
Alex,

The code I pasted into my original message works ok, but the dialog is shown when any item is selected in the drop-down. I want the dialog to be shown only when a particular one is selected. I guess I need to use a different event, or put the <xforms:action> somewhere else to achieve that goal?

Thanks

A.

On Jan 22, 2008, at 8:57 PM, Alessandro Vernet wrote:

On Jan 21, 2008 9:38 AM, Alexander Zatko <[hidden email]&g! t; wrote: e">How can I make a dialog to be shown when a particular item is selected
in select1 control? In particular, I need the "insert-place" dialog
shown when the item labeled "add..." is selected:
[...]

I don't see any problem with this code. Can you create a test case for
the XForms sandbox that shows that dialog does not open with some code
similar to what you have here?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
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



--
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: display dialog when particular item selected

Alessandro Vernet
Administrator
On Jan 22, 2008 12:09 PM, Alexander Zatko <[hidden email]> wrote:
> The code I pasted into my original message works ok, but the dialog is shown
> when any item is selected in the drop-down. I want the dialog to be shown
> only when a particular one is selected. I guess I need to use a different
> event, or put the <xforms:action> somewhere else to achieve that goal?

I see. An "if" on the action should do it:

<xforms:action ev:event="xforms-value-changed" if=". = 'xyz'">

The content of the action is evaluate only if that "if" expression
returns true().

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
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
Reply | Threaded
Open this post in threaded view
|

Re: display dialog when particular item selected

Alexander Žaťko
perfect. Thanks

A.

On Jan 24, 2008, at 2:20 AM, Alessandro Vernet wrote:

> On Jan 22, 2008 12:09 PM, Alexander Zatko <[hidden email]> wrote:
>> The code I pasted into my original message works ok, but the dialog  
>> is shown
>> when any item is selected in the drop-down. I want the dialog to be  
>> shown
>> only when a particular one is selected. I guess I need to use a  
>> different
>> event, or put the <xforms:action> somewhere else to achieve that  
>> goal?
>
> I see. An "if" on the action should do it:
>
> <xforms:action ev:event="xforms-value-changed" if=". = 'xyz'">
>
> The content of the action is evaluate only if that "if" expression
> returns true().
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> 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


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