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
pui.click question - RESOLVED
-
- Profound User
- Posts: 83
- Joined: Sun Oct 03, 2010 8:45 am
- First Name: Mike
- Last Name: Geldert
- Company Name: Stonriver
- Country: Angola
- Contact:
pui.click question - RESOLVED
Last edited by leatherlips on Tue Mar 01, 2011 2:55 pm, edited 1 time in total.
-
- Profound User
- Posts: 83
- Joined: Sun Oct 03, 2010 8:45 am
- First Name: Mike
- Last Name: Geldert
- Company Name: Stonriver
- Country: Angola
- Contact:
Re: pui.click question
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?
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?
-
- Profound User
- Posts: 83
- Joined: Sun Oct 03, 2010 8:45 am
- First Name: Mike
- Last Name: Geldert
- Company Name: Stonriver
- Country: Angola
- Contact:
Re: pui.click question - Possibly RESOLVED
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.
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.
Who is online
Users browsing this forum: No registered users and 2 guests