How to change style during runtime?

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

How to change style during runtime?

quinquin2209
Hi,

I have an xform which will be used in 2 mode: read-only or editing.

I use the following to make the xform read-only

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

and editing

<xforms:bind nodeset="instance('doc-instance')" readonly="false()"/>

Now when it is in read-only mode, the xforms:output should be used. Otherwise xform:select1 should be used.

For example, in read-only mode, it should be :

<xforms:output class="" ref="Header/Type"/>

and in editing mode, it should be :

<xforms:select1 ref="Header/Type" appearance="full">
         <xforms:itemset nodeset="instance('doc-function-instance')/type">
                <xforms:label ref="name"/>
                <xforms:value ref="value"/>
          </xforms:itemset>
</xforms:select1>

Any suggestion how can I achieve it?

Thanks in advance

Queenie
Reply | Threaded
Open this post in threaded view
|

Re: How to change style during runtime?

Alessandro Vernet
Administrator
On Thu, Feb 28, 2008 at 1:57 AM, quinquin2209
<[hidden email]> wrote:

>
>  I have an xform which will be used in 2 mode: read-only or editing.
>
>  I use the following to make the xform read-only
>
>  <xforms:bind nodeset="instance('doc-instance')" readonly="true()"/>
>
>  and editing
>
>  <xforms:bind nodeset="instance('doc-instance')" readonly="false()"/>
>
>  Now when it is in read-only mode, some of the control should have a
>  different style when compared with editing mode.
You can't change classes on controls at this point without
regenerating the page. AVTs would solve this problem and this
something that we would like to implement at some point (see RFE
below).

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

But if what you would like to do is a print view, you can use the
xxforms:readonly-appearance="static" appearance on your
<xforms:model>. This will render all the controls that are read-only
with an appearance appropriate for a print view. Note that you will
need to regenerate the page to use this, for instance adding this
attribute in XSLT if there is a URL parameter ?print=true. For more on
this, see the section "Static Appearance for Read-Only Mode" on:

http://www.orbeon.com/ops/doc/reference-xforms-2

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/


--
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 change style during runtime?

Libelah
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to change style during runtime?

Erik Bruchez
Administrator
Can't see anything wrong with your code, it should work and update  
dynamically. Are you using a recent build?

-Erik

On Apr 23, 2009, at 4:32 AM, Libelah wrote:

>
> Hi,
>
> is there still no way to achive this?
> What i'd like to do:
> I'd like to change the color of a tablecell depending on the value  
> inside,
> which is calculated in its bind.
> i did the following:
> <xhtml:td class="{if(/myValue &gt; 100) then 'red' else
> 'green'}"><xforms:output bind="total-bind" /></xhtml:td>
> Which works - but only with the value which was initially in  
> myValue. If it
> changes the color doesn't change.
>
> Any ideas?
> --
> View this message in context: http://www.nabble.com/How-to-change-style-during-runtime--tp15733168p23195064.html
> Sent from the ObjectWeb 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
--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to change style during runtime?

Libelah
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: How to change style during runtime?

Erik Bruchez
Administrator
I would recommend you try with a more recent build.

-Erik

On Apr 23, 2009, at 11:20 PM, Libelah wrote:

>
> Hi,
>
> so it should work.... nice to hear (though it doesn't ;) )
> I am using Orbeon Forms 3.7.0beta1.200808260135
>
> --  
> View this message in context: http://www.nabble.com/How-to-change-style-during-runtime--tp15733168p23210563.html
> Sent from the ObjectWeb 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
--
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