Page 1 of 1

Changing Button Style onClick

Posted: Mon Apr 25, 2011 11:24 am
by RichDotson
I am using Gradient Buttons as a menu across the top of our web page. When the page that is associated with a button is displayed I want the button to be 'Black Marble' otherwise I want the button to be 'Bright Gold'. I have defined a field and bound it to the 'button style' property for each button and was setting this in the RPGLE program to the desired value.

I was trying to set the button style property in the .onClick event for each button to 'Black Marble' but this does not change the style of the button.

Here's how the buttons look when the initial page is displayed:
Capture1.PNG
Capture1.PNG (2.39 KiB) Viewed 984 times
Here is how the Customers button is defined:
Capture2.PNG
Capture2.PNG (3.86 KiB) Viewed 976 times
Here is the javascript code in the Customers button .onClick event:
applyProperty("btn_Customers", "button style", "Black Marble");

Does anyone see why the above javascript does not change the 'Customers' button to 'Black Marble"?

Re: Changing Button Style onClick

Posted: Mon Apr 25, 2011 12:48 pm
by David
Some properties are only checked when the field type of the widget is set. After your call to set the button style, try including this line, also:

Code: Select all


applyProperty("btn_Customers", "field type", "styled button");

That should force it to reset the button style.