• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

UIParameter issue in HtmlDataTable

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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">
<h:outputText id="text4" styleClass="outputText" value="H No"></h:outputText>
</f:facet>
<h:outputText id="text5" styleClass="outputText"
value="#{varSESSION_COMM_ADDRESS}"></h:outputText>
</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>
<h:outputText id="text55" styleClass="outputText"
value="Delete"></h:outputText>
</h:commandLink>

</hx:columnEx>
</hx:dataTableEx>
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic