Re: Repetition and OnClick of TR
Re: Repetition and OnClick of TR
- Subject: Re: Repetition and OnClick of TR
- From: Alex Johnson <email@hidden>
- Date: Thu, 12 Jan 2006 10:36:42 -0800
I recommend having doing something like this:
<x-tad-bigger><tr onclick="window.location=this.getElementsByTagName('a')[0].href"><td><webobject name="WOHyperlink1"></webobject>
</x-tad-bigger>
or
<x-tad-bigger><tr onclick="window.location=this.childNodes[0].childNodes[0].href"><td><webobject name="WOHyperlink1"></webobject>
</x-tad-bigger>
Where WOHyperlink1's
<x-tad-bigger>action</x-tad-bigger> is bound to
<x-tad-bigger>editLink</x-tad-bigger>. If you use the latter, watch out for textnodes (aka white-space). Whichever one you use, you'll probably want to make the
<x-tad-bigger>onclick</x-tad-bigger> a little more robust, but these should point you in the right direction.
The other option, I think, might be to use WOGenericContainer for the
<x-tad-bigger><tr></x-tad-bigger> tag, binding
<x-tad-bigger>invokeAction</x-tad-bigger> to
<x-tad-bigger>editLink</x-tad-bigger> and
<x-tad-bigger>onclick</x-tad-bigger> to a method that returns
<x-tad-bigger>"window.location='" + context().componentActionUrl() + "'"</x-tad-bigger>, but I have never tried this.
Alex Johnson
|
| |
|||
|| | |
||
| | |
|| || |
||
\\ SITE 9 \\ SITE9.COM \\ 503.248.4440 \\
On Jan 11, 2006, at 5:59 PM, Dave Elsner wrote:
Hi,
Does any one have an easy solution to place a javascript onClick of a table row thats in a <x-tad-bigger>WORepeition</x-tad-bigger>
the Action i need to call is:
<x-tad-bigger>public</x-tad-bigger><x-tad-bigger> WOComponent editLink()</x-tad-bigger>
<x-tad-bigger> {</x-tad-bigger>
<x-tad-bigger>editFlag = </x-tad-bigger><x-tad-bigger>true</x-tad-bigger><x-tad-bigger>;</x-tad-bigger>
my<x-tad-bigger>DisplayGroup.selectObject(aItem);</x-tad-bigger>
<x-tad-bigger> </x-tad-bigger><x-tad-bigger>return</x-tad-bigger><x-tad-bigger> </x-tad-bigger><x-tad-bigger>this</x-tad-bigger><x-tad-bigger>.context().page();</x-tad-bigger>
<x-tad-bigger> }</x-tad-bigger>
I tried adding:
<x-tad-bigger>public</x-tad-bigger><x-tad-bigger> String onClickLocation()</x-tad-bigger>
<x-tad-bigger>{</x-tad-bigger>
<x-tad-bigger>return</x-tad-bigger><x-tad-bigger> </x-tad-bigger><x-tad-bigger>"document.location='<WEBOBJECT NAME=WOActionURL1></WEBOBJECT>';"</x-tad-bigger><x-tad-bigger>;</x-tad-bigger>
<x-tad-bigger>}</x-tad-bigger>
<x-tad-bigger>WOActionURL1: WOActionURL {</x-tad-bigger>
<x-tad-bigger>action = editLink;</x-tad-bigger>
<x-tad-bigger>}</x-tad-bigger>
<x-tad-bigger>and setting onClick to that but that doesn't replace </x-tad-bigger><x-tad-bigger>WOActionURL1 </x-tad-bigger><x-tad-bigger>with the real url.</x-tad-bigger>
<x-tad-bigger>I also tried adding a javascript function using the </x-tad-bigger><x-tad-bigger>WOActionURL1 </x-tad-bigger><x-tad-bigger>which calls editLink() okay but it then has no idea of where the current repeition is up to and I get aItem = null;</x-tad-bigger>
<x-tad-bigger>I have got it to work using a DA but would like a more light weight solution that can be easily reused.</x-tad-bigger>
-------
Dave _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden