Re: Re: Re: where is xforms.js to be found ??

Posted by Binesh Gummadi on
URL: https://discuss.orbeon.com/where-is-xforms-js-to-be-found-tp3032609p3034486.html

DL,

Its more involved to create an XHTML page as our component has a lot more functionality specific to our use case. I apologize. But here is the idea.

<xbl:xbl>

<xbl:script src="/components/citrix-form/flash-picker.js" />
<xbl:script src="/components/citrix-form/swfobject.js" />

<xbl:binding id="fr-flash-picker" element="fr|flash-picker">
<xbl:template xxbl:transform="oxf:unsafe-xslt">
<xsl:transform version="2.0">
<xsl:import href="oxf:/oxf/xslt/utils/xbl.xsl" />
<xsl:template match="/*">
<xforms:group xbl:attr="model context ref bind" xxbl:scope="outer">
<xxforms:script ev:event="xforms-enabled">
YAHOO.xbl.fr.FlashSelector.instance(this).init();
</xxforms:script>
                                                <div id="flashcontent" class="flashcontent"></div>
                                        </xforms:group>
                                </xsl:template>
                        </xsl:transform>
                </xbl:template>
        </xbl:binding>

</xbl:xbl>


flash-picker.js
var YDOM = YAHOO.util.Dom;
var ODOC = ORBEON.xforms.Document;

YAHOO.namespace("xbl.fr");
YAHOO.xbl.fr.FlashSelector = function() {};
ORBEON.xforms.XBL.declareClass(YAHOO.xbl.fr.FlashSelector, "xbl-fr-flash-picker");

YAHOO.xbl.fr.FlashSelector.prototype = {
    _instances: {},

    _getInstance: function(target) {
        var container = YDOM.getElementsByClassName("xbl-fr-flash-picker", null, this.container)[0];
        return this._instances[container.id];
    },

    init: function() {
       this.flashElement =  YDOM.getElementsByClassName("flashcontent", null, this.container)[0];
        var so = new SWFObject("",  "my-flash-picker", "300", "500", "8", "#CCCCCC");
so.addVariable("wmode", "transparent");
so.addVariable("salign", "t");
so.addParam("scale", "noscale");
so.addParam("src", "url-to-swf-file");                   
so.write(this.flashElement);        
    }
}

In XBL you define a div(flashcontent) which will be used by SWFObject javascript. You create a SWFObject and write to the div. Hope this helps.


Binesh Gummadi
Senior Software Engineer
rivetlogic
Voice +1.703.879.5740
Skype binesh.gummadi_rivetlogic
GTalk [hidden email]
Calendarbinesh gummadi's calendar



On Tue, Nov 9, 2010 at 8:14 AM, DL <[hidden email]> wrote:


We built a reusable XBL component using swfobject. We can include the
swfobject.js in xbl and initialize it in component's javascript file. I am
curious as how xforms.js comes into play? I would love to know.

I would appreciate a few more tips on how to add swfobject as you describe
above.
Can you attach a test.xhtml and test.xbl file?

So do I place into Web-inf\resources\xbl\orbeon\swfobject\

the swfobject *.html, swfobject.js, and *.swf files?


Meanwhile I'm looking into xforms.js found in orbeon-resources-public.jar

Thanks.
--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/where-is-xforms-js-to-be-found-tp3032609p3033681.html
Sent from the Orbeon Forms (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




--
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