Orbeon 3.9 question - readonly for xforms:textarea with mediatype=text/html

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

Orbeon 3.9 question - readonly for xforms:textarea with mediatype=text/html

bwallis42
Hi,
  I have an issue with a form for a current customer (simplified example shown below). This is with a very old version of orbeon, version 3.9.0. The same form updated for Orbeon 2016.3 works fine.

I realise that this is very old but would appreciate any suggestions that might make this work.

The problem is for rich text areas inside a repeat where the 2nd and subsequent iterations of the repeat should be set to readonly (via readonly="position() > 1" in the bind).

The text element does get set to readonly in the second iteration but the rich text one does not.

Can you think of any other ways to achieve this that might work? It looks like the rich text element doesn't support a readonly appearance at all during edit.

thanks

<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
            xmlns:ev="http://www.w3.org/2001/xml-events"
            xmlns:exforms="http://www.exforms.org/exf/1-0"
            xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
            xmlns:im="http://www.infomedix.com.au/cpf/forms"
            xmlns:saxon="http://saxon.sf.net/"
            xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
            xmlns:sql="http://orbeon.org/oxf/xml/sql"
            xmlns:xforms="http://www.w3.org/2002/xforms"
            xmlns:xi="http://www.w3.org/2001/XInclude"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
            xmlns:xxi="http://orbeon.org/oxf/xml/xinclude">
    <xhtml:head>
        <xhtml:title>Untitled Form</xhtml:title>
        <xforms:model id="fr-form-model">

            <!-- Main instance -->
            <xforms:instance id="fr-form-instance">
                <form>
                    <section-1>
                        <note>
                            <control-1/>
                            <control-3/>
                        </note>
                        <note>
                            <control-1/>
                            <control-3/>
                        </note>
                    </section-1>
                </form>
            </xforms:instance>

            <!-- Bindings -->
            <xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
                <xforms:bind id="section-1-bind" name="section-1" nodeset="section-1">
                    <xforms:bind id="section-1-note-bind" name="note" nodeset="note" readonly="position() &gt; 1">
                        <xforms:bind id="control-1-bind" name="control-1" nodeset="control-1"/>
                        <xforms:bind id="control-3-bind" name="control-3" nodeset="control-3"/>
                    </xforms:bind>
                </xforms:bind>
            </xforms:bind>

            <!-- Metadata -->
            <xforms:instance id="fr-form-metadata" xxforms:readonly="true">
                <metadata>
                    <application-name>CPF</application-name>
                    <form-name>tidIHN:aa-repeat</form-name>
                    <title xml:lang="en">Untitled Form</title>
                    <description xml:lang="en"/>
                    <author/>
                    <logo filename="" mediatype="" size=""/>
                    <im:version>3</im:version>
                </metadata>
            </xforms:instance>

            <!-- Attachments -->
            <xforms:instance id="fr-form-attachments">
                <attachments>
                    <css filename="" mediatype="text/css" size=""/>
                    <pdf filename="" mediatype="application/pdf" size=""/>
                </attachments>
            </xforms:instance>

            <!-- All form resources -->
            <!-- Don't make readonly by default in case a service modifies the resources -->
            <xforms:instance id="fr-form-resources" xxforms:readonly="false">
                <resources>
                    <resource xml:lang="en">
                        <section-1>
                            <label>Untitled Section</label>
                            <help/>
                        </section-1>
                        <control-1>
                            <label>Text</label>
                            <hint/>
                            <help/>
                            <alert/>
                        </control-1>
                        <control-3>
                            <label>Rich Text</label>
                            <hint/>
                            <help/>
                            <alert/>
                        </control-3>
                    </resource>
                </resources>
            </xforms:instance>

            <!-- Utility instances for services -->
            <xforms:instance id="fr-service-request-instance" xxforms:exclude-result-prefixes="#all">
                <request/>
            </xforms:instance>

            <xforms:instance id="fr-service-response-instance" xxforms:exclude-result-prefixes="#all">
                <response/>
            </xforms:instance>

        </xforms:model>
    </xhtml:head>
    <xhtml:body>
        <fr:view>
            <xforms:label ref="instance('fr-form-metadata')/title"/>
            <fr:body>
                <fr:section bind="section-1-bind" id="section-1-section">
                    <xforms:label ref="$form-resources/section-1/label"/>
                    <xforms:help ref="$form-resources/section-1/help"/>
                    <xforms:repeat bind="section-1-note-bind">
                        <fr:grid>
                            <xhtml:tr>
                                <xhtml:td>
                                    <xforms:input bind="control-1-bind" id="control-1-control">
                                        <xforms:label ref="$form-resources/control-1/label"/>
                                        <xforms:hint ref="$form-resources/control-1/hint"/>
                                        <xforms:help ref="$form-resources/control-1/help"/>
                                        <xforms:alert ref="$fr-resources/detail/labels/alert"/>
                                    </xforms:input>
                                </xhtml:td>
                            </xhtml:tr>
                            <xhtml:tr>
                                <xhtml:td>
                                        <xforms:textarea xmlns:fb="http://orbeon.org/oxf/xml/form-builder"
                                                     xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"
                                                     xmlns:xbl="http://www.w3.org/ns/xbl"
                                                     bind="control-3-bind"
                                                     id="control-3-control"
                                                     mediatype="text/html">
                                            <xforms:label ref="$form-resources/control-3/label"/>
                                            <xforms:hint ref="$form-resources/control-3/hint"/>
                                            <xforms:help ref="$form-resources/control-3/help"/>
                                            <xforms:alert ref="$fr-resources/detail/labels/alert"/>
                                        </xforms:textarea>
                                </xhtml:td>
                            </xhtml:tr>
                        </fr:grid>
                    </xforms:repeat>
                </fr:section>
            </fr:body>
        </fr:view>
    </xhtml:body>
</xhtml:html>
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon 3.9 question - readonly for xforms:textarea with mediatype=text/html

bwallis42
I just noticed that even though the second textarea lets you enter text, it doesn't actually save it in the form.
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon 3.9 question - readonly for xforms:textarea with mediatype=text/html

Alessandro  Vernet
Administrator
Hi Brian,

Could it be that you are hitting the issue linked below? It was fixed a long time ago (in 2012!), but this was after 3.9. The fix is quite simple, so you might be able to apply it on your side.

https://github.com/orbeon/orbeon-forms/issues/175

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon 3.9 question - readonly for xforms:textarea with mediatype=text/html

bwallis42
Hi Alex,
   Ahh... No. No tinymce in 3.9, it is using the yui editor (correct?). So unless there was some similar bug in the yui integration this isn't going to be it.
thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon 3.9 question - readonly for xforms:textarea with mediatype=text/html

Alessandro  Vernet
Administrator
Hi Brian,

Ah, yes, since you have an `<xf:textarea mediatype="text/html">`, you're using the YUI RTE. I don't recall issues with readonlyness with the YUI RTE, but that was a long time ago! And you might have bigger problem with the YUI RTE, namely the fact that it doesn't work with IE11.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet