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 17:45:40 UTC

Re[2]: Object list form ?

Hi Sebastien,

> Ok you're right I should have precised. In fact what I want to display
> is something like the list of email messages in Google, in a table,
> with a checkbox for each line (to select items to apply actions on)
> and just a few details about the item so that I can edit it. For
> example I would like to obtain some HTML code like this at the end :

Are you looking for the repeater-widget?
http://cocoon.apache.org/2.1/userdocs/forms/widget_repeater.html


-- 
* 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

Re[6]: Object list form ?

Posted by Jens Maukisch <co...@maukisch.net>.
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[4]: Object list form ?

Posted by Sebastien Arbogast <se...@gmail.com>.
> Hi Sebastien,
> 
> >> Are you looking for the repeater-widget?
> >> http://cocoon.apache.org/2.1/userdocs/forms/widget_repeater.html
> 
> > Not exactly. I know this widget but my problem is more how to build my
> > form from flowscript than writing the form model itself... :(
> 
> Hmm, so it seems that I don't understand your problem correctly.
> 
> So you have a collection of user-objects and you want to show
> them to the user so that he can select one or more to do further
> actions on them?
> 
> So you want to display a checkbox and some other information from
> the user-objects (e.g. first- and lastname)?

Exactly ! A very good example of what I would like to achieve in the
first place is GMail main frame, except that instead of listing
emails, I want to list users (for now). But it's exactly the kind of
interface I'm trying to make : a list of entities with actions to
apply on selected ones, etc.
It seems to be something quite common in web applications.
But I'm beginning to think of making a HTML form directly, using a
JXTemplate, since validation is not a big issue. This way I could just
do something like that in flowscript :

function displayUsers(){
  var users = usersService.findAllUsers();
  cocoon.sendPageAndWait("users-list",{list : users});
  ...
}

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 ?
-- 
Sebastien ARBOGAST

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


Re[4]: Object list form ?

Posted by Jens Maukisch <co...@maukisch.net>.
Hi Sebastien,

>> Are you looking for the repeater-widget?
>> http://cocoon.apache.org/2.1/userdocs/forms/widget_repeater.html

> Not exactly. I know this widget but my problem is more how to build my
> form from flowscript than writing the form model itself... :(

Hmm, so it seems that I don't understand your problem correctly.

So you have a collection of user-objects and you want to show
them to the user so that he can select one or more to do further
actions on them?

So you want to display a checkbox and some other information from
the user-objects (e.g. first- and lastname)?

-- 
* 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[2]: Object list form ?

Posted by Sebastien Arbogast <se...@gmail.com>.
> Are you looking for the repeater-widget?
> http://cocoon.apache.org/2.1/userdocs/forms/widget_repeater.html

Not exactly. I know this widget but my problem is more how to build my
form from flowscript than writing the form model itself... :(

-- 
Sebastien ARBOGAST

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