Message Boards
What can be the cause for an unset clientid?
What can be the cause for an unset clientid?
Junior Member Posts: 53 Join Date: 12/2/11 Recent PostsHello,
I'm currently debugging regarding a Logmessage "ERROR [ExceptionHandlerBridgeImpl:81] null" in a JSF portlet.
The cause may be that the clientId is unset for a primefaces column.
The functionality I've implemented is default filtering for a primefaces datatable.
According to my debugging primefaces sees the columns (column id's are correct), but "clientid" is unset in the colums.
I'm asking here because I'm unsure where to look for further details.
The component hierachy is view -> form -> composite -> primefaces panel -> primefaces datatable -> column...
My versions are DXP 7.1 (FP dxp-19-7110, hotfix hotfix-4981-7110) with portlet dependencies
com.liferay.faces.alloy-3.0.3.jar
com.liferay.faces.bridge.api-4.1.0.jar
com.liferay.faces.bridge.ext-5.0.5.jar
com.liferay.faces.bridge.impl-4.1.4.jar
com.liferay.faces.portal-3.0.5.jar com.liferay.faces.util-3.3.0.jar
com.liferay.
portal.configuration.metatype.api-1.2.1.jar
com.liferay.portal.configuration.metatype.definitions.annotations-3.0.10.jar
com.liferay.portal.configuration.metatype.definitions.equinox-3.0.4.jar
javax.faces-2.2.20.jar javax.faces-api-
2.2.jar
javax.inject-1.jar primefaces-7.0.14.jar
Best regards,
Gunnar
edit: corrected "default filtering" instead of
"default sorting"
edit: corrected "7.1"
instead of "7.2"
RE: What can be the cause for an unset clientid?
Junior Member Posts: 53 Join Date: 12/2/11 Recent PostsFurther investigations:
- still no clientIds when I'm working without the composite (hierarchiy view -> form -> primefaces datatable -> column...)
- here an NPE is thrown instead of "ERROR [ExceptionHandlerBridgeImpl:81] null" (see below)
- the NPE is only thrown when I use "filterBy" for the datatable itself to apply default filtering
- because this leads to primefaces trying to identify the column from the given FilterState by it's clientId which is unset
- when I'm binding the dataTable and log the column clientIds in some Getter I can see column clientIds are correctly set before the NPE occurs
- so the first problem are unset clientIds via executeRender / renderView / encodeChildren / encodeEnd
- and the second problem is Primefaces 7 not testing for a null clientId
- still unsure whether the first problem is a bug in Liferay Faces or Primefaces or normal behaviour
java.lang.NullPointerException
at org.primefaces.component.datatable.DataTableRenderer.preRender(DataTableRenderer.java:117)
at org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:85)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:920)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
at javax.faces.render.RendererWrapper.encodeChildren(RendererWrapper.java:95)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:890)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
at javax.faces.view.ViewDeclarationLanguageWrapper.renderView(ViewDeclarationLanguageWrapper.java:146)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:134)
at com.liferay.faces.bridge.application.internal.ViewHandlerCompatImpl.renderView(ViewHandlerCompatImpl.java:93)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at com.liferay.faces.bridge.internal.BridgePhaseHeaderRenderCommon.executeRender(BridgePhaseHeaderRenderCommon.java:253)
at com.liferay.faces.bridge.internal.BridgePhaseRenderCompatImpl.execute(BridgePhaseRenderCompatImpl.java:57)
at com.liferay.faces.bridge.internal.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:57)
RE: What can be the cause for an unset clientid?
Junior Member Posts: 53 Join Date: 12/2/11 Recent PostsI've applied a "client side workaround", but maybe this topic is still an unsolved problem and no normal behaviour.
My "client side workaround" is (instead of "filterBy" for "datatable")
...
</p:dataTable>
</p:panel>
<h:outputText value="#{miController.defaultFilterWorkaround}"/>
along with
public String getDefaultFilterWorkaround()
{
PrimeFaces.current().executeScript("PF('" + CONTRACTS_TABLE_WIDGET_VAR + "').filter()");
return "";
}