Page 1 of 1

Changing properties

Posted: 09 Aug 2019, 23:45
by Joerg Hamacher
Hi,
can anybody help me and tell me how the java script should look like for this request - I do not get it :-(

If the mouse hovers over a push the background color shall be changed like this (I suppose property "onFocus" is the correct one?):
if application theme is "Orange" the "onFocus" property of a push button shall be set to background-color = "Grey".
Otherwise background-color should be "Blue".

And it would be nice if the cursor changes to "Hand" if the button gets in focus - can this be done in any way?

Many thaks in advance - have a nice time,
Joerg

Re: Changing properties

Posted: 16 Aug 2019, 12:24
by jeanmichel
Hi Joerg,

The events you are looking for are "mouseenter" and "mouseleave" respectively.
Unfortunately they are not implemented for the push button extension.

In order to request an enhancement to the product please contact LANSA Support.

Re: Changing properties

Posted: 20 Aug 2019, 18:32
by Joerg Hamacher
Thank you, Jean-Michel

I will do so :-)

Cheers, Joerg

Re: Changing properties

Posted: 27 Aug 2019, 10:37
by tim mcentee
Hi Joerg

Here is a hack you could use in the meantime. In your button extension find the enabled option, set it to dynamic mode and edit the script. As long as the last line of the script is returnValue=true; then your script should keep the button active.

Change the colors to suit your needs. You can use a # color code or an rgb function.

$(this._fieldDiv).find("button").hover(
function() {
$( this ).css({backgroundColor: "red"} );
}, function() {
$( this ).css({backgroundColor: "blue"} );
}
);

returnValue=true;

Tim