translating values from XML

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

translating values from XML

MoOmEeN
Hi,

I got issue like this:
We have xforms for presenting XML documents on GUI and for creating them.
In 'create' xforms on some controls, we have dropdowns for selecting values.
E.g. user can select 'Item1' and '1' will be submitted, simple functionality of select control.

The case is, to present 'Item1' instead of '1' when user would like to see submitted document.
I found that I can translate it with 'if' statements, but it does not look good if there are many items.
I can alsa produce select control, but i cannot make it read-only - i think that readonly select control would be quite good.

Are there any further options to achieve my goal.
thanks
Reply | Threaded
Open this post in threaded view
|

Re: translating values from XML

Erik Bruchez
Administrator
I assume you are writing your own XForms.

One way is to use xxforms:readonly-appearance="static" on your model, like this:

  <xforms:model xxforms:readonly-appearance="static">

Then, make your instance readonly, for example:

  <xforms:bind nodeset="instance()" readonly="true()"/>

In the view, you can then use an <xforms:select> or <xforms:select1>,
and it will appear readonly while showing the label associated with
the item.

-Erik

On Thu, May 24, 2012 at 7:10 AM, MoOmEeN <[hidden email]> wrote:

> Hi,
>
> I got issue like this:
> We have xforms for presenting XML documents on GUI and for creating them.
> In 'create' xforms on some controls, we have dropdowns for selecting values.
> E.g. user can select 'Item1' and '1' will be submitted, simple functionality
> of select control.
>
> The case is, to present 'Item1' instead of '1' when user would like to see
> submitted document.
> I found that I can translate it with 'if' statements, but it does not look
> good if there are many items.
> I can alsa produce select control, but i cannot make it read-only - i think
> that readonly select control would be quite good.
>
> Are there any further options to achieve my goal.
> thanks
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/translating-values-from-XML-tp4653027.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.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