File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes UIParameter issue in HtmlDataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "UIParameter issue in HtmlDataTable" Watch "UIParameter issue in HtmlDataTable" New topic
Author

UIParameter issue in HtmlDataTable

vinod perla
Greenhorn

Joined: Jan 06, 2005
Posts: 16
Hello All ,

I have a HtmlDataTable which has a HtmlCommandLink as one Column . I have issue with setting UIParameter for a HtmlCommandLink. I am generating all the components programatically(Dynamic components). I need to set UIParameter value as the value of the row of a Datatable. I have only 2 columns . One column is the toString method of the object . and the other column is the commandLink 'edit' . I need to set the UIParameter of the commandLink as the toString() of the adding object . In other words the value displayed in column 1.

I have done the following code:

HtmlDataTable htmlDataTable = new HtmlDataTable();
htmlDataTable.setId("datatable");
htmlDataTable.getChildren().clear();
htmlDataTable.setVar("dynamicItem");
ValueBinding bindingTable = this.application .createValueBinding("#{sessionScope.objName}");\
htmlDataTable.setValueBinding("value", bindingTable);

UIColumn column = new UIColumn();
HtmlOutputText htmlOutputText = new HtmlOutputText();
htmlOutputText.setValue(getSubString(sessionPath));
htmlOutputText.setId("datatableSSS");
column.setHeader(htmlOutputText);
HtmlOutputText collobjects = new HtmlOutputText();
ValueBinding bindingCol = this.application
.createValueBinding("#{dynamicItem}");
collobjects.setValueBinding("value", bindingCol);
column.getChildren().add(collobjects);
htmlDataTable.getChildren().add(column);

UIColumn editColumn = new UIColumn();
HtmlOutputText editButton = new HtmlOutputText();

editButton.setValue("Edit");
editButton.setId("datatableDDDD" );
editColumn.setHeader(editButton);

HtmlCommandLink editBtn = new HtmlCommandLink();
editBtn.setValue("Edit ");
editBtn.setId("edit" + stackPath + componentIndex++);
MethodBinding editButtonBinding = application
.createMethodBinding(
"#{pc_DynamicUIGeneration.doEditAction}",
null);
editBtn.setAction(editButtonBinding);
UIParameter parameter = new UIParameter();

parameter.setValueBinding("test",this.application
.createValueBinding("#{dynamicItem}");

editBtn.getChildren().add(parameter);
editColumn.getChildren().add(editBtn);
htmlDataTable.getChildren().add(editColumn);

The problem I am facing is at :
=======================================
UIParameter parameter = new UIParameter();

parameter.setValueBinding("test",this.application
.createValueBinding("#{dynamicItem}");
=======================================

I am getting exception as :
ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: /pages/DynamicUIGeneration.jsp. Exception thrown : javax.servlet.ServletException: Argument Error: One or more parameters are null.

Can some one help me in getting this solved please.

Thanks in advance .

Regards,
Suresh
vinod perla
Greenhorn

Joined: Jan 06, 2005
Posts: 16
Hi,

I want the java code for the following tags . This is just for clear understanding of my requirement.

Any help would be great favor for me......

<hx:dataTableEx border="1" cellpadding="2"
cellspacing="0" columnClasses="columnClass1"
headerClass="headerClass" footerClass="footerClass"
rowClasses="rowClass1, rowClass2" id="tableEx1"
styleClass="dataTableEx"
value="#{sessionScope.SESSION_COMM_ADD_LIST}"
var="varSESSION_COMM_ADDRESS"
rendered="#{! empty pc_CommAddress.addressList}">

<hx:columnEx id="column3">
<f:facet name="header">
<hutputText id="text4" styleClass="outputText" value="H No"></hutputText>
</f:facet>
<hutputText id="text5" styleClass="outputText"
value="#{varSESSION_COMM_ADDRESS}"></hutputText>
</hx:columnEx>
<hx:columnEx id="column4">
<f:facet name="header">
</f:facet>

<h:commandLink id="link2" styleClass="requestLink"
action="#{pc_CommAddress.doNameDeleteButtonAction}">
<f:param name="nameID" value="#{varSESSION_COMM_ADDRESS}"></f:param>
<hutputText id="text55" styleClass="outputText"
value="Delete"></hutputText>
</h:commandLink>

</hx:columnEx>
</hx:dataTableEx>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UIParameter issue in HtmlDataTable