Page 1 of 1

pui.click question - RESOLVED

Posted: Mon Feb 28, 2011 9:38 pm
by leatherlips
I'm having some weird things occur in a test app I'm working with.
I have a menu bar, and when clicking, the onoptionclick uses pui.click(value). The values are the ID of buttons(from the choicevalues of the menu bar).
When some of the items are selected on the menu bar, the proper button is clicked and the proper "click action" occurs for that button. On some, it does not seem to work. I put alert(value); along with the pui.click(value); of the onoptionclick event, and I can see the proper ID of the button is being used, but for some reason, the button that is supposed to be clicked does not get clicked, and instead it "acts" like I pressed submit.
For testing, I placed a simple button, and in it's click event I just put an alert("testing"); when I press that button, I see the alert. When I use the menu bar to pui.click that same button, it does not show the "testing" alert.
Is there another way to click a button using script that I should be using? Also, I had assumed that I could make the buttons "hidden" and they would still "click". Is that correct? (i've tried both hidden and visible with same results).

THANKS

Re: pui.click question

Posted: Tue Mar 01, 2011 2:21 pm
by leatherlips
Additional Info:
I created a button (button "A") on a screen. That button had this code in the "click event":
var smry = getObj("btnSmry"); pui.click(smry);
The second button (btnSmry) had this in it's click event: alert("hello");

When I press btnSmry,it displays the alert.
When I press button "A", it submits to the server(like pressing "enter") without executing the "click" event of btnSmry. I am assuming then, that pui.click is not what I should use to press a button on the client side? (without executing a server request)? if that's true is there some other api or native java script that should be used instead?

Re: pui.click question - Possibly RESOLVED

Posted: Tue Mar 01, 2011 2:54 pm
by leatherlips
I figured it out...
In the onclick for button "A":
var smry = getObj("btnSmry"); smry.onclick();
this fired the event on the btnSmry button which is what I needed.