Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can not Invoke actionLister - DataTable of Links  RSS feed

Mike Dingham
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP page with <h:dataTable> with value as an "array of objects".
Each row of this table is defined with commandLink with defined action/actionListener method in the managed bean.

The problem is sometimes this this action is invoked and some times it
is not. Depending on how I instantiate my "array of objects" in the managedbean.

I am populating this array of objects in constructor of managed bean
by calling a service layer method. In this case JSF does not trigger
action when I click on the link. But if I create using
new Object() and add to the array (With out calling service method
some hardcoded values) it does invoke the actionListener and it behaves
exactly how I expect it should work.

I have no clue why it does not invoke in the first case?

I am using RAD6.0, IBM JSF implementation.



public class LenderGroupsBean extends PageCodeBase

//Form data
private ILenderGroupService lenderGroupService;

private LenderGroup[] lenderGroups;

private LenderGroup selectedLenderGroup;

//Binding UIComponent Instances
private HtmlDataTable lenderGroupTable;

* Constructor()
public LenderGroupsBean()
lenderGroupService = (ILenderGroupService) beanFactory

lenderGroups = lenderGroupService.getLenderGroups();

// lenderGroups = new LenderGroup[3];
// LenderGroup lg = new LenderGroup();
// lg.setName("bb");
// lenderGroups[0] = lg;
// lg = new LenderGroup();
// lg.setName("aa");
// lenderGroups[1] = lg;
// lg = new LenderGroup();
// lg.setName("cc");
// lenderGroups[2] = lg;


* @param event
public void selectLenderGroup(ActionEvent event)
LenderGroup selectedlg = (LenderGroup) lenderGroupTable.getRowData();

JSP Code:

<h:dataTable id="lgDataTable" width="750"
value="#{pc_LenderGroups.lenderGroups}" var="lenderGroup"
binding="#{pc_LenderGroups.lenderGroupTable}" border="1">
<h:column id="lgName">
<f:facet name="header">
<h:commandLink id="name" actionListener="#{pc_LenderGroups.sort}">
<hutputText styleClass="outputText" value="LenderGroup Name"
<h:commandLink styleClass="commandLink" id="link1"
<hutputText id="text2" styleClass="outputText"
[ October 06, 2006: Message edited by: Mike Dingham ]
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!