Re: xxforms:variable problem in javascript

Posted by Erik Bruchez on
URL: https://discuss.orbeon.com/xxforms-variable-problem-in-javascript-tp1557302p1561191.html

Laxmi,

Are you running XSLT first? If so, try doubling the brackets to escape
them from XSLT:

href="javascript:jsFunctionForDownload('{{$temp}}')"

If that doesn't work, it might be a bug/missing feature of the version
you are using.

With recent builds, it works. I tried:

<xxforms:variable name="temp" select="'Title'"/>
<xhtml:a href="javascript:alert('{$temp}')">Show</xhtml:a>

-Erik

On Tue, Feb 16, 2010 at 5:06 AM, Laxmi Narayana <[hidden email]> wrote:

> Hi All,
> In my xhtml I have provided code as below.While using temp variable in
> javascript:jsFunctionForDownload('{$temp}')
> It shows error like Undeclared variable $temp .I am using ops3.7.0 version.
> Please help me How to avoid this problem?
>
> <xforms:repeat nodeset="instance('template-instance')//record">
>   <xxforms:variable name="temp" select="title"/>
>   <xxforms:variable name="temp1"
> select='substring-after(substring-after(substring-after(title,"/"),"/"),"/")'/>
>  <xforms:group
> ref=".[substring-after(substring-after(substring-after(title,'/'),'/'),'/')!='']">
>   <a href="javascript:jsFunctionForDownload('{$temp}')"
> id="parah"><xhtml:img src="/images/inbox/attach.gif"
> border="0"/><xforms:output
> value='substring-after(substring-after(substring-after(title,"/"),"/"),"/")'/></a>
>  </xforms:group>
>
>  <xforms:select ref="instance('main-instance')/checkbox" appearance="full"
> multiple="true" style="font-size: 10pt">
>   <xforms:choices>
>    <xforms:item>
>     <xforms:label></xforms:label>
>     <xforms:value ref="$temp1"/></a>
>    </xforms:item>
>   </xforms:choices>
>  </xforms:select>
> </xforms:repeat>
>
>
> --
> 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