Re: [Struts2] CheckBoxList returns XWorkList instead of ArrayList
Isn't XWorkList a sub-class of ArrayList? --- Jon D Cruz [EMAIL PROTECTED] wrote: I've been wracking my brains on this issue for the last day and wonder if someone out there can help. *** I'm using an ArrayListParent to populate a CheckBoxList on my JSP. *** The Parent object has an id and name field. *** I'm using an ArrayListString to retrieve the values that have been selected. *** I'm expecting to see an ArrayListString coming back, but instead a XWorkList is being returned. I've worked with Struts1 and WebWork before, and I don't remember using/seeing the XWorkList object before. I've tried using the ##-conversion.properties process, but this will only help convert the elements of the Collection. *** Is there a way to have an ArrayList returned instead of the XWorkList? I have a feeling I'm missing something basic... The code that's in the Action: // Populate the checkboxlist with these... public ListParent testList = new ArrayListParent(); public ArrayListParent testArrayList = new ArrayListParent(); // Retrieve the values selected from the form public ArrayListString valuesList = new ArrayListString(); public ArrayListString valuesArrayList = new ArrayListString(); //... Getters and Setters for the values### ... ... ... // Create the Parent objects to place in the Lists public void validate() { Parent parent1ForList = new Parent(Check 1); Parent parent2ForList = new Parent(Check 2); Parent parent3ForList = new Parent(Check 3); Parent parent1ForArrayList = new Parent(Check 1); Parent parent2ForArrayList = new Parent(Check 2); Parent parent3ForArrayList = new Parent(Check 3); testList.add(parent1ForList); testList.add(parent2ForList); testList.add(parent3ForList); testArrayList.add(parent1ForArrayList); testArrayList.add(parent2ForArrayList); testArrayList.add(parent3ForArrayList); } The code that's in the JSP: CheckBoxList created from a List: BRBR s:checkboxlist name=valuesList list=testList listKey=id listValue=name/ BRBR CheckBoxList created from a ArrayList: BRBR s:checkboxlist name=valuesArrayList list=testArrayList listKey=id listValue=name/ What I'm getting back from valueslist and valuesArrayList via getClass(): class com.opensymphony.xwork2.util.XWorkList Thanks -- View this message in context: http://www.nabble.com/-Struts2--CheckBoxList-returns-XWorkList-instead-of-ArrayList-tf4642221.html#a13259251 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Struts2] CheckBoxList returns XWorkList instead of ArrayList
I've been wracking my brains on this issue for the last day and wonder if someone out there can help. *** I'm using an ArrayListParent to populate a CheckBoxList on my JSP. *** The Parent object has an id and name field. *** I'm using an ArrayListString to retrieve the values that have been selected. *** I'm expecting to see an ArrayListString coming back, but instead a XWorkList is being returned. I've worked with Struts1 and WebWork before, and I don't remember using/seeing the XWorkList object before. I've tried using the ##-conversion.properties process, but this will only help convert the elements of the Collection. *** Is there a way to have an ArrayList returned instead of the XWorkList? I have a feeling I'm missing something basic... The code that's in the Action: // Populate the checkboxlist with these... public ListParent testList = new ArrayListParent(); public ArrayListParent testArrayList = new ArrayListParent(); // Retrieve the values selected from the form public ArrayListString valuesList = new ArrayListString(); public ArrayListString valuesArrayList = new ArrayListString(); //... Getters and Setters for the values### ... ... ... // Create the Parent objects to place in the Lists public void validate() { Parent parent1ForList = new Parent(Check 1); Parent parent2ForList = new Parent(Check 2); Parent parent3ForList = new Parent(Check 3); Parent parent1ForArrayList = new Parent(Check 1); Parent parent2ForArrayList = new Parent(Check 2); Parent parent3ForArrayList = new Parent(Check 3); testList.add(parent1ForList); testList.add(parent2ForList); testList.add(parent3ForList); testArrayList.add(parent1ForArrayList); testArrayList.add(parent2ForArrayList); testArrayList.add(parent3ForArrayList); } The code that's in the JSP: CheckBoxList created from a List: BRBR s:checkboxlist name=valuesList list=testList listKey=id listValue=name/ BRBR CheckBoxList created from a ArrayList: BRBR s:checkboxlist name=valuesArrayList list=testArrayList listKey=id listValue=name/ What I'm getting back from valueslist and valuesArrayList via getClass(): class com.opensymphony.xwork2.util.XWorkList Thanks -- View this message in context: http://www.nabble.com/-Struts2--CheckBoxList-returns-XWorkList-instead-of-ArrayList-tf4642221.html#a13259251 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Struts2] CheckBoxList returns XWorkList instead of ArrayList
yes it is.. M- Isn't XWorkList a sub-class of ArrayList? --- Jon D Cruz [EMAIL PROTECTED] wrote: I've been wracking my brains on this issue for the last day and wonder if someone out there can help. *** I'm using an ArrayListParent to populate a CheckBoxList on my JSP. *** The Parent object has an id and name field. *** I'm using an ArrayListString to retrieve the values that have been selected. *** I'm expecting to see an ArrayListString coming back, but instead a XWorkList is being returned. I've worked with Struts1 and WebWork before, and I don't remember using/seeing the XWorkList object before. I've tried using the ##-conversion.properties process, but this will only help convert the elements of the Collection. *** Is there a way to have an ArrayList returned instead of the XWorkList? I have a feeling I'm missing something basic... The code that's in the Action: // Populate the checkboxlist with these... public ListParent testList = new ArrayListParent(); public ArrayListParent testArrayList = new ArrayListParent(); // Retrieve the values selected from the form public ArrayListString valuesList = new ArrayListString(); public ArrayListString valuesArrayList = new ArrayListString(); //... Getters and Setters for the values### ... ... ... // Create the Parent objects to place in the Lists public void validate() { Parent parent1ForList = new Parent(Check 1); Parent parent2ForList = new Parent(Check 2); Parent parent3ForList = new Parent(Check 3); Parent parent1ForArrayList = new Parent(Check 1); Parent parent2ForArrayList = new Parent(Check 2); Parent parent3ForArrayList = new Parent(Check 3); testList.add(parent1ForList); testList.add(parent2ForList); testList.add(parent3ForList); testArrayList.add(parent1ForArrayList); testArrayList.add(parent2ForArrayList); testArrayList.add(parent3ForArrayList); } The code that's in the JSP: CheckBoxList created from a List: BRBR s:checkboxlist name=valuesList list=testList listKey=id listValue=name/ BRBR CheckBoxList created from a ArrayList: BRBR s:checkboxlist name=valuesArrayList list=testArrayList listKey=id listValue=name/ What I'm getting back from valueslist and valuesArrayList via getClass(): class com.opensymphony.xwork2.util.XWorkList Thanks -- View this message in context: http://www.nabble.com/-Struts2--CheckBoxList-returns-XWorkList-instead-of-Ar rayList-tf4642221.html#a13259251 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Struts2] CheckBoxList returns XWorkList instead of ArrayList
Yeah, you can chalk this one up as a duh moment for me. I'm using the Db4o object database to save my objects, and it was erroring out when I was trying to save an ArrayListString retrieved from the form, (but Struts2 was returning an XWorkList instead). Struts is just doing what it should be, and I think my Db4o code is in error. Thanks for the replies... newton.dave wrote: Isn't XWorkList a sub-class of ArrayList? --- Jon D Cruz [EMAIL PROTECTED] wrote: I've been wracking my brains on this issue for the last day and wonder if someone out there can help. *** I'm using an ArrayListParent to populate a CheckBoxList on my JSP. *** The Parent object has an id and name field. *** I'm using an ArrayListString to retrieve the values that have been selected. *** I'm expecting to see an ArrayListString coming back, but instead a XWorkList is being returned. I've worked with Struts1 and WebWork before, and I don't remember using/seeing the XWorkList object before. I've tried using the ##-conversion.properties process, but this will only help convert the elements of the Collection. *** Is there a way to have an ArrayList returned instead of the XWorkList? I have a feeling I'm missing something basic... The code that's in the Action: // Populate the checkboxlist with these... public ListParent testList = new ArrayListParent(); public ArrayListParent testArrayList = new ArrayListParent(); // Retrieve the values selected from the form public ArrayListString valuesList = new ArrayListString(); public ArrayListString valuesArrayList = new ArrayListString(); //... Getters and Setters for the values### ... ... ... // Create the Parent objects to place in the Lists public void validate() { Parent parent1ForList = new Parent(Check 1); Parent parent2ForList = new Parent(Check 2); Parent parent3ForList = new Parent(Check 3); Parent parent1ForArrayList = new Parent(Check 1); Parent parent2ForArrayList = new Parent(Check 2); Parent parent3ForArrayList = new Parent(Check 3); testList.add(parent1ForList); testList.add(parent2ForList); testList.add(parent3ForList); testArrayList.add(parent1ForArrayList); testArrayList.add(parent2ForArrayList); testArrayList.add(parent3ForArrayList); } The code that's in the JSP: CheckBoxList created from a List: BRBR s:checkboxlist name=valuesList list=testList listKey=id listValue=name/ BRBR CheckBoxList created from a ArrayList: BRBR s:checkboxlist name=valuesArrayList list=testArrayList listKey=id listValue=name/ What I'm getting back from valueslist and valuesArrayList via getClass(): class com.opensymphony.xwork2.util.XWorkList Thanks -- View this message in context: http://www.nabble.com/-Struts2--CheckBoxList-returns-XWorkList-instead-of-ArrayList-tf4642221.html#a13259251 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-Struts2--CheckBoxList-returns-XWorkList-instead-of-ArrayList-tf4642221.html#a13267284 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]