unable to set style to DecoratingComponent

asked 2016-09-02 06:06:12 +0800

nirmalmandhata gravatar image nirmalmandhata flag of India
2 3

updated 2016-10-26 11:48:07 +0800

I have created a HtmlNativeComponent("button"), when I apply style to this component for the first time it works fine, but when I re-try to apply style to it without re-loading page, then the component doesn't remain HtmlNativeComponent component rather it changes to StubComponent and even after getting the object of StubComponent and applying style to it doesn't sets the style to button.

Here is the code for that

ActionMenuGroup menuGroup = (ActionMenuGroup) component;

            if (menuGroup != null) {
                if(menuGroup.getFirstChild() instanceof HtmlNativeComponent){
                    HtmlNativeComponent child = (HtmlNativeComponent) menuGroup.getFirstChild();
                    child.setDynamicProperty("style", style);
                }else if(menuGroup.getFirstChild() instanceof AbstractComponent){
                    AbstractComponent child = (StubComponent) menuGroup.getFirstChild();
                    child.setAttribute("style", style);

Is there any way to do this.

delete flag offensive retag edit
Be the first one to reply this discussion!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2016-09-02 06:06:12 +0800

Seen: 9 times

Last updated: Sep 02 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More