I have an application that uses frames. I am trying to set up a commandLink using a target frame, but the necessity is that I need to determine which frame to use based on the method in the actionListener. Is this possible?
Basically what I want to do is this:
Where target isn't determined until after the actionListener, but of course this won't work as the target is determined much earlier.
ActionListeners are overused. Their primary utility comes when you want to attach multiple actions to one command.
However, whether you employ an ActionListener or just a plain vanilla action, the value of the target AFTER all the action processing is completed should be what defines things unless I'm mistaken. So, in other words, just set the bean property in the actionListener and you should be OK.
It's one of the reasons that you code an EL value reference, rather than a static one-time expansion on original page display.
Customer surveys are for companies who didn't pay proper attention to begin with.
Joined: Apr 29, 2011
Hi Tim, thanks for replying.
I made the function "getTarget" output something and when I load the initial page it outputs the string, so the target is being set on page load and not once the action is finished processing unfortunately. That's the problem is I need to use the input from the page to determine the target, but from my testing and what I can tell the target needs to be determined on page load. That's the workaround I was hoping for.
Darn. I was afraid of that. Welcome to the Ranch, BTW!
I think you'll probably need to do an AJAX thing then. Modify the generated element right before it gets sent to the action listener rather than in the action listener, because when the action listener gets done, the client is then going to zap the current page and begin outputting the new one, losing any changes done from that point on before they can be seen and acted on.