Results 1 to 8 of 8

Thread: Adding a link to the generated list view

  1. #1
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    66

    Question Adding a link to the generated list view

    I would like to add a button or link to the generated list view of one of my roo entities. The link would call out to another controller mapping with the Id of the entity to perform a service. How? Can I add another <table:column> tag with a link attached?

  2. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    If you want this link to be present in all list views you can simply add the link definition to table.tagx definition. There is also a reference.tagx you could consider.

    If you want the link to appear only in one list view for a specific domain object you can simply edit the list.jspx.
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

  3. #3
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    66

    Question

    >>If you want the link to appear only in one list view for a specific domain object you can simply edit the list.jspx.

    Stefan,

    Yes, I want this link to apply to one list view for a specific entity. How can I insert an HREF into the tag-generated table? How can I reference the ID of the entity? Another question: How are the three links (view detail, edit, delete) at the end of each line generated?

    thanks,

    Lawrence
    Last edited by objectguru; Sep 29th, 2010 at 01:07 PM. Reason: enhancement

  4. #4
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    66

    Default

    I did get this to work

  5. #5
    Join Date
    Mar 2011
    Posts
    1

    Smile

    Quote Originally Posted by objectguru View Post
    I did get this to work
    Can you please post your solution? Thx

  6. #6
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    66

    Default

    Unfortunately the code is with the client and I don't recall exactly what I did. I'll try to re-create the solution for you this week.

  7. #7
    Join Date
    Feb 2011
    Posts
    5

    Default

    Hi there,

    Can you describe or post some example code to illustrate how this can be done ?

    Thanks!!!!

  8. #8
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    66

    Default

    Okay, what you need to do is find the list view for the entity. It will probably be named "list.jspx" in a path like:
    \ui\mvc\src\main\webapp\WEB-INF\views\<entity name>\list.jspx These files are roo-generated but can be edited. See if you can add new column to the list with your custom callout url. If you examine the code, this should be fairly easy and you can see how variables are DE-referenced with expression language constructs. You should be able to call a service method and pass the id of the entity by constructing a URL. When I was working at DirecTV I used this method for a Video DRM proof of concept app.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •