cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Hoskens ...@schaubroeck.be>
Subject Forms, writing extra info
Date Wed, 03 Nov 2004 09:31:16 GMT
Hi,

I have several cforms that connect to xml documents. These may contain 
default values. If a user changes a value, an attribute changed will be 
set on that value-element and on the document-element. To accomplish 
this, I have to set javascript bindings for each value looking like:

<fb:javascript id="myvalue" path="myvalue">
    <fb:load-form>
        widget.setValue(jxpathPointer.getValue());
    </fb:load-form>
    <fb:save-form>
        var formValue = widget.getValue() == null ? new 
java.lang.String(""): new java.lang.String(widget.getValue());
        if ( !jxpathPointer.getValue().equals(formValue)){
            jxpathPointer.setValue(formValue);               
            jxpathContext.createPathAndSetValue("@changed", "true");
            
jxpathContext.createPathAndSetValue("/document_root/@changed", "true");
        }
    </fb:save-form>
</fb:javascript>

Is there a better way to do the same?

Kind Regards,
Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message