Re: javascript integration & repeats, or clickable dynamic images

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

Re: javascript integration & repeats, or clickable dynamic images

Adrian Baker
Ah, I apologise, there a thread and a sample about this very topic: http://mail-archive.objectweb.org/ops-users/2006-12/msg00461.html.

The limitation on javascript integration & repeats still stands however.

Adrian

Adrian Baker wrote:
Inside a repeat I've got:

    <xf:output mediatype="image/*" xhtml:onclick="ORBEON.xforms.Document.dispatchEvent('my-open-trigger', 'DOMActivate');"
        value="{expression-to-get-image-based-on-mime}"/>
       
    <xf:trigger id="my-open-trigger">
        <xf:label ref="{path-to-filename}"/>
        <xf:load ev:event="DOMActivate" ev:propagate="stop" show="new" resource="{path-to-attachment}"/>
    </xf:trigger>
   
There's a icon of the attachment and next to it the filename as a link. Clicking on either popus up a new window. Both work fine *outside* of a repeat. Perhaps you can spot the problem: when in the repeat, the trigger works but the onclick handler on the output does not.

So it seems that javascript integration isn't really possible within repeats, because all the methods are ID based, and the ID's are generated in this case. Perhaps I can resort to parsing the ID of the output to generate an argument to
dispatchEvent ('my-open-trigger1'), but this seems dodgy - any other ideas? I can't see any other way to have a clickable changable image. I tried a trigger containing a label containing the  output, but the mediatype of the output seems to be ignored in this case.

In general the inability of the ORBEON.xforms.Document.* javascript functions to work with repeats seems to really limit their use...

Adrian


--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: javascript integration & repeats, or clickable dynamic images

Adrian Baker
Ah, I apologise, there a thread and a sample about this very topic: http://mail-archive.objectweb.org/ops-users/2006-12/msg00461.html.

The limitation on javascript integration & repeats still stands however.

Adrian

Adrian Baker wrote:
Inside a repeat I've got:

    <xf:output mediatype="image/*" xhtml:onclick="ORBEON.xforms.Document.dispatchEvent('my-open-trigger', 'DOMActivate');"
        value="{expression-to-get-image-based-on-mime}"/>
       
    <xf:trigger id="my-open-trigger">
        <xf:label ref="{path-to-filename}"/>
        <xf:load ev:event="DOMActivate" ev:propagate="stop" show="new" resource="{path-to-attachment}"/>
    </xf:trigger>
   
There's a icon of the attachment and next to it the filename as a link. Clicking on either popus up a new window. Both work fine *outside* of a repeat. Perhaps you can spot the problem: when in the repeat, the trigger works but the onclick handler on the output does not.

So it seems that javascript integration isn't really possible within repeats, because all the methods are ID based, and the ID's are generated in this case. Perhaps I can resort to parsing the ID of the output to generate an argument to
dispatchEvent ('my-open-trigger1'), but this seems dodgy - any other ideas? I can't see any other way to have a clickable changable image. I tried a trigger containing a label containing the  output, but the mediatype of the output seems to be ignored in this case.

In general the inability of the ORBEON.xforms.Document.* javascript functions to work with repeats seems to really limit their use...

Adrian


--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws