0

Anchor and onClick event

asked 2015-03-09 23:20:58 +0800

cotupha gravatar image cotupha
23 5

updated 2015-03-09 23:21:41 +0800

Hello!

I have an anchor which redirects the user to another page. I want to know if it possible to execute an action before the redirection takes place.

Let's suppose I need to set some information in the session before redirecting the user to the url specified in the anchor. How can I do this?

I tried using

myAnchor.addEventListener(1000, Events.ON_CLICK, new EventListener<Event>() {
    @Override
    public void onEvent(Event event) throws Exception {
        session.setAttribute("info", "some info");
    }
});

but the event is captured after the redirection has occurred.

How can I do this?

Thanks!

delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-03-09 23:20:58 +0800

Seen: 7 times

Last updated: Mar 09 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More