|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
html:multibox read but not writeHi All,
I am in very strange situation, and stuck! please help, I have found one thread that much more or less but does not help.. http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704I have already use some example and it works.. Now the situation is lsightly different: I have a form: ------------ Start Code ------------
... FunctionProForm extends ActionForm {
private List
------ the serializable object FunProMap ------------------
public class FunProMap implements Serializable{
private static final long serialVersionUID = 1L;
private FunctionDto function = new FunctionDto();
private List
--------------- in JSP: -------------
--------------------- in the SaveAction ----------------------
... SaveAction extends Action {
protected ActionForward doExecute(ActionMapping mapping,
ActionForm form, HttpServletRequest request, HttpServletResponse response){
FunctionProForm myForm = (FunctionProForm) form;
...
List
------------ End Code ------------ The check boxes are populated correctly from the database, i.e. for each FUnction, the corresponding checkbos is checked according to the list of available Pros (function.pros). The problem is that if I edit these boxes, check and uncheck, and click the Submit button, the changed is not saved to the database. I have run the debug and find that the method myForm.getSelectedPros(fun) returns the old values but not the new checked-unchecked boxes' values :-( !! I have used and
and this works fine..
Please help...
houser |
|
|
Re: html:multibox read but not writeNone of the JSP code made it out of your mail client into the message
I'm afraid. Try re-posting with your mail program set for plain text instead of multipart/mime. L. houser wrote: > Hi All, > > I am in very strange situation, and stuck! please help, I have found one > thread that much more or less but does not help.. > > http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 > http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 > > I have already use some example and it works.. Now the situation is lsightly > different: > > I have a form: > > ------------ Start Code ------------ > > > .... FunctionProForm extends ActionForm { > private List functionProList = new ArrayList(); > > ... > > public List getSelectedPros(FunctionDto fun){ > > List result = new ArrayList(); > for(FunProMap fp : functionProList){ > > if(fp.getFunction().getName().equals(fun.getName())){ > > for(int i = 0; i < fp.getSelectedPros().length; i++){ > result.add(fp.getSelectedPros()[i]); > } > return result; > } > } > > return result; > } > } > > > ------ the serializable object FunProMap ------------------ > > > public class FunProMap implements Serializable{ > > private static final long serialVersionUID = 1L; > > private FunctionDto function = new FunctionDto(); > private List pros = new ArrayList(); > private String[] selectedPros = {}; > > .... > } > > > --------------- in JSP: ------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------- in the SaveAction ---------------------- > > > .... SaveAction extends Action { > protected ActionForward doExecute(ActionMapping mapping, > ActionForm form, HttpServletRequest request, > HttpServletResponse response){ > > FunctionProForm myForm = (FunctionProForm) form; > ... > > List functions = myService.listFunctions(); > > for(FunctionDto fun : functions){ > > fun.setPros(myForm.getSelectedPros(fun)); > > myService.updateFunction(fun); > } > .... > return mapping.findForward("success"); > } > } > > > ------------ End Code ------------ > > The check boxes are populated correctly from the database, i.e. for each > FUnction, the corresponding checkbos is checked according to the list of > available Pros (function.pros). > > The problem is that if I edit these boxes, check and uncheck, and click the > Submit button, the changed is not saved to the database. > > I have run the debug and find that the method myForm.getSelectedPros(fun) > returns the old values but not the new checked-unchecked boxes' values :-( > !! > > I have used with a simple form according to: > > http://www.jguru.com/faq/view.jsp?EID=925277 > http://www.jguru.com/faq/view.jsp?EID=925277 > > > MyForm extends ActionForm { > List myList; > String[] selectedValues; > // .... > } > > > and > > > > > > > > > > > > and this works fine.. > > Please help... > > ruga --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
Re: html:multibox read but not writeThanks for your reply..
I have already changed it by using tag and the JSP pieces of code are displayed.. can give it another look please? houser
|
|
|
Re: html:multibox read but not writeBy the way.. to which email address should I post my message using the email program?
is it: user@struts.apache.org? or support@nabble.com? thanks
|
|
|
Re: html:multibox read but not writeSorry, I don't see a repost with the JSP readable so there's still
nothing to take another look at :-/ L. houser wrote: > Thanks for your reply.. > I have already changed it by using tag and the JSP pieces of code are > displayed.. can give it another look please? > > houser > > Laurie Harper wrote: >> None of the JSP code made it out of your mail client into the message >> I'm afraid. Try re-posting with your mail program set for plain text >> instead of multipart/mime. >> >> L. >> >> houser wrote: >>> Hi All, >>> >>> I am in very strange situation, and stuck! please help, I have found one >>> thread that much more or less but does not help.. >>> >>> http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 >>> http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 >>> >>> I have already use some example and it works.. Now the situation is >>> lsightly >>> different: >>> >>> I have a form: >>> >>> ------------ Start Code ------------ >>> >>> >>> .... FunctionProForm extends ActionForm { >>> private List functionProList = new ArrayList(); >>> >>> ... >>> >>> public List getSelectedPros(FunctionDto fun){ >>> >>> List result = new ArrayList(); >>> for(FunProMap fp : functionProList){ >>> >>> if(fp.getFunction().getName().equals(fun.getName())){ >>> >>> for(int i = 0; i < fp.getSelectedPros().length; i++){ >>> result.add(fp.getSelectedPros()[i]); >>> } >>> return result; >>> } >>> } >>> >>> return result; >>> } >>> } >>> >>> >>> ------ the serializable object FunProMap ------------------ >>> >>> >>> public class FunProMap implements Serializable{ >>> >>> private static final long serialVersionUID = 1L; >>> >>> private FunctionDto function = new FunctionDto(); >>> private List pros = new ArrayList(); >>> private String[] selectedPros = {}; >>> >>> .... >>> } >>> >>> >>> --------------- in JSP: ------------- >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> --------------------- in the SaveAction ---------------------- >>> >>> >>> .... SaveAction extends Action { >>> protected ActionForward doExecute(ActionMapping mapping, >>> ActionForm form, HttpServletRequest request, >>> HttpServletResponse response){ >>> >>> FunctionProForm myForm = (FunctionProForm) form; >>> ... >>> >>> List functions = myService.listFunctions(); >>> >>> for(FunctionDto fun : functions){ >>> >>> fun.setPros(myForm.getSelectedPros(fun)); >>> >>> myService.updateFunction(fun); >>> } >>> .... >>> return mapping.findForward("success"); >>> } >>> } >>> >>> >>> ------------ End Code ------------ >>> >>> The check boxes are populated correctly from the database, i.e. for each >>> FUnction, the corresponding checkbos is checked according to the list of >>> available Pros (function.pros). >>> >>> The problem is that if I edit these boxes, check and uncheck, and click >>> the >>> Submit button, the changed is not saved to the database. >>> >>> I have run the debug and find that the method myForm.getSelectedPros(fun) >>> returns the old values but not the new checked-unchecked boxes' values >>> :-( >>> !! >>> >>> I have used with a simple form according to: >>> >>> http://www.jguru.com/faq/view.jsp?EID=925277 >>> http://www.jguru.com/faq/view.jsp?EID=925277 >>> >>> >>> MyForm extends ActionForm { >>> List myList; >>> String[] selectedValues; >>> // .... >>> } >>> >>> >>> and >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> and this works fine.. >>> >>> Please help... >>> >>> ruga >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@... >> For additional commands, e-mail: user-help@... >> >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
Re: html:multibox read but not writeuser@struts; support@... would be the customer support channel
for the Nabble list browser/forum system. L. houser wrote: > By the way.. to which email address should I post my message using the email > program? > is it: user@...? or support@...? > > thanks > > > Laurie Harper wrote: >> None of the JSP code made it out of your mail client into the message >> I'm afraid. Try re-posting with your mail program set for plain text >> instead of multipart/mime. >> >> L. >> >> houser wrote: >>> Hi All, >>> >>> I am in very strange situation, and stuck! please help, I have found one >>> thread that much more or less but does not help.. >>> >>> http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 >>> http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 >>> >>> I have already use some example and it works.. Now the situation is >>> lsightly >>> different: >>> >>> I have a form: >>> >>> ------------ Start Code ------------ >>> >>> >>> .... FunctionProForm extends ActionForm { >>> private List functionProList = new ArrayList(); >>> >>> ... >>> >>> public List getSelectedPros(FunctionDto fun){ >>> >>> List result = new ArrayList(); >>> for(FunProMap fp : functionProList){ >>> >>> if(fp.getFunction().getName().equals(fun.getName())){ >>> >>> for(int i = 0; i < fp.getSelectedPros().length; i++){ >>> result.add(fp.getSelectedPros()[i]); >>> } >>> return result; >>> } >>> } >>> >>> return result; >>> } >>> } >>> >>> >>> ------ the serializable object FunProMap ------------------ >>> >>> >>> public class FunProMap implements Serializable{ >>> >>> private static final long serialVersionUID = 1L; >>> >>> private FunctionDto function = new FunctionDto(); >>> private List pros = new ArrayList(); >>> private String[] selectedPros = {}; >>> >>> .... >>> } >>> >>> >>> --------------- in JSP: ------------- >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> --------------------- in the SaveAction ---------------------- >>> >>> >>> .... SaveAction extends Action { >>> protected ActionForward doExecute(ActionMapping mapping, >>> ActionForm form, HttpServletRequest request, >>> HttpServletResponse response){ >>> >>> FunctionProForm myForm = (FunctionProForm) form; >>> ... >>> >>> List functions = myService.listFunctions(); >>> >>> for(FunctionDto fun : functions){ >>> >>> fun.setPros(myForm.getSelectedPros(fun)); >>> >>> myService.updateFunction(fun); >>> } >>> .... >>> return mapping.findForward("success"); >>> } >>> } >>> >>> >>> ------------ End Code ------------ >>> >>> The check boxes are populated correctly from the database, i.e. for each >>> FUnction, the corresponding checkbos is checked according to the list of >>> available Pros (function.pros). >>> >>> The problem is that if I edit these boxes, check and uncheck, and click >>> the >>> Submit button, the changed is not saved to the database. >>> >>> I have run the debug and find that the method myForm.getSelectedPros(fun) >>> returns the old values but not the new checked-unchecked boxes' values >>> :-( >>> !! >>> >>> I have used with a simple form according to: >>> >>> http://www.jguru.com/faq/view.jsp?EID=925277 >>> http://www.jguru.com/faq/view.jsp?EID=925277 >>> >>> >>> MyForm extends ActionForm { >>> List myList; >>> String[] selectedValues; >>> // .... >>> } >>> >>> >>> and >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> and this works fine.. >>> >>> Please help... >>> >>> ruga >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@... >> For additional commands, e-mail: user-help@... >> >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
Re: html:multibox read but not writeHi Laurie,
thanks for your attempts.. I give up.. I cannot find in the help how to submit via email... I have tried.. and this is another attempt with no openning tag mark "<" .... I can see the code of this and of the original post in IE and FireFox ... --------------- in JSP: (1) ------------- table> logic:iterate id="funPro" name="funProForm" property="functionProList "> tr> td> table border="0"> tr> logic:iterate id="pro" name="funPro" property="pros"> td> html:multibox name="funPro" property="selectedPros"> bean:write name="pro" property="label" /> /html:multibox> /td> /logic:iterate> tr> /table> /td> /tr> /table> ---------- in JSP: (2) ------------ logic:iterate id="item" name="myForm" property="myList"> td> html:multibox property="selectedValues"> bean:write name="item" property="label" /> /html:multibox> /td> /logic:iterate>
|
| Free Forum Powered by Nabble | Forum Help |