Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8424797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:06:14+00:00 2026-06-10T04:06:14+00:00

I created a composite component that implements a spinner, i works really fine, but

  • 0

I created a composite component that implements a spinner, i works really fine, but when I changed from primefaces 2.2.1 to primefaces 3.3.1 the component crashes all the page when I try use p:ajax instead of f:ajax.

Here is the component:

<c:interface>
    <c:attribute name="value" required="true"/>
    <c:attribute name="fator" required="false" default="1"/>
    <c:attribute name="required" required="false" default="false"/>
    <c:attribute name="requiredMessage" required="false" default=""/>
    <c:attribute name="validatorMessage" required="false" default="Não é um número válido!"/>
    <c:attribute name="disabled" required="false" default="false"/>
    <c:attribute name="title" required="false" default=""/>
    <c:attribute name="width" required="false" default="100"/>
    <c:attribute name="dinheiro" required="false" default="false"/>
    <c:attribute name="local" required="false" default="pt-BR"/>
    <c:attribute name="imediato" required="false" default="false"/>
    <c:attribute name="onchange" required="false" default=""/>
    <c:attribute name="onkeyup" required="false" default=""/>
    <c:attribute name="max" required="false" default="-1"/>
    <c:attribute name="min" required="false" default="0"/>
    <c:attribute name="parametro" required="false" default=""/>
    <c:attribute name="casasDecimais" required="false" default="2"/>
    <c:attribute name="valueChangeListener" method-signature="void method(javax.faces.event.ValueChangeEvent)"
                 targets="spinner"/>
    <c:attribute name="rendered" required="false" default="true"/>
    <c:editableValueHolder name="#{cc.id}" targets="spinner"/>
    <c:clientBehavior name="blur" default="true" event="blur"
                      targets="spinner"/>
    <c:clientBehavior name="change" default="true" event="change"
                      targets="spinner"/>
</c:interface>

<c:implementation>
    <h:outputStylesheet library="css" name="hrgiSpinner.css" target="head"/>
    <h:outputScript library="js" name="jquery.formatCurrency-1.4.0.min.js" target="head"/>
    <h:outputScript library="js" name="jquery.formatCurrency.pt-BR.js" target="head"/>
    <h:outputScript library="js" name="hrgiSpinner.js" target="head"/>
    <h:panelGroup layout="block" styleClass="hrgi-spinner" rendered="#{cc.attrs.rendered}">
        <p:inputText id="spinner" value="#{cc.attrs.value}"
                     styleClass="hrgi-spinner-input editableField" disabled="#{cc.attrs.disabled}"
                     onchange="formatar(this,'#{cc.attrs.fator}','#{cc.attrs.local}','#{cc.attrs.dinheiro}','#{cc.attrs.max}','#{cc.attrs.min}','#{cc.attrs.casasDecimais}'); #{cc.attrs.onchange}"
                     required="#{cc.attrs.required}" requiredMessage="#{cc.attrs.requiredMessage}"
                     validatorMessage="#{cc.attrs.validatorMessage}" onkeyup="#{cc.attrs.onkeyup}"
                     title="#{cc.attrs.title}" immediate="#{cc.attrs.imediato}" style="width: #{cc.attrs.width}px;"
                     converterMessage="O valor informado não é um número.">
            <f:attribute name="objeto" value="#{cc.attrs.parametro}"/>
        </p:inputText>
        <h:panelGroup layout="block" styleClass="hrgi-spinner-painel-botoes"
                      rendered="#{not cc.attrs.disabled}">
            <div onmousedown="incrementar('#{cc.clientId}'+':spinner','#{cc.attrs.fator}','#{cc.attrs.local}','#{cc.attrs.dinheiro}','#{cc.attrs.max}','#{cc.attrs.min}','#{cc.attrs.casasDecimais}');"
                 class="hrgi-spinner-botao hrgi-spinner-botao-alto clearfix"/>
            <div onmousedown="decrementar('#{cc.clientId}'+':spinner','#{cc.attrs.fator}','#{cc.attrs.local}','#{cc.attrs.dinheiro}','#{cc.attrs.max}','#{cc.attrs.min}','#{cc.attrs.casasDecimais}');"
                 class="hrgi-spinner-botao hrgi-spinner-botao-baixo clearfix"/>
        </h:panelGroup>
        <h:panelGroup layout="block"
                      styleClass="hrgi-spinner-painel-botoes hrgi-spinner-painel-botoes-desabilitados"
                      rendered="#{cc.attrs.disabled}">
            <div class="hrgi-spinner-botao hrgi-spinner-botao-alto clearfix"/>
            <div class="hrgi-spinner-botao hrgi-spinner-botao-baixo clearfix"/>
        </h:panelGroup>
    </h:panelGroup>
