0
votes

I want to compute the styleClass property on an xp:button similar to the disabled computation for that button:

if (viewScope.get("maskBtnContinue") == true){
    return true;
}
else{
    return false;
}

so similar for the styleClass I use:

if (viewScope.get("maskBtnContinue") == true){
    return "btn btn-default";
}
else{
    return "btn btn-primary";
}

When I perform a partial refresh on the xp:panel that contains the xp:button I notice the disabled property changes for the xp:button when viewScope "maskBtnContinue changes but the styleClass remains having the same value.

Anyone can tell me how I should change the class for the button properly when the viewScope changes?

1

1 Answers

2
votes

You have to disable runtime-applied styles on the button.

I did a small test and had the same issue. After checking 'Disable runtime-applied default styles' on the button, it worked. Or in source mode: add disableTheme="true" as property for the button.