Default selection for within

前端 未结 3 781
Happy的楠姐
Happy的楠姐 2020-12-01 15:53

How to make default selection for within ?

It\'s needed,that particular \"20\" item of dropdown

相关标签:
3条回答
  • 2020-12-01 16:13

    Initialize the recordsPerPage in your backing bean.

    From your source code I assume that you have a bean FileSearchCriteriaOut and your recordsPerPage is a String, then you can do the following in the bean's constructor:

    public FileSearchCriteriaOut() {
       recordsPerPage = "20";
    }
    

    For the facelet refer to Jigar Joshi's answer.

    0 讨论(0)
  • 2020-12-01 16:21
    <h:selectOneMenu id="items" value="#{bean.selectedItem}">
      <f:selectItem itemLabel="10" itemValue="10"/>
      <f:selectItem itemLabel="20" itemValue="20"/>
      <f:selectItem itemLabel="30" itemValue="30"/>
    </h:selectOneMenu>
    

    The default selection would be the one which has value same as selectedItem which you set in bean.

    selectedItem = 20;
    
    0 讨论(0)
  • 2020-12-01 16:24
    <div class="row">
        <div class="form-group col-md-6">
            <label for="sexo"><span class="obligatorio">#{messageSource['etiqueta_requerido']}</span> #{messageSource['etiqueta_estatus']}
            </label>
            <p:selectOneRadio 
                id                  = "status"  
                required            = "true"
                requiredMessage     = "#{messageSource['mensaje_validacion_datoRequerido']}"
                value="#{mbUnidadDeMedida.dtoUnidadDeMedida.estatus}"
            >
                <f:selectItem itemLabel="#{messageSource['etiqueta_activo']}"   itemValue="1" />
                <f:selectItem itemLabel="#{messageSource['etiqueta_inactivo']}" itemValue="0" />
            </p:selectOneRadio>
        </div>
    </div>
    
    0 讨论(0)
提交回复
热议问题