Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > On submit checkbox member always null in ActionForm. Checkboxes display checked/unchecked properly on jsp/struts page.

Reply
Thread Tools

On submit checkbox member always null in ActionForm. Checkboxes display checked/unchecked properly on jsp/struts page.

 
 
runescience
Guest
Posts: n/a
 
      02-23-2006
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:


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

<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>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
choosing to display or not to display a checkbox in repeater control. Imran Aziz ASP .Net 4 08-11-2005 05:00 PM
How to allow only one checkbox to be checked in a group of checkboxes moondaddy ASP .Net 4 06-22-2004 04:32 AM
How would I use qsort to sort a struct with a char* member and a long member - I want to sort in order of the long member Angus Comber C Programming 7 02-05-2004 06:41 PM
More American Graffiti: Properly Framed, Properly Scored? Scot Gardner DVD Video 0 09-02-2003 02:28 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57