'Can not update component without a attached renderer. Component class: "class org.primefaces.component.menuitem.UIMenuItem"

I have an warning on my page that is:

Can not update component without a attached renderer. Component class: "class org.primefaces.component.menuitem.UIMenuItem"

It's working perfect but i still getting this warning message. What i have are a table that should show a context menu to the user based on what is the row selected, rendering some menu itens or not.

This is my table:

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

This is the menu:

<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>

PF4



Solution 1:[1]

I know this question is so outdated, but i'm just curious if you use UIMenuItem directly from code?

  • If so, have you tried to use MenuModel - MenuItem (DefaultMenuModel/DynamicMenuModel - DefaultMenuItem) instead?

  • Also you should consider using ids for each item you use in your contextMenu

Solution 2:[2]

I had the same error message on :

<div id="toggle-panel">
     <p:commandLink action="#{controller.toggle()}" process="@this" update="@parent">

And the update wasn't working. I had to change <div> to <p:outputPanel id ="...">. Primefaces might have some difficulties referencing a tag that isn't from Primefaces, so you should try to add a p:outputPanel (with an id) around your menu.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Levente Takács
Solution 2 Asoub