You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Thomas Walland <of...@walland.net> on 2006/12/09 20:50:41 UTC

Clay-Question

Hi,

I want to do the following with apache-clay:

I'm adapting the clay-usecase example for my needs because I want to
build a person-management-interface. In my case, persons can have
relationships to one or more other persons. This data I also want to
manage with this interface.

So I have a Vector or a Map which has a dynamical length and this list
should  be rendered like this:

+---------------+
|Relationships: |
+---------------+
| (X) Person A  |
| (X) Person B  |
| ...           |
| (X) Person Z  |
+---------------+
|Add new Person |
+---------------+

If you click on the (X) you delete a relationship, if you click on
"Add..." You add a new one.

How can I cover this with clay. Are there some examples or does
anybody have some tipps for me? I want to build this in a STRICT HTML
FORM, so actualy my clay application deals only with html-files for
the visualization.

But in HTML I do not have the ability to iterate on a collection. Do I
have to implement my own renderer and does anybody have some tipps or
tutorials for me?

Thanks a lot!


Re: Clay-Question

Posted by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>.
Thomas Walland schrieb:
> Hi,
> 
> I want to do the following with apache-clay:
> 
> I'm adapting the clay-usecase example for my needs because I want to
> build a person-management-interface. In my case, persons can have
> relationships to one or more other persons. This data I also want to
> manage with this interface.
> 
> So I have a Vector or a Map which has a dynamical length and this list
> should  be rendered like this:
> 
> +---------------+
> |Relationships: |
> +---------------+
> | (X) Person A  |
> | (X) Person B  |
> | ...           |
> | (X) Person Z  |
> +---------------+
> |Add new Person |
> +---------------+
> 
> If you click on the (X) you delete a relationship, if you click on
> "Add..." You add a new one.
> 
> How can I cover this with clay. Are there some examples or does
> anybody have some tipps for me? I want to build this in a STRICT HTML
> FORM, so actualy my clay application deals only with html-files for
> the visualization.
> 
> But in HTML I do not have the ability to iterate on a collection. Do I
> have to implement my own renderer and does anybody have some tipps or
> tutorials for me?
> 
> Thanks a lot!
> 

You can use a dataTable do render this. Using clays component crafting 
this should be no problem.
You can still use your html form, the table placeholder in your form 
gets replaced by the component, which itself can do what you want.
The row have to render a commandLink for deletion, the add is a simple 
commandLink to another form to add a person.

So i dont really see the problem why it should be a problem for clay - 
use the components and be happy.

Torsten