Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SelectOneMenu inside Datatable

843842Jul 14 2005 — edited Jul 14 2005
I am having trouble with populating a SelectOneMenu inside a DataTable. I access a database to get an ArrayList of vl (datatable var) beans. That works perfectly. The problem comes when I try put a SelectOneMenu in a column because the values of the SelectOneMenu are also got from the database and depend on the values got from the previous database access. Sorry, if the explanation is not clear enough.
<h:dataTable border="0" id="constituyentes" value="#{db_inserta.constituyentes}" var="vl">
	<h:column>
		<f:facet name="header">
			<h:outputText value="Constituyente"/>
		</f:facet>
		<h:outputText value="#{vl.descripcion}"/>
	</h:column>
	<h:column>
		<f:facet name="header">
			<h:outputText value="Resultado"/>
		</f:facet>						
		<h:selectOneMenu id="elige" value="#{vl.resultado}">
                         <f:selectItems value="?????????????" />
                 </h:selectOneMenu>				
	</h:column>
	<h:column>
		<f:facet name="header">
			<h:outputText value="Unidades"/>
		</f:facet>
		<h:outputText value="#{vl.unidades}"/>
	</h:column>
</h:dataTable>
The problem comes with the value of SelectItems. It has to create dynamicly the list of values accessing to a database that depends on the values got from a previous access, the one that gives you the row.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 11 2005
Added on Jul 14 2005
1 comment
185 views