You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Simon Raveh <si...@nominum.com> on 2003/11/14 23:25:20 UTC
GenericLink
Hi,
It may be a very easy thing but I can not figure it out.
I need to use GenericLing to generate a javascript url, the format of
the URL is:
javascript:deleteRow( 'tableId', rowIndex )
Where rowIndex is a property of a page
here is the component I was trying to use
<component id="deleteUrl" type="GenericLink">
<binding name="href" expression="javascript:deleteRow( +
\'cname\' +, recordIndex)" />
</component>
Any suggestions
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: GenericLink
Posted by Simon Raveh <si...@nominum.com>.
Jim Frederic wrote:
> GenericLink allows you to disable the link, but since I didn't need
> that I got the desired effect from an Any.
>
> <component id="selectSource" type="Any">
> <static-binding name="element" value="a"/>
> <binding name="href"
> expression="'javascript:selectNode('+displayNode.id+',"'+displayNode.name+'")'"/>
>
> </component>
>
> This renders HTML like this:
> <a href="javascript:selectNode(5183,"The Node Name")">The
> Node Name</a>
>
> which calls the selectNode function passing the number 5183 and the
> string "The Node Name".
>
> Note the placement of the single quote marks, which OGNL interprets as
> literal strings.
>
> -Jim
>
> Simon Raveh wrote:
>
>> Hi,
>>
>> It may be a very easy thing but I can not figure it out.
>> I need to use GenericLing to generate a javascript url, the format of
>> the URL is:
>>
>> javascript:deleteRow( 'tableId', rowIndex )
>>
>> Where rowIndex is a property of a page
>>
>> here is the component I was trying to use
>>
>> <component id="deleteUrl" type="GenericLink">
>> <binding name="href" expression="javascript:deleteRow( +
>> \'cname\' +, recordIndex)" />
>> </component>
>>
>> Any suggestions
>>
>> Simon
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
Thanks, I'll give it a try
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: GenericLink
Posted by Jim Frederic <ji...@isogen.com>.
GenericLink allows you to disable the link, but since I didn't need that
I got the desired effect from an Any.
<component id="selectSource" type="Any">
<static-binding name="element" value="a"/>
<binding name="href"
expression="'javascript:selectNode('+displayNode.id+',"'+displayNode.name+'")'"/>
</component>
This renders HTML like this:
<a href="javascript:selectNode(5183,"The Node Name")">The Node
Name</a>
which calls the selectNode function passing the number 5183 and the
string "The Node Name".
Note the placement of the single quote marks, which OGNL interprets as
literal strings.
-Jim
Simon Raveh wrote:
> Hi,
>
> It may be a very easy thing but I can not figure it out.
> I need to use GenericLing to generate a javascript url, the format of
> the URL is:
>
> javascript:deleteRow( 'tableId', rowIndex )
>
> Where rowIndex is a property of a page
>
> here is the component I was trying to use
>
> <component id="deleteUrl" type="GenericLink">
> <binding name="href" expression="javascript:deleteRow( +
> \'cname\' +, recordIndex)" />
> </component>
>
> Any suggestions
>
> Simon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: GenericLink
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
You may be better off using the alternate syntax:
<binding name="href">
"javascript:deleteRow('" + cname + "', recordIndex);"
</binding>
--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com
> -----Original Message-----
> From: Simon Raveh [mailto:simon.raveh@nominum.com]
> Sent: Friday, November 14, 2003 5:25 PM
> To: Tapestry-User
> Subject: GenericLink
>
>
> Hi,
>
> It may be a very easy thing but I can not figure it out.
> I need to use GenericLing to generate a javascript url, the format of
> the URL is:
>
> javascript:deleteRow( 'tableId', rowIndex )
>
> Where rowIndex is a property of a page
>
> here is the component I was trying to use
>
> <component id="deleteUrl" type="GenericLink">
> <binding name="href" expression="javascript:deleteRow( +
> \'cname\' +, recordIndex)" />
> </component>
>
> Any suggestions
>
> Simon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org