1 Reply Latest reply on Jan 18, 2012 11:49 AM by davidmiller

    rich:picklist only shows selected items on error

    davidmiller

      I wonder if you can help me?


      I have a rich:picklist that won't render the right hand side on load, and will only render the values if it fails validation and I add a Facesmessage and fail validation('Validation.instance().fail();')


      The jsf code is as follows:


      <rich:pickList onclick="javascript: documentWarningChecker();"
          id="documentshuttle" listsHeight="200" sourceListWidth="400"
          fastMoveControlsVisible="false" targetListWidth="400"
          value="#{newsEntryAction.news.downloads}">
          <s:selectItems value="#{newsEntryAction.liveDownloads}"
          var="doc" label="#{doc.displayName} - #{doc.fileSize}" />
          <s:convertEntity />
      </rich:pickList>



      Both the selectItems and the value are using the same entity type, that overrides hashcode and equals.
      The newsEntryAction is a stateful bean:



      @Stateful
      @Name("newsEntryAction")
      @Restrict("#{identity.loggedIn}")
      @Scope(ScopeType.CONVERSATION)
      public class NewsEntryAction implements NewsEntryI {...}



      What can the problem be?


      thanks in advance,


      Dave


        • 1. Re: rich:picklist only shows selected items on error
          davidmiller

          Managed to fix the problem....


          The #{newsEntryAction.liveDownloads} was being populated via the action method on page load, via a EntityHome subclass. 
          I changed this so it would populate my 'livedocument' via a dao:
          liveDownloads = downloadService.getLiveDocuments(cmsCompany);


          Thus removing a layer.  Problem fixed...


          Remember to override equals()!