Read only controls in static mode

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

Read only controls in static mode

mbojja
Hi guys - To not show the combo box in read only mode I used the
xxf:readonly-appearance="static" as in the below sample form. But I see no
change when the form is published and opened

Expectation : Combo box shown as a grayed text box
Actual : Combo box grayed out

 <xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:ev="http://www.w3.org/2001/xml-events"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
         xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
         xmlns:map="http://www.w3.org/2005/xpath-functions/map"
         xmlns:array="http://www.w3.org/2005/xpath-functions/array"
         xmlns:exf="http://www.exforms.org/exf/1-0"
         xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
         xmlns:saxon="http://saxon.sf.net/"
         xmlns:sql="http://orbeon.org/oxf/xml/sql"
         xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:fb="http://orbeon.org/oxf/xml/form-builder">
    <xh:head>
        <xh:title>Read only test</xh:title>
        <xf:model id="fr-form-model" xxf:expose-xpath-types="true"
xxf:analysis.calculate="true"
                  xxf:readonly-appearance="static">

           
            <xf:instance id="fr-form-instance"
xxf:exclude-result-prefixes="#all" xxf:index="id">
                <form>
                    <section-1>
                        <grid-1>
                            <control-2/>
                            <control-1/>
                            <control-3/>
                        </grid-1>
                       
                    </section-1>
                </form>
            </xf:instance>

           
            <xf:bind id="fr-form-binds" ref="instance('fr-form-instance')">
                <xf:bind id="section-1-bind" name="section-1"
ref="section-1">
                    <xf:bind id="grid-1-bind" ref="grid-1" name="grid-1">
                        <xf:bind id="control-2-bind" ref="control-2"
name="control-2" xxf:whitespace="trim"
                                 readonly="true()"/>
                        <xf:bind id="control-1-bind" ref="control-1"
name="control-1" readonly="true()"/>
                        <xf:bind id="control-3-bind" ref="control-3"
name="control-3" readonly="true()"/>
                    </xf:bind>
                   
                </xf:bind>
            </xf:bind>

           
            <xf:instance id="fr-form-metadata" xxf:readonly="true"
xxf:exclude-result-prefixes="#all">
                <metadata>
                    <application-name>test</application-name>
                    <form-name>readonly</form-name>
                    <title xml:lang="en">Read only test</title>
                    <description xml:lang="en"/>
                   
<created-with-version>2019.2.2.department-education-western-australia.202004102354
PE</created-with-version>
                    <library-versions>
                        <orbeon>1</orbeon>
                    </library-versions>
                </metadata>
            </xf:instance>

           
            <xf:instance id="fr-form-attachments"
xxf:exclude-result-prefixes="#all">
                <attachments/>
            </xf:instance>

           
            <xf:instance xxf:readonly="true" id="fr-form-resources"
xxf:exclude-result-prefixes="#all">
                <resources>
                    <resource xml:lang="en">
                        <control-2>
                            <label>Text</label>
                            <hint/>
                        </control-2>
                        <control-1>
                            <label>Static</label>
                            <hint/>
                            <item>
                                <label>First choice</label>
                                <value>1</value>
                            </item>
                            <item>
                                <label>Second choice</label>
                                <value>2</value>
                            </item>
                            <item>
                                <label>Third choice</label>
                                <value>3</value>
                            </item>
                        </control-1>
                        <control-3>
                            <label>Dynamic</label>
                            <hint/>
                        </control-3>
                        <section-1>
                            <label>Static mode</label>
                        </section-1>
                       
                    </resource>
                </resources>
            </xf:instance>

        </xf:model>
    </xh:head>
    <xh:body>
        <fr:view>
            <fr:body xmlns:xbl="http://www.w3.org/ns/xbl"
xmlns:p="http://www.orbeon.com/oxf/pipeline"
                     xmlns:oxf="http://www.orbeon.com/oxf/processors">
                <fr:section id="section-1-section" bind="section-1-bind">
                    <xf:label ref="$form-resources/section-1/label"/>
                    <fr:grid id="grid-1-grid" bind="grid-1-bind">
                        <fr:c y="1" x="1" w="12">
                            <xf:input id="control-2-control"
bind="control-2-bind">
                                <xf:label
ref="$form-resources/control-2/label"/>
                                <xf:hint
ref="$form-resources/control-2/hint"/>
                                <xf:alert
ref="$fr-resources/detail/labels/alert"/>
                       
                               
                            </xf:input>
                               
                            </fr:c>
                        <fr:c x="1" y="2" w="12">
                            <xf:select1 id="control-1-control"
bind="control-1-bind" appearance="dropdown">
                                <xf:label
ref="$form-resources/control-1/label"/>
                                <xf:hint
ref="$form-resources/control-1/hint"/>
                                <xf:alert
ref="$fr-resources/detail/labels/alert"/>
                       
                               
                                <xf:itemset
ref="$form-resources/control-1/item">
                                    <xf:label ref="label"/>
                                    <xf:value ref="value"/>
                                </xf:itemset>
                            </xf:select1>
                        </fr:c>
                        <fr:c x="1" y="3" w="12">
                            <fr:databound-select1
xmlns="http://orbeon.org/oxf/xml/form-builder"
                                                 
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
                                                  id="control-3-control"
                                                  resource=""
                                                  bind="control-3-bind">
                                <xf:label
ref="$form-resources/control-3/label"/>
                                <xf:hint
ref="$form-resources/control-3/hint"/>
                                <xf:alert
ref="$fr-resources/detail/labels/alert"/>
                       
                               
                                <xf:itemset ref="item">
                                    <xf:label ref="label"/>
                                    <xf:value ref="value"/>
                                </xf:itemset>
                            </fr:databound-select1>
                        </fr:c>
                    </fr:grid>
                </fr:section>
            </fr:body>
        </fr:view>
    </xh:body>
</xh:html>

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1617758600995-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Read only controls in static mode

Alessandro  Vernet
Administrator
Hi Manish,

When using Form Runner, you can't manually add
`xxf:readonly-appearance="static"`. However, using the static-readonly
appearance is exactly what the view page does. Would you be able to point
users to the view page, instead of the edit page, for your form?

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1617841510953-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Read only controls in static mode

Alessandro  Vernet
Administrator
Hi Manish,

Did you get a chance to try using the view page for this? If so, is it
working for you?

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1618511673398-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet