문제

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 ?

도움이 되었습니까?

해결책

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}" />

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top