Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Retrieve an object in a selectItem

    Hi,

    I use a SelectItem who contains a list of Object. For instance, it contains a list of Technology which are instance of a basic Java Class who implements Serializable.
    My SelectItem doesn't interact with the server. It used only on client side.

    The problem I have is to retrieve the technology selected in the selectItem when I submit the form. Using a LinkedHashMap<Technology, String> and set the selectItem with this LinkedHashMap doesn't work. I have te following Exception :

    Code:
    [ERROR] Uncaught exception escaped
    java.lang.ClassCastException: fr.sii.nantes.b2m.client.transverse.ov.Technology
    	at com.smartgwt.client.util.JSOHelper.convertMapToJavascriptObject(JSOHelper.java:645)
    Is there a working solution to retrieve a selected object in a selectItem ?

    Thanks

    #2
    A valueMap must be a Map<String, String>. To provide a set of records and be able to retrieve the selected record, make a clientOnly DataSource and provide it as the optionDataSource on the SelectItem, and use getSelectedRecord() to get the selected record.

    Comment

    Working...
    X