Note that there are some explanatory texts on larger screens.

plurals
  1. POEvent are not called in richfaces
    primarykey
    data
    text
    <p>(ps: sorry about my english)</p> <p>I have a text field in my application and for this textfield I have a a4j:support that should work on onchange event! So I have the same form for Include and Update. The user fill the textfield with a code and in my bean I have a method that search the equivalent combobox if that value exists then set it to my object of my bean, this works fine for include but not for update! I don't know what this could be. I will post the code.</p> <p>My xhtml page</p> <pre><code>&lt;ui:decorate template="../templates/edit.xhtml"&gt; &lt;ui:param name="idComponente" value="codTipoVinculo" /&gt; &lt;ui:define name="label"&gt;Tipo Vínculo: &lt;/ui:define&gt; &lt;h:inputText id="codTipoVinculo" value="#{cadastroPrestadorBean.codTipoVinculo}" size="4" maxlength="1" styleClass="#{validationUtil.invalid('codTipoVinculo', facesContext) ? 'invalido' : ''}" onkeypress="return(soEntraNumero(event,this));" onmouseout="soArrastaNumero(this);" onblur="soArrastaNumero(this);"&gt; &lt;a4j:support event="onchange" action="#{cadastroPrestadorBean.findByKey(cadastroPrestadorBean.prestador.tipoVinculo)}" ajaxSingle="true" immediate="true" focus="codTipoPgtoMatmed" reRender="nomeTipoVinculo, codTipoVinculo, outputMessagesInForm"&gt; &lt;a4j:actionparam noEscape="true" value="(document.getElementById('formPrestador:codTipoVinculo').value == '' ? '-11111' : document.getElementById('formPrestador:codTipoVinculo').value)" assignTo="#{cadastroPrestadorBean.codTipoVinculo}" /&gt; &lt;/a4j:support&gt; &lt;/h:inputText&gt; &lt;rich:comboBox enableManualInput="false" defaultLabel="Selecione uma opção" id="nomeTipoVinculo" value="#{cadastroPrestadorBean.prestador.tipoVinculo}" converter="simpleIndexConverterTipoVinculo"&gt; &lt;f:selectItems value="#{cadastroPrestadorBean.listaTipoVinculo }" /&gt; &lt;a4j:support event="onchange" reRender="codTipoVinculo, outputMessagesInForm" ajaxSingle="true" limitToList="true" action="#{cadastroPrestadorBean.findByKey(cadastroPrestadorBean.prestador.tipoVinculo)}" /&gt; &lt;/rich:comboBox&gt; &lt;/ui:decorate&gt; </code></pre> <p>My bean method</p> <pre><code>if (object instanceof TipoVinculo) { if ( codTipoVinculo == null || codTipoVinculo == -11111) { prestador.setTipoVinculo(new TipoVinculo()); return; } for (SelectItem element : listItemsTipoVinculo) { if ( ( ((TipoVinculo)element.getValue()).getCodTipoVinculo().intValue() ) == codTipoVinculo ){ prestador.setTipoVinculo((TipoVinculo)BeanUtils.cloneBean(element.getValue())); achou = true; } } if ( !achou ){ prestador.setTipoVinculo(new TipoVinculo()); addMessageInfo("Tipo Vínculo inválido."); } achou = false; } </code></pre> <p>This is the method that populate the listItemsTipoVinculo </p> <pre><code> public List&lt;SelectItem&gt; getListaTipoVinculo() { try { if ( listItemsTipoVinculo.size() == 0 ){ List&lt;TipoVinculo&gt; list = tipoVinculoBusiness.listaTiposVinculos(); for (TipoVinculo item : list) { listItemsTipoVinculo.add(new SelectItem(item)); } } } catch (CommonBusinessException e) { addMessageError(e); } return listItemsTipoVinculo; } </code></pre> <p>The combobox is previously populated in the listItemsTipoVinculo so when the page start I have it populated. When the user put the code in the textfield it should call the findbykey method but they don't ! just in my update screen when my object 'prestador' is populated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload