This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Displaying a link using display tag.

 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
Im using the display tag to perform pagination , and have been successfully able to implement it , however im not being able to figure out how to call a method by passing a parameter using a hyper link.
My earlier implementation was

I modified it to

However , when I now run the app , the objid is NOT being passed, and neither is the required function being called , why so ?
Any ideas?
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are doing two things here, setting a link in 'href' and telling it to go to a function. Do one thing at a time. Either go to the jsp or go to the function and submit the page.

and what do you see in the url after Main.jsp? when you use only the 'href' ?
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks for replying ,Robin.
When I use only href (the first implementation). I see that upon clicking the link I get a popup that contains the value of the parameter 'objid' in this case and then a corresponding method is called from the supporting class which uses the value of 'objid' as a parameter .However this is not happening in the second case .. Hope I'm being clear.
Thanks.
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thats because they are supposed to do different things. the 'onclick' event goes to a js function and the href goes to that url. So, did you find out what you want to do ?
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Um , okay .Please pardon my ignorance . Im a newbie to programming and this is my first with display tag. Earlier with the href i was intending to assign a link that whose onclick a hidden value in my form is set .I use this value that i recover using a servlet for further processing. Is this not possible using display tag??.
Thank you for taking the time out to reply.
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the displayColumn 'href' attribute should do the usual stuff what an anchor tag 'href' attribute can do.. so try using the anchor tag first and then try the displayColumn and in both the case see the html source.
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Robin John wrote:the displayColumn 'href' attribute should do the usual stuff what an anchor tag 'href' attribute can do.. so try using the anchor tag first and then try the displayColumn and in both the case see the html source.


Are you suggesting something like this?

EDIT :tried this and doesnt work , onclick is not recognized as a valid attribute for display:column . Any hinters on how I could implement it to suit my needs?
 
Sean Clark
Rancher
Posts: 377
Android Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

You can also create a link manually rather than using displaytag which will probably suit your needs:
I haven't tested this, but this is similar to code I was using in my last project.
Hope it helps.

Sean
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sean ,
Thank you for replying.It works now .
Im pasting the final snippet below for future reference .
.
Thanks a lot.
 
Everybody! Do the Funky Monkey! Like this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!