BUG: CommandLinks in Portlets require stacked ActionListeners
Hello,
Okay, after hours of fustration with JSF Portlets in Java Studio Creator 2 Update 1 with Liferay I have finally figured out what the hell was going on.
The problem: Setting the ActionListener property of dynamically created links does not trigger page navigation cases.
The solution (horrible):
Simply create two method bindings to two methods:
For Example:
//an action event method binding.
rosterLinkMB = (MethodBinding) this.getApplication().createMethodBinding("#{PortletPage1.emailRoster_action}", args);
//a regular method binding
navMB = (MethodBinding) this.getApplication().createMethodBinding("#{PortletPage1.button1_action}",null);
Then, when you create the hyperlinks assign navMB to the Action property, and the rosterLinkMB to the ActionListener property.
Then, create the methods like this:
public String emailRoster_action(ActionEvent ae){
/*
* do link ID selection and logic here
*/
returnnull;//always return null.
}
public String button1_action(){
//do the navigation here.
return"someCase";
}
This way, the actionlistener will get called first then the action. You can find out what link was selected and all that and then process the navigation.
Can someone please confirm this for me? I can post a testcase if needbe.
JLS

