Re: Custom XBL component

Posted by marek2608 on
URL: https://discuss.orbeon.com/Custom-XBL-component-tp4196663p4196990.html

Yes it helps thanks alot.

I am new to XBL and XForms in general so I am missing lots of subtilties at this point.

I manage to rewrite the XBL as follows:

<xbl:xbl xmlns:xhtml="http://www.w3.org/1999/xhtml"
         xmlns:xforms="http://www.w3.org/2002/xforms"
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:ev="http://www.w3.org/2001/xml-events"
         xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
         xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
         xmlns:xbl="http://www.w3.org/ns/xbl"
         xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         xmlns:oxf="http://www.orbeon.com/oxf/processors"
         xmlns:exf="http://www.exforms.org/exf/1-0" >
         

    <xbl:binding element="fr|hyperlink">
        <xbl:template >
            <xforms:group xbl:attr="model context ref bind" xxbl:scope="outer">
                <xbl:content includes="xforms|label,xforms|help,xforms|hint,xforms|alert"/>
                <xforms:group appearance="xxforms:internal" xxbl:scope="inner"> 
                     <xxforms:variable name="binding"> 
                         <xxforms:sequence select="." xxbl:scope="outer" /> 
                     </xxforms:variable> 
                     <xxforms:variable name="label" value="????"/>
                        <xforms:trigger ref="$binding" appearance="minimal" >
                            <xforms:label ref="$label"/>
                            <xforms:action ev:event="DOMActivate">
                                <xforms:load ref="$label" show="new"/>
                            </xforms:action>
                        </xforms:trigger>
            </xforms:group>
          </xforms:group>
        </xbl:template>
    </xbl:binding>
</xbl:xbl>

My next question is: how can I set the label variable so it contains the value of the label provided by the user in the Form Builder, in the form's instance resources:
            <xforms:instance id="fr-form-resources" xxforms:readonly="false">
                <resources>
                    <resource xml:lang="en">
                        <control-1>
                            <label>http://www.google.com</label>
                            <hint/>
                            <help/>
                            <alert/>
                        </control-1>

My guess is using the binding element, but I'm not too sure how this would be expressed.

Thanks again