On submit checkbox member always null in ActionForm. Checkboxes display checked/unchecked properly o

R

runescience

Hi all:

I am populating all fields in the ActionForm, and also populating an
array of QueryResults from the data base. This bean called QueryResults
has a field on it called selected. This QueryResults bean lives in the
Actionform.

Going out to the jsp, and returning on the execute():
All the data in the ActionForm, and the nestedbean:query results is
populated properly except for one field and that is the big problem:

checkbox member: QueryResults[1-'x'].selected <i>always</i> null in
ActionForm.

Here is the code. I dont konw what to do. Any suggestions? Here is my
code:


class QueryResultsFormBean extends ActionForm {
QueryResults[] queryRes;
String jspFld1;
String jspFld2;
String jspFld3;
......

public QueryResults[] getQueryRes() {
return hatResultsList;
}
public void setQueryRes(QueryResults[] queryRes) {
this.queryRes= queryRes;
}
}



class QueryResults {
String selected;
String col1data;
String col2data;
String col3data;
}

The action execute() is pulling things out of the data base and filling
in the form data:


public class QueryInitAction extends Action {
........
QueryResultsFormBean myForm = (QueryResultsFormBean)form;
db.moveDataHelper(myForm);
}


Now when I get to the actual jsp I tried the following:


<nested:present name="QueryResultsFormBean" property="QueryResults" >
queryResults are present.
</nested:present>

<nested:iterate id="element" name="QueryResultsFormBean"
property="QueryResults" scope="session">

<nested:checkbox name="element" property="selected" />
<nested:write name="element" property="col1data" />
<nested:write name="element" property="col2data" />
</nested:iterate>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top