Pergunta

hi i want to pass a bean as parameter composite component, then i will call its function as an action.

<cc:attribute required="true"   name="daobean" />

<ui:param name="daobeann" value="#{cc.attrs.daobean}" />
<p:commandButton action="#{daobeann.update}" />

and i use the component as

 <util:mycomponent daobean="mybean" />

but i get mybean.update() not found.

How can i call update method ?

Foi útil?

Solução

ui:param is for templating purposes. You don't need it here.

Just use correct composite interface and implementation

<cc:interface>
        <cc:attribute required="true" name="daobean" />
</cc:interface>

<cc:implementation>
     <p:commandButton action="#{cc.attributes.daobean.update}" />
</cc:implementation>

Then reference it from parent page like

<util:mycomponent daobean="#{mybean}" />

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top