ObjectTable. How to customize TR attributes ?

View: New views
17 Messages — Rating Filter:   Alert me  

ObjectTable. How to customize TR attributes ?

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I would like to implement a "Web 2.0" kind of hover-over popup window using Javascript inside of an ObjectTable. Therefore I need to add additional TR attributes in the Table rows:

<TR class="second" title="cssbody=[dvbdy1] cssheader=[dvhdr1] header=[<img src='img/info.png' style='vertical-align:middle'> Information] body=[Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tatio] fade=[on] fadespeed=[0.05]">

What would be the best way to extend ObjectTable accordingly?

Toby
   

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: ObjectTable. How to customize TR attributes ?

by Alejandro Scandroli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Toby,

For that level of customization (if 'class' attributes are not enough
for you) you will be better off with a plain tapestry table decomposed
to its internal lower level components.
http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/table.html#Complicated%20Render

--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es

On Dec 11, 2007 12:53 PM,  <superoverdrive@...> wrote:

> I would like to implement a "Web 2.0" kind of hover-over popup window using Javascript inside of an ObjectTable. Therefore I need to add additional TR attributes in the Table rows:
>
> <TR class="second" title="cssbody=[dvbdy1] cssheader=[dvhdr1] header=[<img src='img/info.png' style='vertical-align:middle'> Information] body=[Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tatio] fade=[on] fadespeed=[0.05]">
>
> What would be the best way to extend ObjectTable accordingly?
>
> Toby
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: ObjectTable. How to customize TR attributes ?

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, thanks....

-------- Original-Nachricht --------
> Datum: Wed, 12 Dec 2007 11:03:38 +0100
> Von: "Alejandro Scandroli" <alejandroscandroli@...>
> An: users@...
> Betreff: Re: [trails-users] ObjectTable. How to customize TR attributes ?

> Hi Toby,
>
> For that level of customization (if 'class' attributes are not enough
> for you) you will be better off with a plain tapestry table decomposed
> to its internal lower level components.
> http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/table.html#Complicated%20Render
>
> --
> Alejandro Scandroli
> Amneris: We build process-driven web applications.
> http://www.amneris.es
>
> On Dec 11, 2007 12:53 PM,  <superoverdrive@...> wrote:
> > I would like to implement a "Web 2.0" kind of hover-over popup window
> using Javascript inside of an ObjectTable. Therefore I need to add additional
> TR attributes in the Table rows:
> >
> > <TR class="second" title="cssbody=[dvbdy1] cssheader=[dvhdr1]
> header=[<img src='img/info.png'
> style='vertical-align:middle'> Information] body=[Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
> volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tatio] fade=[on]
> fadespeed=[0.05]">
> >
> > What would be the best way to extend ObjectTable accordingly?
> >
> > Toby
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Trails forms and @Transient properties

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

1. I have just noticed that @Transient getter Methods are not ignored during an updated - so it tries to call no-existent setters if you have @Transient getter methods (e.g. for formatting data etc...)


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


additional columns for ObjectTables?

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is it possible to add additional columns to an ObjectTable?
E.g. for adding buttons that are not related to a data column of the object that is displayed? (e.g. delete, remove buttons per column, etc..) ?

Thanks!

Toby

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Trails forms and @Transient properties

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have used:

@PropertyDescriptor (summary=false, readOnly=true)

now for all @Trancient getter methods.

-------- Original-Nachricht --------
> Datum: Wed, 12 Dec 2007 11:21:36 +0100
> Von: superoverdrive@...
> An: users@...
> Betreff: [trails-users] Trails forms and @Transient properties

> 1. I have just noticed that @Transient getter Methods are not ignored
> during an updated - so it tries to call no-existent setters if you have
> @Transient getter methods (e.g. for formatting data etc...)
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Trails forms and @Transient properties

by Kalle Korhonen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

@Transient shouldn't force read-only. It's sometimes advantageous to have read/write properties that won't be persisted.

Kalle

On 12/12/07, superoverdrive@... <superoverdrive@...> wrote:
1. I have just noticed that @Transient getter Methods are not ignored during an updated - so it tries to call no-existent setters if you have @Transient getter methods (e.g. for formatting data etc...)


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email



Re: additional columns for ObjectTables?

by Alejandro Scandroli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Toby

In Trails 1.1.1 there is no easy way to add new columns to an
ObjectTable, if you are brave enough to try 1.2-SNAPSHOT you will find
a new ObjectTable parameter called "extraColumns"
(http://jira.codehaus.org/browse/TRAILS-65) that works exactly like
the "columns" parameter of the Tapestry table component.

An option that work in 1.1.1 is to add a new getter method for each
new column you want to display. I know it's ugly but it might help you
 workaround this ObjectTable limitation.

--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es


On Dec 12, 2007 11:23 AM,  <superoverdrive@...> wrote:

> Is it possible to add additional columns to an ObjectTable?
> E.g. for adding buttons that are not related to a data column of the object that is displayed? (e.g. delete, remove buttons per column, etc..) ?
>
> Thanks!
>
> Toby
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: additional columns for ObjectTables?

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, thanks!

-------- Original-Nachricht --------
> Datum: Wed, 12 Dec 2007 15:05:57 +0100
> Von: "Alejandro Scandroli" <alejandroscandroli@...>
> An: users@...
> Betreff: Re: [trails-users] additional columns for ObjectTables?

> Hi Toby
>
> In Trails 1.1.1 there is no easy way to add new columns to an
> ObjectTable, if you are brave enough to try 1.2-SNAPSHOT you will find
> a new ObjectTable parameter called "extraColumns"
> (http://jira.codehaus.org/browse/TRAILS-65) that works exactly like
> the "columns" parameter of the Tapestry table component.
>
> An option that work in 1.1.1 is to add a new getter method for each
> new column you want to display. I know it's ugly but it might help you
>  workaround this ObjectTable limitation.
>
> --
> Alejandro Scandroli
> Amneris: We build process-driven web applications.
> http://www.amneris.es
>
>
> On Dec 12, 2007 11:23 AM,  <superoverdrive@...> wrote:
> > Is it possible to add additional columns to an ObjectTable?
> > E.g. for adding buttons that are not related to a data column of the
> object that is displayed? (e.g. delete, remove buttons per column, etc..) ?
> >
> > Thanks!
> >
> > Toby
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


How to display object1.object2.attribute in ObjectTable ?

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a class called RememberedClip that contains a Clip and a timestamp when this Clip was remembered.

I want to display all remembered clips in an ObjectTable.

Inside:

public boolean displaying(IPropertyDescriptor description){
...
}

only a whole "Clip" is passed...so I have not found a way to display
something like:

rememberedClip.clip.title  rememberedClip.clip.category rememberedClip.when

in a table....I also want to avoid displaying everything in a single column as the sorting of the table should still be possible.

Would ObjectTable be able to do this somehow or not?

Thanks!

Toby

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: How to display object1.object2.attribute in ObjectTable ?

by Alejandro Scandroli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tobias,

Sorry for the late response.
Do you want to use nested ObjectTables? or do you want to use an
ObjectTable with an EditCollection?
In case you want to use it with an EditCollection check  this:
http://svn.trails.codehaus.org/browse/trails/trunk/trails/modules/trails-core/src/main/resources/org/trails/component/EditCollection.html?r=885
There you will find an example of how to do it, although it's commented out.

--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es

On Dec 12, 2007 5:24 PM,  <superoverdrive@...> wrote:

> I have a class called RememberedClip that contains a Clip and a timestamp when this Clip was remembered.
>
> I want to display all remembered clips in an ObjectTable.
>
> Inside:
>
> public boolean displaying(IPropertyDescriptor description){
> ...
> }
>
> only a whole "Clip" is passed...so I have not found a way to display
> something like:
>
> rememberedClip.clip.title  rememberedClip.clip.category rememberedClip.when
>
> in a table....I also want to avoid displaying everything in a single column as the sorting of the table should still be possible.
>
> Would ObjectTable be able to do this somehow or not?
>
> Thanks!
>
> Toby
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Parent Message unknown Re: How to display object1.object2.attribute in ObjectTable ?

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there!

No - not nested ObjectTables - nested objects inside a table.

E.g. car.name in one column and car.colour in another column but at the same time car.door.type in another column inside the same table.

It seems to be impossible currently to have several object graph levels
("deepness") in the same table.

I have solved it by modifying my classes with lots of transient getter methods...but I dont like this solution!

Thanks!

Tobias
-------- Original-Nachricht --------
> Datum: Fri, 14 Dec 2007 15:52:49 +0100
> Von: "Alejandro Scandroli" <alejandroscandroli@...>
> An: users@...
> Betreff: Re: [trails-users] How to display object1.object2.attribute in ObjectTable ?

> Hi Tobias,
>
> Sorry for the late response.
> Do you want to use nested ObjectTables? or do you want to use an
> ObjectTable with an EditCollection?
> In case you want to use it with an EditCollection check  this:
> http://svn.trails.codehaus.org/browse/trails/trunk/trails/modules/trails-core/src/main/resources/org/trails/component/EditCollection.html?r=885
> There you will find an example of how to do it, although it's commented
> out.
>
> --
> Alejandro Scandroli
> Amneris: We build process-driven web applications.
> http://www.amneris.es
>
> On Dec 12, 2007 5:24 PM,  <superoverdrive@...> wrote:
> > I have a class called RememberedClip that contains a Clip and a
> timestamp when this Clip was remembered.
> >
> > I want to display all remembered clips in an ObjectTable.
> >
> > Inside:
> >
> > public boolean displaying(IPropertyDescriptor description){
> > ...
> > }
> >
> > only a whole "Clip" is passed...so I have not found a way to display
> > something like:
> >
> > rememberedClip.clip.title  rememberedClip.clip.category
> rememberedClip.when
> >
> > in a table....I also want to avoid displaying everything in a single
> column as the sorting of the table should still be possible.
> >
> > Would ObjectTable be able to do this somehow or not?
> >
> > Thanks!
> >
> > Toby
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: How to display object1.object2.attribute in ObjectTable ?

by Alejandro Scandroli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tobias

ahhh, now I understand.
A proper solution would be to use the Tapestry Table component.
But if (transient) getter methods are working, I think it's not that
bad for a quick solution.

Saludos.
--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es

On Dec 15, 2007 5:50 PM,  <superoverdrive@...> wrote:

> Hi there!
>
> No - not nested ObjectTables - nested objects inside a table.
>
> E.g. car.name in one column and car.colour in another column but at the same time car.door.type in another column inside the same table.
>
> It seems to be impossible currently to have several object graph levels
> ("deepness") in the same table.
>
> I have solved it by modifying my classes with lots of transient getter methods...but I dont like this solution!
>
> Thanks!
>
> Tobias
> -------- Original-Nachricht --------
> > Datum: Fri, 14 Dec 2007 15:52:49 +0100
> > Von: "Alejandro Scandroli" <alejandroscandroli@...>
> > An: users@...
> > Betreff: Re: [trails-users] How to display object1.object2.attribute in ObjectTable ?
>
>
> > Hi Tobias,
> >
> > Sorry for the late response.
> > Do you want to use nested ObjectTables? or do you want to use an
> > ObjectTable with an EditCollection?
> > In case you want to use it with an EditCollection check  this:
> > http://svn.trails.codehaus.org/browse/trails/trunk/trails/modules/trails-core/src/main/resources/org/trails/component/EditCollection.html?r=885
> > There you will find an example of how to do it, although it's commented
> > out.
> >
> > --
> > Alejandro Scandroli
> > Amneris: We build process-driven web applications.
> > http://www.amneris.es
> >
> > On Dec 12, 2007 5:24 PM,  <superoverdrive@...> wrote:
> > > I have a class called RememberedClip that contains a Clip and a
> > timestamp when this Clip was remembered.
> > >
> > > I want to display all remembered clips in an ObjectTable.
> > >
> > > Inside:
> > >
> > > public boolean displaying(IPropertyDescriptor description){
> > > ...
> > > }
> > >
> > > only a whole "Clip" is passed...so I have not found a way to display
> > > something like:
> > >
> > > rememberedClip.clip.title  rememberedClip.clip.category
> > rememberedClip.when
> > >
> > > in a table....I also want to avoid displaying everything in a single
> > column as the sorting of the table should still be possible.
> > >
> > > Would ObjectTable be able to do this somehow or not?
> > >
> > > Thanks!
> > >
> > > Toby
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe from this list please visit:
> > >
> > >     http://xircles.codehaus.org/manage_email
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


<span jwcid="@trails:AssociationSelect"/>

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there!

I am trying to do a PropertySelection (for a custom search page).

I am using the AssociationSelect components and wonder whether this is the right usage:

<span jwcid="@trails:AssociationSelect"
instances="ognl:allCategories"
propertyDescriptor="ognl:descriptor"/>


public abstract class Search extends TrailsPage {

        public List<Category> getAllCategories(){
         return this.getPersistenceService().getAllInstances(Category.class);
        }
       
        public IPropertyDescriptor getDescriptor(){
                return getDescriptorService().getClassDescriptor(Category.class).getIdentifierDescriptor();
        }
}


Cheers!

Toby

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


RE: <span jwcid="@trails:AssociationSelect"/>

by nhhockeyplayer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey Toby,
 
I have not been sync'd with the sources for a while due to being pre-empt'd with critical path development (hopefully to resolve my participation in coming weeks and offer next wave of trails validation/qualification and feedback)... but I can lend some sight.
 
TRAILS-CORE
The Editors.page spec models an editable value compounded with all the knowledge of the objects property (within the propertyDescriptor)

<component id="associationSelect" type="AssociationSelect">

<binding name="value">model[#this.descriptor.name]</binding>

<binding name="propertyDescriptor">descriptor</binding>

</component>
 
There really isn't an AssociationSelect.html that one might expect that would implement a user interface.
 
Rather Alejandro has decoupled and modularized trails into pieces. A concept that I have not yet grasp'd yet nor have I understood the motivation for rationalizing the replication that comes with it. Some insight on this with start to end benefits would be nicer for conceptual architectures that other folks are unaware of.
 
TRAILS-HIBERNATE
HibernateAssociationSelect extends AssociationSelect
The spec for this is empty and just anchors the logic to the semantics within HibernateAssociationSelect class.
<component-specification class="org.trails.component.HibernateAssociationSelect">

</component-specification>
 
The Editors.page spec for this guy NOW does the same as the original AssociationSelect editor

<component id="associationSelect" type="HibernateAssociationSelect">

<binding name="value">model[#this.descriptor.name]</binding>

<binding name="propertyDescriptor">descriptor</binding>

</component>
 
This is an instance of the replication I referred to earlier... regardless...
 
So where is the UI for this guy... and how do we use it?
 
TAPESTRY 101...
Blocks are declarations, not necessarily a defined user interface... to be modeled and used in a different place or different module. Thats how we model each of our properties that trails objects support editing for.
 
TRAILS-CORE
Editors.html

<span jwcid="referenceEditor@Block">

<li>

<label class="desc" jwcid="@FieldLabel" field="component:associationSelect" displayName="ognl:descriptor.displayName"/>

<span jwcid="associationSelect" class="select medium"/>

</li>

</span>
 
TRAILS-HIBERNATE
HibernateEditors.html

<span jwcid="referenceEditor@Block">

<li><label class="desc" jwcid="@FieldLabel" field="component:associationSelect" displayName="ognl:descriptor.displayName"/>

<span jwcid="associationSelect" class="select medium"/>

</li>

</span>
 
Yes, more replication.... (Alejandro is going to come sniping for me .. )
 
ok so at this point we have java classes spec'd and modeled and editors modeled in Block's
 
Where is the UI? Tapestry propertySelection component renders it internally.
 
How does the list get populated? buildSelectionModel in each respective class implementation.
 
How does buildSelectionModel get invoked?

@Parameter(defaultValue = "buildSelectionModel()")

public abstract IPropertySelectionModel getModel();
 
And PropertySelection.getModel gets invoked on initialization of the component.
 
AssociationSearchField.html shows a typical usage...
<span jwcid="$content$">

<input jwcid="hibernateAssociationSelect"/>

</span>
 
The property type and list are automatically created internally. Anything beyond this would be custom override.
 
ada'dia ada'dia ada'dia ada'dia dats all folks... !


Best regards
Ken in nashua



> Date: Wed, 9 Jan 2008 14:11:22 +0100
> From: superoverdrive@...
> To: users@...
> Subject: [trails-users] <span jwcid="@trails:AssociationSelect"/>
>
> Hi there!
>
> I am trying to do a PropertySelection (for a custom search page).
>
> I am using the AssociationSelect components and wonder whether this is the right usage:
>
> <span jwcid="@trails:AssociationSelect"
> instances="ognl:allCategories"
> propertyDescriptor="ognl:descriptor"/>
>
>
> public abstract class Search extends TrailsPage {
>
> public List<Category> getAllCategories(){
> return this.getPersistenceService().getAllInstances(Category.class);
> }
>
> public IPropertyDescriptor getDescriptor(){
> return getDescriptorService().getClassDescriptor(Category.class).getIdentifierDescriptor();
> }
> }
>
>
> Cheers!
>
> Toby
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
> http://xircles.codehaus.org/manage_email
>



Put your friends on the big screen with Windows Vista® + Windows Live™. Start now!
Best regards
Ken in nashua

Re: <span jwcid="@trails:AssociationSelect"/>

by Alejandro Scandroli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Toby,

There is an usage example in
examples/ajaxlist/src/main/webapp/WEB-INF/NoteEdit.html

If this is your Entity:

@Entity
public class Note
{
        private Category category;
...
...
...
}

This is what you should use:

<select jwcid="categoryPropertySelection@trails:HibernateAssociationSelect"
        value="ognl:model.category"
        propertyDescriptor="ognl:classDescriptor.getPropertyDescriptor('category')"/>

Where "model" is a Note and "classDescriptor" is the Note.class
classDescriptor.
You don't have to worry about getting all the instances, Trails will
do it for you.

I hope it helps.
Alejandro.

--
Alejandro Scandroli
Amneris: We build process-driven web applications.
http://www.amneris.es



On Jan 9, 2008 2:11 PM,  <superoverdrive@...> wrote:

> Hi there!
>
> I am trying to do a PropertySelection (for a custom search page).
>
> I am using the AssociationSelect components and wonder whether this is the right usage:
>
> <span jwcid="@trails:AssociationSelect"
> instances="ognl:allCategories"
> propertyDescriptor="ognl:descriptor"/>
>
>
> public abstract class Search extends TrailsPage {
>
>         public List<Category> getAllCategories(){
>          return this.getPersistenceService().getAllInstances(Category.class);
>         }
>
>         public IPropertyDescriptor getDescriptor(){
>                 return getDescriptorService().getClassDescriptor(Category.class).getIdentifierDescriptor();
>         }
> }
>
>
> Cheers!
>
> Toby
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: <span jwcid="@trails:AssociationSelect"/>

by Toby78 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks! AssociationSelect saves a lot of work ;-)

-------- Original-Nachricht --------
> Datum: Wed, 9 Jan 2008 20:01:39 +0100
> Von: "Alejandro Scandroli" <alejandroscandroli@...>
> An: users@...
> Betreff: Re: [trails-users] <span jwcid="@trails:AssociationSelect"/>

> Hi Toby,
>
> There is an usage example in
> examples/ajaxlist/src/main/webapp/WEB-INF/NoteEdit.html
>
> If this is your Entity:
>
> @Entity
> public class Note
> {
> private Category category;
> ...
> ...
> ...
> }
>
> This is what you should use:
>
> <select
> jwcid="categoryPropertySelection@trails:HibernateAssociationSelect"
>         value="ognl:model.category"
>        
> propertyDescriptor="ognl:classDescriptor.getPropertyDescriptor('category')"/>
>
> Where "model" is a Note and "classDescriptor" is the Note.class
> classDescriptor.
> You don't have to worry about getting all the instances, Trails will
> do it for you.
>
> I hope it helps.
> Alejandro.
>
> --
> Alejandro Scandroli
> Amneris: We build process-driven web applications.
> http://www.amneris.es
>
>
>
> On Jan 9, 2008 2:11 PM,  <superoverdrive@...> wrote:
> > Hi there!
> >
> > I am trying to do a PropertySelection (for a custom search page).
> >
> > I am using the AssociationSelect components and wonder whether this is
> the right usage:
> >
> > <span jwcid="@trails:AssociationSelect"
> > instances="ognl:allCategories"
> > propertyDescriptor="ognl:descriptor"/>
> >
> >
> > public abstract class Search extends TrailsPage {
> >
> >         public List<Category> getAllCategories(){
> >          return
> this.getPersistenceService().getAllInstances(Category.class);
> >         }
> >
> >         public IPropertyDescriptor getDescriptor(){
> >                 return
> getDescriptorService().getClassDescriptor(Category.class).getIdentifierDescriptor();
> >         }
> > }
> >
> >
> > Cheers!
> >
> > Toby
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email