[英]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.
然后,我用该ID注释了snd cc。 Obviously the id is also found, because I can launch the the page already.
显然也找到了ID,因为我已经可以启动页面了。
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: 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? 有人知道如何在cc输入表单按钮内正确更新cc数据表吗?
thnx n
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). 您已经指定了一个以
:
开头的客户端ID,因此它将相对于视图根进行解释(即它成为“绝对”客户端ID)。 But you seem to have another NamingContainer
component between the view root and the datatable component, for example a <h:form>
. 但是,您似乎在视图根和数据表组件之间还有另一个
NamingContainer
组件,例如<h:form>
。 Its ID will also end up in the client ID. 其ID也将以客户端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. 要确定
myDataTable
的正确客户端ID,您需要在myDataTable
浏览器中打开页面,右键单击并查看Source,然后找到<table id="xxx:myDataTable">
组件,其中xxx
目前未知。 You need to use exactly this client ID in the update
: 您需要在
update
完全使用此客户端ID:
<cc:myInput update=":xxx:myDataTable">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.