Getting warning “getClientId should not be called while the view is being constructed.”

StackOverflow https://stackoverflow.com/questions/8328522

  •  26-10-2019
  •  | 
  •  

سؤال

In my JSF application I have one JSP page which keeps generating a warning which sometimes gets rendered. In the log files I can see something like this:

WARNING: getClientId should not be called while the view is being constructed. 
         Component-ID: j_id18

The component which generates the warning looks like this:

<tr:panelCaptionGroup captionText="Jobs">
<tr:poll pollListener="#{jobBean.update}" id="poll" interval="#{msg.cfg_pollingInterval}" />
<tr:table allDetailsEnabled="true" partialTriggers="::poll ::groupFilter">
  <f:facet name="detailStamp" >
    <tr:table var="trg" value="#{subbean}" >
       ...stuff...
</tr:table>
  </f:facet>
  <tr:column>
    <h:panelGroup>
  <tr:commandLink  />
    </h:panelGroup>
  </tr:column>
  <tr:column />
</tr:table>

Could it be an issue with polling in the table?

I'm using Trinidad 2.0.0. I've tried the option org.apache.myfaces.trinidad.CLIENT_ID_CACHING in web.xml and I observe the behavior with all options ON, OFF and DEBUG.

هل كانت مفيدة؟

المحلول

As it seems, there was a NPE occurring somewhere while creating a dropdown in the screen. The code has been fixed, and the warning doesn't appear any more.

نصائح أخرى

My solution was to refresh any parent programatically in a backing bean prior to ending up in this state.

Note, it looks like this message was added to java/org/apache/myfaces/trinidad/component/UIXComponentBase.java in May 2010 at revision 942933 to prevent and NPE when clientId is null.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top