Hi

I suspect that this is not a Struts problem per-se, but I'm asking here in
the hope that someone else has seen this.

I'm using Struts 2.2.1 with DisplayTag 1.2. I've got a simple jsp page that
contains -

    
    
    
    
    

and my decorator is as follows;

    public class EditOrDeleteDecorator implements DisplaytagColumnDecorator
{

        @Override
        public Object decorate(Object arg0, PageContext context, MediaTypeEnum
arg2)
                        throws DecoratorException {
                
                IdsFunction function = (IdsFunction) 
context.getAttribute("row");
                
                return "<a href=\"edit-function?id=" + 
function.getId()
                + "\">Edit  | "
                + "<a href=\"delete-function?id=" + 
function.getId()
                + "\">Delete  | "
                + "<a href=\"list-service-definitions?id=" + 
function.getId()
                + "\">Definitions ";

        }

    }

Debugging the decorator shows that context.getAttribute("row") does indeed
return an IdsFunction object, but on each iteration it's always the same
IdsFunction object and it's the last IdsFunction instance in the list. I was
expecting to be handed each row object in turn.

The rendered JSP displays the row objects correctly, with each member of the
list displayed but obviously the URL's all point to the last member in the
list.

What am I missing?

Regards

--
View this message in context: 
http://struts.1045723.n5.nabble.com/Struts2-and-DisplayTag-tp4271030p4271030.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to