03 November 2010

TROUBLESHOOTING: af:showPopupBehavior raises the popup although the parent action component is disabled

Scenario:
The following will raise the component
eg

< af:commandToolbarButton   ... 
              disabled="true"
              icon="/images/icon.png"
              disabledIcon="/images/disableIcon.png"                
              ... >
               < af:showPopupBehavior popupId="Popup"
                                    triggerType="click" />
</af:commandToolbarButton >     

Note: that the command component will be disable and will be rendered with the disable icon



Solution:
In order to not raise the pop use  triggerType="action"

< af:commandToolbarButton   ... 
              disabled="true"
              icon="/images/icon.png"
              disabledIcon="/images/disableIcon.png"                
              ... >
               < af:showPopupBehavior popupId="Popup"
                                    triggerType="action" />
</af:commandToolbarButton >     


Below is part of the documentation in order to help you understand why. Probably is because of the "the component will still raise the action event."

Client Event Trigger Types

The following table lists component family-specific event types that can be assigned to the triggerType attribute:

Event TypeComponent FamilyDescription
actionCommandFires when user triggers the command component. Owning component's server-side action listeners will be ignored since the event will be canceled.
...

The following table lists input (mouse/keyboard) event types. These events are delivered for all components (though in some cases may be consumed by the peer implementation) and can be assigned to the triggerType attribute:

Event TypeDescription
clickFires when user clicks on component. When the event source is a command family component, the component will still raise the action event.

Links:

No comments:

Post a Comment

You might also like:

Related Posts Plugin for WordPress, Blogger...
There was an error in this gadget