我的页面上有一个警告:
Can not update component without a attached renderer. Component class: "class org.primefaces.component.menuitem.UIMenuItem"
Run Code Online (Sandbox Code Playgroud)
它工作得很完美,但我仍然收到这条警告信息.我所拥有的是一个表,应根据所选行显示用户的上下文菜单,呈现一些菜单.
这是我的表:
<p:dataTable id="protocoloTable" var="protocolo" value="#{juridicaBean.protocolsLazy}" paginator="true" lazy="true" selectionMode="single"
selection="#{protocoloBean.selectedEntity}">
<p:ajax event="contextMenu" update=":registration_form:protocoloTableMenu" oncomplete="protoMenu.show(currentEvent);" process="protocoloTable" />
Run Code Online (Sandbox Code Playgroud)
这是菜单:
<p:contextMenu id="protocoloTableMenu" for="protocoloTable" widgetVar="protoMenu">
<p:menuitem value="Visualizar protocolo" icon="icon-ticket icon-large" actionListener="#{ocorrenciaBean.loadViewOcorrencias(protocoloBean.selectedEntity)}"
process="@this" update="view_proto_details" oncomplete="PF('viewProtocolDlg').show()"></p:menuitem>
<p:menuitem value="Nova ocorrência" icon="icon-plus icon-large" actionListener="#{ocorrenciaBean.newOcorrencia(protocoloBean.selectedEntity)}" oncomplete="PF('ocorrenciaDlg').show()" process="@this" update="ocorrencia_details" rendered="#{protocoloBean.selectedEntity.status eq 'PENDENTE'}"></p:menuitem>
<p:menuitem value="Reabrir protocolo" icon="icon-unlock-alt icon-large" rendered="#{protocoloBean.selectedEntity.status eq 'CONCLUIDO'}"
actionListener="#{protocoloBean.openProtocol()}" update="protocoloTable" process="@this"></p:menuitem>
Run Code Online (Sandbox Code Playgroud)
PF4
我知道这个问题已经过时了,但我只是好奇你是否直接从代码中使用 UIMenuItem ?
如果是这样,您是否尝试过使用MenuModel - MenuItem(DefaultMenuModel/DynamicMenuModel - DefaultMenuItem) 来代替?
此外,您还应该考虑为contextMenu 中使用的每个项目使用 id
| 归档时间: |
|
| 查看次数: |
2244 次 |
| 最近记录: |