• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2: My s:select will not select rows which it should do applicable

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I hope someone can look over what I have written and check to see why it is not working as I thought it would...

I have a select on a edit user page which shows Group objects, the User can be selected to any of these. The data as already defined in the database.



I know that the two collections are set becasue in the previously in the JSP I put..



User: [1, General Site User, 213, General (Team)]
Team: [213, General (Team), 214, Moderator (Team), 215, Admin (Team), 1, General Site User]



I have highlighted the 2 object in the lists that should get selected when the page is shown and on the Group object I have tried creating an equals method which I though would be used by struts.

Does anyone see an error in my code?

Thanks

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What code?
 
David Rocks
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My own really, I have an edit user action that supplys both list objects for the JSP and the Group object is mine.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No no, I mean that it's kinda hard to know what might be wrong without anything other than a single line of JSP.
 
David Rocks
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is a struts 2 tag which displays one ArrayList of Group objects and highlights rows which represent objects contained in another ArrayList of Group objects.

The comparison of the group objects is done by the equals method in the Group object.

It does not work as documented, the rest of the JSP is not relevant.
 
David Rocks
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it, made userGroups an arralist of intergers containing the groups IDs
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic