1 Reply Latest reply: Sep 10, 2008 6:56 AM by Ilya Shaikovsky RSS

    SelectOneMenu Item It dispaly Comment using richfaces

    gopi b Newbie

      I am new to richfaces, I created one drop down box using selectOneMenu, creating upto drop down box is ok but the problem is , If i select any item from the drop down box at the same time i should display display one comment and one input text box, for others. please find the code below, thank u.

      <h:panelGrid columns="4" width="900" columnClasses="formColumn1,formColumn2">
      <h:outputText styleClass="formFont" value="Academic Qualification"></h:outputText>

      <h:selectOneMenu styleClass="formColumnInputText" required="true" value="#{uiRenderer.title}" >
      <f:selectItem itemValue=" " itemLabel=" "/>
      <f:selectItem itemValue="Secondary Level" itemLabel="Secondary Level"/>
      <f:selectItem itemValue="Degree Level" itemLabel="Degree Level"/>
      <f:selectItem itemValue="Post Graduate" itemLabel="Post Graduate"/>
      <f:selectItem itemValue="Others" itemLabel="Others" />
      <a4j:support event="onchange" action="#{uiRenderer.updateView()}" reRender="ot1"/>

      <a4j:outputPanel id="ot1" rendered="#{uiRendered.visible}" >
      <h:outputText value="If Others(Please specify here)"/>
      <h:inputText value=" " ></h:inputText>

      .class file:
      package com.manam.mortgage.session;

      import org.jboss.seam.annotations.Name;

      public class UIRenderUtil {

      private String listValue;
      private boolean visible;
      private String title;

      public String getTitle() {
      return title;
      public void setTitle(String title) {
      this.title = title;

      public void updateView(){
      System.out.println("Visible Value" +visible);
      System.out.println("Method Called. 34...... ");
      public boolean isVisible() {
      return visible;

      public void setVisible(boolean visible) {
      System.out.println("Method Visible Called");
      this.visible = visible;
      System.out.println("Visible Value" +visible);

      public String getListValue() {
      return listValue;

      public void setListValue(String listValue) {
      this.listValue = listValue;