Custom Control (XBL)

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

Custom Control (XBL)

Askerion
Hello there,

I would like to create a custom textoutput Control .

I copied the original Textoutput Control from /forms/orbeon/builder/xbl/text-output.xbl to /xbl/orbeon/hevos_session/hevos_session.xbl

XBL File
<!--
  Copyright (C) 2009 Orbeon, Inc.

  This program is free software; you can redistribute it and/or modify it under the terms of the
  GNU Lesser General Public License as published by the Free Software Foundation; either version
  2.1 of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU Lesser General Public License for more details.

  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
  -->
<xbl:xbl xmlns:xf="http://www.w3.org/2002/xforms"
         xmlns:xbl="http://www.w3.org/ns/xbl">

    <xbl:binding id="fb-output" element="xf|output">
        <metadata xmlns="http://orbeon.org/oxf/xml/form-builder">
            <display-name lang="en">Session</display-name>
            <display-name lang="es">Session</display-name>
            <display-name lang="fi">Session</display-name>
            <display-name lang="fr">Session</display-name>
            <display-name lang="ru">Session</display-name>
            <display-name lang="de">Session</display-name>
            <display-name lang="it">Session</display-name>
            <display-name lang="nl">Session</display-name>
            <display-name lang="sv">Session</display-name>
            <display-name lang="pt">Session</display-name>
            <icon lang="en">
                <small-icon>/apps/fr/style/images/silk/text_align_left.png</small-icon>
                <large-icon>/apps/fr/style/images/silk/text_align_left.png</large-icon>
            </icon>
            <templates>
                <view>
                    <xf:output id="" ref="" xmlns="">
                        <xf:label ref=""/>
                        <xf:hint ref=""/>
                        <xf:help ref=""/>
                        <xf:alert ref=""/>
                        
                        
                    </xf:output>
                </view>
            </templates>
        </metadata>

    </xbl:binding>

</xbl:xbl>




Then I added under the properties Shape builder.xml the control
oxf:/xbl/orbeon/hevos_session/hevos_session.xbl



As far as everything works ,

Now I would like to add the Control Inital Data
For example : xxforms:get-request-parameter('w')

How can I do that?


regards
Reply | Threaded
Open this post in threaded view
|

Re: Custom Control (XBL)

Alessandro  Vernet
Administrator
Hi,

What do you mean by "add the Control Initial Data"? This would typically be done by the user of your control in Form Builder, in the Control Settings, under Formulas / Initial Value. Or would you like the control to always have a pre-set initial value, without the form author having to do anything?

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

Re: Custom Control (XBL)

Askerion
This post was updated on .
yes , the control is always worth a standard pre-set initial value

How can I do that?
Reply | Threaded
Open this post in threaded view
|

Re: Custom Control (XBL)

Askerion
is this possible?
Reply | Threaded
Open this post in threaded view
|

Re: Custom Control (XBL)

Alessandro  Vernet
Administrator
Hi,

Yes, it is possible, and in this case should be pretty simple. Inside <templates>, adding an <bind calculate="xxf:get-request-parameter('w')"/> should do it. You'll let us know if this works for you.

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