• 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

How to access a property attribute of a value outside of an iterate, but within another iterate

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

This is much easer that what it sound like... This is my code:

file1.jsp


file2.jsp




So, file1.jsp iterate over a collection of Objetivos. For each Objetivo we call file2.jsp wich iterates over Autores.... This is on a separte file, because the are actions involved with the list (delete, add Autores for each Objetivo)...

What I need to do is to add a <s:param name="codigo" value="codigo" /> to the iteration on list2.jsp, but that codigo must be from the Objetivo, not the Autor.

I know this must be like a very basic thing, however I havent found how to do it! sorry!

any help will be very much appriciated. By the way, Im using Struts 2.1.6.

daniel
 
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
I don't see where you're including jsp2: how are you doing that?

Options include putting the value into a scope or creating an OGNL-scoped var.
 
daniel mario munoz
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David!

On line 23 of file1.jsp:



This calls an action, and displays the informacion on the div (The action points to file2.jsp).

--

I dont undestand what you mean by:

Options include putting the value into a scope or creating an OGNL-scoped var.



how do I do that?
 
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
Oh, you mean by making an Ajax request to an action. That will create a new request, hence new value stack.

You may have to pass an ID (or whatever it is) in the Ajax request and process it in the action. If I understand what you're doing.
 
daniel mario munoz
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if I had something like this:



How do I pass the objetivos value inside the autores iterator?

Sorry if I insist alot!... thanks!
 
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
You'd have to pass it in via an <s:param> tag when you create the Ajax URL. If what you're trying to pass is an object (as opposed to an ID) then you'd need to pass the ID and look it up in the Ajax action.

Well, that's not entirely true--you could use <s:set> to put it into the session and access an actual object that way, maybe.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic