5 Replies Latest reply on Jan 29, 2008 5:18 AM by panky_p

    s:selectItem problem while persisting

    panky_p Novice

      Hi I am trying to save to database the value selected from list but it is saving it as object of selectItem
      my xhtml code is

      <h:selectOneMenu id="carList" value="#{carBean.carCategory}">
      <s:selectItems var="carCategory" value="#{carDetail.carCategoryList}"
      label="#{carCategory.label}" noSelectionLabel="Select Car Category..."/>
      </h:selectOneMenu>

      and my list is
      public List<SelectItem> carCategoryList()
      {
       get values for car list from database such as Audi, BMW etc
      }
      

      it works fine till populating list and retriving data from database as well but in database i want to store it as string "Audi" instead it saves it as object string
      javax.faces.model.SelectItem@15817ba

      can any one help me how can i store it as an actual string??

      Thanks
      Panky