Menu

Dynamic links with a Decorator

pavan
2007-01-10
2012-10-09
  • pavan

    pavan - 2007-01-10

    Hi,
    I tried to generate dynamic links containing more than one parameter using Decarator as below

    public String getDtlLink4()
    {
    TestClass Dtl= (TestClass)getCurrentRowObject();
    String Grp= (Dtl.getGroupName());
    String Appl= (Dtl.getApplicationName());
    String Job= (String.valueOf(Dtl.getJobName()));
    String RunId= (String.valueOf(Dtl.getProcessRunId()));
    return "<a href=\"TestAction.action?groupName=" +Grp+ "&applicationName=" +Appl+ "&jobName=" +Job+ "&RunId=" +RunId+"\">Details</a>";
    }

    JSP has
    <display:column property="dtlLink4" sortable="false" title="Details" />

    Every thing works fine. But in the web page the table will have values for Column Details as below string

    <a href="TestAction.action?groupName=ABC&applicationName=XYZ&jobName=JOB1&RunId=11">Details</a>

    It should be displayed as hyperlink for Details. when i click on that link it should invoke the action. I tried to give autolink="true" in Display:Column . But it didn't work.
    Any help about this problem.

     
    • Maju Paul J

      Maju Paul J - 2007-01-11

      Hi Pavan....

      try

      return "<a href="TestAction.action?groupName=ABC&applicationName=XYZ&jobName=JOB1&RunId=11">Details</a>";

      instead of

      return "&lt;a href=\"TestAction.action?groupName=" +Grp+ "&amp;applicationName=" +Appl+ "&amp;jobName=" +Job+ "&amp;RunId=" +RunId+"\">Details&lt;/a>";

      it will work...

      i have tried a similar one and its workin fine....

      Maju Paul J

       

Log in to post a comment.