You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jens Maukisch <co...@maukisch.net> on 2005/05/02 23:15:28 UTC

Re[6]: Object list form ?

Hi Sebastien,

> But the problem with this is how do I get data back from "users-list"
> form page ? How to get POST parameters ?
> And over all, which solution is more elegant : CForm (if possible) or
> ordinary HTML form ?
> WDYT ?

We've used CForms for this.

function displayUsers(){
  var users = usersService.findAllUsers();
  var form = new Form("model.xml");
  form.createBinding("binding.xml");
  form.load(users);
  form.showForm("displayUsersForm");
  // get the repeater widget from the form an look which
  // users are selected and get the corresponding bean
  // from the users collection and do whatever you want to do :-)
  // maybe dependend on form.submitId
}

In the form-model you can use a fd:booleanfield for the selection
and fd:output-fields to display the username inside the
repeater-widget.

hth

-- 
* best regards
* Jens Maukisch              


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


Re: Re[6]: Object list form ?

Posted by Sebastien Arbogast <se...@gmail.com>.
Ok this is what I've tried so far. You will find the three form files
attached. And the flowscript function is the following :

function displayUsersList(){
    getUsers();
    
    var usersList = users.getAllUsers();
    
    var form = new Form("users_d.xml");
    form.createBinding("users_b.xml");
    form.load(usersList);
    form.showForm("displayUsersForm");
}

And here is the concerned pipeline :

<map:pipeline internal-only="true">
            <map:act type="locale">
                
                <map:match pattern="internal/*">
                    <map:generate src="pages/{1}.xml"/>
                    <map:call resource="apply-theme">
                        <map:parameter name="includemenu" value="true"/>
                    </map:call>
                </map:match>
            </map:act>
        </map:pipeline>

Of course it doesn't work I'm sure I miss a few things but I don't
know where. Here is the exception I get :

An Error Occurred

No Cocoon Form found.

org.apache.cocoon.ProcessingException: Error executing pipeline.:
org.xml.sax.SAXException: No Cocoon Form found.

cause: org.xml.sax.SAXException: No Cocoon Form found.

full exception chain stacktrace[hide]

org.apache.cocoon.ProcessingException: Error executing pipeline.:
org.xml.sax.SAXException: No Cocoon Form found.
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.handleException(AbstractProcessingPipeline.java:940)
	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:281)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:483)
	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:120)
...

Any idea ?

Thx in advance.

-- 
Sebastien ARBOGAST