This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Okay. A few days have passed since that advice was given. I am working with JSF and Java 1.6.0_14 using Netbeans 6.7.1. I am building my HtmlPanelGrid dynamically in the following way.
I have read through the JavaDocs to attempt to understand establishing the binding of ' #{itemcountbean.itemno} ' in the correct manner. I have searched dozens of sites trying to determine my error(s). Some advice was as little as 'Read the JavaDocs', but most was on binding before the JSF and/or NBs requiring use of the ValueExpression and setValueExpression. Most of the answers are 2-3 years old.
Would someone please help me in completion of binding/transferring my value from my HtmlCommandLink to be used in the backing bean?
Thank you.
rdb
Richard Blaha
Greenhorn
Joined: Dec 13, 2007
Posts: 26
posted
0
OK. Here is what I found and what works. This is complete replacement code for what I presented in the previous post. This code is simpler and easier once I learned how to do it. I learned there is a huge difference between the introductory JSF code in chapter 1 and the Integrating of Data Grids in chapter 10 of JavaServerFaces In Action (Manning C 2005). Even in reading and using these examples (the first got me facing the problem I did and the second suggested I change my method) it still did not answer the question I needed answered. I ended up copying from a previous Visual ICEFaces project I had succesfully built. The final and key answer to my question I got from a blog I found searching for 'HtmlOutputText binding'. Passing component attributes from JSF to backing beans Again I have implemented all in the following replacement code.
/**
* @return the itemHtmlOutputText
*/
public HtmlOutputText getItemHtmlOutputText() {
return itemHtmlOutputText;
}
/**
* @return the itemHtmlOutputText
*/
public String getItemHtmlOutputTextValue() {
return (String) itemHtmlOutputText.getAttributes().get("itemText");
}
/**
* @param itemHtmlOutputText the itemHtmlOutputText to set
*/
public void setitemHtmlOutputText(HtmlOutputText itemHtmlOutputText) {
this.itemHtmlOutputText = itemHtmlOutputText;
}