About the dynamic selects, the implementation is generic enough, I guess:
We added two annotations:
@InitialValue
@PossibleValues
As an example, imagine you have client -> project -> task. task is not directly
mapped to client, only through the corresponding project. So InitialValue
annotates a transient attribute named client:
@Transient
@InitialValue("project.client")
private Client client;
so to populate the client property, it evaluates the propect.client expression.
(project can be null, in which case no client is pre-selected).
And the client drop down is obtained evaluating another expression:
@PossibleValues("client.projects")
@ManyToOne
private Project project;
client.projects gives the list of projects for a client. If client is null (not
yet selected), the project drop down is empty.
This cascading can be chained to any limit (well, we tested it with three
chained combos).
This forces to declare both sides of a many-to-one relation.
Hope it is clear enough.
Alejandro, what do you think?
regards.
Ken in nashua wrote:
> Alejandro is the uthority on what goes ito the project.
>
> It makes sense to show the diffs...
>
> Are you doing this in tapestry script? Or under the hood tapestry
> component+handlers... ?
>
> Will it jive with j2ee enums model? Are you parsing int's or strings or
> both?
>
> Wondering how complicated it is.
>
> Anyway, if you shoot up some code I believe Alejandro will advise.
>
> The dynamic select's seem a bit on the custom side for me (not valid to
> place in the project).
>
> Nice to hear from users out there...
>
> So how do you like 1.2-SNAPSHOT ?
>
> - cheers
>
> Best regards
> Ken in nashua
>
>
>
> > Date: Mon, 7 Jul 2008 11:13:48 -0300
> > From:
pablo.grana@...
> > To:
users@...
> > Subject: [trails-users] Enum in search
> >
> > Hi there.
> >
> > We added search by enums in our project. Can that be incorporated in the
> > project? We did it as an extension to trails, but I can send a diff
> against
> > 1.2-SNAPSHOT this week if you like.
> >
> > We also added the NONE search option in the association search block.
> >
> > And somebody in the team implemented 'cascaded combos': when one
> combo changes,
> > the other combos are refreshed based on this changing combo. For example:
> >
> > Client -> Project -> Task. Create a new task and select a client.
> This populates
> > the project combo with the projects of that client.
> >
> > And finally, 2 minor things: an unbalanced <li> and a clarification
> in the
> > message for an exception.
> >
> > I can send diffs for these.
> >
> > regards
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> >
> >
http://xircles.codehaus.org/manage_email> >
> >
>
>
> ------------------------------------------------------------------------
> Making the world a better place one message at a time. Check out the i'm
> Talkathon.
> <
http://www.imtalkathon.com/?source=EML_WLH_Talkathon_BetterPlace>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email