• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to select an object on a page and set a property for it without leaving the page?  RSS feed

 
Jeff Wachhorst
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a JSP, I am iterating through a List of objects and printing out some properties of each Object as I go. Here is an example:
<c:forEach var="depFlite" items="${listOfDepartingFlights}" >
<tr>
<td>
<c ut value="${depFlite.airline}"/>
<c ut value="${depFlite.flightNo}"/>

</td>
<tr>
What I want to do is allow the user to essentially select depFlite and by doing so, save off the properties 'airline' and 'flightNo' by passing them to a

java program from this JSP. I believe I can get to the program, using the JSTL <c:url..> tag and passing the properties as parameters of that URL like so:

<c:url value="/myProgram" var="programURL">
<c aram name="airline" value="${depFlite.airline}"/>
<c aram name="flightNo" value="${depFlite.flightNo}"/>
</c:url>
<a href='<c ut value="${programURL}"/>'>

The user would click on the link that's displayed as a result of the <a href=..> tag and control would be passed to myProgram, along with the parameters

'airline' and 'flight'. My problem is this: How do I send the parameters to myProgram but NOT yet leave this page? The reason is that I need the user to

select properties of an Object from a list of returning flights before leaving this page.

I don't even know if this is possible and I'm really stuck- Any help would be GREATLY appreciated!

Thank you in advance-
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You did not include how the list of objects is created or where the objects come from and are stored.

Chances are that the objects no longer exist by the time the user gets to see the page.
[ September 30, 2005: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. It's a good idea to check the 'disable smilies' checkbox when posting code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!