specifying custom properties to a displaytag table decorator

I have a decorator specified on a displaytag table that I need to pass parameters to. The decorator adds an id attribute to the row. Currently the values I require are hardcoded.

The parameters I need are:

  • The name of the property to use as id value
  • An id prefix (usually the property used is a number and IE doesn’t like ids starting with numbers)

Looking through the javadocs for displaytag, it looks like I can set a property (<displaytag:setProperty>), but there doesn’t seem to be a way for me to return a general property.

Answer

Decorators have access to the PageContext. You can pass parameters as its attributes (for example, using <c:set .../>).

Leave a Reply

Your email address will not be published. Required fields are marked *