0

I want to make a selectonemenu form that display data from 1 table ahmdsmun_msttypeclr that consist of 3 columns: - VTYPECODE (PK) (string) - VCLRCODE (string) - VCLRDESC (string)

I want to make VCLRDESC in my selectonemenu form.

I have read this link How to populate options of h:selectOneMenu from database? that answered by BalusC so detail. But I am confused which one I should use for my problem because I don't get the use of converter and the differences to implement between string and Object

Thank you in advance

Community
  • 1
  • 1

1 Answers1

0

I guess you want a selectonemenu that displays VCLRDESC and returns VTYPECODE when your user choose an option. So I think you just should follow the "Complex objects as available items" section from the link you mentioned:

<h:selectOneMenu value="#{bean.entities}">
  <f:selectItems value="#{bean.neededValue}" var="entity" itemValue="#{entity.VTYPECODE}" itemLabel="#{entity.VCLRDESC}" />
</h:selectOneMenu>
Hieu Tran
  • 150
  • 6
  • thank you for your answer. may you you tell me what "entities" mean? and the differences between itemValue and itemLabel? and my problem, I need to display VCLRDESC and save the selected VCLRDESC to another table in database. – Veni Manurung Jul 16 '15 at 00:23