How can I call a method of a JSF-component dialog from the surrounding parent dialog?

asked 16.02.2015 at 11:31

SupportIvyTeam's gravatar image

SupportIvyTeam ♦♦
accept rate: 77%

Yes, thats possible:

in the child component you have to declare a p:remoteCommand that executes the child component logic. The name of this remoteCommand should be defined by a component interface attribute:

< cc:interface componentType="IvyComponent">
  < cc:attribute name="callbackName" />
< /cc:interface>
< cc:implementation>
  < p:remoteCommand name="#{cc.attrs.callbackName}" actionListener="#{logic.execMyComponentLogic}"/>
< /cc:implementation>

The parent dialog can then embedd the component-dialog and define the name of the child callback method. And bind it to an oncomplete action of a commandButton:

< callbackName="callChild" />
< p:commandButton value="call child logic" oncomplete="callChild();"/>

answered 16.02.2015 at 11:37

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
accept rate: 70%

edited 16.02.2015 at 11:47

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 16.02.2015 at 11:31

Seen: 1,784 times

Last updated: 16.02.2015 at 11:47