This content has been marked as final.
Show 4 replies
-
1. Re: Problem with InputSpinner
ilya_shaikovsky Jun 22, 2009 6:06 AM (in response to thiagofmam)this simple test case works for me under 3.3.1
<form> <rich:inputNumberSpinner value="50" step="10" binding="#{userBean.spinner}" id="spinner"/> <a4j:commandButton action="#{userBean.change}" value="change" reRender="spinner"/>
and in a request scoped bean:... private UIInputNumberSpinner spinner; public void change(){ spinner.setValue(32); } public UIInputNumberSpinner getSpinner() { return spinner; } public void setSpinner(UIInputNumberSpinner spinner) { this.spinner = spinner; } ...
-
2. Re: Problem with InputSpinner
thiagofmam Jun 22, 2009 1:22 PM (in response to thiagofmam)Thank you for answer,
In my case I need one dynamic number of inputSpinner on panelgrid.
The sintax all ok,
I don't understand why when the value is null all work.
This form is included in the tabpanel with ajax submit.
The code that I use below:private HtmlInputNumberSpinner getInputSpinner(Perfil_atributosT perfil_atributosT){ int idPerfilAtributo = perfil_atributosT.getIdperfilatributo(); FacesContext facesContext = FacesContext.getCurrentInstance(); Application app = facesContext.getApplication(); HtmlInputNumberSpinner spinner = (HtmlInputNumberSpinner) app.createComponent (HtmlInputNumberSpinner.COMPONENT_TYPE); spinner.setId("cmbPerfilSelecao_"+idPerfilAtributo); spinner.setValueExpression("value", app.getExpressionFactory().createValueExpression("#{detalheClienteMB.mapListVariaveis[" + idPerfilAtributo + "]}", String.class)); String valor = getCTDVarPerfilPessoa(perfil_atributosT); mapListVariaveis.put(idPerfilAtributo,valor); try { Perfil_atributo_limiteConsultMB perfil_atributo_limiteConsultMB = new Perfil_atributo_limiteConsultMB(); perfil_atributosT.setIdempresa(idEmpresa); Perfil_atributo_limiteT paLimite = perfil_atributo_limiteConsultMB.consultAction(perfil_atributosT); //spinner.setValueExpression("value", app.getExpressionFactory().createValueExpression("#{detalheClienteMB.mapListVariaveis["+ idPerfilAtributo +"]}", String.class)); spinner.setMaxValue(String.valueOf(paLimite.getVlrmaximo())); spinner.setMinValue(String.valueOf(paLimite.getVlrminimo())); spinner.setStep(String.valueOf(paLimite.getVlrsalto())); if (valor != null) { spinner.setValue(valor); } else { spinner.setValue(null); } } catch (Exception e) { e.printStackTrace(); } return spinner; }
-
3. Re: Problem with InputSpinner
thiagofmam Jun 22, 2009 1:31 PM (in response to thiagofmam)The InputSpinner is show
The problem is when I submit the form, the values not change or the commandbutton not work -
4. Re: Problem with InputSpinner
thiagofmam Jun 22, 2009 3:11 PM (in response to thiagofmam)The problem is resolved.
The commandbutton submit value not worked because some inputSpinner values of minimum was as greater than the maximu value.
Thank you