Code: Select all
/* ================================================================================
disableCssButton() sets the "disabled" property to "true"
sets the "css class 2" property to "faded"
then sets the "field type" property to force a redraw.
*/
wob.disableCssButton = function(elementId)
{
if (getObj(elementId).pui.properties["field type"] == "css button")
{
applyProperty(elementId, "disabled", "true");
applyProperty(elementId, "css class 2", "faded");
applyProperty(elementId, "field type", getObj(elementId).pui.properties["field type"]);
}
}
/* ================================================================================
enableCssButton() sets the "disabled" property to "false"
sets the "css class 2" property to " "
then sets the "field type" property to force a redraw.
*/
wob.enableCssButton = function(elementId)
{
if (getObj(elementId).pui.properties["field type"] == "css button")
{
applyProperty(elementId, "disabled", "false");
applyProperty(elementId, "css class 2", " ");
applyProperty(elementId, "field type", getObj(elementId).pui.properties["field type"]);
}
}
We have also tried it two different ways. The first way is with the two properties ("disabled" and "css class 2") bound to RPG fields and set from RPG as *ON and "faded", respectively. The second way is with the two properties hardcoded in the screen as "true" and "faded", respectively. Under the first scenario the button becomes enabled (it's clickable) but remains faded (i.e., the css class is not being removed or the button is not being redrawn). Under the second scenario the button remains disabled (not clickable) *and* faded.
So, my second question is: If a property is bound to an RPG field, does this preclude being able to use the applyProperty() API to change the bound property's value?
In the end, though, my ultimate question is: How can we make this work? Thanks.