You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jim O'Callaghan <ji...@peritussolutions.com> on 2010/09/13 18:15:33 UTC

Enum mask

Tapestry provides a very handy facility for presenting enums as drop down
lists for display - is there anything built-in that allows certain values
for the enum to be hidden from the generated drop down list?  Ex. where a
status transition follows a strict order where A can be progressed to B and
then to C, but B cannot got back to A, so in the case where an entity is
already at status B,  I only want to display B and C as options for
selection.  Similarly if A needs to go to B before C, when an entity has
status A, I only want to display A, B rather than A, B, C.

 

Regards,

Jim.


RE: Enum mask

Posted by Jim O'Callaghan <jc...@yahoo.co.uk>.
Thanks Thiago - I'll give that a shot.

Regards,
Jim.

-----Original Message-----
From: Thiago H. de Paula Figueiredo [mailto:thiagohp@gmail.com] 
Sent: 13 September 2010 18:26
To: Tapestry users
Subject: Re: Enum mask

On Mon, 13 Sep 2010 14:03:05 -0300, Jim O'Callaghan  
<jc...@yahoo.co.uk> wrote:

> Thanks Howard.  Is there an easier way, just using a mixin that takes
> another parameter (ex. a comma separated list of include / exclude list
> index entries) from the template and in the mixin beginRender etc.  
> performs an op on the model created from the Enum?

Tapestry doesn't have one out-of-the-box, but creating such a mixin would  
be almost easy. ;) Just rewrite the DOM after the rendering of the Select  
component.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informa��o Ltda.
http://www.arsmachina.com.br

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



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


Re: Enum mask

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 13 Sep 2010 14:03:05 -0300, Jim O'Callaghan  
<jc...@yahoo.co.uk> wrote:

> Thanks Howard.  Is there an easier way, just using a mixin that takes
> another parameter (ex. a comma separated list of include / exclude list
> index entries) from the template and in the mixin beginRender etc.  
> performs an op on the model created from the Enum?

Tapestry doesn't have one out-of-the-box, but creating such a mixin would  
be almost easy. ;) Just rewrite the DOM after the rendering of the Select  
component.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


RE: Enum mask

Posted by Jim O'Callaghan <jc...@yahoo.co.uk>.
Thanks Howard.  Is there an easier way, just using a mixin that takes
another parameter (ex. a comma separated list of include / exclude list
index entries) from the template and in the mixin beginRender etc. performs
an op on the model created from the Enum?  I was hoping to not have to
duplicate the creation of the model from the enum, camel casing it etc. that
the existing SelectModel does.  I'm working with 5.2 - perhaps there are
some new features I can take advantage of.

Regards,
Jim.

-----Original Message-----
From: Howard Lewis Ship [mailto:hlship@gmail.com] 
Sent: 13 September 2010 17:43
To: Tapestry users
Subject: Re: Enum mask

No, in that case, you'd want to create your own SelectModel and
populate it.  You may inject and use the SelectModelFactory service to
help with this.

On Mon, Sep 13, 2010 at 9:15 AM, Jim O'Callaghan
<ji...@peritussolutions.com> wrote:
> Tapestry provides a very handy facility for presenting enums as drop down
> lists for display - is there anything built-in that allows certain values
> for the enum to be hidden from the generated drop down list?  Ex. where a
> status transition follows a strict order where A can be progressed to B
and
> then to C, but B cannot got back to A, so in the case where an entity is
> already at status B,  I only want to display B and C as options for
> selection.  Similarly if A needs to go to B before C, when an entity has
> status A, I only want to display A, B rather than A, B, C.
>
>
>
> Regards,
>
> Jim.
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



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


Re: Enum mask

Posted by Howard Lewis Ship <hl...@gmail.com>.
No, in that case, you'd want to create your own SelectModel and
populate it.  You may inject and use the SelectModelFactory service to
help with this.

On Mon, Sep 13, 2010 at 9:15 AM, Jim O'Callaghan
<ji...@peritussolutions.com> wrote:
> Tapestry provides a very handy facility for presenting enums as drop down
> lists for display - is there anything built-in that allows certain values
> for the enum to be hidden from the generated drop down list?  Ex. where a
> status transition follows a strict order where A can be progressed to B and
> then to C, but B cannot got back to A, so in the case where an entity is
> already at status B,  I only want to display B and C as options for
> selection.  Similarly if A needs to go to B before C, when an entity has
> status A, I only want to display A, B rather than A, B, C.
>
>
>
> Regards,
>
> Jim.
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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