On May 7, 2004, at 5:18 AM, Samuel Tribehou wrote:
Hello there. I'm a new cocoon user, so please bear with my ignorance ;)
Par for the course, as they say :-)
Here is my problem :
Say I have page which contains a main form. This form contains not only traditionnal form elements, but also some data displayed as lists which is gathered form a database.
To add/remove items from those lists, there are links which opens little forms in a popup window. Once those forms are submitted, the popup closes and the user does things with the main form again.
My problem is, how can I redisplay the main form with the actualized data ?
Here's how I do it...
You have a "main" page with a list of items, right? And a "details" page that lets you add/edit/delete on a per-item basis, right?
OK, first of all... flow is great, but it's not automatically the solution to everything :-). In particular, I think you should not be trying to think of the "details" popup as being in the same flow as the display of the main page. I could be wrong, and maybe someone knows more flow tricks will be able to show you how to do it more along the lines of what you have suggested.
But I would recommend that you first change the sitemap for the details to make it a per-item resource, i.e. embed the item ID in the URN somewhere, and pass that ID to the flowscript for your details page:
<map:match "details/*">
<map:call function="details">
<map:parameter name="item" value="{1}" />
</map:call>
</map:match>Then, in the main page, display your list items as links that call up the details page for the respective items (using client-side Javascript to get the popup effect... you can also make them buttons instead of links if you want).
To get the redisplay part working, here's what ya do...
In the flowscript for the details page, after you have processed the form, do this:
cocoon.sendPage ("finished");
Have that match in your sitemap to send this page:
<html>
<head>
<script language="javascript">
if (!self.opener.closed) {
self.opener.document.location.reload();
}
self.close();
</script>
</head>
<body/>
</html>I think that's about all there is to it. Does this solve your problem?
~mark
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
