Hi

I need to write a simple page with 2 selectOneChoice components, the second 
being dependent on the first. This means that the second should be disabled as 
long as a correct value in the first one has not been selected. Also, the items 
in the second need to be dynamically loaded depending on the content on the 
first one. 

I guess this should be easily feasible in Trinidad, but obviously, I must be 
missing something because I can't get it to work. it seems that the value of 
the second component never gets properly populated in the bean entry. Also, 
strangely, in the 'valuechangelistener', the oldvalue is always null, even when 
a proper value was correctly selected.

Also, is it possible to avoid the presence of a 'empty' selectItem by 
auto-selecting the first valid entry (how can I do that)?

Thanks a lot for your help

Jean-Noel Colin




                                <tr:selectOneChoice id="project" label="project"
                                        binding="#{entryBean.projectSelector}"
                                        
value="#{entryBean.currentLine.projectId}" showRequired="true"
                                        autoSubmit="true" 
unselectedLabel="Select" immediate="true"
                                        
valueChangeListener="#{entryBean.projectChangeListener}">
                                        <f:selectItems 
value="#{globalData.activeprojects}" />
                                </tr:selectOneChoice>
                                <tr:selectOneChoice id="subproject" 
label="sub-project"
                                        partialTriggers="project" 
binding="#{entryBean.subProjectSelector}"
                                        
value="#{entryBean.currentLine.subProjectId}" showRequired="true"
                                        unselectedLabel="Select" 
disabled="#{empty entryBean.subProjects}">
                                        <f:selectItems 
value="#{entryBean.subProjects}" />
                                </tr:selectOneChoice>

Reply via email to