Picklist issue

UI Components for JSF
Post Reply
ozbluesky
Posts: 20
Joined: 30 Oct 2010, 06:39

26 Dec 2010, 04:00

Hi,

I have a screen using <p:layout>. In left layout unit, there is a navigation tree. On initial load of the screen, there is nothing on the right side. When a tree node is clicked, the right side shows content with p:picklist .
Main screen code:

Code: Select all

         <ui:define name="leftnav" id="leftnav">
            <ui:include src="/main/section/menu.xhtml"/>
         </ui:define>
         <ui:define name="content">
            <ui:include src="#{treeBean.centerSrc}" />
         </ui:define>
<ui:include> source is defined by treeBean.centerSrc, and is updated on tree node select.
Navigation tree code:

Code: Select all

         <h:form>
            <p:tree value="#{treeBean.root}" var="node"
                    selectionMode="single" selection="#{treeBean.selectedNode}" nodeSelectListener="#{treeBean.onNodeSelect}"
                    update="@none"
                    onselectComplete="updateCenter()">
               <p:treeNode>
                  <h:outputText value="#{node.nodeName}"/>
               </p:treeNode>
            </p:tree>
            <p:remoteCommand name="updateCenter"  update="contentUnit"/>
          </h:form>
Now the issues is that the picklist in included content doesn't show & act properly unless I reload the page. I noticed that following code is not included in initial load:

Code: Select all

<link type="text/css" rel="stylesheet" href="/myapp/faces/javax.faces.resource/picklist/picklist.css?ln=primefaces&v=2.2.RC2" />
<script type="text/javascript" src="/myapp/faces/javax.faces.resource/picklist/picklist.js?ln=primefaces&v=2.2.RC2"></script>
My workaround is that in initial included content, add a dummy hidden picklist (<p:pickList rendered ="false" />) , then subsequent include screen will work fine.
But this way doesn't look good for me. when other component is required in subsequent pages, I have to add more and more dummy components into initial page.
Is there any better way to get the picklist work properly?


Thanks
PrimeFaces 2.2.1/3.0M1, JSF2.0, Netbean 6.9.1 GlassFishes 3

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 49 guests