Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ValueChangeListener for double values  RSS feed

Mathandisto Mathandistos
Posts: 1
Eclipse IDE Java Windows Vista
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am hoping someone will be able to assist, I am new to jsf and i'm having difficulties with valuechangelistener.

For some odd reason, it's not rendering the total field with the new value. Did I perhaps miss something?

Your assistance will be much appreciated.

in my feesCalculationEdit.xhtml I have

h:form id="feesCalculation">
<s:decorate id="squareMetersField" template="/layout/edit.xhtml">
<ui:define name="label">Square meters</ui:define>
<h:inputText id="squareMeters" value="#{feesCalculationHome.instance.squareMeters}"
<a:support event="onchange" reRender="squareMetersField,totalField" bypassUpdates="true" ajaxSingle="true"/>

<s:decorate id="totalField" template="/layout/edit.xhtml">
<ui:define name="label">Total</ui:define>
R<h:inputText id="total" value="#{}">
<a:support event="onblur" reRender="totalField" bypassUpdates="true" ajaxSingle="true"/>

and in my feesCalculationHome bean I have

Map<Double, UIComponent> UIComponent;
public void updateFeeValuesChanged(ValueChangeEvent event) {
System.out.println("A value has changed!");
Double oldSquareMeters = ((double) event.getOldValue()).doubleValue();
Double squareMeters = ((double) event.getNewValue()).doubleValue();
System.out.println("OLD squareMeters = " + oldSquareMeters);
System.out.println("squareMeters = " + squareMeters );
javax.faces.component.UIComponent total = event.getComponent().findComponent(":feesCalculation:totalField:total");

Thank you in advance
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!