You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Peter Bliznak <pb...@gmail.com> on 2010/10/26 03:16:08 UTC
checkbox problem
Hi,
I have a list over which I am iterating - it has checkbox and other fields.
I know I can define array associated with checkbox's values but that only
returns values which were checked. In my other column I have date and I have
to make that date associated with checkbox's state. How am I supposed to do
that?........Say I get five values in table and decide to check 2 of them
but array is only going to return true for 2 elements ...Is there any way I
would define collection/array for checkboxes and it would return ALL value
including those which were unchecked?...
Regards
Peter.
Re: checkbox problem
Posted by Li Ying <li...@gmail.com>.
Actually, I have tested these sample codes before I sent it to you,
and it worked very well.
If it not working on your environment, maybe something else is getting wrong.
Does any exception message appeared?
2010/10/27 Peter Bliznak <pb...@gmail.com>:
> Thanks for your time but what you show me is exactly what I was already
> doing .... but inputted changes are NOT being seen in that list when I tried
> to post it. That was my question or rather problem
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Peter Bliznak <pb...@gmail.com>.
Thanks for your time but what you show me is exactly what I was already
doing .... but inputted changes are NOT being seen in that list when I tried
to post it. That was my question or rather problem
On Tue, Oct 26, 2010 at 4:32 AM, Li Ying <li...@gmail.com> wrote:
> My way to solve this kind of problem:
>
> (1) Use a DTO class as the data modal for columns of each row.
> Every column is represented by one property of the DTO class.
>
> For example:
> public class Info {
> private boolean use;
>
> private String name;
>
> private int id;
>
> // getter and setter is omitted
> }
>
>
> (2) In the action class, use a property to represent the rows, and the
> data type of this property is List<DTO> .
>
> For example:
> private List<Info> infoList = new ArrayList<Info>();
> // getter and setter is omitted
> // initialization code is omitted
>
> (3) In JSP, use a <interator> tag on the List, to display rows for
> each DTO instance:
> For example:
> <s:iterator value="infoList" status="rowStatus">
> ID: <s:textfield name="infoList[%{#rowStatus.index}].id" />
> Name: <s:textfield name="infoList[%{#rowStatus.index}].name"
> />
> <s:checkbox label="Use"
> name="infoList[%{#rowStatus.index}].use"/>
> <br/>
> </s:iterator>
>
> The data initialized in action class will be display in your page, and
> the data inputted by user will be applied to the List<DTO> property.
>
>
> I think this is a better design, because the data modal is more
> compliant with OO principles.
>
> Hope this helps.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: checkbox problem
Posted by Dave Newton <da...@gmail.com>.
No problem! It's always a mystery until it isn't :)
Dave
On Tue, Oct 26, 2010 at 3:42 PM, Peter Bliznak <pb...@gmail.com> wrote:
> Yep, got it ... I really didn't realize that method of referring to stuff on
> OLGN stack could make such a difference.
> All works now, thanks Dave!
>
>
>
> On Tue, Oct 26, 2010 at 3:23 PM, Dave Newton <da...@gmail.com> wrote:
>
>> And I told you why you're having that problem. The difference between
>> your code ("doesn't work") and Ying's code ("does work") tells you the
>> same thing. And if you understand how things like the <s:iterator...>
>> tag work, you understand why it displays correctly, even though it
>> fails on the submit. Yes?
>>
>> Dave
>>
>> On Tue, Oct 26, 2010 at 3:12 PM, Peter Bliznak <pb...@gmail.com> wrote:
>> > In the email above I was typing fast ans made mistakes but in code I have
>> > everything OK.
>> > As I`ve said I can load list and show all records and column with
>> checkboxes
>> > is displayed correctly as well.
>> > It is only when I try to get list back after submit I have problem.
>> >
>> >
>> > On Tue, Oct 26, 2010 at 3:05 PM, Dave Newton <da...@gmail.com>
>> wrote:
>> >
>> >> Your names are wrong; if you're trying to reference a property of a
>> >> member in a list, you need to reference the list--how else would it
>> >> know what it's supposed to set? Think of OGNL names the exact same way
>> >> you'd use a Java name.
>> >>
>> >> The type conversion documentation covers this (somewhat obliquely,
>> >> IMO), as do both books you mentioned.
>> >>
>> >> Dave
>> >>
>> >> On Tue, Oct 26, 2010 at 2:36 PM, Peter Bliznak <pb...@gmail.com>
>> wrote:
>> >> > Nope........basically first line in the action is to call getter on
>> that
>> >> > list and it is already null ..... man :-(
>> >> >
>> >> > On Tue, Oct 26, 2010 at 2:33 PM, satyanarayana katta
>> >> > <sa...@gmail.com>wrote:
>> >> >
>> >> >> R u by any chance creating the new list in the action class. If so
>> it
>> >> >> won't work and u will get null.
>> >> >>
>> >> >> Sent from my iPhone
>> >> >>
>> >> >> On Oct 26, 2010, at 10:23 AM, Peter Bliznak <pb...@gmail.com>
>> wrote:
>> >> >>
>> >> >> > Opps...damn gmail.
>> >> >> >
>> >> >> > As I've said I am using pretty much same approach as it was
>> suggested
>> >> >> above
>> >> >> > by the other poster.
>> >> >> > I have list:
>> >> >> > private List<WorkOrderTask> workOrderTaskList;
>> >> >> >
>> >> >> > with getter and setter'
>> >> >> >
>> >> >> > EAch : WorkOrderTask have :
>> >> >> > Long id;
>> >> >> > boolean completed ;// checkbox
>> >> >> >
>> >> >> > with getters and setter's
>> >> >> >
>> >> >> > in jsp iterate:
>> >> >> >
>> >> >> >
>> >> >> > <s:if test="workOrderTaskList.size() > 0">
>> >> >> > <s:iterator value="workOrderTask proceList" var="task"
>> >> >> > status="assetStatus">
>> >> >> > <tr class="listRow">
>> >> >> > <td ><s:checkbox theme="simple"
>> >> name="completed"
>> >> >> > fieldValue="%{#task.completed}" /> </td>
>> >> >> > <td ><p><s:property value="strDescription"
>> >> >> > /></p></td>
>> >> >> > so on....................
>> >> >> >
>> >> >> >
>> >> >> > at this stage I can display everything - all works including
>> >> checkboxes.
>> >> >> >
>> >> >> > Problem is when I submit and trying to retrive workOrderTaskList
>> >> inside
>> >> >> my
>> >> >> > action for futher processing - list is null - and I do have
>> >> getter/setter
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > On Tue, Oct 26, 2010 at 12:20 PM, Dave Newton <
>> davelnewton@gmail.com>
>> >> >> wrote:
>> >> >> >
>> >> >> >> This question has been asked and answered quite a few times. I
>> agree
>> >> >> >> the documentation should reflect this; as we're a volunteer group
>> all
>> >> >> >> assistance is appreciated. Feel free to file a CLA and update the
>> >> docs
>> >> >> >> to accurately reflect current behavior, and add entries to the FAQ
>> if
>> >> >> >> it addresses a typical pain point.
>> >> >> >>
>> >> >> >> And my book specifically *did* address many types of best
>> practices,
>> >> >> >> but mine, like all other books, have a limited number of pages,
>> and
>> >> >> >> which information is included/excluded is not always up to the
>> >> author.
>> >> >> >>
>> >> >> >> The reason the docs for checkbox don't address this typical case
>> is
>> >> >> >> because it has nothing specifically to do with checkboxes.
>> >> >> >>
>> >> >> >> If you're having a specific issue, post your code, configuration,
>> and
>> >> >> >> Struts version, otherwise we can't really help.
>> >> >> >>
>> >> >> >> Dave
>> >> >> >>
>> >> >> >> On Tue, Oct 26, 2010 at 11:59 AM, Peter Bliznak <
>> pbliznak@gmail.com>
>> >> >> >> wrote:
>> >> >> >>> Listen I googled quite a while before I asked here and all I saw
>> was
>> >> >> sea
>> >> >> >> of
>> >> >> >>> lost souls asking same question dating back to 2007...but NOT
>> >> >> >> answers...if
>> >> >> >>> it is so simple and obvious then why docs for checkbox are not
>> >> >> mentioning
>> >> >> >>> this trivial case. ...... BTW would you please point me to the
>> site
>> >> >> where
>> >> >> >>> there is nicely organized reading on Best Struts2 Practices....I
>> >> will
>> >> >> >> truly
>> >> >> >>> appreciate it. (S2 in Action didn't mention and book written by
>> guy
>> >> >> with
>> >> >> >>> similar same like yours neither....aside from that Ive' read 3
>> >> >> >> more...guess
>> >> >> >>> what... nobody mentioned it anywhere)
>> >> >> >>>
>> >> >> >>> On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <
>> davelnewton@gmail.com
>> >> >
>> >> >> >> wrote:
>> >> >> >>>
>> >> >> >>>> Oh, I understand. Definitely agree; I think the OP just isn't
>> aware
>> >> of
>> >> >> >>>> some S2 functionality and/or best practices, that's all.
>> >> >> >>>>
>> >> >> >>>> Dave
>> >> >> >>>>
>> >> >> >>>> On Tuesday, October 26, 2010, Li Ying <liying.cn.2010@gmail.com
>> >
>> >> >> wrote:
>> >> >> >>>>> I mean:
>> >> >> >>>>>
>> >> >> >>>>> Representing associated data by a DTO class and then holding
>> DTO
>> >> >> >>>>> instances in one List
>> >> >> >>>>>
>> >> >> >>>>> is better than
>> >> >> >>>>>
>> >> >> >>>>> Holding data in several separated Lists each represent one
>> column.
>> >> >> >>>>>
>> >> >> >>>>>
>> >> >> >>>>>
>> >> >> >>>>> 2010/10/26 Dave Newton <da...@gmail.com>:
>> >> >> >>>>>> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
>> >> >> >>>>>>> I think this is a better design, because the data modal is
>> more
>> >> >> >>>>>>> compliant with OO principles.
>> >> >> >>>>>>
>> >> >> >>>>>> Better than what?
>> >> >> >>>>>>
>> >> >> >>>>>> (And as an aside, there's nothing particularly OO about what's
>> >> >> >>>>>> essentially a struct, although from a pragmatic viewpoint,
>> >> >> >>>>>> particularly when doing data transfer, sometimes such
>> constructs
>> >> >> seem
>> >> >> >>>>>> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a
>> >> brief
>> >> >> >>>>>> discussion.)
>> >> >> >>>>>>
>> >> >> >>>>>> Dave
>> >> >> >>>>>
>> >> >> >>>>>
>> >> ---------------------------------------------------------------------
>> >> >> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >> >>>>> For additional commands, e-mail: user-help@struts.apache.org
>> >> >> >>>>>
>> >> >> >>>>>
>> >> >> >>>>
>> >> >> >>>>
>> >> ---------------------------------------------------------------------
>> >> >> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >> >>>> For additional commands, e-mail: user-help@struts.apache.org
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>>
>> >> >> >>
>> >> >> >>
>> ---------------------------------------------------------------------
>> >> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >> >> For additional commands, e-mail: user-help@struts.apache.org
>> >> >> >>
>> >> >> >>
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >> For additional commands, e-mail: user-help@struts.apache.org
>> >> >>
>> >> >>
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Ashlon Hill <as...@gmail.com>.
> Dave/Peter,
>
> Was the issue resolved due to names of methods and properties not matching?
>
> Curious,
> Ashlon
>
>
> On Tue, Oct 26, 2010 at 2:42 PM, Peter Bliznak <pb...@gmail.com> wrote:
>
>> Yep, got it ... I really didn't realize that method of referring to stuff
>> on
>> OLGN stack could make such a difference.
>> All works now, thanks Dave!
>>
>>
>>
>> On Tue, Oct 26, 2010 at 3:23 PM, Dave Newton <da...@gmail.com>
>> wrote:
>>
>> > And I told you why you're having that problem. The difference between
>> > your code ("doesn't work") and Ying's code ("does work") tells you the
>> > same thing. And if you understand how things like the <s:iterator...>
>> > tag work, you understand why it displays correctly, even though it
>> > fails on the submit. Yes?
>> >
>> > Dave
>> >
>> > On Tue, Oct 26, 2010 at 3:12 PM, Peter Bliznak <pb...@gmail.com>
>> wrote:
>> > > In the email above I was typing fast ans made mistakes but in code I
>> have
>> > > everything OK.
>> > > As I`ve said I can load list and show all records and column with
>> > checkboxes
>> > > is displayed correctly as well.
>> > > It is only when I try to get list back after submit I have problem.
>> > >
>> > >
>> > > On Tue, Oct 26, 2010 at 3:05 PM, Dave Newton <da...@gmail.com>
>> > wrote:
>> > >
>> > >> Your names are wrong; if you're trying to reference a property of a
>> > >> member in a list, you need to reference the list--how else would it
>> > >> know what it's supposed to set? Think of OGNL names the exact same
>> way
>> > >> you'd use a Java name.
>> > >>
>> > >> The type conversion documentation covers this (somewhat obliquely,
>> > >> IMO), as do both books you mentioned.
>> > >>
>> > >> Dave
>> > >>
>> > >> On Tue, Oct 26, 2010 at 2:36 PM, Peter Bliznak <pb...@gmail.com>
>> > wrote:
>> > >> > Nope........basically first line in the action is to call getter on
>> > that
>> > >> > list and it is already null ..... man :-(
>> > >> >
>> > >> > On Tue, Oct 26, 2010 at 2:33 PM, satyanarayana katta
>> > >> > <sa...@gmail.com>wrote:
>> > >> >
>> > >> >> R u by any chance creating the new list in the action class. If
>> so
>> > it
>> > >> >> won't work and u will get null.
>> > >> >>
>> > >> >> Sent from my iPhone
>> > >> >>
>> > >> >> On Oct 26, 2010, at 10:23 AM, Peter Bliznak <pb...@gmail.com>
>> > wrote:
>> > >> >>
>> > >> >> > Opps...damn gmail.
>> > >> >> >
>> > >> >> > As I've said I am using pretty much same approach as it was
>> > suggested
>> > >> >> above
>> > >> >> > by the other poster.
>> > >> >> > I have list:
>> > >> >> > private List<WorkOrderTask> workOrderTaskList;
>> > >> >> >
>> > >> >> > with getter and setter'
>> > >> >> >
>> > >> >> > EAch : WorkOrderTask have :
>> > >> >> > Long id;
>> > >> >> > boolean completed ;// checkbox
>> > >> >> >
>> > >> >> > with getters and setter's
>> > >> >> >
>> > >> >> > in jsp iterate:
>> > >> >> >
>> > >> >> >
>> > >> >> > <s:if test="workOrderTaskList.size() > 0">
>> > >> >> > <s:iterator value="workOrderTask proceList"
>> var="task"
>> > >> >> > status="assetStatus">
>> > >> >> > <tr class="listRow">
>> > >> >> > <td ><s:checkbox theme="simple"
>> > >> name="completed"
>> > >> >> > fieldValue="%{#task.completed}" /> </td>
>> > >> >> > <td ><p><s:property
>> value="strDescription"
>> > >> >> > /></p></td>
>> > >> >> > so on....................
>> > >> >> >
>> > >> >> >
>> > >> >> > at this stage I can display everything - all works including
>> > >> checkboxes.
>> > >> >> >
>> > >> >> > Problem is when I submit and trying to retrive workOrderTaskList
>> > >> inside
>> > >> >> my
>> > >> >> > action for futher processing - list is null - and I do have
>> > >> getter/setter
>> > >> >> >
>> > >> >> >
>> > >> >> >
>> > >> >> >
>> > >> >> > On Tue, Oct 26, 2010 at 12:20 PM, Dave Newton <
>> > davelnewton@gmail.com>
>> > >> >> wrote:
>> > >> >> >
>> > >> >> >> This question has been asked and answered quite a few times. I
>> > agree
>> > >> >> >> the documentation should reflect this; as we're a volunteer
>> group
>> > all
>> > >> >> >> assistance is appreciated. Feel free to file a CLA and update
>> the
>> > >> docs
>> > >> >> >> to accurately reflect current behavior, and add entries to the
>> FAQ
>> > if
>> > >> >> >> it addresses a typical pain point.
>> > >> >> >>
>> > >> >> >> And my book specifically *did* address many types of best
>> > practices,
>> > >> >> >> but mine, like all other books, have a limited number of pages,
>> > and
>> > >> >> >> which information is included/excluded is not always up to the
>> > >> author.
>> > >> >> >>
>> > >> >> >> The reason the docs for checkbox don't address this typical
>> case
>> > is
>> > >> >> >> because it has nothing specifically to do with checkboxes.
>> > >> >> >>
>> > >> >> >> If you're having a specific issue, post your code,
>> configuration,
>> > and
>> > >> >> >> Struts version, otherwise we can't really help.
>> > >> >> >>
>> > >> >> >> Dave
>> > >> >> >>
>> > >> >> >> On Tue, Oct 26, 2010 at 11:59 AM, Peter Bliznak <
>> > pbliznak@gmail.com>
>> > >> >> >> wrote:
>> > >> >> >>> Listen I googled quite a while before I asked here and all I
>> saw
>> > was
>> > >> >> sea
>> > >> >> >> of
>> > >> >> >>> lost souls asking same question dating back to 2007...but NOT
>> > >> >> >> answers...if
>> > >> >> >>> it is so simple and obvious then why docs for checkbox are not
>> > >> >> mentioning
>> > >> >> >>> this trivial case. ...... BTW would you please point me to the
>> > site
>> > >> >> where
>> > >> >> >>> there is nicely organized reading on Best Struts2
>> Practices....I
>> > >> will
>> > >> >> >> truly
>> > >> >> >>> appreciate it. (S2 in Action didn't mention and book written
>> by
>> > guy
>> > >> >> with
>> > >> >> >>> similar same like yours neither....aside from that Ive' read 3
>> > >> >> >> more...guess
>> > >> >> >>> what... nobody mentioned it anywhere)
>> > >> >> >>>
>> > >> >> >>> On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <
>> > davelnewton@gmail.com
>> > >> >
>> > >> >> >> wrote:
>> > >> >> >>>
>> > >> >> >>>> Oh, I understand. Definitely agree; I think the OP just isn't
>> > aware
>> > >> of
>> > >> >> >>>> some S2 functionality and/or best practices, that's all.
>> > >> >> >>>>
>> > >> >> >>>> Dave
>> > >> >> >>>>
>> > >> >> >>>> On Tuesday, October 26, 2010, Li Ying <
>> liying.cn.2010@gmail.com
>> > >
>> > >> >> wrote:
>> > >> >> >>>>> I mean:
>> > >> >> >>>>>
>> > >> >> >>>>> Representing associated data by a DTO class and then holding
>> > DTO
>> > >> >> >>>>> instances in one List
>> > >> >> >>>>>
>> > >> >> >>>>> is better than
>> > >> >> >>>>>
>> > >> >> >>>>> Holding data in several separated Lists each represent one
>> > column.
>> > >> >> >>>>>
>> > >> >> >>>>>
>> > >> >> >>>>>
>> > >> >> >>>>> 2010/10/26 Dave Newton <da...@gmail.com>:
>> > >> >> >>>>>> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
>> > >> >> >>>>>>> I think this is a better design, because the data modal is
>> > more
>> > >> >> >>>>>>> compliant with OO principles.
>> > >> >> >>>>>>
>> > >> >> >>>>>> Better than what?
>> > >> >> >>>>>>
>> > >> >> >>>>>> (And as an aside, there's nothing particularly OO about
>> what's
>> > >> >> >>>>>> essentially a struct, although from a pragmatic viewpoint,
>> > >> >> >>>>>> particularly when doing data transfer, sometimes such
>> > constructs
>> > >> >> seem
>> > >> >> >>>>>> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for
>> a
>> > >> brief
>> > >> >> >>>>>> discussion.)
>> > >> >> >>>>>>
>> > >> >> >>>>>> Dave
>> > >> >> >>>>>
>> > >> >> >>>>>
>> > >> ---------------------------------------------------------------------
>> > >> >> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > >> >> >>>>> For additional commands, e-mail:
>> user-help@struts.apache.org
>> > >> >> >>>>>
>> > >> >> >>>>>
>> > >> >> >>>>
>> > >> >> >>>>
>> > >> ---------------------------------------------------------------------
>> > >> >> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > >> >> >>>> For additional commands, e-mail: user-help@struts.apache.org
>> > >> >> >>>>
>> > >> >> >>>>
>> > >> >> >>>
>> > >> >> >>
>> > >> >> >>
>> > ---------------------------------------------------------------------
>> > >> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > >> >> >> For additional commands, e-mail: user-help@struts.apache.org
>> > >> >> >>
>> > >> >> >>
>> > >> >>
>> > >> >>
>> ---------------------------------------------------------------------
>> > >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > >> >> For additional commands, e-mail: user-help@struts.apache.org
>> > >> >>
>> > >> >>
>> > >> >
>> > >>
>> > >> ---------------------------------------------------------------------
>> > >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > >> For additional commands, e-mail: user-help@struts.apache.org
>> > >>
>> > >>
>> > >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>>
>
>
Re: checkbox problem
Posted by Li Ying <li...@gmail.com>.
I think so.
In the final, if you want to submit any data to member of a list, the
[name] of the HTML element should be something like:
"listName[indexNumber].propertyName"
Or strust2 can not know where this parameter should be applied to.
If your code can work, the first thing should check is:
If the HTML code generated by your JSP tag is right?
If not, read the docs of tag, and check if misused.
In my sample code,
<s:textfield name="infoList[%{#rowStatus.index}].name"
<s:checkbox label="Use" name="infoList[%#rowStatus.index}].use"/>
Will display the existing data
AND also
submit inputted data back to server correctly.
Read the HTML code generated by tag, you will understand how it works.
2010/10/27 Ashlon Hill <as...@gmail.com>:
> Dave/Peter,
>
> Was the issue resolved due to names of methods and properties not matching?
>
> Curious,
> Ashlon
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Ashlon Hill <as...@gmail.com>.
Dave/Peter,
Was the issue resolved due to names of methods and properties not matching?
Curious,
Ashlon
On Tue, Oct 26, 2010 at 2:42 PM, Peter Bliznak <pb...@gmail.com> wrote:
> Yep, got it ... I really didn't realize that method of referring to stuff
> on
> OLGN stack could make such a difference.
> All works now, thanks Dave!
>
>
>
> On Tue, Oct 26, 2010 at 3:23 PM, Dave Newton <da...@gmail.com>
> wrote:
>
> > And I told you why you're having that problem. The difference between
> > your code ("doesn't work") and Ying's code ("does work") tells you the
> > same thing. And if you understand how things like the <s:iterator...>
> > tag work, you understand why it displays correctly, even though it
> > fails on the submit. Yes?
> >
> > Dave
> >
> > On Tue, Oct 26, 2010 at 3:12 PM, Peter Bliznak <pb...@gmail.com>
> wrote:
> > > In the email above I was typing fast ans made mistakes but in code I
> have
> > > everything OK.
> > > As I`ve said I can load list and show all records and column with
> > checkboxes
> > > is displayed correctly as well.
> > > It is only when I try to get list back after submit I have problem.
> > >
> > >
> > > On Tue, Oct 26, 2010 at 3:05 PM, Dave Newton <da...@gmail.com>
> > wrote:
> > >
> > >> Your names are wrong; if you're trying to reference a property of a
> > >> member in a list, you need to reference the list--how else would it
> > >> know what it's supposed to set? Think of OGNL names the exact same way
> > >> you'd use a Java name.
> > >>
> > >> The type conversion documentation covers this (somewhat obliquely,
> > >> IMO), as do both books you mentioned.
> > >>
> > >> Dave
> > >>
> > >> On Tue, Oct 26, 2010 at 2:36 PM, Peter Bliznak <pb...@gmail.com>
> > wrote:
> > >> > Nope........basically first line in the action is to call getter on
> > that
> > >> > list and it is already null ..... man :-(
> > >> >
> > >> > On Tue, Oct 26, 2010 at 2:33 PM, satyanarayana katta
> > >> > <sa...@gmail.com>wrote:
> > >> >
> > >> >> R u by any chance creating the new list in the action class. If so
> > it
> > >> >> won't work and u will get null.
> > >> >>
> > >> >> Sent from my iPhone
> > >> >>
> > >> >> On Oct 26, 2010, at 10:23 AM, Peter Bliznak <pb...@gmail.com>
> > wrote:
> > >> >>
> > >> >> > Opps...damn gmail.
> > >> >> >
> > >> >> > As I've said I am using pretty much same approach as it was
> > suggested
> > >> >> above
> > >> >> > by the other poster.
> > >> >> > I have list:
> > >> >> > private List<WorkOrderTask> workOrderTaskList;
> > >> >> >
> > >> >> > with getter and setter'
> > >> >> >
> > >> >> > EAch : WorkOrderTask have :
> > >> >> > Long id;
> > >> >> > boolean completed ;// checkbox
> > >> >> >
> > >> >> > with getters and setter's
> > >> >> >
> > >> >> > in jsp iterate:
> > >> >> >
> > >> >> >
> > >> >> > <s:if test="workOrderTaskList.size() > 0">
> > >> >> > <s:iterator value="workOrderTask proceList" var="task"
> > >> >> > status="assetStatus">
> > >> >> > <tr class="listRow">
> > >> >> > <td ><s:checkbox theme="simple"
> > >> name="completed"
> > >> >> > fieldValue="%{#task.completed}" /> </td>
> > >> >> > <td ><p><s:property value="strDescription"
> > >> >> > /></p></td>
> > >> >> > so on....................
> > >> >> >
> > >> >> >
> > >> >> > at this stage I can display everything - all works including
> > >> checkboxes.
> > >> >> >
> > >> >> > Problem is when I submit and trying to retrive workOrderTaskList
> > >> inside
> > >> >> my
> > >> >> > action for futher processing - list is null - and I do have
> > >> getter/setter
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> > On Tue, Oct 26, 2010 at 12:20 PM, Dave Newton <
> > davelnewton@gmail.com>
> > >> >> wrote:
> > >> >> >
> > >> >> >> This question has been asked and answered quite a few times. I
> > agree
> > >> >> >> the documentation should reflect this; as we're a volunteer
> group
> > all
> > >> >> >> assistance is appreciated. Feel free to file a CLA and update
> the
> > >> docs
> > >> >> >> to accurately reflect current behavior, and add entries to the
> FAQ
> > if
> > >> >> >> it addresses a typical pain point.
> > >> >> >>
> > >> >> >> And my book specifically *did* address many types of best
> > practices,
> > >> >> >> but mine, like all other books, have a limited number of pages,
> > and
> > >> >> >> which information is included/excluded is not always up to the
> > >> author.
> > >> >> >>
> > >> >> >> The reason the docs for checkbox don't address this typical case
> > is
> > >> >> >> because it has nothing specifically to do with checkboxes.
> > >> >> >>
> > >> >> >> If you're having a specific issue, post your code,
> configuration,
> > and
> > >> >> >> Struts version, otherwise we can't really help.
> > >> >> >>
> > >> >> >> Dave
> > >> >> >>
> > >> >> >> On Tue, Oct 26, 2010 at 11:59 AM, Peter Bliznak <
> > pbliznak@gmail.com>
> > >> >> >> wrote:
> > >> >> >>> Listen I googled quite a while before I asked here and all I
> saw
> > was
> > >> >> sea
> > >> >> >> of
> > >> >> >>> lost souls asking same question dating back to 2007...but NOT
> > >> >> >> answers...if
> > >> >> >>> it is so simple and obvious then why docs for checkbox are not
> > >> >> mentioning
> > >> >> >>> this trivial case. ...... BTW would you please point me to the
> > site
> > >> >> where
> > >> >> >>> there is nicely organized reading on Best Struts2
> Practices....I
> > >> will
> > >> >> >> truly
> > >> >> >>> appreciate it. (S2 in Action didn't mention and book written by
> > guy
> > >> >> with
> > >> >> >>> similar same like yours neither....aside from that Ive' read 3
> > >> >> >> more...guess
> > >> >> >>> what... nobody mentioned it anywhere)
> > >> >> >>>
> > >> >> >>> On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <
> > davelnewton@gmail.com
> > >> >
> > >> >> >> wrote:
> > >> >> >>>
> > >> >> >>>> Oh, I understand. Definitely agree; I think the OP just isn't
> > aware
> > >> of
> > >> >> >>>> some S2 functionality and/or best practices, that's all.
> > >> >> >>>>
> > >> >> >>>> Dave
> > >> >> >>>>
> > >> >> >>>> On Tuesday, October 26, 2010, Li Ying <
> liying.cn.2010@gmail.com
> > >
> > >> >> wrote:
> > >> >> >>>>> I mean:
> > >> >> >>>>>
> > >> >> >>>>> Representing associated data by a DTO class and then holding
> > DTO
> > >> >> >>>>> instances in one List
> > >> >> >>>>>
> > >> >> >>>>> is better than
> > >> >> >>>>>
> > >> >> >>>>> Holding data in several separated Lists each represent one
> > column.
> > >> >> >>>>>
> > >> >> >>>>>
> > >> >> >>>>>
> > >> >> >>>>> 2010/10/26 Dave Newton <da...@gmail.com>:
> > >> >> >>>>>> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
> > >> >> >>>>>>> I think this is a better design, because the data modal is
> > more
> > >> >> >>>>>>> compliant with OO principles.
> > >> >> >>>>>>
> > >> >> >>>>>> Better than what?
> > >> >> >>>>>>
> > >> >> >>>>>> (And as an aside, there's nothing particularly OO about
> what's
> > >> >> >>>>>> essentially a struct, although from a pragmatic viewpoint,
> > >> >> >>>>>> particularly when doing data transfer, sometimes such
> > constructs
> > >> >> seem
> > >> >> >>>>>> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a
> > >> brief
> > >> >> >>>>>> discussion.)
> > >> >> >>>>>>
> > >> >> >>>>>> Dave
> > >> >> >>>>>
> > >> >> >>>>>
> > >> ---------------------------------------------------------------------
> > >> >> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >> >> >>>>> For additional commands, e-mail: user-help@struts.apache.org
> > >> >> >>>>>
> > >> >> >>>>>
> > >> >> >>>>
> > >> >> >>>>
> > >> ---------------------------------------------------------------------
> > >> >> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >> >> >>>> For additional commands, e-mail: user-help@struts.apache.org
> > >> >> >>>>
> > >> >> >>>>
> > >> >> >>>
> > >> >> >>
> > >> >> >>
> > ---------------------------------------------------------------------
> > >> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >> >> >> For additional commands, e-mail: user-help@struts.apache.org
> > >> >> >>
> > >> >> >>
> > >> >>
> > >> >>
> ---------------------------------------------------------------------
> > >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >> >> For additional commands, e-mail: user-help@struts.apache.org
> > >> >>
> > >> >>
> > >> >
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >> For additional commands, e-mail: user-help@struts.apache.org
> > >>
> > >>
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
Re: checkbox problem
Posted by Peter Bliznak <pb...@gmail.com>.
Yep, got it ... I really didn't realize that method of referring to stuff on
OLGN stack could make such a difference.
All works now, thanks Dave!
On Tue, Oct 26, 2010 at 3:23 PM, Dave Newton <da...@gmail.com> wrote:
> And I told you why you're having that problem. The difference between
> your code ("doesn't work") and Ying's code ("does work") tells you the
> same thing. And if you understand how things like the <s:iterator...>
> tag work, you understand why it displays correctly, even though it
> fails on the submit. Yes?
>
> Dave
>
> On Tue, Oct 26, 2010 at 3:12 PM, Peter Bliznak <pb...@gmail.com> wrote:
> > In the email above I was typing fast ans made mistakes but in code I have
> > everything OK.
> > As I`ve said I can load list and show all records and column with
> checkboxes
> > is displayed correctly as well.
> > It is only when I try to get list back after submit I have problem.
> >
> >
> > On Tue, Oct 26, 2010 at 3:05 PM, Dave Newton <da...@gmail.com>
> wrote:
> >
> >> Your names are wrong; if you're trying to reference a property of a
> >> member in a list, you need to reference the list--how else would it
> >> know what it's supposed to set? Think of OGNL names the exact same way
> >> you'd use a Java name.
> >>
> >> The type conversion documentation covers this (somewhat obliquely,
> >> IMO), as do both books you mentioned.
> >>
> >> Dave
> >>
> >> On Tue, Oct 26, 2010 at 2:36 PM, Peter Bliznak <pb...@gmail.com>
> wrote:
> >> > Nope........basically first line in the action is to call getter on
> that
> >> > list and it is already null ..... man :-(
> >> >
> >> > On Tue, Oct 26, 2010 at 2:33 PM, satyanarayana katta
> >> > <sa...@gmail.com>wrote:
> >> >
> >> >> R u by any chance creating the new list in the action class. If so
> it
> >> >> won't work and u will get null.
> >> >>
> >> >> Sent from my iPhone
> >> >>
> >> >> On Oct 26, 2010, at 10:23 AM, Peter Bliznak <pb...@gmail.com>
> wrote:
> >> >>
> >> >> > Opps...damn gmail.
> >> >> >
> >> >> > As I've said I am using pretty much same approach as it was
> suggested
> >> >> above
> >> >> > by the other poster.
> >> >> > I have list:
> >> >> > private List<WorkOrderTask> workOrderTaskList;
> >> >> >
> >> >> > with getter and setter'
> >> >> >
> >> >> > EAch : WorkOrderTask have :
> >> >> > Long id;
> >> >> > boolean completed ;// checkbox
> >> >> >
> >> >> > with getters and setter's
> >> >> >
> >> >> > in jsp iterate:
> >> >> >
> >> >> >
> >> >> > <s:if test="workOrderTaskList.size() > 0">
> >> >> > <s:iterator value="workOrderTask proceList" var="task"
> >> >> > status="assetStatus">
> >> >> > <tr class="listRow">
> >> >> > <td ><s:checkbox theme="simple"
> >> name="completed"
> >> >> > fieldValue="%{#task.completed}" /> </td>
> >> >> > <td ><p><s:property value="strDescription"
> >> >> > /></p></td>
> >> >> > so on....................
> >> >> >
> >> >> >
> >> >> > at this stage I can display everything - all works including
> >> checkboxes.
> >> >> >
> >> >> > Problem is when I submit and trying to retrive workOrderTaskList
> >> inside
> >> >> my
> >> >> > action for futher processing - list is null - and I do have
> >> getter/setter
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > On Tue, Oct 26, 2010 at 12:20 PM, Dave Newton <
> davelnewton@gmail.com>
> >> >> wrote:
> >> >> >
> >> >> >> This question has been asked and answered quite a few times. I
> agree
> >> >> >> the documentation should reflect this; as we're a volunteer group
> all
> >> >> >> assistance is appreciated. Feel free to file a CLA and update the
> >> docs
> >> >> >> to accurately reflect current behavior, and add entries to the FAQ
> if
> >> >> >> it addresses a typical pain point.
> >> >> >>
> >> >> >> And my book specifically *did* address many types of best
> practices,
> >> >> >> but mine, like all other books, have a limited number of pages,
> and
> >> >> >> which information is included/excluded is not always up to the
> >> author.
> >> >> >>
> >> >> >> The reason the docs for checkbox don't address this typical case
> is
> >> >> >> because it has nothing specifically to do with checkboxes.
> >> >> >>
> >> >> >> If you're having a specific issue, post your code, configuration,
> and
> >> >> >> Struts version, otherwise we can't really help.
> >> >> >>
> >> >> >> Dave
> >> >> >>
> >> >> >> On Tue, Oct 26, 2010 at 11:59 AM, Peter Bliznak <
> pbliznak@gmail.com>
> >> >> >> wrote:
> >> >> >>> Listen I googled quite a while before I asked here and all I saw
> was
> >> >> sea
> >> >> >> of
> >> >> >>> lost souls asking same question dating back to 2007...but NOT
> >> >> >> answers...if
> >> >> >>> it is so simple and obvious then why docs for checkbox are not
> >> >> mentioning
> >> >> >>> this trivial case. ...... BTW would you please point me to the
> site
> >> >> where
> >> >> >>> there is nicely organized reading on Best Struts2 Practices....I
> >> will
> >> >> >> truly
> >> >> >>> appreciate it. (S2 in Action didn't mention and book written by
> guy
> >> >> with
> >> >> >>> similar same like yours neither....aside from that Ive' read 3
> >> >> >> more...guess
> >> >> >>> what... nobody mentioned it anywhere)
> >> >> >>>
> >> >> >>> On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <
> davelnewton@gmail.com
> >> >
> >> >> >> wrote:
> >> >> >>>
> >> >> >>>> Oh, I understand. Definitely agree; I think the OP just isn't
> aware
> >> of
> >> >> >>>> some S2 functionality and/or best practices, that's all.
> >> >> >>>>
> >> >> >>>> Dave
> >> >> >>>>
> >> >> >>>> On Tuesday, October 26, 2010, Li Ying <liying.cn.2010@gmail.com
> >
> >> >> wrote:
> >> >> >>>>> I mean:
> >> >> >>>>>
> >> >> >>>>> Representing associated data by a DTO class and then holding
> DTO
> >> >> >>>>> instances in one List
> >> >> >>>>>
> >> >> >>>>> is better than
> >> >> >>>>>
> >> >> >>>>> Holding data in several separated Lists each represent one
> column.
> >> >> >>>>>
> >> >> >>>>>
> >> >> >>>>>
> >> >> >>>>> 2010/10/26 Dave Newton <da...@gmail.com>:
> >> >> >>>>>> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
> >> >> >>>>>>> I think this is a better design, because the data modal is
> more
> >> >> >>>>>>> compliant with OO principles.
> >> >> >>>>>>
> >> >> >>>>>> Better than what?
> >> >> >>>>>>
> >> >> >>>>>> (And as an aside, there's nothing particularly OO about what's
> >> >> >>>>>> essentially a struct, although from a pragmatic viewpoint,
> >> >> >>>>>> particularly when doing data transfer, sometimes such
> constructs
> >> >> seem
> >> >> >>>>>> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a
> >> brief
> >> >> >>>>>> discussion.)
> >> >> >>>>>>
> >> >> >>>>>> Dave
> >> >> >>>>>
> >> >> >>>>>
> >> ---------------------------------------------------------------------
> >> >> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> >>>>> For additional commands, e-mail: user-help@struts.apache.org
> >> >> >>>>>
> >> >> >>>>>
> >> >> >>>>
> >> >> >>>>
> >> ---------------------------------------------------------------------
> >> >> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> >>>> For additional commands, e-mail: user-help@struts.apache.org
> >> >> >>>>
> >> >> >>>>
> >> >> >>>
> >> >> >>
> >> >> >>
> ---------------------------------------------------------------------
> >> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> >> For additional commands, e-mail: user-help@struts.apache.org
> >> >> >>
> >> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> For additional commands, e-mail: user-help@struts.apache.org
> >> >>
> >> >>
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: checkbox problem
Posted by Dave Newton <da...@gmail.com>.
And I told you why you're having that problem. The difference between
your code ("doesn't work") and Ying's code ("does work") tells you the
same thing. And if you understand how things like the <s:iterator...>
tag work, you understand why it displays correctly, even though it
fails on the submit. Yes?
Dave
On Tue, Oct 26, 2010 at 3:12 PM, Peter Bliznak <pb...@gmail.com> wrote:
> In the email above I was typing fast ans made mistakes but in code I have
> everything OK.
> As I`ve said I can load list and show all records and column with checkboxes
> is displayed correctly as well.
> It is only when I try to get list back after submit I have problem.
>
>
> On Tue, Oct 26, 2010 at 3:05 PM, Dave Newton <da...@gmail.com> wrote:
>
>> Your names are wrong; if you're trying to reference a property of a
>> member in a list, you need to reference the list--how else would it
>> know what it's supposed to set? Think of OGNL names the exact same way
>> you'd use a Java name.
>>
>> The type conversion documentation covers this (somewhat obliquely,
>> IMO), as do both books you mentioned.
>>
>> Dave
>>
>> On Tue, Oct 26, 2010 at 2:36 PM, Peter Bliznak <pb...@gmail.com> wrote:
>> > Nope........basically first line in the action is to call getter on that
>> > list and it is already null ..... man :-(
>> >
>> > On Tue, Oct 26, 2010 at 2:33 PM, satyanarayana katta
>> > <sa...@gmail.com>wrote:
>> >
>> >> R u by any chance creating the new list in the action class. If so it
>> >> won't work and u will get null.
>> >>
>> >> Sent from my iPhone
>> >>
>> >> On Oct 26, 2010, at 10:23 AM, Peter Bliznak <pb...@gmail.com> wrote:
>> >>
>> >> > Opps...damn gmail.
>> >> >
>> >> > As I've said I am using pretty much same approach as it was suggested
>> >> above
>> >> > by the other poster.
>> >> > I have list:
>> >> > private List<WorkOrderTask> workOrderTaskList;
>> >> >
>> >> > with getter and setter'
>> >> >
>> >> > EAch : WorkOrderTask have :
>> >> > Long id;
>> >> > boolean completed ;// checkbox
>> >> >
>> >> > with getters and setter's
>> >> >
>> >> > in jsp iterate:
>> >> >
>> >> >
>> >> > <s:if test="workOrderTaskList.size() > 0">
>> >> > <s:iterator value="workOrderTask proceList" var="task"
>> >> > status="assetStatus">
>> >> > <tr class="listRow">
>> >> > <td ><s:checkbox theme="simple"
>> name="completed"
>> >> > fieldValue="%{#task.completed}" /> </td>
>> >> > <td ><p><s:property value="strDescription"
>> >> > /></p></td>
>> >> > so on....................
>> >> >
>> >> >
>> >> > at this stage I can display everything - all works including
>> checkboxes.
>> >> >
>> >> > Problem is when I submit and trying to retrive workOrderTaskList
>> inside
>> >> my
>> >> > action for futher processing - list is null - and I do have
>> getter/setter
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > On Tue, Oct 26, 2010 at 12:20 PM, Dave Newton <da...@gmail.com>
>> >> wrote:
>> >> >
>> >> >> This question has been asked and answered quite a few times. I agree
>> >> >> the documentation should reflect this; as we're a volunteer group all
>> >> >> assistance is appreciated. Feel free to file a CLA and update the
>> docs
>> >> >> to accurately reflect current behavior, and add entries to the FAQ if
>> >> >> it addresses a typical pain point.
>> >> >>
>> >> >> And my book specifically *did* address many types of best practices,
>> >> >> but mine, like all other books, have a limited number of pages, and
>> >> >> which information is included/excluded is not always up to the
>> author.
>> >> >>
>> >> >> The reason the docs for checkbox don't address this typical case is
>> >> >> because it has nothing specifically to do with checkboxes.
>> >> >>
>> >> >> If you're having a specific issue, post your code, configuration, and
>> >> >> Struts version, otherwise we can't really help.
>> >> >>
>> >> >> Dave
>> >> >>
>> >> >> On Tue, Oct 26, 2010 at 11:59 AM, Peter Bliznak <pb...@gmail.com>
>> >> >> wrote:
>> >> >>> Listen I googled quite a while before I asked here and all I saw was
>> >> sea
>> >> >> of
>> >> >>> lost souls asking same question dating back to 2007...but NOT
>> >> >> answers...if
>> >> >>> it is so simple and obvious then why docs for checkbox are not
>> >> mentioning
>> >> >>> this trivial case. ...... BTW would you please point me to the site
>> >> where
>> >> >>> there is nicely organized reading on Best Struts2 Practices....I
>> will
>> >> >> truly
>> >> >>> appreciate it. (S2 in Action didn't mention and book written by guy
>> >> with
>> >> >>> similar same like yours neither....aside from that Ive' read 3
>> >> >> more...guess
>> >> >>> what... nobody mentioned it anywhere)
>> >> >>>
>> >> >>> On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <davelnewton@gmail.com
>> >
>> >> >> wrote:
>> >> >>>
>> >> >>>> Oh, I understand. Definitely agree; I think the OP just isn't aware
>> of
>> >> >>>> some S2 functionality and/or best practices, that's all.
>> >> >>>>
>> >> >>>> Dave
>> >> >>>>
>> >> >>>> On Tuesday, October 26, 2010, Li Ying <li...@gmail.com>
>> >> wrote:
>> >> >>>>> I mean:
>> >> >>>>>
>> >> >>>>> Representing associated data by a DTO class and then holding DTO
>> >> >>>>> instances in one List
>> >> >>>>>
>> >> >>>>> is better than
>> >> >>>>>
>> >> >>>>> Holding data in several separated Lists each represent one column.
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> 2010/10/26 Dave Newton <da...@gmail.com>:
>> >> >>>>>> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
>> >> >>>>>>> I think this is a better design, because the data modal is more
>> >> >>>>>>> compliant with OO principles.
>> >> >>>>>>
>> >> >>>>>> Better than what?
>> >> >>>>>>
>> >> >>>>>> (And as an aside, there's nothing particularly OO about what's
>> >> >>>>>> essentially a struct, although from a pragmatic viewpoint,
>> >> >>>>>> particularly when doing data transfer, sometimes such constructs
>> >> seem
>> >> >>>>>> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a
>> brief
>> >> >>>>>> discussion.)
>> >> >>>>>>
>> >> >>>>>> Dave
>> >> >>>>>
>> >> >>>>>
>> ---------------------------------------------------------------------
>> >> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >>>>> For additional commands, e-mail: user-help@struts.apache.org
>> >> >>>>>
>> >> >>>>>
>> >> >>>>
>> >> >>>>
>> ---------------------------------------------------------------------
>> >> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >>>> For additional commands, e-mail: user-help@struts.apache.org
>> >> >>>>
>> >> >>>>
>> >> >>>
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >> For additional commands, e-mail: user-help@struts.apache.org
>> >> >>
>> >> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Peter Bliznak <pb...@gmail.com>.
In the email above I was typing fast ans made mistakes but in code I have
everything OK.
As I`ve said I can load list and show all records and column with checkboxes
is displayed correctly as well.
It is only when I try to get list back after submit I have problem.
On Tue, Oct 26, 2010 at 3:05 PM, Dave Newton <da...@gmail.com> wrote:
> Your names are wrong; if you're trying to reference a property of a
> member in a list, you need to reference the list--how else would it
> know what it's supposed to set? Think of OGNL names the exact same way
> you'd use a Java name.
>
> The type conversion documentation covers this (somewhat obliquely,
> IMO), as do both books you mentioned.
>
> Dave
>
> On Tue, Oct 26, 2010 at 2:36 PM, Peter Bliznak <pb...@gmail.com> wrote:
> > Nope........basically first line in the action is to call getter on that
> > list and it is already null ..... man :-(
> >
> > On Tue, Oct 26, 2010 at 2:33 PM, satyanarayana katta
> > <sa...@gmail.com>wrote:
> >
> >> R u by any chance creating the new list in the action class. If so it
> >> won't work and u will get null.
> >>
> >> Sent from my iPhone
> >>
> >> On Oct 26, 2010, at 10:23 AM, Peter Bliznak <pb...@gmail.com> wrote:
> >>
> >> > Opps...damn gmail.
> >> >
> >> > As I've said I am using pretty much same approach as it was suggested
> >> above
> >> > by the other poster.
> >> > I have list:
> >> > private List<WorkOrderTask> workOrderTaskList;
> >> >
> >> > with getter and setter'
> >> >
> >> > EAch : WorkOrderTask have :
> >> > Long id;
> >> > boolean completed ;// checkbox
> >> >
> >> > with getters and setter's
> >> >
> >> > in jsp iterate:
> >> >
> >> >
> >> > <s:if test="workOrderTaskList.size() > 0">
> >> > <s:iterator value="workOrderTask proceList" var="task"
> >> > status="assetStatus">
> >> > <tr class="listRow">
> >> > <td ><s:checkbox theme="simple"
> name="completed"
> >> > fieldValue="%{#task.completed}" /> </td>
> >> > <td ><p><s:property value="strDescription"
> >> > /></p></td>
> >> > so on....................
> >> >
> >> >
> >> > at this stage I can display everything - all works including
> checkboxes.
> >> >
> >> > Problem is when I submit and trying to retrive workOrderTaskList
> inside
> >> my
> >> > action for futher processing - list is null - and I do have
> getter/setter
> >> >
> >> >
> >> >
> >> >
> >> > On Tue, Oct 26, 2010 at 12:20 PM, Dave Newton <da...@gmail.com>
> >> wrote:
> >> >
> >> >> This question has been asked and answered quite a few times. I agree
> >> >> the documentation should reflect this; as we're a volunteer group all
> >> >> assistance is appreciated. Feel free to file a CLA and update the
> docs
> >> >> to accurately reflect current behavior, and add entries to the FAQ if
> >> >> it addresses a typical pain point.
> >> >>
> >> >> And my book specifically *did* address many types of best practices,
> >> >> but mine, like all other books, have a limited number of pages, and
> >> >> which information is included/excluded is not always up to the
> author.
> >> >>
> >> >> The reason the docs for checkbox don't address this typical case is
> >> >> because it has nothing specifically to do with checkboxes.
> >> >>
> >> >> If you're having a specific issue, post your code, configuration, and
> >> >> Struts version, otherwise we can't really help.
> >> >>
> >> >> Dave
> >> >>
> >> >> On Tue, Oct 26, 2010 at 11:59 AM, Peter Bliznak <pb...@gmail.com>
> >> >> wrote:
> >> >>> Listen I googled quite a while before I asked here and all I saw was
> >> sea
> >> >> of
> >> >>> lost souls asking same question dating back to 2007...but NOT
> >> >> answers...if
> >> >>> it is so simple and obvious then why docs for checkbox are not
> >> mentioning
> >> >>> this trivial case. ...... BTW would you please point me to the site
> >> where
> >> >>> there is nicely organized reading on Best Struts2 Practices....I
> will
> >> >> truly
> >> >>> appreciate it. (S2 in Action didn't mention and book written by guy
> >> with
> >> >>> similar same like yours neither....aside from that Ive' read 3
> >> >> more...guess
> >> >>> what... nobody mentioned it anywhere)
> >> >>>
> >> >>> On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <davelnewton@gmail.com
> >
> >> >> wrote:
> >> >>>
> >> >>>> Oh, I understand. Definitely agree; I think the OP just isn't aware
> of
> >> >>>> some S2 functionality and/or best practices, that's all.
> >> >>>>
> >> >>>> Dave
> >> >>>>
> >> >>>> On Tuesday, October 26, 2010, Li Ying <li...@gmail.com>
> >> wrote:
> >> >>>>> I mean:
> >> >>>>>
> >> >>>>> Representing associated data by a DTO class and then holding DTO
> >> >>>>> instances in one List
> >> >>>>>
> >> >>>>> is better than
> >> >>>>>
> >> >>>>> Holding data in several separated Lists each represent one column.
> >> >>>>>
> >> >>>>>
> >> >>>>>
> >> >>>>> 2010/10/26 Dave Newton <da...@gmail.com>:
> >> >>>>>> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
> >> >>>>>>> I think this is a better design, because the data modal is more
> >> >>>>>>> compliant with OO principles.
> >> >>>>>>
> >> >>>>>> Better than what?
> >> >>>>>>
> >> >>>>>> (And as an aside, there's nothing particularly OO about what's
> >> >>>>>> essentially a struct, although from a pragmatic viewpoint,
> >> >>>>>> particularly when doing data transfer, sometimes such constructs
> >> seem
> >> >>>>>> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a
> brief
> >> >>>>>> discussion.)
> >> >>>>>>
> >> >>>>>> Dave
> >> >>>>>
> >> >>>>>
> ---------------------------------------------------------------------
> >> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >>>>> For additional commands, e-mail: user-help@struts.apache.org
> >> >>>>>
> >> >>>>>
> >> >>>>
> >> >>>>
> ---------------------------------------------------------------------
> >> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >>>> For additional commands, e-mail: user-help@struts.apache.org
> >> >>>>
> >> >>>>
> >> >>>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> For additional commands, e-mail: user-help@struts.apache.org
> >> >>
> >> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: checkbox problem
Posted by Dave Newton <da...@gmail.com>.
Your names are wrong; if you're trying to reference a property of a
member in a list, you need to reference the list--how else would it
know what it's supposed to set? Think of OGNL names the exact same way
you'd use a Java name.
The type conversion documentation covers this (somewhat obliquely,
IMO), as do both books you mentioned.
Dave
On Tue, Oct 26, 2010 at 2:36 PM, Peter Bliznak <pb...@gmail.com> wrote:
> Nope........basically first line in the action is to call getter on that
> list and it is already null ..... man :-(
>
> On Tue, Oct 26, 2010 at 2:33 PM, satyanarayana katta
> <sa...@gmail.com>wrote:
>
>> R u by any chance creating the new list in the action class. If so it
>> won't work and u will get null.
>>
>> Sent from my iPhone
>>
>> On Oct 26, 2010, at 10:23 AM, Peter Bliznak <pb...@gmail.com> wrote:
>>
>> > Opps...damn gmail.
>> >
>> > As I've said I am using pretty much same approach as it was suggested
>> above
>> > by the other poster.
>> > I have list:
>> > private List<WorkOrderTask> workOrderTaskList;
>> >
>> > with getter and setter'
>> >
>> > EAch : WorkOrderTask have :
>> > Long id;
>> > boolean completed ;// checkbox
>> >
>> > with getters and setter's
>> >
>> > in jsp iterate:
>> >
>> >
>> > <s:if test="workOrderTaskList.size() > 0">
>> > <s:iterator value="workOrderTask proceList" var="task"
>> > status="assetStatus">
>> > <tr class="listRow">
>> > <td ><s:checkbox theme="simple" name="completed"
>> > fieldValue="%{#task.completed}" /> </td>
>> > <td ><p><s:property value="strDescription"
>> > /></p></td>
>> > so on....................
>> >
>> >
>> > at this stage I can display everything - all works including checkboxes.
>> >
>> > Problem is when I submit and trying to retrive workOrderTaskList inside
>> my
>> > action for futher processing - list is null - and I do have getter/setter
>> >
>> >
>> >
>> >
>> > On Tue, Oct 26, 2010 at 12:20 PM, Dave Newton <da...@gmail.com>
>> wrote:
>> >
>> >> This question has been asked and answered quite a few times. I agree
>> >> the documentation should reflect this; as we're a volunteer group all
>> >> assistance is appreciated. Feel free to file a CLA and update the docs
>> >> to accurately reflect current behavior, and add entries to the FAQ if
>> >> it addresses a typical pain point.
>> >>
>> >> And my book specifically *did* address many types of best practices,
>> >> but mine, like all other books, have a limited number of pages, and
>> >> which information is included/excluded is not always up to the author.
>> >>
>> >> The reason the docs for checkbox don't address this typical case is
>> >> because it has nothing specifically to do with checkboxes.
>> >>
>> >> If you're having a specific issue, post your code, configuration, and
>> >> Struts version, otherwise we can't really help.
>> >>
>> >> Dave
>> >>
>> >> On Tue, Oct 26, 2010 at 11:59 AM, Peter Bliznak <pb...@gmail.com>
>> >> wrote:
>> >>> Listen I googled quite a while before I asked here and all I saw was
>> sea
>> >> of
>> >>> lost souls asking same question dating back to 2007...but NOT
>> >> answers...if
>> >>> it is so simple and obvious then why docs for checkbox are not
>> mentioning
>> >>> this trivial case. ...... BTW would you please point me to the site
>> where
>> >>> there is nicely organized reading on Best Struts2 Practices....I will
>> >> truly
>> >>> appreciate it. (S2 in Action didn't mention and book written by guy
>> with
>> >>> similar same like yours neither....aside from that Ive' read 3
>> >> more...guess
>> >>> what... nobody mentioned it anywhere)
>> >>>
>> >>> On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <da...@gmail.com>
>> >> wrote:
>> >>>
>> >>>> Oh, I understand. Definitely agree; I think the OP just isn't aware of
>> >>>> some S2 functionality and/or best practices, that's all.
>> >>>>
>> >>>> Dave
>> >>>>
>> >>>> On Tuesday, October 26, 2010, Li Ying <li...@gmail.com>
>> wrote:
>> >>>>> I mean:
>> >>>>>
>> >>>>> Representing associated data by a DTO class and then holding DTO
>> >>>>> instances in one List
>> >>>>>
>> >>>>> is better than
>> >>>>>
>> >>>>> Holding data in several separated Lists each represent one column.
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> 2010/10/26 Dave Newton <da...@gmail.com>:
>> >>>>>> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
>> >>>>>>> I think this is a better design, because the data modal is more
>> >>>>>>> compliant with OO principles.
>> >>>>>>
>> >>>>>> Better than what?
>> >>>>>>
>> >>>>>> (And as an aside, there's nothing particularly OO about what's
>> >>>>>> essentially a struct, although from a pragmatic viewpoint,
>> >>>>>> particularly when doing data transfer, sometimes such constructs
>> seem
>> >>>>>> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a brief
>> >>>>>> discussion.)
>> >>>>>>
>> >>>>>> Dave
>> >>>>>
>> >>>>> ---------------------------------------------------------------------
>> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >>>>> For additional commands, e-mail: user-help@struts.apache.org
>> >>>>>
>> >>>>>
>> >>>>
>> >>>> ---------------------------------------------------------------------
>> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >>>> For additional commands, e-mail: user-help@struts.apache.org
>> >>>>
>> >>>>
>> >>>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >>
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Peter Bliznak <pb...@gmail.com>.
Nope........basically first line in the action is to call getter on that
list and it is already null ..... man :-(
On Tue, Oct 26, 2010 at 2:33 PM, satyanarayana katta
<sa...@gmail.com>wrote:
> R u by any chance creating the new list in the action class. If so it
> won't work and u will get null.
>
> Sent from my iPhone
>
> On Oct 26, 2010, at 10:23 AM, Peter Bliznak <pb...@gmail.com> wrote:
>
> > Opps...damn gmail.
> >
> > As I've said I am using pretty much same approach as it was suggested
> above
> > by the other poster.
> > I have list:
> > private List<WorkOrderTask> workOrderTaskList;
> >
> > with getter and setter'
> >
> > EAch : WorkOrderTask have :
> > Long id;
> > boolean completed ;// checkbox
> >
> > with getters and setter's
> >
> > in jsp iterate:
> >
> >
> > <s:if test="workOrderTaskList.size() > 0">
> > <s:iterator value="workOrderTask proceList" var="task"
> > status="assetStatus">
> > <tr class="listRow">
> > <td ><s:checkbox theme="simple" name="completed"
> > fieldValue="%{#task.completed}" /> </td>
> > <td ><p><s:property value="strDescription"
> > /></p></td>
> > so on....................
> >
> >
> > at this stage I can display everything - all works including checkboxes.
> >
> > Problem is when I submit and trying to retrive workOrderTaskList inside
> my
> > action for futher processing - list is null - and I do have getter/setter
> >
> >
> >
> >
> > On Tue, Oct 26, 2010 at 12:20 PM, Dave Newton <da...@gmail.com>
> wrote:
> >
> >> This question has been asked and answered quite a few times. I agree
> >> the documentation should reflect this; as we're a volunteer group all
> >> assistance is appreciated. Feel free to file a CLA and update the docs
> >> to accurately reflect current behavior, and add entries to the FAQ if
> >> it addresses a typical pain point.
> >>
> >> And my book specifically *did* address many types of best practices,
> >> but mine, like all other books, have a limited number of pages, and
> >> which information is included/excluded is not always up to the author.
> >>
> >> The reason the docs for checkbox don't address this typical case is
> >> because it has nothing specifically to do with checkboxes.
> >>
> >> If you're having a specific issue, post your code, configuration, and
> >> Struts version, otherwise we can't really help.
> >>
> >> Dave
> >>
> >> On Tue, Oct 26, 2010 at 11:59 AM, Peter Bliznak <pb...@gmail.com>
> >> wrote:
> >>> Listen I googled quite a while before I asked here and all I saw was
> sea
> >> of
> >>> lost souls asking same question dating back to 2007...but NOT
> >> answers...if
> >>> it is so simple and obvious then why docs for checkbox are not
> mentioning
> >>> this trivial case. ...... BTW would you please point me to the site
> where
> >>> there is nicely organized reading on Best Struts2 Practices....I will
> >> truly
> >>> appreciate it. (S2 in Action didn't mention and book written by guy
> with
> >>> similar same like yours neither....aside from that Ive' read 3
> >> more...guess
> >>> what... nobody mentioned it anywhere)
> >>>
> >>> On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <da...@gmail.com>
> >> wrote:
> >>>
> >>>> Oh, I understand. Definitely agree; I think the OP just isn't aware of
> >>>> some S2 functionality and/or best practices, that's all.
> >>>>
> >>>> Dave
> >>>>
> >>>> On Tuesday, October 26, 2010, Li Ying <li...@gmail.com>
> wrote:
> >>>>> I mean:
> >>>>>
> >>>>> Representing associated data by a DTO class and then holding DTO
> >>>>> instances in one List
> >>>>>
> >>>>> is better than
> >>>>>
> >>>>> Holding data in several separated Lists each represent one column.
> >>>>>
> >>>>>
> >>>>>
> >>>>> 2010/10/26 Dave Newton <da...@gmail.com>:
> >>>>>> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
> >>>>>>> I think this is a better design, because the data modal is more
> >>>>>>> compliant with OO principles.
> >>>>>>
> >>>>>> Better than what?
> >>>>>>
> >>>>>> (And as an aside, there's nothing particularly OO about what's
> >>>>>> essentially a struct, although from a pragmatic viewpoint,
> >>>>>> particularly when doing data transfer, sometimes such constructs
> seem
> >>>>>> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a brief
> >>>>>> discussion.)
> >>>>>>
> >>>>>> Dave
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>>> For additional commands, e-mail: user-help@struts.apache.org
> >>>>>
> >>>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>> For additional commands, e-mail: user-help@struts.apache.org
> >>>>
> >>>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: checkbox problem
Posted by satyanarayana katta <sa...@gmail.com>.
R u by any chance creating the new list in the action class. If so it won't work and u will get null.
Sent from my iPhone
On Oct 26, 2010, at 10:23 AM, Peter Bliznak <pb...@gmail.com> wrote:
> Opps...damn gmail.
>
> As I've said I am using pretty much same approach as it was suggested above
> by the other poster.
> I have list:
> private List<WorkOrderTask> workOrderTaskList;
>
> with getter and setter'
>
> EAch : WorkOrderTask have :
> Long id;
> boolean completed ;// checkbox
>
> with getters and setter's
>
> in jsp iterate:
>
>
> <s:if test="workOrderTaskList.size() > 0">
> <s:iterator value="workOrderTask proceList" var="task"
> status="assetStatus">
> <tr class="listRow">
> <td ><s:checkbox theme="simple" name="completed"
> fieldValue="%{#task.completed}" /> </td>
> <td ><p><s:property value="strDescription"
> /></p></td>
> so on....................
>
>
> at this stage I can display everything - all works including checkboxes.
>
> Problem is when I submit and trying to retrive workOrderTaskList inside my
> action for futher processing - list is null - and I do have getter/setter
>
>
>
>
> On Tue, Oct 26, 2010 at 12:20 PM, Dave Newton <da...@gmail.com> wrote:
>
>> This question has been asked and answered quite a few times. I agree
>> the documentation should reflect this; as we're a volunteer group all
>> assistance is appreciated. Feel free to file a CLA and update the docs
>> to accurately reflect current behavior, and add entries to the FAQ if
>> it addresses a typical pain point.
>>
>> And my book specifically *did* address many types of best practices,
>> but mine, like all other books, have a limited number of pages, and
>> which information is included/excluded is not always up to the author.
>>
>> The reason the docs for checkbox don't address this typical case is
>> because it has nothing specifically to do with checkboxes.
>>
>> If you're having a specific issue, post your code, configuration, and
>> Struts version, otherwise we can't really help.
>>
>> Dave
>>
>> On Tue, Oct 26, 2010 at 11:59 AM, Peter Bliznak <pb...@gmail.com>
>> wrote:
>>> Listen I googled quite a while before I asked here and all I saw was sea
>> of
>>> lost souls asking same question dating back to 2007...but NOT
>> answers...if
>>> it is so simple and obvious then why docs for checkbox are not mentioning
>>> this trivial case. ...... BTW would you please point me to the site where
>>> there is nicely organized reading on Best Struts2 Practices....I will
>> truly
>>> appreciate it. (S2 in Action didn't mention and book written by guy with
>>> similar same like yours neither....aside from that Ive' read 3
>> more...guess
>>> what... nobody mentioned it anywhere)
>>>
>>> On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <da...@gmail.com>
>> wrote:
>>>
>>>> Oh, I understand. Definitely agree; I think the OP just isn't aware of
>>>> some S2 functionality and/or best practices, that's all.
>>>>
>>>> Dave
>>>>
>>>> On Tuesday, October 26, 2010, Li Ying <li...@gmail.com> wrote:
>>>>> I mean:
>>>>>
>>>>> Representing associated data by a DTO class and then holding DTO
>>>>> instances in one List
>>>>>
>>>>> is better than
>>>>>
>>>>> Holding data in several separated Lists each represent one column.
>>>>>
>>>>>
>>>>>
>>>>> 2010/10/26 Dave Newton <da...@gmail.com>:
>>>>>> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
>>>>>>> I think this is a better design, because the data modal is more
>>>>>>> compliant with OO principles.
>>>>>>
>>>>>> Better than what?
>>>>>>
>>>>>> (And as an aside, there's nothing particularly OO about what's
>>>>>> essentially a struct, although from a pragmatic viewpoint,
>>>>>> particularly when doing data transfer, sometimes such constructs seem
>>>>>> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a brief
>>>>>> discussion.)
>>>>>>
>>>>>> Dave
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Peter Bliznak <pb...@gmail.com>.
Opps...damn gmail.
As I've said I am using pretty much same approach as it was suggested above
by the other poster.
I have list:
private List<WorkOrderTask> workOrderTaskList;
with getter and setter'
EAch : WorkOrderTask have :
Long id;
boolean completed ;// checkbox
with getters and setter's
in jsp iterate:
<s:if test="workOrderTaskList.size() > 0">
<s:iterator value="workOrderTask proceList" var="task"
status="assetStatus">
<tr class="listRow">
<td ><s:checkbox theme="simple" name="completed"
fieldValue="%{#task.completed}" /> </td>
<td ><p><s:property value="strDescription"
/></p></td>
so on....................
at this stage I can display everything - all works including checkboxes.
Problem is when I submit and trying to retrive workOrderTaskList inside my
action for futher processing - list is null - and I do have getter/setter
On Tue, Oct 26, 2010 at 12:20 PM, Dave Newton <da...@gmail.com> wrote:
> This question has been asked and answered quite a few times. I agree
> the documentation should reflect this; as we're a volunteer group all
> assistance is appreciated. Feel free to file a CLA and update the docs
> to accurately reflect current behavior, and add entries to the FAQ if
> it addresses a typical pain point.
>
> And my book specifically *did* address many types of best practices,
> but mine, like all other books, have a limited number of pages, and
> which information is included/excluded is not always up to the author.
>
> The reason the docs for checkbox don't address this typical case is
> because it has nothing specifically to do with checkboxes.
>
> If you're having a specific issue, post your code, configuration, and
> Struts version, otherwise we can't really help.
>
> Dave
>
> On Tue, Oct 26, 2010 at 11:59 AM, Peter Bliznak <pb...@gmail.com>
> wrote:
> > Listen I googled quite a while before I asked here and all I saw was sea
> of
> > lost souls asking same question dating back to 2007...but NOT
> answers...if
> > it is so simple and obvious then why docs for checkbox are not mentioning
> > this trivial case. ...... BTW would you please point me to the site where
> > there is nicely organized reading on Best Struts2 Practices....I will
> truly
> > appreciate it. (S2 in Action didn't mention and book written by guy with
> > similar same like yours neither....aside from that Ive' read 3
> more...guess
> > what... nobody mentioned it anywhere)
> >
> > On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <da...@gmail.com>
> wrote:
> >
> >> Oh, I understand. Definitely agree; I think the OP just isn't aware of
> >> some S2 functionality and/or best practices, that's all.
> >>
> >> Dave
> >>
> >> On Tuesday, October 26, 2010, Li Ying <li...@gmail.com> wrote:
> >> > I mean:
> >> >
> >> > Representing associated data by a DTO class and then holding DTO
> >> > instances in one List
> >> >
> >> > is better than
> >> >
> >> > Holding data in several separated Lists each represent one column.
> >> >
> >> >
> >> >
> >> > 2010/10/26 Dave Newton <da...@gmail.com>:
> >> >> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
> >> >>> I think this is a better design, because the data modal is more
> >> >>> compliant with OO principles.
> >> >>
> >> >> Better than what?
> >> >>
> >> >> (And as an aside, there's nothing particularly OO about what's
> >> >> essentially a struct, although from a pragmatic viewpoint,
> >> >> particularly when doing data transfer, sometimes such constructs seem
> >> >> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a brief
> >> >> discussion.)
> >> >>
> >> >> Dave
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> > For additional commands, e-mail: user-help@struts.apache.org
> >> >
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: checkbox problem
Posted by Dave Newton <da...@gmail.com>.
On Tue, Oct 26, 2010 at 12:50 PM, Peter Bliznak wrote:
> As I've said I am using pretty much same approach as it was suggested above
> by the other poster. I have list.
Well, both Ying and I do it in a way that works, so I'd suggest
there's at least *some* difference in our approaches. Without any
further info, it's impossible to help.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Peter Bliznak <pb...@gmail.com>.
As I've said I am using pretty much same approach as it was suggested above
by the other poster.
I have list.
On Tue, Oct 26, 2010 at 12:20 PM, Dave Newton <da...@gmail.com> wrote:
> This question has been asked and answered quite a few times. I agree
> the documentation should reflect this; as we're a volunteer group all
> assistance is appreciated. Feel free to file a CLA and update the docs
> to accurately reflect current behavior, and add entries to the FAQ if
> it addresses a typical pain point.
>
> And my book specifically *did* address many types of best practices,
> but mine, like all other books, have a limited number of pages, and
> which information is included/excluded is not always up to the author.
>
> The reason the docs for checkbox don't address this typical case is
> because it has nothing specifically to do with checkboxes.
>
> If you're having a specific issue, post your code, configuration, and
> Struts version, otherwise we can't really help.
>
> Dave
>
> On Tue, Oct 26, 2010 at 11:59 AM, Peter Bliznak <pb...@gmail.com>
> wrote:
> > Listen I googled quite a while before I asked here and all I saw was sea
> of
> > lost souls asking same question dating back to 2007...but NOT
> answers...if
> > it is so simple and obvious then why docs for checkbox are not mentioning
> > this trivial case. ...... BTW would you please point me to the site where
> > there is nicely organized reading on Best Struts2 Practices....I will
> truly
> > appreciate it. (S2 in Action didn't mention and book written by guy with
> > similar same like yours neither....aside from that Ive' read 3
> more...guess
> > what... nobody mentioned it anywhere)
> >
> > On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <da...@gmail.com>
> wrote:
> >
> >> Oh, I understand. Definitely agree; I think the OP just isn't aware of
> >> some S2 functionality and/or best practices, that's all.
> >>
> >> Dave
> >>
> >> On Tuesday, October 26, 2010, Li Ying <li...@gmail.com> wrote:
> >> > I mean:
> >> >
> >> > Representing associated data by a DTO class and then holding DTO
> >> > instances in one List
> >> >
> >> > is better than
> >> >
> >> > Holding data in several separated Lists each represent one column.
> >> >
> >> >
> >> >
> >> > 2010/10/26 Dave Newton <da...@gmail.com>:
> >> >> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
> >> >>> I think this is a better design, because the data modal is more
> >> >>> compliant with OO principles.
> >> >>
> >> >> Better than what?
> >> >>
> >> >> (And as an aside, there's nothing particularly OO about what's
> >> >> essentially a struct, although from a pragmatic viewpoint,
> >> >> particularly when doing data transfer, sometimes such constructs seem
> >> >> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a brief
> >> >> discussion.)
> >> >>
> >> >> Dave
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> > For additional commands, e-mail: user-help@struts.apache.org
> >> >
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: checkbox problem
Posted by Dave Newton <da...@gmail.com>.
This question has been asked and answered quite a few times. I agree
the documentation should reflect this; as we're a volunteer group all
assistance is appreciated. Feel free to file a CLA and update the docs
to accurately reflect current behavior, and add entries to the FAQ if
it addresses a typical pain point.
And my book specifically *did* address many types of best practices,
but mine, like all other books, have a limited number of pages, and
which information is included/excluded is not always up to the author.
The reason the docs for checkbox don't address this typical case is
because it has nothing specifically to do with checkboxes.
If you're having a specific issue, post your code, configuration, and
Struts version, otherwise we can't really help.
Dave
On Tue, Oct 26, 2010 at 11:59 AM, Peter Bliznak <pb...@gmail.com> wrote:
> Listen I googled quite a while before I asked here and all I saw was sea of
> lost souls asking same question dating back to 2007...but NOT answers...if
> it is so simple and obvious then why docs for checkbox are not mentioning
> this trivial case. ...... BTW would you please point me to the site where
> there is nicely organized reading on Best Struts2 Practices....I will truly
> appreciate it. (S2 in Action didn't mention and book written by guy with
> similar same like yours neither....aside from that Ive' read 3 more...guess
> what... nobody mentioned it anywhere)
>
> On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <da...@gmail.com> wrote:
>
>> Oh, I understand. Definitely agree; I think the OP just isn't aware of
>> some S2 functionality and/or best practices, that's all.
>>
>> Dave
>>
>> On Tuesday, October 26, 2010, Li Ying <li...@gmail.com> wrote:
>> > I mean:
>> >
>> > Representing associated data by a DTO class and then holding DTO
>> > instances in one List
>> >
>> > is better than
>> >
>> > Holding data in several separated Lists each represent one column.
>> >
>> >
>> >
>> > 2010/10/26 Dave Newton <da...@gmail.com>:
>> >> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
>> >>> I think this is a better design, because the data modal is more
>> >>> compliant with OO principles.
>> >>
>> >> Better than what?
>> >>
>> >> (And as an aside, there's nothing particularly OO about what's
>> >> essentially a struct, although from a pragmatic viewpoint,
>> >> particularly when doing data transfer, sometimes such constructs seem
>> >> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a brief
>> >> discussion.)
>> >>
>> >> Dave
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Peter Bliznak <pb...@gmail.com>.
Listen I googled quite a while before I asked here and all I saw was sea of
lost souls asking same question dating back to 2007...but NOT answers...if
it is so simple and obvious then why docs for checkbox are not mentioning
this trivial case. ...... BTW would you please point me to the site where
there is nicely organized reading on Best Struts2 Practices....I will truly
appreciate it. (S2 in Action didn't mention and book written by guy with
similar same like yours neither....aside from that Ive' read 3 more...guess
what... nobody mentioned it anywhere)
On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton <da...@gmail.com> wrote:
> Oh, I understand. Definitely agree; I think the OP just isn't aware of
> some S2 functionality and/or best practices, that's all.
>
> Dave
>
> On Tuesday, October 26, 2010, Li Ying <li...@gmail.com> wrote:
> > I mean:
> >
> > Representing associated data by a DTO class and then holding DTO
> > instances in one List
> >
> > is better than
> >
> > Holding data in several separated Lists each represent one column.
> >
> >
> >
> > 2010/10/26 Dave Newton <da...@gmail.com>:
> >> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
> >>> I think this is a better design, because the data modal is more
> >>> compliant with OO principles.
> >>
> >> Better than what?
> >>
> >> (And as an aside, there's nothing particularly OO about what's
> >> essentially a struct, although from a pragmatic viewpoint,
> >> particularly when doing data transfer, sometimes such constructs seem
> >> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a brief
> >> discussion.)
> >>
> >> Dave
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: checkbox problem
Posted by Dave Newton <da...@gmail.com>.
Oh, I understand. Definitely agree; I think the OP just isn't aware of
some S2 functionality and/or best practices, that's all.
Dave
On Tuesday, October 26, 2010, Li Ying <li...@gmail.com> wrote:
> I mean:
>
> Representing associated data by a DTO class and then holding DTO
> instances in one List
>
> is better than
>
> Holding data in several separated Lists each represent one column.
>
>
>
> 2010/10/26 Dave Newton <da...@gmail.com>:
>> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
>>> I think this is a better design, because the data modal is more
>>> compliant with OO principles.
>>
>> Better than what?
>>
>> (And as an aside, there's nothing particularly OO about what's
>> essentially a struct, although from a pragmatic viewpoint,
>> particularly when doing data transfer, sometimes such constructs seem
>> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a brief
>> discussion.)
>>
>> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Li Ying <li...@gmail.com>.
I mean:
Representing associated data by a DTO class and then holding DTO
instances in one List
is better than
Holding data in several separated Lists each represent one column.
2010/10/26 Dave Newton <da...@gmail.com>:
> On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
>> I think this is a better design, because the data modal is more
>> compliant with OO principles.
>
> Better than what?
>
> (And as an aside, there's nothing particularly OO about what's
> essentially a struct, although from a pragmatic viewpoint,
> particularly when doing data transfer, sometimes such constructs seem
> reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a brief
> discussion.)
>
> Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Dave Newton <da...@gmail.com>.
On Tue, Oct 26, 2010 at 4:32 AM, Li Ying wrote:
> I think this is a better design, because the data modal is more
> compliant with OO principles.
Better than what?
(And as an aside, there's nothing particularly OO about what's
essentially a struct, although from a pragmatic viewpoint,
particularly when doing data transfer, sometimes such constructs seem
reasonable. See http://c2.com/cgi/wiki?DumbDataObject for a brief
discussion.)
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Li Ying <li...@gmail.com>.
My way to solve this kind of problem:
(1) Use a DTO class as the data modal for columns of each row.
Every column is represented by one property of the DTO class.
For example:
public class Info {
private boolean use;
private String name;
private int id;
// getter and setter is omitted
}
(2) In the action class, use a property to represent the rows, and the
data type of this property is List<DTO> .
For example:
private List<Info> infoList = new ArrayList<Info>();
// getter and setter is omitted
// initialization code is omitted
(3) In JSP, use a <interator> tag on the List, to display rows for
each DTO instance:
For example:
<s:iterator value="infoList" status="rowStatus">
ID: <s:textfield name="infoList[%{#rowStatus.index}].id" />
Name: <s:textfield name="infoList[%{#rowStatus.index}].name" />
<s:checkbox label="Use" name="infoList[%{#rowStatus.index}].use"/>
<br/>
</s:iterator>
The data initialized in action class will be display in your page, and
the data inputted by user will be applied to the List<DTO> property.
I think this is a better design, because the data modal is more
compliant with OO principles.
Hope this helps.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Peter Bliznak <pb...@gmail.com>.
Sounds good I will try it first thing in the morning.
Thank you for your time spent with me
Peter.
On Mon, Oct 25, 2010 at 10:44 PM, Dave Newton <da...@gmail.com> wrote:
> Ultimately they're all going to handle it more-or-less the same way:
> persistent state on the server, or hidden fields in the form. If the
> code is invisible to the developer, I don't see much of a difference.
>
> I also gave you another option: use a map, keyed by an ID, with an object
> value.
>
> On Monday, October 25, 2010, Peter Bliznak <pb...@gmail.com> wrote:
> > checked CheckboxInterceptor and see what it does. I guess no way around
> it
> >
> > PS as for what I checked before - that was lift and wicked..somehow I
> found
> > it friendlier but hey that might be just my opinion :-)
> >
> >
> > On Mon, Oct 25, 2010 at 10:09 PM, Dave Newton <da...@gmail.com>
> wrote:
> >
> >> Hidden parameters are the only way to get a value for an unchecked
> >> checkbox, that's just how HTML works. But yes, you're wrong; the
> >> checkbox interceptor does the work for you. Please read the
> >> documentation and just try it.
> >>
> >> Dave
> >>
> >> (Cumbersome? Compared to what?)
> >>
> >> On Monday, October 25, 2010, Peter Bliznak <pb...@gmail.com> wrote:
> >> > Sorry about "of course" we have over two dozens of s1 apps and
> evaluating
> >> if
> >> > s2 makes sense to switch to or go with something else.
> >> > And for that we have over 50 items to cover to see how difficult/easy
> it
> >> is
> >> > in s2.
> >> > I am really surprise that such a trivial task has to be done using
> hidden
> >> > parameters.
> >> > Just to be sure : you really meant to assign dynamically hidden
> parameter
> >> > values inside iterator? -- and then -- since you will end up with 2
> >> > collections to go ahead and compared them and figure out what is
> "missing
> >> in
> >> > one of them" and so to get values from the other?...I hope I am wrong
> -
> >> > sounds very cumbersome for 2010.
> >> >
> >> > On Mon, Oct 25, 2010 at 9:39 PM, Dave Newton <da...@gmail.com>
> >> wrote:
> >> >
> >> >> Same way they're generated now, with the checkbox tag, or by hand. Or
> >> use a
> >> >> map.
> >> >>
> >> >> And there's no "of course": people use both versions.
> >> >>
> >> >> Dave
> >> >>
> >> >> On Monday, October 25, 2010, Peter Bliznak <pb...@gmail.com>
> wrote:
> >> >> > Hi Dave,
> >> >> > using S2 of course.
> >> >> > not sure I am getting what you suggested. I have dynamic list and
> have
> >> no
> >> >> > idea what size is going to be (inside my jsp which was created
> prior
> >> to
> >> >> that
> >> >> > call)-- how would you then create hidden parameters dynamically?
> >> >> >
> >> >> > On Mon, Oct 25, 2010 at 9:19 PM, Dave Newton <
> davelnewton@gmail.com>
> >> >> wrote:
> >> >> >
> >> >> >> Which version of Struts?
> >> >> >>
> >> >> >> Struts 2 uses a hidden field to deal with default (unchecked)
> values.
> >> >> >> Struts 1 ActionForms used the reset() method to pre-load default
> >> >> >> values.
> >> >> >>
> >> >> >> Dave
> >> >> >>
> >> >> >> On Mon, Oct 25, 2010 at 9:16 PM, Peter Bliznak <
> pbliznak@gmail.com>
> >> >> wrote:
> >> >> >> > Hi,
> >> >> >> > I have a list over which I am iterating - it has checkbox and
> other
> >> >> >> fields.
> >> >> >> > I know I can define array associated with checkbox's values but
> >> that
> >> >> only
> >> >> >> > returns values which were checked. In my other column I have
> date
> >> and
> >> >> I
> >> >> >> have
> >> >> >> > to make that date associated with checkbox's state. How am I
> >> supposed
> >> >> to
> >> >> >> do
> >> >> >> > that?........Say I get five values in table and decide to check
> 2
> >> of
> >> >> them
> >> >> >> > but array is only going to return true for 2 elements ...Is
> there
> >> any
> >> >> way
> >> >> >> I
> >> >> >> > would define collection/array for checkboxes and it would return
> >> ALL
> >> >> >> value
> >> >> >> > including those which were unchecked?...
> >> >> >> > Regards
> >> >> >> > Peter.
> >> >> >> >
> >> >> >>
> >> >> >>
> ---------------------------------------------------------------------
> >> >> >> To unsubscribe, e-mail:
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: checkbox problem
Posted by Dave Newton <da...@gmail.com>.
Ultimately they're all going to handle it more-or-less the same way:
persistent state on the server, or hidden fields in the form. If the
code is invisible to the developer, I don't see much of a difference.
I also gave you another option: use a map, keyed by an ID, with an object value.
On Monday, October 25, 2010, Peter Bliznak <pb...@gmail.com> wrote:
> checked CheckboxInterceptor and see what it does. I guess no way around it
>
> PS as for what I checked before - that was lift and wicked..somehow I found
> it friendlier but hey that might be just my opinion :-)
>
>
> On Mon, Oct 25, 2010 at 10:09 PM, Dave Newton <da...@gmail.com> wrote:
>
>> Hidden parameters are the only way to get a value for an unchecked
>> checkbox, that's just how HTML works. But yes, you're wrong; the
>> checkbox interceptor does the work for you. Please read the
>> documentation and just try it.
>>
>> Dave
>>
>> (Cumbersome? Compared to what?)
>>
>> On Monday, October 25, 2010, Peter Bliznak <pb...@gmail.com> wrote:
>> > Sorry about "of course" we have over two dozens of s1 apps and evaluating
>> if
>> > s2 makes sense to switch to or go with something else.
>> > And for that we have over 50 items to cover to see how difficult/easy it
>> is
>> > in s2.
>> > I am really surprise that such a trivial task has to be done using hidden
>> > parameters.
>> > Just to be sure : you really meant to assign dynamically hidden parameter
>> > values inside iterator? -- and then -- since you will end up with 2
>> > collections to go ahead and compared them and figure out what is "missing
>> in
>> > one of them" and so to get values from the other?...I hope I am wrong -
>> > sounds very cumbersome for 2010.
>> >
>> > On Mon, Oct 25, 2010 at 9:39 PM, Dave Newton <da...@gmail.com>
>> wrote:
>> >
>> >> Same way they're generated now, with the checkbox tag, or by hand. Or
>> use a
>> >> map.
>> >>
>> >> And there's no "of course": people use both versions.
>> >>
>> >> Dave
>> >>
>> >> On Monday, October 25, 2010, Peter Bliznak <pb...@gmail.com> wrote:
>> >> > Hi Dave,
>> >> > using S2 of course.
>> >> > not sure I am getting what you suggested. I have dynamic list and have
>> no
>> >> > idea what size is going to be (inside my jsp which was created prior
>> to
>> >> that
>> >> > call)-- how would you then create hidden parameters dynamically?
>> >> >
>> >> > On Mon, Oct 25, 2010 at 9:19 PM, Dave Newton <da...@gmail.com>
>> >> wrote:
>> >> >
>> >> >> Which version of Struts?
>> >> >>
>> >> >> Struts 2 uses a hidden field to deal with default (unchecked) values.
>> >> >> Struts 1 ActionForms used the reset() method to pre-load default
>> >> >> values.
>> >> >>
>> >> >> Dave
>> >> >>
>> >> >> On Mon, Oct 25, 2010 at 9:16 PM, Peter Bliznak <pb...@gmail.com>
>> >> wrote:
>> >> >> > Hi,
>> >> >> > I have a list over which I am iterating - it has checkbox and other
>> >> >> fields.
>> >> >> > I know I can define array associated with checkbox's values but
>> that
>> >> only
>> >> >> > returns values which were checked. In my other column I have date
>> and
>> >> I
>> >> >> have
>> >> >> > to make that date associated with checkbox's state. How am I
>> supposed
>> >> to
>> >> >> do
>> >> >> > that?........Say I get five values in table and decide to check 2
>> of
>> >> them
>> >> >> > but array is only going to return true for 2 elements ...Is there
>> any
>> >> way
>> >> >> I
>> >> >> > would define collection/array for checkboxes and it would return
>> ALL
>> >> >> value
>> >> >> > including those which were unchecked?...
>> >> >> > Regards
>> >> >> > Peter.
>> >> >> >
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail:
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Peter Bliznak <pb...@gmail.com>.
checked CheckboxInterceptor and see what it does. I guess no way around it
PS as for what I checked before - that was lift and wicked..somehow I found
it friendlier but hey that might be just my opinion :-)
On Mon, Oct 25, 2010 at 10:09 PM, Dave Newton <da...@gmail.com> wrote:
> Hidden parameters are the only way to get a value for an unchecked
> checkbox, that's just how HTML works. But yes, you're wrong; the
> checkbox interceptor does the work for you. Please read the
> documentation and just try it.
>
> Dave
>
> (Cumbersome? Compared to what?)
>
> On Monday, October 25, 2010, Peter Bliznak <pb...@gmail.com> wrote:
> > Sorry about "of course" we have over two dozens of s1 apps and evaluating
> if
> > s2 makes sense to switch to or go with something else.
> > And for that we have over 50 items to cover to see how difficult/easy it
> is
> > in s2.
> > I am really surprise that such a trivial task has to be done using hidden
> > parameters.
> > Just to be sure : you really meant to assign dynamically hidden parameter
> > values inside iterator? -- and then -- since you will end up with 2
> > collections to go ahead and compared them and figure out what is "missing
> in
> > one of them" and so to get values from the other?...I hope I am wrong -
> > sounds very cumbersome for 2010.
> >
> > On Mon, Oct 25, 2010 at 9:39 PM, Dave Newton <da...@gmail.com>
> wrote:
> >
> >> Same way they're generated now, with the checkbox tag, or by hand. Or
> use a
> >> map.
> >>
> >> And there's no "of course": people use both versions.
> >>
> >> Dave
> >>
> >> On Monday, October 25, 2010, Peter Bliznak <pb...@gmail.com> wrote:
> >> > Hi Dave,
> >> > using S2 of course.
> >> > not sure I am getting what you suggested. I have dynamic list and have
> no
> >> > idea what size is going to be (inside my jsp which was created prior
> to
> >> that
> >> > call)-- how would you then create hidden parameters dynamically?
> >> >
> >> > On Mon, Oct 25, 2010 at 9:19 PM, Dave Newton <da...@gmail.com>
> >> wrote:
> >> >
> >> >> Which version of Struts?
> >> >>
> >> >> Struts 2 uses a hidden field to deal with default (unchecked) values.
> >> >> Struts 1 ActionForms used the reset() method to pre-load default
> >> >> values.
> >> >>
> >> >> Dave
> >> >>
> >> >> On Mon, Oct 25, 2010 at 9:16 PM, Peter Bliznak <pb...@gmail.com>
> >> wrote:
> >> >> > Hi,
> >> >> > I have a list over which I am iterating - it has checkbox and other
> >> >> fields.
> >> >> > I know I can define array associated with checkbox's values but
> that
> >> only
> >> >> > returns values which were checked. In my other column I have date
> and
> >> I
> >> >> have
> >> >> > to make that date associated with checkbox's state. How am I
> supposed
> >> to
> >> >> do
> >> >> > that?........Say I get five values in table and decide to check 2
> of
> >> them
> >> >> > but array is only going to return true for 2 elements ...Is there
> any
> >> way
> >> >> I
> >> >> > would define collection/array for checkboxes and it would return
> ALL
> >> >> value
> >> >> > including those which were unchecked?...
> >> >> > Regards
> >> >> > Peter.
> >> >> >
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> For additional commands, e-mail: user-help@struts.apache.org
> >> >>
> >> >>
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: checkbox problem
Posted by Dave Newton <da...@gmail.com>.
Hidden parameters are the only way to get a value for an unchecked
checkbox, that's just how HTML works. But yes, you're wrong; the
checkbox interceptor does the work for you. Please read the
documentation and just try it.
Dave
(Cumbersome? Compared to what?)
On Monday, October 25, 2010, Peter Bliznak <pb...@gmail.com> wrote:
> Sorry about "of course" we have over two dozens of s1 apps and evaluating if
> s2 makes sense to switch to or go with something else.
> And for that we have over 50 items to cover to see how difficult/easy it is
> in s2.
> I am really surprise that such a trivial task has to be done using hidden
> parameters.
> Just to be sure : you really meant to assign dynamically hidden parameter
> values inside iterator? -- and then -- since you will end up with 2
> collections to go ahead and compared them and figure out what is "missing in
> one of them" and so to get values from the other?...I hope I am wrong -
> sounds very cumbersome for 2010.
>
> On Mon, Oct 25, 2010 at 9:39 PM, Dave Newton <da...@gmail.com> wrote:
>
>> Same way they're generated now, with the checkbox tag, or by hand. Or use a
>> map.
>>
>> And there's no "of course": people use both versions.
>>
>> Dave
>>
>> On Monday, October 25, 2010, Peter Bliznak <pb...@gmail.com> wrote:
>> > Hi Dave,
>> > using S2 of course.
>> > not sure I am getting what you suggested. I have dynamic list and have no
>> > idea what size is going to be (inside my jsp which was created prior to
>> that
>> > call)-- how would you then create hidden parameters dynamically?
>> >
>> > On Mon, Oct 25, 2010 at 9:19 PM, Dave Newton <da...@gmail.com>
>> wrote:
>> >
>> >> Which version of Struts?
>> >>
>> >> Struts 2 uses a hidden field to deal with default (unchecked) values.
>> >> Struts 1 ActionForms used the reset() method to pre-load default
>> >> values.
>> >>
>> >> Dave
>> >>
>> >> On Mon, Oct 25, 2010 at 9:16 PM, Peter Bliznak <pb...@gmail.com>
>> wrote:
>> >> > Hi,
>> >> > I have a list over which I am iterating - it has checkbox and other
>> >> fields.
>> >> > I know I can define array associated with checkbox's values but that
>> only
>> >> > returns values which were checked. In my other column I have date and
>> I
>> >> have
>> >> > to make that date associated with checkbox's state. How am I supposed
>> to
>> >> do
>> >> > that?........Say I get five values in table and decide to check 2 of
>> them
>> >> > but array is only going to return true for 2 elements ...Is there any
>> way
>> >> I
>> >> > would define collection/array for checkboxes and it would return ALL
>> >> value
>> >> > including those which were unchecked?...
>> >> > Regards
>> >> > Peter.
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Peter Bliznak <pb...@gmail.com>.
Sorry about "of course" we have over two dozens of s1 apps and evaluating if
s2 makes sense to switch to or go with something else.
And for that we have over 50 items to cover to see how difficult/easy it is
in s2.
I am really surprise that such a trivial task has to be done using hidden
parameters.
Just to be sure : you really meant to assign dynamically hidden parameter
values inside iterator? -- and then -- since you will end up with 2
collections to go ahead and compared them and figure out what is "missing in
one of them" and so to get values from the other?...I hope I am wrong -
sounds very cumbersome for 2010.
On Mon, Oct 25, 2010 at 9:39 PM, Dave Newton <da...@gmail.com> wrote:
> Same way they're generated now, with the checkbox tag, or by hand. Or use a
> map.
>
> And there's no "of course": people use both versions.
>
> Dave
>
> On Monday, October 25, 2010, Peter Bliznak <pb...@gmail.com> wrote:
> > Hi Dave,
> > using S2 of course.
> > not sure I am getting what you suggested. I have dynamic list and have no
> > idea what size is going to be (inside my jsp which was created prior to
> that
> > call)-- how would you then create hidden parameters dynamically?
> >
> > On Mon, Oct 25, 2010 at 9:19 PM, Dave Newton <da...@gmail.com>
> wrote:
> >
> >> Which version of Struts?
> >>
> >> Struts 2 uses a hidden field to deal with default (unchecked) values.
> >> Struts 1 ActionForms used the reset() method to pre-load default
> >> values.
> >>
> >> Dave
> >>
> >> On Mon, Oct 25, 2010 at 9:16 PM, Peter Bliznak <pb...@gmail.com>
> wrote:
> >> > Hi,
> >> > I have a list over which I am iterating - it has checkbox and other
> >> fields.
> >> > I know I can define array associated with checkbox's values but that
> only
> >> > returns values which were checked. In my other column I have date and
> I
> >> have
> >> > to make that date associated with checkbox's state. How am I supposed
> to
> >> do
> >> > that?........Say I get five values in table and decide to check 2 of
> them
> >> > but array is only going to return true for 2 elements ...Is there any
> way
> >> I
> >> > would define collection/array for checkboxes and it would return ALL
> >> value
> >> > including those which were unchecked?...
> >> > Regards
> >> > Peter.
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: checkbox problem
Posted by Dave Newton <da...@gmail.com>.
Same way they're generated now, with the checkbox tag, or by hand. Or use a map.
And there's no "of course": people use both versions.
Dave
On Monday, October 25, 2010, Peter Bliznak <pb...@gmail.com> wrote:
> Hi Dave,
> using S2 of course.
> not sure I am getting what you suggested. I have dynamic list and have no
> idea what size is going to be (inside my jsp which was created prior to that
> call)-- how would you then create hidden parameters dynamically?
>
> On Mon, Oct 25, 2010 at 9:19 PM, Dave Newton <da...@gmail.com> wrote:
>
>> Which version of Struts?
>>
>> Struts 2 uses a hidden field to deal with default (unchecked) values.
>> Struts 1 ActionForms used the reset() method to pre-load default
>> values.
>>
>> Dave
>>
>> On Mon, Oct 25, 2010 at 9:16 PM, Peter Bliznak <pb...@gmail.com> wrote:
>> > Hi,
>> > I have a list over which I am iterating - it has checkbox and other
>> fields.
>> > I know I can define array associated with checkbox's values but that only
>> > returns values which were checked. In my other column I have date and I
>> have
>> > to make that date associated with checkbox's state. How am I supposed to
>> do
>> > that?........Say I get five values in table and decide to check 2 of them
>> > but array is only going to return true for 2 elements ...Is there any way
>> I
>> > would define collection/array for checkboxes and it would return ALL
>> value
>> > including those which were unchecked?...
>> > Regards
>> > Peter.
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: checkbox problem
Posted by Peter Bliznak <pb...@gmail.com>.
Hi Dave,
using S2 of course.
not sure I am getting what you suggested. I have dynamic list and have no
idea what size is going to be (inside my jsp which was created prior to that
call)-- how would you then create hidden parameters dynamically?
On Mon, Oct 25, 2010 at 9:19 PM, Dave Newton <da...@gmail.com> wrote:
> Which version of Struts?
>
> Struts 2 uses a hidden field to deal with default (unchecked) values.
> Struts 1 ActionForms used the reset() method to pre-load default
> values.
>
> Dave
>
> On Mon, Oct 25, 2010 at 9:16 PM, Peter Bliznak <pb...@gmail.com> wrote:
> > Hi,
> > I have a list over which I am iterating - it has checkbox and other
> fields.
> > I know I can define array associated with checkbox's values but that only
> > returns values which were checked. In my other column I have date and I
> have
> > to make that date associated with checkbox's state. How am I supposed to
> do
> > that?........Say I get five values in table and decide to check 2 of them
> > but array is only going to return true for 2 elements ...Is there any way
> I
> > would define collection/array for checkboxes and it would return ALL
> value
> > including those which were unchecked?...
> > Regards
> > Peter.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: checkbox problem
Posted by Dave Newton <da...@gmail.com>.
Which version of Struts?
Struts 2 uses a hidden field to deal with default (unchecked) values.
Struts 1 ActionForms used the reset() method to pre-load default
values.
Dave
On Mon, Oct 25, 2010 at 9:16 PM, Peter Bliznak <pb...@gmail.com> wrote:
> Hi,
> I have a list over which I am iterating - it has checkbox and other fields.
> I know I can define array associated with checkbox's values but that only
> returns values which were checked. In my other column I have date and I have
> to make that date associated with checkbox's state. How am I supposed to do
> that?........Say I get five values in table and decide to check 2 of them
> but array is only going to return true for 2 elements ...Is there any way I
> would define collection/array for checkboxes and it would return ALL value
> including those which were unchecked?...
> Regards
> Peter.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org