1

I would like that in the selectItem, instead of giving me a value, it would default to one of those in selectItems where I have 6 values.

Let's say I want the 4 to appear, could it be done?

my code:

<div class="row group">
<h:outputLabel for="critEjec" value="#{msg['cod_ejec']}" styleClass="nombreCampo" />
<h:selectOneMenu id="critEjec" value="#{maestroSubCategoriasBean.critEjec}" styleClass="campo">
    <f:selectItem itemLabel="#{msg['comunes_seleccionarTodos']}" itemValue="-1" />
    <f:selectItems value="#{maestroSubCategoriasController.comboListaEjesCatalogacion}" />
    <a4j:support event="onchange" action="#{maestroSubCategoriasController.llenarComboCategorias}" reRender="CategoriasPanel,mensajesPanel" ajaxSingle="true" />
</h:selectOneMenu>

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Serzulu
  • 11
  • 1
  • if you ignore your problem for now, where does the value you actively select in the ui end up? Tried assigning a value upfront to that same field? – Kukeltje Oct 02 '19 at 12:17
  • The `#{maestroSubCategoriasBean.critEjec}` represents the selected value. – BalusC Oct 02 '19 at 12:40
  • Sorry, im new, now i got this: but i got duplicated one item – Serzulu Oct 02 '19 at 12:49
  • The `` does not represent the selected value. They represent the available values. Instead, the `#{maestroSubCategoriasBean.critEjec}` represents the selected value, as explained in my previous comment. In case you missed it, there's a duplicate link in top of your question. – BalusC Oct 02 '19 at 17:48

0 Answers0