First of all, thanks everyone for the help so far. I do have working
code using iterator tags, but the display tags would be much nicer.
When I try your suggestion below:
String pin = (String)(pageContext.getAttribute("row")).getPin();
The compiler is telling me that getPin() is not defined for type Object....
On Mon, 7 Mar 2005 12:04:09 -0600, Brad Balmer <[EMAIL PROTECTED]> wrote:
> Off the top of my head (without using a TableDecorator, have you tried
> giving the table an id and using the id inside?
>
> <display:table name="sessionScope.ManagerLookupActionForm.managersReturned"
> id="row">
> <display:column title=" Manager: Name">
> <a
> href ="javascript:myJSFunction(${row.pin})"><c:out
> value="${row.name}"/></a>
> </display:column>
> </display:table>
>
> I don't think the above will work. I'm sure that you can do something like
> this within the <display:table> tags:
>
> <display:table name="sessionScope.ManagerLookupActionForm.managersReturned"
> id="row">
> <%
> String pin = (String)(pageContext.getAttribute("row")).getPin();
> String name = (String)(pageContext.getAttribute("row")).getName();
> %>
> <display:column title=" Manager: Name">
> <a href="#" onclick="myJSFunction('<%=pin%>')"><%=name%></a>
> </display:column>
> </display:table>
>
> It's pretty ugly, but it 'should' work.
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Nic Werner
> Sent: Monday, March 07, 2005 11:50 AM
> To: [email protected]
> Subject: Re: [displaytag-user] Javascript link in display:column...
>
> I had a similiar problem with using the href link where the data
> wouldn't change based on the row, it used the data from the first row
> only. I mentioned it here but had no response.
>
> - Nic
>
> PJ Hyett wrote:
>
> >What's the id of the table?
> >
> >
> >On Mon, 7 Mar 2005 08:59:02 -0600, Wesley Lemke <[EMAIL PROTECTED]>
> wrote:
> >
> >
> >>Sorry, the corrent code below is incorrect, I did not have the
> >>property="name" in there. This is the code that I am now using that
> >>doesn't work:
> >>
> >><display:column title=" Manager: Name"><a
> >>href="javascript:myJSFunction(${sessionScope.ManagerLookupActionForm.manag
> ersReturned.pin})">${sessionScope.ManagerLookupActionForm.managersReturned.n
> ame}</a></display:column>
> >>
> >>On Mon, 7 Mar 2005 08:43:28 -0600, Wesley Lemke <[EMAIL PROTECTED]>
> wrote:
> >>
> >>
> >>>Still no dice, it just displays
> >>>${sessionScope.ManagerLookupActionForm.managersReturned.name}
> >>>on the page, and
> >>>${sessionScope.ManagerLookupActionForm.managersReturned.pin} for the
> >>>parameter to the javascript function.
> >>>This is the tag now:
> >>>
> >>><display:column property="name" title=" Manager: Name"><a
> >>>href="javascript:myJSFunction(${sessionScope.ManagerLookupActionForm.mana
> gersReturned.pin})">${sessionScope.ManagerLookupActionForm.managersReturned.
> name}</a></display:column>
> >>>
> >>>
> >>>On Fri, 4 Mar 2005 16:32:25 -0600, PJ Hyett <[EMAIL PROTECTED]> wrote:
> >>>
> >>>
> >>>>Sorry about that, you need to remove the property="name" tag in the
> >>>>display:column. That should do the trick.
> >>>>
> >>>>-PJ
> >>>>
> >>>>On Fri, 4 Mar 2005 16:13:00 -0600, Wesley Lemke <[EMAIL PROTECTED]>
> wrote:
> >>>>
> >>>>
> >>>>>Thanks for the response. That didn't seem to work. I acted the same
> >>>>>as if the "<a
> href="javascript:myJSFunction(${listing.name})">${listing.name}</a>"
> >>>>> wasn't even there.
> >>>>>
> >>>>>Anything that I put between the <display:column></display:column> is
> >>>>>getting ignored.
> >>>>>
> >>>>>Here is the exact code I used:
> >>>>>
> >>>>><display:column property="name" title=" Manager: Name"><a
> >>>>>href="javascript:populateAccountManager(${sessionScope.ManagerLookupAct
> ionForm.managersReturned.id})">${sessionScope.ManagerLookupActionForm.manage
> rsReturned.name}</a></display:column>
> >>>>>
> >>>>>Is sessionScope.ManagerLookupActionForm.managersReturned.name the
> >>>>>correct syntax?
> >>>>>
> >>>>>This just shows the name, but it isn't even a link. Is there
> >>>>>something I'm missing?
> >>>>>
> >>>>>
> >>>>>On Fri, 4 Mar 2005 14:12:08 -0600, PJ Hyett <[EMAIL PROTECTED]> wrote:
> >>>>>
> >>>>>
> >>>>>>How about: (replace listing with whatever the real id is supposed to
> be)
> >>>>>>
> >>>>>><display:column class="listrow" property="name" title="My Title">
> >>>>>><a href="javascript:myJSFunction(${listing.name})">${listing.name}</a>
> >>>>>></display:column>
> >>>>>>
> >>>>>>-PJ
> >>>>>>
> >>>>>>
> >>>>>>On Thu, 3 Mar 2005 12:32:28 -0600, Wesley Lemke <[EMAIL PROTECTED]>
> wrote:
> >>>>>>
> >>>>>>
> >>>>>>>I am trying to call a javascript function when a user clicks on a
> link
> >>>>>>>in a <display:column> tag. Here is my current code:
> >>>>>>>
> >>>>>>><display:column href="javascript:myJSFunction()" class="listrow"
> >>>>>>>property="name" title="My Title"/>
> >>>>>>>
> >>>>>>>This much works find, but I want to pass a parameter to the function.
> >>>>>>>In this case I want it to be the ID that goes along with the Name.
> Is
> >>>>>>>there a way to do this?
> >>>>>>>
> >>>>>>>-------------------------------------------------------
> >>>>>>>SF email is sponsored by - The IT Product Guide
> >>>>>>>Read honest & candid reviews on hundreds of IT Products from real
> users.
> >>>>>>>Discover which products truly live up to the hype. Start reading now.
> >>>>>>>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> >>>>>>>_______________________________________________
> >>>>>>>displaytag-user mailing list
> >>>>>>>[email protected]
> >>>>>>>https://lists.sourceforge.net/lists/listinfo/displaytag-user
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>-------------------------------------------------------
> >>>>>>SF email is sponsored by - The IT Product Guide
> >>>>>>Read honest & candid reviews on hundreds of IT Products from real
> users.
> >>>>>>Discover which products truly live up to the hype. Start reading now.
> >>>>>>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> >>>>>>_______________________________________________
> >>>>>>displaytag-user mailing list
> >>>>>>[email protected]
> >>>>>>https://lists.sourceforge.net/lists/listinfo/displaytag-user
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>-------------------------------------------------------
> >>>>>SF email is sponsored by - The IT Product Guide
> >>>>>Read honest & candid reviews on hundreds of IT Products from real
> users.
> >>>>>Discover which products truly live up to the hype. Start reading now.
> >>>>>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> >>>>>_______________________________________________
> >>>>>displaytag-user mailing list
> >>>>>[email protected]
> >>>>>https://lists.sourceforge.net/lists/listinfo/displaytag-user
> >>>>>
> >>>>>
> >>>>>
> >>>>-------------------------------------------------------
> >>>>SF email is sponsored by - The IT Product Guide
> >>>>Read honest & candid reviews on hundreds of IT Products from real users.
> >>>>Discover which products truly live up to the hype. Start reading now.
> >>>>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> >>>>_______________________________________________
> >>>>displaytag-user mailing list
> >>>>[email protected]
> >>>>https://lists.sourceforge.net/lists/listinfo/displaytag-user
> >>>>
> >>>>
> >>>>
> >>-------------------------------------------------------
> >>SF email is sponsored by - The IT Product Guide
> >>Read honest & candid reviews on hundreds of IT Products from real users.
> >>Discover which products truly live up to the hype. Start reading now.
> >>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> >>_______________________________________________
> >>displaytag-user mailing list
> >>[email protected]
> >>https://lists.sourceforge.net/lists/listinfo/displaytag-user
> >>
> >>
> >>
> >
> >
> >-------------------------------------------------------
> >SF email is sponsored by - The IT Product Guide
> >Read honest & candid reviews on hundreds of IT Products from real users.
> >Discover which products truly live up to the hype. Start reading now.
> >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> >_______________________________________________
> >displaytag-user mailing list
> >[email protected]
> >https://lists.sourceforge.net/lists/listinfo/displaytag-user
> >
> >
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> displaytag-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> displaytag-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user