Hi Priti,
What is your JavaScript error? If you're using
Firefox/mozilla/netscape, you can bring up the JavaScript console by
typing: "javascript:" in the URL box.
Also, you may want to look into installing "FireBug" if you're using
Firefox. This also helps track down JavaScript problems.
To ensure you're finding the component, check your clientId. Trying
doing an alert on whatever getElementById is returning. Make sure
"doClick()" is the right method to call (check the documentation b/c I
think this button has some proprietary way to do this).
It may be a browser issue... test to see if you get different results
when it is visible vs. hidden. Perhaps the browser hides it from JS
too?? I'm not sure. If this turns out to be the case, you may want to
try a Hyperlink. Or you may need to generate your own JavaScript. Let
me know what you need to do b/c we may want to implement the solution as
a flag to the button/hyperlink factory so that it can happen more easily.
I hope this gives you some ideas on things to check... let us know what
you find out!
Thanks,
Ken
Priti Tiwary wrote:
> Hi,
> I have a button with several command events, which i want to invoke on
> checkbok selection. so i am hiding the button from user and attaching
> the onClick event handler of checkbox to search the button element in
> form and click it . I have the following code to accomplish it , but
> cannot figure out why it is not working
> <sun:form id="form">
> <sun:table id="basicTable" title="Basic Table">
>
> <sun:tableRowGroup id="rowGroup1" data={"{a=data1}", "{a=data2}"}
> sourceVar="td">
> <sun:tableColumn id="col1">
> <sun:checkbox id="checkbox"
> onClick="javascript:
> document.getElementById('form:basicTable:rowGroup1:col1:testBtn').doClick();
> alert('checkbox selected')"/>
> <sun:button id="testBtn"
> visible="$boolean{false}" text="Choose Me">
> <!command
> ....several handlers
> />
> </sun:button>
> </sun:tableColumn>
>
> </sun:table>
> </sun:form>
> Even the alert does not popup..because getElementById cannot execute
> successfully...
> Any ideas what is wrong ?
> Priti
>
>