0

I am trying to load dynamic xhtmls inside a datagrid. but somehow it displays correct data in p:outputlabel and got a null inside ui:include.

here is my code snippet

<p:dataGrid var="myBoard" value="#{dashBoard.widgetList}" columns="2"
                rows="2" paginator="true" id="widgetsGrid"
                paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}" 
                rendered="#{dashBoard.boardSize gt 0}">

        **// ***** Here is populate correct data ********
        <p:outputLabel value="#{myBoard.endpointUrl}" />  

        <p:panel id="one_#{myBoard.id}">
            <p:lightBox iframe="true" id="lighbox_one_#{myBoard.id}" height="550px" width="1024px" >
                <h:outputLink value="display" title="#{myBoard.name}">
                    <ui:insert name="widgetone">

                        **// ******* how come this would be null? *********

                        <ui:include src="#{myBoard.endpointUrl}"> 
                        </ui:include>

                    </ui:insert>
                    <f:param name="id" value="#{myBoard.id}" />
                </h:outputLink>
            </p:lightBox>
        </p:panel>      

    </p:dataGrid>

I did tried different ways to put it in c:if but couldn't resolve the same. is this sequence supported by primefaces or any suggestions to implement the same?

Thanks in Advance...

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Chirag Loliyana
  • 17
  • 1
  • 3
  • 8

1 Answers1

0

That's because "#{myBoard.endpointUrl}" is null during the "Restore View Phase".

For more details about JSF Lifecycle : http://docs.oracle.com/javaee/1.4/tutorial/doc/JSFIntro10.html

S19
  • 71
  • 1
  • 5
  • Thanks for the reply... so is there any workaround to achieve the same in p:dataGrid ? or i should use some other component ? – Chirag Loliyana Sep 11 '14 at 13:11
  • Check this : http://stackoverflow.com/questions/13990965/jsf-uiinclude-not-being-rendered-properly – S19 Sep 11 '14 at 13:13