First - thank you fort he detailed answer!

=> 
=> Just something to consider: "binding is not a must" :-)
=> 
=> The binding framework is intended as a help over extensive (and
=> duplicate: load/save) form-api calls in the majority (80-20 rule) of
=> cases where the flow and form deal with the back-end model in a very
=> symmetrical way.
=> 
=> Meaning most people will only use one binding per form, and load/save
=> back to the same model instance. (and truly collect the bonus of using
=> the binding)
=> 
=> The system is flexible enough to be used outside those typical use cases
=> for sure (and do some pretty hefty things by leaving the paved road)...
=> 
=> Just know that there is an alternative: in stead of bending your mind
=> over until you succeed expressing your problem in terms of fb:* elements
=> you can consider just getting into the form's API and structure right
=> away and get out the data you need:
=> 
=> (oh blast, I was going to insert:
=> http://cocoon.apache.org/2.1/userdocs/forms/api_java.html or its
=> javascript equivalent :-))
=> 
=> anyways form.lookupWidget(path-like-pointer-into-the-widget-tree) should
=> be your help together with widget.get/setValue()
=> 
=> 
=> Note: I didn't say you should abandon binding in your or any non-trivial
=> case, far from it.  I just know that there is no way you can consider
=> the alternative if you don't know about it :-)

You're right - not everything has to be handled with CForm binding. But even
the access into the basic rules of CForms is not easy, if you're new to
Cocoon. Okay, I'm using update operations (load/save to the same model
instance) as well and it works (mostly) fine. But for me adding a simple XML
structure to a document should be a standard operation. So I would expect,
to work with that fb:insert-node element in a 'xslt' way. 
What I tried was something like that:

<?xml version="1.0" encoding="UTF-8"?>
<fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"; path="/" >
  <fb:context path="." direction="load">
        <fb:value id="orgname" path="orgname" />
        <fb:value id="org" path="org"/>
  </fb:context>
        
  <fb:context path="authentication/users" direction="save">
        <fb:insert-node>
                <user>
                  <orgname><fb:value id="orgname" path="orgname"
/></orgname>
                  <org><fb:value id="org" path="org"/></org>
                  <name><fb:value id="name" path="name"/></name>
                  <password><fb:value id="password"
path="password"/></password>
                  <role><fb:value id="role" path="role"/></role>
                </user> 
        </fb:insert-node>       
  </fb:context>
</fb:context>

The binding to the form worked very well. The binding back to the xml
document, too - except the matter, that none of the 'fb:value' elements has
been dissolved. Okay, perhaps it was a bit to optimistic to expect a
behaviour as a xsl:value-of element, but is there an easy (like xslt) way to
add new elements to an existing xml document? Or must I build that xml
structure with JS everytime (under
http://cocoon.apache.org/2.1/userdocs/forms/api_java.html I can only find
one sentence: 'To be done' :)?

Best regards - Claus  


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to