4 Replies Latest reply on Apr 14, 2008 1:29 PM by ilya_shaikovsky

    rich:inplaceSelect Label for default value

    nofreak

      Hi,
      i use the tag in this way:

      <rich:inplaceSelect defaultLabel="'Herr/Frau'" label="'Herr/Frau'" id="gender" size="1" styleClass="combo" value="#{Member.gender}" >
       <f:selectItem itemLabel="Herr" itemValue="1" />
       <f:selectItem itemLabel="Frau" itemValue="2" />
      </rich:inplaceSelect>


      I want, to show the itemLabel for the selected value instead of the defaultLabel. But if the value equal 1 or 2 only the entry in the dropDown list are correctly default selected, but the label is "Herr/Frau" and not the itemLabel...do anybody know why?


        • 1. Re: rich:inplaceSelect Label for default value
          nofreak

          HI,
          no ideas how i could enable the labeling for the selected itemLabel?

          • 2. Re: rich:inplaceSelect Label for default value
            nofreak

            do nobody know how i could enable the itemLabel?

            • 3. Re: rich:inplaceSelect Label for default value
              ilya_shaikovsky

              Do you able to achieve the same with h:selectOneMenu using this code?

              • 4. Re: rich:inplaceSelect Label for default value
                ilya_shaikovsky

                this

                <rich:inplaceSelect value="#{inplaceComponentsBean.inputValue}"
                 defaultLabel="Click here to edit">
                 <f:selectItem itemValue="0" itemLabel="Option 1" />
                 <f:selectItem itemValue="1" itemLabel="Option 2" />
                 <f:selectItem itemValue="2" itemLabel="Option 3" />
                 <f:selectItem itemValue="3" itemLabel="Option 4" />
                 <f:selectItem itemValue="4" itemLabel="Option 5" />
                 </rich:inplaceSelect>
                


                /**
                 *
                 */
                package org.richfaces.demo.inplaces;
                
                /**
                 * @author Ilya Shaikovsky
                 *
                 */
                public class InplaceComponentsBean {
                
                 private String inputValue;
                
                 public String getInputValue() {
                 System.out.println("InplaceComponentsBean.getInputValue()");
                 return inputValue;
                 }
                
                 public void setInputValue(String inputValue) {
                 this.inputValue = inputValue;
                 }
                
                 public InplaceComponentsBean() {
                 System.out.println("InplaceComponentsBean.InplaceComponentsBean()");
                 inputValue = "3";
                 }
                }
                


                works fine for me. Option 4 active by default.