To include dynamic clickable images within a trigger

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

To include dynamic clickable images within a trigger

Joseph Lawrence
Erik,
      I need to include a set of dynamic clickable images into a set of pages. For this I used the following code:

<xhtml:html>

<xhtml:head>
      <xforms:model>
           <xforms:instance id=”main”>
                <main>
                    <xsl:copy-of  select=”result/*”/>
                </main>
           </instance>
           <xforms:instance id=”page-to-load”>
                <page-to-load >
                     <page/>
                </ page-to-load >
           </instance>
           <xforms:bind nodeset=”instance(‘page-to-load’)/page”  calculate=”concat(‘<a href="http://localhost:8888/sample/’,instance(‘main’)/data">http://localhost:8888/sample/’,instance(‘main’)/data[index(’main-id’)]/page)”/>
      </xforms:model>
</xhtml:head>

<xhtml:body>
<xforms:repeat nodeset=”instance(‘main’)/data” id=”main-id”>
       <xforms:trigger appearance=”xxforms:link”>
             <xforms:label>
                  <xforms:output ref=”./imagepath” mediatype=”image/*”/>
             </xforms:label>
             <xforms:action ev:event=”DOMActivate”>
                   <xforms:recalculate/>
                   <xforms:load ref=”instance(page-to-load)/page”/>
             </xforms:action>
       </xforms:trigger>
</xforms:repeat>
</xhtml:body>
<xhtml:html>
 

While I was using the OPS3.0.1 release, the above code returned an error message. With the 25th  July 2006 nightly build, I wasn’t getting any error message but  wasn’t getting the image displayed.

 
Thanks
Joseph Lawrence
Stabilix Solutions Pvt Ltd



--
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: To include dynamic clickable images within a trigger

Erik Bruchez
Administrator
Joseph,

We don't yet support exactly the construct you are using. We now have
minimal support for xforms:output in xforms:label, etc., but we do not
support HTML markup or images in there yet.

However you could use xforms:output with mediatype="text/html" and
produce the complete HTML markup fragment with that, as the "Flickr
Resizing" example shows:

<xforms:output
     value="concat(
             '&lt;img',
               ' src=&#34;http://static.flickr.com/',
                 @server, '/',
                 @id, '_',
                 @secret,
                 '_',
                 if (instance('inst-control')/size &lt; 100)
                   then 's' else  'm',
                 '.jpg&#34;',
               ' style=&#34;',
                 'width:', instance('inst-control')/size, ';',
                 ' height:', instance('inst-control')/size, ';&#34;',
             '/&gt;'
            )"
         mediatype="text/html"
         class="flickr-image"/>

That kind of code is not the most beautiful, but it works.

-Erik

[hidden email] wrote:

> Erik,
>       I need to include a set of dynamic clickable images into a set of pages. For this I used the following code:
>
> <xhtml:html>
>
> <xhtml:head>
>       <xforms:model>
>            <xforms:instance id=”main”>
>                 <main>
>                     <xsl:copy-of  select=”result/*”/>
>                 </main>
>            </instance>
>            <xforms:instance id=”page-to-load”>
>                 <page-to-load >
>                      <page/>
>                 </ page-to-load >
>            </instance>
>            <xforms:bind nodeset=”instance(‘page-to-load’)/page”  calculate=”concat(‘http://localhost:8888/sample/’,instance(‘main’)/data[index(’main-id’)]/page)”/>
>       </xforms:model>
> </xhtml:head>
>
> <xhtml:body>
> <xforms:repeat nodeset=”instance(‘main’)/data” id=”main-id”>
>        <xforms:trigger appearance=”xxforms:link”>
>              <xforms:label>
>                   <xforms:output ref=”./imagepath” mediatype=”image/*”/>
>              </xforms:label>
>              <xforms:action ev:event=”DOMActivate”>
>                    <xforms:recalculate/>
>                    <xforms:load ref=”instance(page-to-load)/page”/>
>              </xforms:action>
>        </xforms:trigger>
> </xforms:repeat>
> </xhtml:body>
> <xhtml:html>
>  
>
> While I was using the OPS3.0.1 release, the above code returned an error message. With the 25th  July 2006 nightly build, I wasn’t getting any error message but  wasn’t getting the image displayed.
>
>  
> Thanks
> Joseph Lawrence
> Stabilix Solutions Pvt Ltd
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



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