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 binding dataTable problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "binding dataTable problem" Watch "binding dataTable problem" New topic
Author

binding dataTable problem

Sarina Smith
Greenhorn

Joined: Mar 13, 2005
Posts: 4
Hi,
I have a trouble to bind the table.
1. in my main.jsp, I have <h ataTable id="table"
binding="#{myBackingBean.table}" ...>
2. In myBackingBean.java, I added:
protected HtmlDataTable table;
protected HtmlDataTable getTable() {
if (table == null) {
table = (HtmlDataTable)findComponentInRoot("table");
}
return table;
}
public void setTable(HtmlDataTable table) {
this.table = table;
}

For focusing the problem, I omitted other part of code.
When I tried to run the main.jsp, I got the error:
javax.faces.el.PropertyNotFoundException: Error getting
property 'table' from bean of type myBackingBean

I think it's binding problem.
First, I am not sure WHAT should be the "table" type. Should the type be:
HtmlDataTable or sth. else?
How to fix the problem?
Thanks a lot for your help.

Sarina
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
Your getter/setter methods should have "public" modifiers, only then your JSP would be able to access the properties.



- Varun
Sarina Smith
Greenhorn

Joined: Mar 13, 2005
Posts: 4
Thanks, varun,

I am using IBM RAD6 to developing app usinf JSF. You may know that in RAD6, the backing bean is automatically generated. For example, I have a page named main.jsp, the backing bean Main.java is generated under pageCode package.

I bind the dataTable to backing bean:
<h ataTable id="table" binding="#{pc_Main.table}" ....>
(Note: pc_Main is backing bean)
In the backing bean, protected getTable and public setTable is generated. I changed it to public, when I rebuild the project, it seems change "public" back to "protected". I said "seems" is because I am not sure---Sometime I saw it changed back to "protected", sometimes, when I rebuild the project, I just couldn't restart the project with the error:
"Publish completed with errors and/or warnings. Please see server logs for more details.
Publishing WinProject to WebSphere Application Server v6.0
Installing New Application: WinProject
[SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.net.ConnectException: Connection refused: connect; targetException=java.lang.IllegalArgumentException: Error opening socket: java.net.ConnectException: Connection refused: connect]
com.ibm.websphere.management.exception.ConnectorNotAvailableException: [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.net.ConnectException: Connection refused: connect; targetException=java.lang.IllegalArgumentException: Error opening socket: java.net.ConnectException: Connection refused: connect]
at com.ibm.ws.management.connector.soap.SOAPConnectorClient.reconnect(SOAPConnectorClient.java:328)
at com.ibm.ws.management.connector.soap.SOAPConnectorClient.invokeTemplate(SOAPConnectorClient.java:567)
at com.ibm.ws.management.connector.soap.SOAPConnectorClient.invoke(SOAPConnectorClient.java:547)
at com.ibm.ws.management.connector.soap.SOAPConnectorClient.invoke(SOAPConnectorClient.java:367)
at $Proxy11.invoke(Unknown Source)
at com.ibm.ws.management.AdminClientImpl.invoke(AdminClientImpl.java:191)
at com.ibm.ws.rd.websphere.server.WSSynchronousOperations.installApp(Unknown Source)
at com.ibm.ws.rd.websphere.server.WSAppAdminOperations.installApp(Unknown Source)
at com.ibm.ws.rd.websphere.jobs.AbstractPublishJob.installNewApplicationDefault(Unknown Source)
at com.ibm.ws.rd.websphere.jobs.J2EEProjectPublishJob.installNewApplication(Unknown Source)
at com.ibm.ws.rd.websphere.jobs.AbstractPublishJob.execute(Unknown Source)
at com.ibm.ws.rd.websphere.jobs.J2EEProjectPublishJob.execute(Unknown Source)
at com.ibm.ws.rd.websphere.jobs.AbstractWSServerJob.run(Unknown Source)
at com.ibm.ws.rd.websphere.jobs.AbstractPublishJob.run(Unknown Source)
at com.ibm.ws.rd.websphere.jobs.J2EEProjectPublishJob.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Unknown Source)
Application Failed to Install. WinProject
Please see server logs for more details."

Not sure if someone has the same problem and know the solution
Thanks for your help

Sarina
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
I use IBM WSAD, which too auto-genrate all the backing beans crap.

To remove it, I simply go to JSP page and remove the IBM's properitery tag at the top of the page which binds it to backing bean :


Do you also have suck kind of tag, try to remove it and then work. I don't think compiler should stop you from changing protected method to public.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: binding dataTable problem
 
Similar Threads
h:dataTable binding => duplicate ID
Struts-config.xml
how to find component via code?
java.lang.NumberFormatException: For input string
how to delete a row from a datatable?