0 Replies Latest reply on Feb 27, 2013 1:20 AM by Noor Jalillah Jeffri

    <h:selectOneMenu> and <rich:select> tag does not work in portlet

    Noor Jalillah Jeffri Newbie

      Hi, good day.

      Currently i'm developing a portlet using jsf 2.1 + richfaces 4.3 in seam 2.3 and using jboss as7.I deployed my portlet in gatein 3.5 Final.

      Now im facing a problem that my jsf code and richfaces doesn't work in portlet.The screen has come but when we select it doesn't show an output.It also doesn't throw any exception.i have tried the code in web application and it works fine.

       

      This is my .xhtml code using <h:selectOneMenu>

       

       

      <h:outputText value=" Select Assay " />

                <h:selectOneMenu id="prop"  value="#{assay.compound_property_id}">

                      <f:ajax execute="prop"  render="output" event="change" />

                   <f:selectItems  value="#{assayAction.getAllAssay()}" var="a"

                                       itemLabel="#{a.assay_name}" itemValue="#{a.compound_property_id}" />

                                 </h:selectOneMenu>

                               

                                  <h:outputText value=" Compound Id " />

                              <h:panelGrid id="output">

                                    <h:outputText  value="#{assay.compound_property_id}"/>

                                     </h:panelGrid>

       

      This is another .xhtml code using <rich:select>

       

      <rich:select id="prop"  value="#{assay.compound_property_id}"  required="true" requiredMessage="Please select a property">

                                                        <f:ajax execute="prop" render="output" event="change"/>

                                                        <f:selectItems id="h1"  value="#{assayAction.getAllAssay()}" var="a"

                                                                     itemLabel="#{a.assay_name}" itemValue="#{a.compound_property_id}" />

                                                                     <h:inputText id="hidden1" value="#{assay.compound_property_id}" />

                                                  </rich:select>

           <rich:message for="prop"/>

        <h:outputText value="Compound id:" />

        <h:outputText id="output" value="#{assay.compound_property_id}" />

       

      This is my method in bean class

       

       

      public List<Assay> getAllAssay() {

       

      CriteriaBuilder qb = em.getCriteriaBuilder();

      CriteriaQuery<Assay> query = qb.createQuery(Assay.class);

      Root<Assay> root = query.from(Assay.class);

      query.select(root);

      List<Assay> list = em.createQuery(query).getResultList();

      return list;

       

       

      }

      getter in the assay table :

       

      @NotNull @Column( name = "compound_property_id" )

                public int getCompound_property_id() {

                          return compound_property_id;

                }

       

      Any suggestion?Thanks in advance.