简体   繁体   中英

Update a composite component?

how can I tell a composite component that it should update another cc?

I tried to give a "update" attribute to the first cc, which is handed to a button. Then I annotated the snd cc with that id. Obviously the id is also found, because I can launch the the page already.

BUT clicking the button: nothing happens!

input cc:

<composite:interface>
<composite:attribute name="update"/>
</composite:interface>

<composite:implementation>
<p:commandButton value="Create" update="#{cc.attrs.update}" action="register...">
</composite:implementation>

JSF:

<cc:myInput update=":myDataTable">

<cc:myDataTable id="myDataTable">

Anyone has a clue how to do proper update of the cc datatable of within the cc input form button?

thnx

You've specified a client ID which starts with : , so it will be interpreted relative to the view root (ie it becomes the "absolute" client ID). But you seem to have another NamingContainer component between the view root and the datatable component, for example a <h:form> . Its ID will also end up in the client ID.

To figure the right client ID of the myDataTable , you need to open the page in the webbrowser, rightclick and View Source and locate the <table id="xxx:myDataTable"> component where xxx is unknown right now. You need to use exactly this client ID in the update :

<cc:myInput update=":xxx:myDataTable">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM