cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jcplerm" <jcpl...@ameritech.net>
Subject Re: Clickable list
Date Thu, 04 Dec 2003 16:33:41 GMT
I guess your question has already been somehow answered by someone
(I did not keep the reply), but basically Woody does not have a way
of doing that directly.

But I had the exact same need as you and now I describe an example
of how I worked around. I produce a list of diagram links. When
users click on one of the diagram names, they are directed to an
update form.

This is how the form template looks like:


      <wt:repeater-size id="diagrams"/>
        <wt:repeater-widget id="diagrams">
          <tr>
            <td><wt:widget id="id">
        <wi:styling type="hidden"/>
              </wt:widget></td>
            <td><a><href>/diagram/diagramUpdate?OBJ_ID=<wt:widget
id="idOutput"/></href><text><wt:widget id="name"/></text></a></td></tr>
        </wt:repeater-widget>

Please note that the form definition includes an output widget which
contains a simple copy of the source "id" field.

Then I have another transformer down the pipeline which alters the
"<a><href>..." in the example above to the appropriate anchor notation such
as "<a href='...'</a>".

This is my own solution, it's not standard, maybe there are other better
approaches already developed by other people, but that's how it works for
me.

Yes, I agree that Woody needs a more straightforward way of defining
clickable lists, but as of now you have to work around such limitation.

But if there are better alternatives already developed, please share with
the rest of the members of this mailing list.

jlerm

----- Original Message ----- 
From: "Steve Steinitz" <steinitz@datatactics.com.au>
To: <users@cocoon.apache.org>
Sent: Thursday, December 04, 2003 12:01 AM
Subject: Clickable list


> Hello,
>
> My colleague and I both posted a question last week which received
> no answers.  The two questions were posed from different points of
> view but, I believe, addressed the same issue.  In the hope of
> getting some insight into this issue the text of each question is
> repeated below.  We appreciate your time.
>
> Steve Steinitz
>
> -----------
>
> Hi everyone,
>
> We're having a lot of fun with woody and flow but have a problem with a
> common scenario.
>
> Scenario:
>
> 1. A list of items is displayed.
> 2. click on an item in the list
> 3. Go to an editor (form) to edit the clicked item.
>
> This is a typical scenario for most applications.
>
> Question:
>
> How do we create a clickable list with woody? There does not appear to
> be a widget that renders as a simple HTML Anchor (ie. <a
> href=destination.html?someKindOfReference=aReference&contrinuation-
> id=1234567890">Click me to edit the item I represent</a>)
>
> I can see that a anchor widget does not submit a form (like the
> wd:action does)
>
> How are you dealing with this scenario?
>
> Thanks,
>
> Phil
>
>
> ------------
>
>
> Hello,
>
> We have prototyped some forms with Woody and Flow. It is impressive
> technology, particularly the binding framework.
>
> We use Cayenne (similar to OJB) as our object layer to access our
> postgres database.
>
> It is not obvious to us how to use woody to implement a 'clickable
> list' of objects -- meaning a list of objects (actually object
> attributes) where clicking one of them takes the user to a form to
> edit that object.   We've now realized that this 'clickable list'
> may not really be a job for woody.  Even so, we would still like to
> take advantage of woody's powerful bindings.  Moreover, while we
> could implement a 'clickable list' using the wd:action widgets
> inside a wd:repeater we would rather use hyperlinks than buttons --
> which even more, we suppose, begs the question: why even use woody?
> (But, we would like to use one technique for all our dynamic data.)
>
> We would be interested in suggestions on implementing a 'clickable
> list' and also on techniques for identifying the clicked object.
> We had intended to use, as part of the solution, Cayenne's
> DataObject.objectid() method which (I believe) is guaranteed to be
> unique among objects in a given DataContext (simliar to OJB's
> Broker).   Now however, looking at frameworks like struts, we
> wonder if we even need to use the objectid  -- that there might be
> a more elegant way to identify the clicked object.
>
> Here is some of our prototype code which works as far as displaying
> the list of objects from the database via Cayenne but does not yet
> attempt to allow selection of one of the objects.
>
>
> Widget Definition
> -----------------
>
> <?xml version = "1.0" encoding = "UTF-8"?>
> <wd:form xmlns:wd="http://apache.org/cocoon/woody/definition/1.0">
>
>     <wd:widgets>
>         <wd:repeater id="kriCategoryList">
>             <wd:widgets>
>
>                 <wd:field id="kriCategoryName">
>                     <wd:label>KRI Category Name</wd:label>
>                     <wd:datatype base="string"/>
>                 </wd:field>
>
>             </wd:widgets>
>
>         </wd:repeater>
>     </wd:widgets>
>
> </wd:form>
>
>
> Bindings
> --------
>
> <wb:context xmlns:wb="http://apache.org/cocoon/woody/binding/1.0"
> path="/" >
>   <wb:repeater id="kriCategoryList"
>     parent-path="."
>     row-path="KRICategories"
>     unique-row-id="globalID"
>     unique-path="@id"
> >
>     <wd:convertor datatype="long" /> -->
>
>     <wb:on-bind>
>         <wb:value id="kriCategoryName" path="@name" />
>     </wb:on-bind>
>
>   </wb:repeater>
> </wb:context>
>
>
> Flow
> ----
>
> function kriCategoryList(form)
> {
>     form.load(ourApp());
>     form.showForm("kriCategoryList-pipeline");
>     // form.save(ourApp());
>     cocoon.sendPage("editingPage.html");
> }
>
>
> Content
> -------
>
> <html xmlns:wt="http://apache.org/cocoon/woody/template/1.0"
>     xmlns:wi="http://apache.org/cocoon/woody/instance/1.0">
>     <head>
>         <title>KRI Category List</title>
>     </head>
>     <body>
>         <h1>Select a KRI Category</h1>
>         <wt:form-template
> action="?continuation-id=#{$continuation/id}" method="POST">
>             <wt:widget id="kriCategoryList"/>
>             <br/>
>             <input type="submit"/>
>         </wt:form-template>
>     </body>
> </html>
>
>
> SiteMap
> -------
>
> <map:match pattern="KRICategoryList.html">
>     <map:select type="request-method">
>         <!-- GET : start the flow for this screen -->
>         <map:when test="GET">
>             <map:call function="woody">
>                 <map:parameter name="function"
> value="kriCategoryList"/>
>                 <map:parameter name="form-definition"
> value="forms/kriCategoryList.wd"/>
>                 <map:parameter name="documentURI"
> value="docs/kriCategoryListTempData.xml"/>
>                 <map:parameter name="bindingURI"
> value="forms/kriCategoryList.wb"/>
>             </map:call>
>         </map:when>
>         <!-- POST (form submission) : continue the flow -->
>         <map:when test="POST">
>             <map:call continuation="{request-param:continuation-id}"/>
>         </map:when>
>     </map:select>
> </map:match>
>
> <map:match pattern="kriCategoryList-pipeline">
>     <map:generate src="docs/kriCategoryList.xml"/>
>     <map:transform type="woody"/>
>     <map:transform src="stylesheets/forms/woody-samples-styling.xsl"/>
>     <map:serialize type="html"/>
> </map:match>
>
>
>
>
> ---
>
> Steve Steinitz         ph +61 (0)2 9487 7215
> Director
>
> Data Tactics
> Sydney, Australia
>
> www.datatactics.com.au
>
> Web Commerce Development
> Project Estimation and Planning
> Software Development
> MacOS X Support
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


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


Mime
View raw message