David Verdin wrote:
Hi everybody,
I spent a lot of time parsing the cocoon documentation, samples and wiki, but there are still a lot of question I wonder about cocoon and Cforms. I think that as long as these questions stay unanswered, I won't be able to use Cocoon properly. So here is my list :
1- In "action" widgets, what is exactly the "action-command" attribute ? the documentation states that it is "a name that will be part of the event generated by this widget". And that's all. Is it a reference to a script ? In this case, which script, in which language am I supposed to write it ?
That attribute is here mostly for historical reasons and isn't of much use except for <repeater-action> and <row-action> where it indicates the action to be taken on a repeater. For the general <action> and <submit>, it will soon be made optional.
2- More generally, how can I make a script happen on some events on widgets ? For example, in a simple HTML form, I use the "onClick" attribute of a button to make a javascript to happen. I don't get how to do the same with Cforms widgets.
It's done automatically on <submit> and <action>, and you can specify it on any other widget using a special attribute on the styling, e.g.
<ft:widget id="foo"> <fi:styling submit-on-change="true"/> </ft:widget>
This has the effect of doing a roundtrip on the server to trigger server-side event listerners.
3- Is everything in the cocoon framework compatible ? Is it possible to make the binding framework work alongside JXtemplategenrator ? If I use repeaters, what happens to the binding file when I add a row ?
Of course, everything is compatible! The binding framework provides some special elements to bind repeaters, i.e. <fb:repeater> and <fb:simple-repeater>. Binding a repeater is however not always a piece of cake, because can have to bind modifications instead of clearing the target data and recreating it from scracth.
4- Where can I find the list of cocoon javascript functions and objects ? Is it the API ? If so, is there something else, because most of the time, the API is poorly documented ?
The FOM (Flow Object Model) is documented at [1]. The JS api for CForms is to be written (see [2]) but is rather straightforward, and you should learn it quickly by looking at the CForms samples.
I would love to work with cocoon. actually I'm trying to since two monthes. But I begin to be quite desparated, as most of the thing I achieved are just copies of samples. I just don't find the informations which would help me to understand. Maybe it's the vocabulary, maybe I miss some important knowledge to be able to understand, but I am very frustrated for the moment, because I feel that Cocoon has a very big potential, but it seems impossible for me to make it work properly.
<shameless-plug>
Just while you were posting this question, I was giving a flowscript and CForms training. And I also gave several training sessions in Rennes a while ago (some of them are now regular contributors to this list!)
Interested? Drop me a mail :-) </shameless-plug>
Sylvain
[1] http://cocoon.apache.org/2.1/userdocs/flow/api.html [2] http://cocoon.apache.org/2.1/userdocs/forms/api_javascript.html
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
