I modify the code in the binding file like that:
 
...
<fb:_javascript_ id="nazione" path=".">
<fb:load-form>
</fb:load-form>
<fb:save-form>
   var pointer = jxpathContext.getPointer('nazione');
   var formValue = widget.getValue();
   var appValue = doCountryConversion(formValue);
   pointer.setValue(appValue);
</fb:save-form>
</fb:_javascript_>
...
 
& now it work :-D
 
Cheers
Roberto
 
----- Original Message -----
Sent: Tuesday, June 14, 2005 9:01 AM
Subject: Binding problem...

Hi guys,
still here with some problem of binding. Let me explain the situation.
First of all a snipped of how the file are made:
 
-- Binding file --
...
<fb:value id="indirizzo1" path="indirizzo"/>
<fb:value id="cap" path="cap"/>
<fb:_javascript_ id="nazione" path=".">
<fb:load-form/>
<fb:save-form>
    var formValue = widget.getValue();
    var appValue = doCountryConversion(formValue);
    jxpathPointer.setValue(appValue);
</fb:save-form>
</fb:_javascript_>
...
-- File definition --
...
<!-- Nazione -->
<fd:field id="nazione">
  <fd:label>Nazione:</fd:label>
  <fd:datatype base="string"/>
  <fd:selection-list src="cocoon:/nazioni.list"/>
</fd:field>
...
 
-- Java Bean --
 
public class ContactBean {
 
 
  private Country nazione;
   
  public Country getNazione(){
    return this.nazione;
  }
 
 
  public void setNazione(Country _nazione){
      this.nazione = _nazione;
  }
 
}
 
The problem is when the binding is doing this "jxpathPointer.setValue(appValue);" I got this error:
 

An Error Occurred

uncaught _javascript_ exception: at contatti (file:/D:/Programmi/Apache Group/cocoon-2.1.5.1/build/webapp/mf/flow/contatti.js, Line 41) at (resource://org/apache/cocoon/forms/flow/_javascript_/Form.js, Line 171): org.apache.avalon.framework.CascadingRuntimeException: Error invoking _javascript_ event handler

org.apache.avalon.framework.CascadingRuntimeException: uncaught _javascript_ exception: at contatti (file:/D:/Programmi/Apache Group/cocoon-2.1.5.1/build/webapp/mf/flow/contatti.js, Line 41) at (resource://org/apache/cocoon/forms/flow/_javascript_/Form.js, Line 171): org.apache.avalon.framework.CascadingRuntimeException: Error invoking _javascript_ event handler

cause: org.mozilla._javascript_._javascript_Exception: at top-level script (file:/D:/Programmi/Apache Group/cocoon-2.1.5.1/build/webapp/mf/binding/contatti/contatti.xml, Line 14): java.lang.NullPointerException

The contatti.xml, Line 14 correspond to "jxpathPointer.setValue(appValue);" but appValue is not null there is a value!!
 
Any suggestion is welcome.
 
Thanx in advance
Roberto
 
 

Reply via email to