Changing Button Style onClick

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
RichDotson
Profound User
Posts: 22
Joined: Fri Aug 06, 2010 1:40 pm
First Name: Rich
Last Name: Dotson
Company Name: Wheeling & Lake Erie Rail
State / Province: Ohio
Country: United States
Contact:

Changing Button Style onClick

Post 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 981 times
Here is how the Customers button is defined:
Capture2.PNG
Capture2.PNG (3.86 KiB) Viewed 973 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"?
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Changing Button Style onClick

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests