In one of mine ColumnDecorator classes I need more than one property to handle the decoration of the column.
As I understand the <display:column property="methodname" .....decorator="some.decorator.class"/> grabs the methodName, uses the Reflection api to actually grab the value from the method and passes it on to the decorator class for the final finish / appearance. Formatting a Date Object is quite easy, as shown in one of the examples submitted with the displaytag distribution and I have made severals myself, including displaying an image.
My requirements however is this: One column should display some text, along with an image.
Piece of code from a table before using displaytag:
...
<td>
<bean:write name="element" property="name" />
<il:productViewer name="element" property="type" />
</td>
...
Meaning, within the <td></td> tag I write the name, then by using a taglib and passing in the 'type' property I am returning html code for displaying the proper image. Both name and image is displayed within one 'column' How to solve this with the <display:column> tag?
I need both the name and image within 1 column (as within <td></td>) not like this:
<display:column property="name" ..../>
<display:column property="imageName" ... decorator="some.image.decorator.class/>
Actually I would like to pass in the object beeing iterated to some attribute in the columntag.
Anyone with some good ideas?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Allowing me to do more computations inside a ColumnDecorater since I now can retrieve all values from the SomeDTOObject, rather than a simple value from the same object.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In one of mine ColumnDecorator classes I need more than one property to handle the decoration of the column.
As I understand the <display:column property="methodname" .....decorator="some.decorator.class"/> grabs the methodName, uses the Reflection api to actually grab the value from the method and passes it on to the decorator class for the final finish / appearance. Formatting a Date Object is quite easy, as shown in one of the examples submitted with the displaytag distribution and I have made severals myself, including displaying an image.
My requirements however is this: One column should display some text, along with an image.
Piece of code from a table before using displaytag:
...
<td>
<bean:write name="element" property="name" />
<il:productViewer name="element" property="type" />
</td>
...
Meaning, within the <td></td> tag I write the name, then by using a taglib and passing in the 'type' property I am returning html code for displaying the proper image. Both name and image is displayed within one 'column' How to solve this with the <display:column> tag?
I need both the name and image within 1 column (as within <td></td>) not like this:
<display:column property="name" ..../>
<display:column property="imageName" ... decorator="some.image.decorator.class/>
Actually I would like to pass in the object beeing iterated to some attribute in the columntag.
Anyone with some good ideas?
Consider this as closed. I added a method in the DTO object returning itself.
SomeDTOObject {
.
.
.
public SomeDTOObject getSelf() {
return this;
}
}
<display:table .....>
<display:column property="self">
</display:table>
Allowing me to do more computations inside a ColumnDecorater since I now can retrieve all values from the SomeDTOObject, rather than a simple value from the same object.