I have a <p:selectOneMenu> where you choose a level; that is populated with a list and when one of these <f:selectItems> are clicked then with <p:ajax> I update my <p:selectManyMenu> with another list, with Entries. I want it to default select the first element in that list of entries and mark it, that is not what happens.
What does happen is that, it takes the old value saved in the attribute submittedValue and uses the value stored in that attribute, this does not exists in current list and therefor, it is not marked.
selectOneMenu
<p:selectOneMenu id="levelSelection" style="width:342px;text-align:left"
       panelStyle="width:180px"
       value="#{cc.attrs.agOptionObj.levelTemp}"
       onchange="onLevelSelectionChange(this), updateChild();"
       panelStyleClass="auto-close-panel"
       converter="lyngsoe.catellae.converter.LongOptionConverter"
       rendered="#{!cc.attrs.agOptionObj.hidePartitionSelection}">
           <f:selectItems
               value="#areaGroupSelection.getLevelsForHierarchy
                      (cc.attrs.agOptionObj,
                      cc.attrs.controller.model.periodSelectionOption,                        
                      cc.attrs.controller.reportName)}"
               var="levelOpt" 
               itemLabel="#{levelOpt.text}" 
               itemValue="#{levelOpt}"/>
           <p:ajax 
               update="levelEntries"
               listener="#{areaGroupSelection.levelChanged
                    (cc.attrs.agOptionObj,
                    cc.attrs.controller.model.periodSelectionOption)}"
               partialSubmit="true"/>
</p:selectOneMenu>
selectManyMenu
<p:selectManyMenu id="levelEntries"
        value="#{cc.attrs.agOptionObj.entriesTemp}"
        style="width:342px;text-align:left;height:150px"
        onchange="onEntriesSelectionChange(this);"
        converter="lyngsoe.catellae.converter.StringOptionConverter"
        rendered="#{!cc.attrs.hidePartitionSelection}"
        required="true"
        requiredMessage="#{msg['areaGroupSelection.areaError']}">
            <f:selectItems
               value="#{areaGroupSelection.getHierarchyNodesAtLevel
                         (cc.attrs.agOptionObj,
                         cc.attrs.controller.model.periodSelectionOption)}"
               var="entryOpt" itemLabel="#{entryOpt.text}" itemValue="#               
                           {entryOpt}"/>
</p:selectManyMenu>
I have read and tried the following links:
- https://stackoverflow.com/a/21789675/3430698
 - https://stackoverflow.com/a/13420257/3430698
 - https://stackoverflow.com/a/17755007/3430698
 - http://www.primefaces.org/showcase/ui/misc/resetInput.xhtml
 - http://blog.primefaces.org/?p=2745
 
I am unsure if, what I am looking for is the use of one of these:
To clarify: I need to be able to choose from my <p:selectOneMenu> and then populate my <p:selectManyMenu> AND have the first element in <p:selectManyMenu>to be default selected.
If any further clarification is needed, please write - I will be monitoring this post like a hawk.