</c:implementation>

when I use f:ajax:

 <hrgi:spinner id="aliquotaIpiItem" rendered="#{itemEmbrulhado.carregado}"
     disabled="#{not modeloPopupLancamentoNF.lancamentoDanfe}"
     value="#{controladorTabelaDinamicaItemNF.recuperarIPI(itemEmbrulhado).aliquota}"
     dinheiro="false" fator="0.01" local="pt-BR" min="0.00" width="70"
     parametro="#{itemEmbrulhado}">
     <f:ajax render=":lancamentoNF:abasNF:painelItensNF :alerta" execute="@form"
         event="blur" listener="#{controladorPopupLancamentoNF.validarAliquotasItemEAdicionar}"
         onevent="definirFoco"/>
     <f:convertNumber maxFractionDigits="2" minFractionDigits="2" locale="#{cc.attrs.local}"
         for="aliquotaIpiItem"/>
 </hrgi:spinner>

Normal

when I use p:ajax:

<hrgi:spinner id="aliquotaIpiItem" rendered="#{itemEmbrulhado.carregado}"
    disabled="#{not modeloPopupLancamentoNF.lancamentoDanfe}"
    value="#{controladorTabelaDinamicaItemNF.recuperarIPI(itemEmbrulhado).aliquota}"
    dinheiro="false" fator="0.01" local="pt-BR" min="0.00" width="70"
    parametro="#{itemEmbrulhado}">
    <p:ajax update=":lancamentoNF:abasNF:painelItensNF :alerta" process="@form"
        event="blur" listener="#{controladorPopupLancamentoNF.validarAliquotasItemEAdicionar(itemEmbrulhado)}"
        onsuccess="salvarFoco();" oncomplete="carregarFoco(); exibirPopupAlerta(xhr, status, args);"/>
    <f:convertNumber maxFractionDigits="2" minFractionDigits="2" locale="#{cc.attrs.local}"
        for="aliquotaIpiItem"/>
</hrgi:spinner>

Crashed

Could someone explain me what is happening??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T04:06:15+00:00Added an answer on June 10, 2026 at 4:06 am

    As @maple_shaft said, I was unable to pass p:ajax to composite component. Primefaces has an spinner component, but unfortunately it still isn’t good (doesn’t support internationalization and show extra decimal numbers like 0.06666666669 instead of 0.07) and I don’t have enough time to wait for the correction. Are rares the cases that I need use p:ajax with this component, generally just to get args like validationFailed. So, I’ve solved the problem using an ugly workaround:

    <hrgi:spinner id="aliquotaIpiItem" rendered="#{itemEmbrulhado.carregado}"
         disabled="#{not modeloPopupLancamentoNF.lancamentoDanfe}"
         value="#{controladorTabelaDinamicaItemNF.recuperarIPI(itemEmbrulhado).aliquota}"
         dinheiro="false" fator="0.01" local="pt-BR" min="0.00" width="70"
         onblur="adicionarItemNF();">
         <f:convertNumber maxFractionDigits="2" minFractionDigits="2" locale="#{cc.attrs.local}"
             for="aliquotaIpiItem"/>
    </hrgi:spinner>
    <p:remoteCommand name="adicionarItemNF" update=":lancamentoNF:abasNF:painelItensNF :alerta" process="@form"
        action="#{controladorPopupLancamentoNF.validarAliquotasItemEAdicionar(itemEmbrulhado)}" global="false"
        onsuccess="salvarFoco();" oncomplete="carregarFoco(); exibirPopupAlerta(xhr, status, args);"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a composite component in JSF2. I works great. I would like
I've created a composite component that has a commandLink embedded inside of a ui:repeat.
Created .NET WCF service, tested it - works. Generated schemas from Data and service
Let's say I've created a simple composite component in one of my JSF 2.0
how can I tell a composite component that it should update another cc? I
I created a widget that is a subclass of Composite and has a com.extjs.gxt.ui.client.widget.Viewport
I need to create a custom Component with JSF 2.0 (not composite component), that
I created a JSF composite component to extend h:inputBox <p class=label clear> <label for=#{cc.attrs.id}
I'm using a composite design in my current game which works pretty well. All
I'm trying create a composite component to use across my projects, so, I've created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.