Topic
No replies
romskom1981
romskom1981
5 Posts
ACCEPTED ANSWER

Pinned topic Problem with hx:inputRowSelect

‏2012-05-05T04:07:54Z |
Hello! I create JSF 1.2 web application using WAS 8.0.4 and WAS 7.0.19.
I am trying to create JSF page for list data from database using hx:dataTableEx and JPA technology.
I am also ising hx:inputRowSelect component to get user option to select some rows.

This is my JSP Page:

<!DOCTYPE HTML PUBLIC 
"-//W3C//DTD HTML 4.01 Transitional//EN"> <%-- jsf:pagecode language=
"java" location=
"/src/pagecode/TestDataPage.java" --%><%-- /jsf:pagecode --%><%@page language=
"java" contentType=
"text/html; charset=UTF-8" pageEncoding=
"UTF-8"%> <%@taglib uri=
"http://java.sun.com/jsf/core" prefix=
"f"%> <%@taglib uri=
"http://www.ibm.com/jsf/html_extended" prefix=
"hx"%> <%@taglib uri=
"http://java.sun.com/jsf/html" prefix=
"h"%> <html> <head> <title>testDataPage</title> <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8"> <link rel=
"stylesheet" type=
"text/css" title=
"Style" href=
"${pageContext.request.contextPath}/theme/stylesheet.css"> </head> <f:view> <body> <hx:scriptCollector id=
"scriptCollector1"> <h:form styleClass=
"form" id=
"form1"> <hx:dataTableEx id=
"productList1" value=
"#{pc_TestDataPage.productList}" var=
"varproductList" styleClass=
"dataTableEx" headerClass=
"headerClass" footerClass=
"footerClass" rowClasses=
"rowClass1, rowClass2" columnClasses=
"columnClass1" border=
"0" cellpadding=
"2" cellspacing=
"0"> <hx:columnEx id=
"columnEx1"> <hx:inputRowSelect styleClass=
"inputRowSelect" id=
"rowSelect1" value=
"#{pc_TestDataPage.selected}"> <f:param value=
"#{varproductList.id}" name=
"param1" id=
"param1"></f:param> <f:param value=
"#{varproductList.defValue}" name=
"param2" id=
"param2"></f:param> </hx:inputRowSelect> <f:facet name=
"header"></f:facet> </hx:columnEx> <hx:columnEx id=
"id1column"> <f:facet name=
"header"> <h:outputText styleClass=
"outputText" value=
"Id" id=
"id1text"></h:outputText> </f:facet> <h:outputText styleClass=
"outputText" id=
"id1" value=
"#{varproductList.id}"> </h:outputText> </hx:columnEx> <hx:columnEx id=
"name1column"> <f:facet name=
"header"> <h:outputText styleClass=
"outputText" value=
"Name" id=
"name1text"></h:outputText> </f:facet> <h:outputText styleClass=
"outputText" id=
"name1" value=
"#{varproductList.name}"> </h:outputText> </hx:columnEx> <hx:columnEx id=
"defValue1column"> <f:facet name=
"header"> <h:outputText styleClass=
"outputText" value=
"DefValue" id=
"defValue1text"></h:outputText> </f:facet> <h:outputText styleClass=
"outputText" id=
"defValue1" value=
"#{varproductList.defValue}"> </h:outputText> </hx:columnEx> </hx:dataTableEx> <hx:commandExButton type=
"submit" value=
"Submit" styleClass=
"commandExButton" id=
"button1"></hx:commandExButton> </h:form>   </hx:scriptCollector> </body> </f:view> </html>


And this is field definition in my back end bean for selected array params:



protected List selected;   

public List getSelected() 
{ 

return selected; 
}   

public 

void setSelected(List selected) 
{ System.out.println(
"SetSelected " + ToStringBuilder.reflectionToString(selected)); this.selected = selected; 
}

Then i press the submit button, i have

5/5/12 9:54:28:727 YEKST 00000042 SystemOut O =====================================================================
5/5/12 9:54:28:727 YEKST 00000042 SystemOut O =====================================================================
5/5/12 9:54:28:727 YEKST 00000042 SystemOut O =====================================================================
5/5/12 9:54:28:727 YEKST 00000042 SystemOut O
BEFORE PHASE RESTORE_VIEW 1
5/5/12 9:54:28:729 YEKST 00000042 SystemOut O
AFTER PHASE RESTORE_VIEW 1
5/5/12 9:54:28:729 YEKST 00000042 SystemOut O
BEFORE PHASE APPLY_REQUEST_VALUES 2
5/5/12 9:54:28:739 YEKST 00000042 SystemOut O
AFTER PHASE APPLY_REQUEST_VALUES 2
5/5/12 9:54:28:739 YEKST 00000042 SystemOut O
BEFORE PHASE PROCESS_VALIDATIONS 3
5/5/12 9:54:28:739 YEKST 00000042 SystemOut O
AFTER PHASE PROCESS_VALIDATIONS 3
5/5/12 9:54:28:739 YEKST 00000042 SystemOut O
BEFORE PHASE UPDATE_MODEL_VALUES 4
5/5/12 9:54:28:750 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:750 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:751 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:751 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:751 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:751 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:751 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:751 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:752 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:752 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:752 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:752 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:752 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:752 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:752 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:753 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:753 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:753 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:753 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:753 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:753 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:753 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:754 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:754 YEKST 00000042 SystemOut O SetSelected <null>
5/5/12 9:54:28:754 YEKST 00000042 SystemOut O
AFTER PHASE UPDATE_MODEL_VALUES 4
5/5/12 9:54:28:754 YEKST 00000042 SystemOut O
BEFORE PHASE INVOKE_APPLICATION 5
5/5/12 9:54:28:754 YEKST 00000042 SystemOut O
AFTER PHASE INVOKE_APPLICATION 5
5/5/12 9:54:28:754 YEKST 00000042 SystemOut O
BEFORE PHASE RENDER_RESPONSE 6
5/5/12 9:54:28:770 YEKST 00000042 SystemOut O
AFTER PHASE RENDER_RESPONSE 6
5/5/12 9:54:28:770 YEKST 00000042 SystemOut O *** REQUEST END

How must i change the page code to get selected rows params?