2 Replies Latest reply on Aug 5, 2008 8:59 AM by Ilya Shaikovsky

    How to get selected value from <rich:suggestionbox>

    Pagera Newbie

      hello
      my problem is How to get selected value from <rich:suggestionbox>
      that my cod

      jsp page

       <h:outputText value="#{res.t_payment_teacher_}" />
       <h:inputText id="teacherSuggest"/>
       <rich:suggestionbox for="teacherSuggest" width="100" height="200"
       suggestionAction="#{myBean.beanAutocomplet}" var="teacher"
       fetchValue="#{teacher.firstLastName}" value="#{myBean.current}"
       usingSuggestObjects="true" >
       <rich:column>
       <h:outputText value="#{teacher.firstName}"/>
       </rich:column>
       <rich:column>
       <h:outputText value="#{teacher.fatherName}"/>
       </rich:column>
       <h:column>
       <h:outputText value="#{teacher.lastName}"/>
       </h:column>
       </rich:suggestionbox>
      


      mybean

      public class TeacherPaymentBean extends MainViewBean {
      
      
       private List<Teacher> teacherz = new Vector();
       private String teacherName = "";
       private Teacher current;
      
       public TeacherPaymentBean() {
      
      
       }
      
       public List<Teacher> beanAutocomplet(Object obj){
      
       //do some search
      
       return teacherz;
       }
      
       public Teacher getCurrent() {
       return current;
       }
      
       public void setCurrent(Teacher current) {
       this.current = current;
       }
      
       public List<Teacher> getTeacherz() {
       return teacherz;
       }
      
       public void setTeacherz(List<Teacher> teacherz) {
       this.teacherz = teacherz;
       }
      
      
      }
      


      when im tryin to get the value of
      Teacher current ... it gave null..

      so do u have any suggestion????

      and is this attribute usingSuggestObjects="true"
      mean that i can got the selected value as object??

      that what i understood from rf document

      and thankx for help