Re: checkbox problem
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 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 > 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 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 > 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 > wrote: > >> > Nopebasically 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 > >> > 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 > 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 workOrderTaskList; > >> >> > > >> >> > with getter and setter' > >> >> > > >> >> > EAch : WorkOrderTask have : > >> >> > Long id; > >> >> > boolean completed ;// checkbox > >> >> > > >> >> > with getters and setter's > >> >> > > >> >> > in jsp iterate: > >> >> > > >> >> > > >> >> > > >> >> > >> >> > status="assetStatus"> > >> >> > > >> >> > >> name="completed" > >> >> > fieldValue="%{#task.completed}" /> > >> >> > >> >> > /> > >> >> > 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 < > davelnew...@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 >
Re: checkbox problem
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 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 wrote: > > Nopebasically 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 > > 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 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 workOrderTaskList; > >> > > >> > with getter and setter' > >> > > >> > EAch : WorkOrderTask have : > >> > Long id; > >> > boolean completed ;// checkbox > >> > > >> > with getters and setter's > >> > > >> > in jsp iterate: > >> > > >> > > >> > > >> > >> > status="assetStatus"> > >> > > >> > name="completed" > >> > fieldValue="%{#task.completed}" /> > >> > >> > /> > >> > 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 > >> 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 > >> >> 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 PracticesI > will > >> >> truly > >> >>> appreciate it. (S2 in Action didn't mention and book written by guy > >> wit
Re: checkbox problem
Nopebasically 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 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 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 workOrderTaskList; > > > > with getter and setter' > > > > EAch : WorkOrderTask have : > > Long id; > > boolean completed ;// checkbox > > > > with getters and setter's > > > > in jsp iterate: > > > > > > > > > status="assetStatus"> > > > > > fieldValue="%{#task.completed}" /> > > > /> > > 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 > 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 > >> 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 PracticesI will > >> truly > >>> appreciate it. (S2 in Action didn't mention and book written by guy > with > >>> similar same like yours neitheraside from that Ive' read 3 > >> more...guess > >>> what... nobody mentioned it anywhere) > >>> > >>> On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton > >> 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 > 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 : > >>>>>> 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-unsubscr...@struts.apache.org > >>>>> For additional commands, e-mail: user-h...@struts.apache.org > >>>>> > >>>>> > >>>> > >>>> - > >>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >>>> For additional commands, e-mail: user-h...@struts.apache.org > >>>> > >>>> > >>> > >> > >> - > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > >> > >> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: checkbox problem
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 workOrderTaskList; with getter and setter' EAch : WorkOrderTask have : Long id; boolean completed ;// checkbox with getters and setter's in jsp iterate: 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 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 > 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 PracticesI will > truly > > appreciate it. (S2 in Action didn't mention and book written by guy with > > similar same like yours neitheraside from that Ive' read 3 > more...guess > > what... nobody mentioned it anywhere) > > > > On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton > 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 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 : > >> >> 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-unsubscr...@struts.apache.org > >> > For additional commands, e-mail: user-h...@struts.apache.org > >> > > >> > > >> > >> - > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > >> > >> > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: checkbox problem
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 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 > 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 PracticesI will > truly > > appreciate it. (S2 in Action didn't mention and book written by guy with > > similar same like yours neitheraside from that Ive' read 3 > more...guess > > what... nobody mentioned it anywhere) > > > > On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton > 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 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 : > >> >> 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-unsubscr...@struts.apache.org > >> > For additional commands, e-mail: user-h...@struts.apache.org > >> > > >> > > >> > >> - > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > >> > >> > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: checkbox problem
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 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 . > > For example: > private List infoList = new ArrayList(); > // getter and setter is omitted > // initialization code is omitted > > (3) In JSP, use a tag on the List, to display rows for > each DTO instance: > For example: > >ID: >Name: /> > name="infoList[%{#rowStatus.index}].use"/> > > > > The data initialized in action class will be display in your page, and > the data inputted by user will be applied to the List 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-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: checkbox problem
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 PracticesI will truly appreciate it. (S2 in Action didn't mention and book written by guy with similar same like yours neitheraside from that Ive' read 3 more...guess what... nobody mentioned it anywhere) On Tue, Oct 26, 2010 at 7:54 AM, Dave Newton 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 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 : > >> 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-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: checkbox problem
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 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 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 > 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 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 > >> 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 > 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 < > davelnew...@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 < > pbliz...@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-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: checkbox problem
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 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 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 > 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 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 > >> 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 > >> 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-unsubscr...@struts.apache.org > >> >> For additional commands, e-mail: user-h...@struts.apache.org > >> >> > >> >> > >> > > >> > >> - > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > >> > >> > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: checkbox problem
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 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 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 > 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 > 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-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > >> > >> > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: checkbox problem
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 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 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-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
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.
Reading properties from separate source folder
Hi all, here's my problem. How do I make S2 read property files from separate folder. We have different properties for prod, uat and so on ... so we want the have separate folder which will contain different set of files for each environment. in S1 we used to have two source folders one for java files and second for all properties. I tried same thing here and I can't make it work or maybe it is not even supported.Any ideas? Peter. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Ghostly exception
Hi folk, noticed few days ago app is throwing following exception but everything is working fine I see no problems whatsoever. But obviously I would be happier camper if I had clean runs. All ideas welcome. Almost forgot running S_2.1.6 on WebShpere 6.1. Peter. [17/07/09 16:32:06:747 EDT] 002c OgnlValueStac W org.apache.commons.logging.impl.Jdk14Logger warn Error setting value ognl.OgnlException: target is null for setProperty(null, "next", [Ljava.lang.String;@1fce1fce) at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1651) at ognl.ASTProperty.setValueBody(ASTProperty.java:101) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177) at ognl.SimpleNode.setValue(SimpleNode.java:246) at ognl.ASTChain.setValueBody(ASTChain.java:172) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177) at ognl.SimpleNode.setValue(SimpleNode.java:246) at ognl.Ognl.setValue(Ognl.java:476) at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:192) at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:155) at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:143) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:273) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at ca.on.gov.ebc.esdi.dd.webc.presentation.common.interceptors.LoggerInterceptor.intercept(LoggerInterceptor.java:18) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.impl.St
Re: Passing runtime exp into tag
Figured it out, forget it. From: Peter Bliznak To: Struts Users Mailing List Sent: Friday, July 10, 2009 11:23:15 AM Subject: Passing runtime exp into tag Hi all, translating portion of old code which was using S1 and Tiles and ran into problem. There is one tile representing form which is being used on almost all screens. One doesn't want to write same tile over and over again since only name of the action differs. Existing code used this: // define name of the action to be a passed from parent tile then it was used like this: JSPG0124E: Custom tag attribute action cannot be runtime expression. value: "[%= formAction.toString() %]" Any ideas how to solve it? Thanks, Peter.
Passing runtime exp into tag
Hi all, translating portion of old code which was using S1 and Tiles and ran into problem. There is one tile representing form which is being used on almost all screens. One doesn't want to write same tile over and over again since only name of the action differs. Existing code used this: // define name of the action to be a passed from parent tile then it was used like this: JSPG0124E: Custom tag attribute action cannot be runtime expression. value: "[%= formAction.toString() %]" Any ideas how to solve it? Thanks, Peter.
Re: Commercial framework based on struts2.
Aahhh...in that case be my guest and go for it From: Musachy Barroso To: Struts Users Mailing List Sent: Tuesday, July 7, 2009 2:33:12 PM Subject: Re: Commercial framework based on struts2. On Tue, Jul 7, 2009 at 11:22 AM, Peter Bliznak wrote: > Greek legend of Sisyphus but I love pushing this stone around :) musachy -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Commercial framework based on struts2.
Excuse me but I've been following this list for number of years and this is FIRST time anybody is asking for anything like this - I would not call this an overwhelming demand. Besides these kind of widgets can't ever be done to everyone's liking - they must tweaked amd changed for a specific app - if anybody wants to start working on anything like that then I would like to remind him/her of Greek legend of Sisyphus . just my two cents. P. From: Musachy Barroso To: Struts Users Mailing List Sent: Tuesday, July 7, 2009 2:10:29 PM Subject: Re: Commercial framework based on struts2. hum, and I never thought there was a demand for something like this...maybe we should do something about it :) @OP: I haven't seen any product like this. musachy On Tue, Jul 7, 2009 at 10:06 AM, sharath karnati wrote: > HI Bharath, > >I know Struts2 is a framework but I'm looking like customized tags like > dataTable,panelGrids and so on > >All tags should support AJAX functionality without doing any coding... > Please check Icefaces for example which is built on top of JSF and giving > more UI tags > > Thanks, > Sharath. > > --- On Tue, 7/7/09, Bhaarat Sharma wrote: > > > From: Bhaarat Sharma > Subject: Re: Commercial framework based on struts2. > To: "Struts Users Mailing List" > Date: Tuesday, July 7, 2009, 12:24 PM > > > Struts 2 IS a framework > > On Tue, Jul 7, 2009 at 12:20 PM, sharath karnati wrote: > >> Dear All, >> >>I'm looking for chimerical framework which is built on top of struts2, >> with having AJAX support tags. I know struts2 comes with DOJO but we need to >> write lot of coding which we'd like to avoid and we are planning to purchase >> chimerical product with support. >> >>Similar to Icefaces which is build on JSF technology. >> >>Can anyone please let me know. If you have price details then please >> include that also... >> >> Thanks, >> Sharath. >> >> >> >> >> > > > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Custom validation interceptor
Preciously!..what you said about changing form is exactly what I was thinking. From: Dave Newton To: Struts Users Mailing List Sent: Saturday, June 20, 2009 8:35:50 PM Subject: Re: Custom validation interceptor Peter Bliznak wrote: > It is across entire app (there are many dozen of actions) - every > single action has to have same behavior - 3 crosses go and try again. > It's app for changing personal info on government issued documents - > sorta wizard like thing. I can see how I can do it by keeping eye of > parameters - but I am looking for cleanest possible implementation. But if I > decide to modify default stack I am not certain what might > be consequences for the rest of app. None, if you do it right. Since it's across the entire app I'd go the interceptor route--but you're still going to have to either use a hidden parameter, keep something in session, or whatever. Both have their advantages and disadvantages, but are basically the same complexity. I'd probably consider modifying the template to insert a hidden parameter, but that leaves it vulnerable to someone spoofing the validation count--if that's an issue. Otherwise you'd have to track a session variable, re-initialize it when a form is displayed for the first time, and so on. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Custom validation interceptor
It is across entire app (there are many dozen of actions) - every single action has to have same behavior - 3 crosses go and try again. It's app for changing personal info on government issued documents - sorta wizard like thing. I can see how I can do it by keeping eye of parameters - but I am looking for cleanest possible implementation. But if I decide to modify default stack I am not certain what might be consequences for the rest of app. From: Dave Newton To: Struts Users Mailing List Sent: Saturday, June 20, 2009 7:57:24 PM Subject: Re: Custom validation interceptor Peter Bliznak wrote: > I have following requirement: If validation of the page fails 3 times > in row - invalidate session and redirect to index page. Should I > replace default validation interceptor in default stack with my own > to achieve what I am after? I there any other way? Is this across the entire app or just a single action? If it's just a single action then this could probably be done via a session var or a hidden counter (updated in the actions validate() method)... although I'm not sure how you'd tell the workflow interceptor to go to the "strike three" page. AFAICT the workflow.inputResultName parameter doesn't eval OGNL, so you'd have to set the result location in the action--seems messy. I started off thinking no on the interceptor, but now I'm not so sure. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Custom validation interceptor
Hi,I have following requirement:If validation of the page fails 3 times in row - invalidate session and redirect to index page.Should I replace default validation interceptor in default stack with my own to achieve what I am after?I there any other way?Any hint would be greatly appreciatedPeter.
Struts2 validation
Hi all, converting big S1 application and run into this problem. Even though form is being validated in S1 version by validator.xml there is an user field which was validated on focus lost by asynch call using Ajax - to find found if by user chosen user name is still available. Call is then intercepted and handled in S1 ACTION with following construct if (nameTaken) { msg = new ActionMessage(NAME_TAKEN); error = addMsgErrors(error,Constants.NAME_ERROR, msg); this.addErrors(request, error); return mapping.getInputForward(); }. My question is - provided asynch check must stay - how to handle this in S2 - or what is best practice to handle such a case - to create validation error programmatically? Thanks, Peter
Re: JSON and ExtJS
ok...you made my day!!! now I can get rid of all streaming stuff from my action and struts.xml ok...I admit it pays off to read docs :-) THANKS!!! - Original Message From: Musachy Barroso <[EMAIL PROTECTED]> To: Struts Users Mailing List Sent: Thursday, December 20, 2007 4:27:24 PM Subject: Re: JSON and ExtJS yes indeed. http://cwiki.apache.org/S2PLUGINS/json-plugin.html musachy On Dec 20, 2007 4:23 PM, Peter Bliznak <[EMAIL PROTECTED]> wrote: > hm..so you are saying > > putting things into MAP like this: > > MAP entry 1 : success true > entry 2 : rotalCount 2 > entry 3 : rootList > is going to create this: > > { 'success': true, 'totalCount':'2', 'root':[{'description':'desc0','id':0,'name':'name0','value':'value0'},... > > if so...then you are making my day > > > - Original Message > From: Musachy Barroso <[EMAIL PROTECTED]> > To: Struts Users Mailing List > > Sent: Thursday, December 20, 2007 3:54:22 PM > Subject: Re: JSON and ExtJS > > just add fields to your action with those names and values, or return > a map with all those value as the root object to be serialized. > > musachy > > On Dec 20, 2007 3:49 PM, Peter Bliznak <[EMAIL PROTECTED]> wrote: > > We are using EXTJS and Struts2 + Hibernate Search and JPA and here > are no problems. > > > > As for JSON plugin mentioned below. > > I was using it for old dojo before we gave up on it and switched to > beatifull EXTJS. > > But I dont think I can use this JSON plugin since there is no way - > or let me put it this way - > > I don't know how to get structure EXTJS data stores are expecting. > > Say I have list to load table store which is just list of my > hibernate VOs. > > But expected structure must include at the beginning couple of > parameters and I see no way > > how to get them there without changes initial collection. > > this is what is required.: > > "{ 'success': true, 'totalCount':'2', 'root':["FROM HERE IT IS > JUST > COLLECTION"{'description':'desc0','id':0,'name':'name0','value':'value0'},{'description':'desc1','id':1,'name':'name1','value':'value1'} > > how to add those at the beginning " 'success': true, > 'totalCount':'2', " ? > > > > Peter. > > - Original Message > > From: Musachy Barroso <[EMAIL PROTECTED]> > > To: Struts Users Mailing List > > Sent: Thursday, December 20, 2007 3:16:51 PM > > Subject: Re: JSON and ExtJS > > > > > > You might also want to take a look at the JSON plugin, to decouple > > your action from JSON at all. > > > > musachy > > > > On Dec 20, 2007 12:28 PM, Gary Affonso <[EMAIL PROTECTED]> > wrote: > > > Rick Reumann wrote: > > > > On Dec 20, 2007 10:54 AM, Martin Gainty <[EMAIL PROTECTED]> > > wrote: > > > > > > > >> JavaDoc mentions that shallow serialization will take place with > > the > > > >> include > > > >> being arbiter of which collection classes > > > >> may be serialized.. > > > >> hibernate has a similar situation where lazy_init="true" but I > can > > request > > > >> hibernate to instantiate parent and child classes via > > > >> lazy_init="false".. > > > >> is there any capability for lazy_init="false" i.e. serialize > > everything as > > > >> default behaviour considered for JSONSerializer ? > > > > > > I'm getting in late on this thread, please forgive me if I mention > > > something already discussed. > > > > > > Have you taken a look at DWR? It has several mechanisms by which > you > > > can deep-serialize your domain objects and it explicitly knows > about > > > hibernate domain objects.. > > > > > > I did only a minimal amount of DWR and ExtJS integration but my > > memory > > > is that they can be tweaked to work together in a pretty > > straightforward > > > manner. > > > > > > - Gary > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > -- > > "Hey you! Would you help me to carry the stone?" Pink Floyd > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSON and ExtJS
hm..so you are saying putting things into MAP like this: MAP entry 1 : success true entry 2 : rotalCount 2 entry 3 : rootList is going to create this: { 'success': true, 'totalCount':'2', 'root':[{'description':'desc0','id':0,'name':'name0','value':'value0'},... if so...then you are making my day - Original Message From: Musachy Barroso <[EMAIL PROTECTED]> To: Struts Users Mailing List Sent: Thursday, December 20, 2007 3:54:22 PM Subject: Re: JSON and ExtJS just add fields to your action with those names and values, or return a map with all those value as the root object to be serialized. musachy On Dec 20, 2007 3:49 PM, Peter Bliznak <[EMAIL PROTECTED]> wrote: > We are using EXTJS and Struts2 + Hibernate Search and JPA and here are no problems. > > As for JSON plugin mentioned below. > I was using it for old dojo before we gave up on it and switched to beatifull EXTJS. > But I dont think I can use this JSON plugin since there is no way - or let me put it this way - > I don't know how to get structure EXTJS data stores are expecting. > Say I have list to load table store which is just list of my hibernate VOs. > But expected structure must include at the beginning couple of parameters and I see no way > how to get them there without changes initial collection. > this is what is required.: > "{ 'success': true, 'totalCount':'2', 'root':["FROM HERE IT IS JUST COLLECTION"{'description':'desc0','id':0,'name':'name0','value':'value0'},{'description':'desc1','id':1,'name':'name1','value':'value1'} > how to add those at the beginning " 'success': true, 'totalCount':'2', " ? > > Peter. > - Original Message > From: Musachy Barroso <[EMAIL PROTECTED]> > To: Struts Users Mailing List > Sent: Thursday, December 20, 2007 3:16:51 PM > Subject: Re: JSON and ExtJS > > > You might also want to take a look at the JSON plugin, to decouple > your action from JSON at all. > > musachy > > On Dec 20, 2007 12:28 PM, Gary Affonso <[EMAIL PROTECTED]> wrote: > > Rick Reumann wrote: > > > On Dec 20, 2007 10:54 AM, Martin Gainty <[EMAIL PROTECTED]> > wrote: > > > > > >> JavaDoc mentions that shallow serialization will take place with > the > > >> include > > >> being arbiter of which collection classes > > >> may be serialized.. > > >> hibernate has a similar situation where lazy_init="true" but I can > request > > >> hibernate to instantiate parent and child classes via > > >> lazy_init="false".. > > >> is there any capability for lazy_init="false" i.e. serialize > everything as > > >> default behaviour considered for JSONSerializer ? > > > > I'm getting in late on this thread, please forgive me if I mention > > something already discussed. > > > > Have you taken a look at DWR? It has several mechanisms by which you > > can deep-serialize your domain objects and it explicitly knows about > > hibernate domain objects.. > > > > I did only a minimal amount of DWR and ExtJS integration but my > memory > > is that they can be tweaked to work together in a pretty > straightforward > > manner. > > > > - Gary > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSON and ExtJS
We are using EXTJS and Struts2 + Hibernate Search and JPA and here are no problems. As for JSON plugin mentioned below. I was using it for old dojo before we gave up on it and switched to beatifull EXTJS. But I dont think I can use this JSON plugin since there is no way - or let me put it this way - I don't know how to get structure EXTJS data stores are expecting. Say I have list to load table store which is just list of my hibernate VOs. But expected structure must include at the beginning couple of parameters and I see no way how to get them there without changes initial collection. this is what is required.: "{ 'success': true, 'totalCount':'2', 'root':["FROM HERE IT IS JUST COLLECTION"{'description':'desc0','id':0,'name':'name0','value':'value0'},{'description':'desc1','id':1,'name':'name1','value':'value1'} how to add those at the beginning " 'success': true, 'totalCount':'2', " ? Peter. - Original Message From: Musachy Barroso <[EMAIL PROTECTED]> To: Struts Users Mailing List Sent: Thursday, December 20, 2007 3:16:51 PM Subject: Re: JSON and ExtJS You might also want to take a look at the JSON plugin, to decouple your action from JSON at all. musachy On Dec 20, 2007 12:28 PM, Gary Affonso <[EMAIL PROTECTED]> wrote: > Rick Reumann wrote: > > On Dec 20, 2007 10:54 AM, Martin Gainty <[EMAIL PROTECTED]> wrote: > > > >> JavaDoc mentions that shallow serialization will take place with the > >> include > >> being arbiter of which collection classes > >> may be serialized.. > >> hibernate has a similar situation where lazy_init="true" but I can request > >> hibernate to instantiate parent and child classes via > >> lazy_init="false".. > >> is there any capability for lazy_init="false" i.e. serialize everything as > >> default behaviour considered for JSONSerializer ? > > I'm getting in late on this thread, please forgive me if I mention > something already discussed. > > Have you taken a look at DWR? It has several mechanisms by which you > can deep-serialize your domain objects and it explicitly knows about > hibernate domain objects.. > > I did only a minimal amount of DWR and ExtJS integration but my memory > is that they can be tweaked to work together in a pretty straightforward > manner. > > - Gary > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dynamic tree
Hi new to 2.0 ajax tags so I need some help on tree tag. I am trying to build tree and since it rather big one I would like to get data from server incrementally -- only when I click on tree node. I found tree docs at http://struts.apache.org/2.x/docs/tree.html and at the very bottom of the page there is "Dynamic tree loaded with AJAX (one request is made for each node):" but example of how to make one is missing. I just want to ask if anyone would be able to help me on this. I guess my next question is -- is this available at the current 2.0.11 build? and finally to achieve what I've described can I just use ajax tag or do I have to use some additional dojo tags or coding? Thanks Peter.
Re: Struts-Faces: validator
Hi Rodrigo, yes you can use commandButon. Btw have you look at example code coming with Struts 1.3.5? Peter. PS If you still have problem to make it work let me know I will send you some code to nail it down. Rodrigo Pereira <[EMAIL PROTECTED]> wrote: I am already doing this. Can I use h:commandButton to submit ( call onsubmit ) struts-faces form? Thanks, Rodrigo Pereira On 2/4/07, Martin Gainty wrote: > Kevin-- > > I would suggest implementing the validation.xml packaged within struts as the > basis for your validation efforts > Feel free to ping the list if you have any questions > > HTH, > Martin-- > --- > This e-mail message (including attachments, if any) is intended for the use > of the individual or entity to which it is addressed and may contain > information that is privileged, proprietary , confidential and exempt from > disclosure. If you are not the intended recipient, you are notified that any > dissemination, distribution or copying of this communication is strictly > prohibited. > --- > Le présent message électronique (y compris les pièces qui y sont annexées, le > cas échéant) s'adresse au destinataire indiqué et peut contenir des > renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le > destinataire de ce document, nous vous signalons qu'il est strictement > interdit de le diffuser, de le distribuer ou de le reproduire. > - Original Message - > From: "Simons Kevin" > To: "Struts Users Mailing List" > Sent: Sunday, February 04, 2007 8:46 AM > Subject: Re: Struts-Faces: validator > > > > Rodrigo, > > > > AFAIK that was possible. > > > > Regards, > > - Original Message - > > From: "Rodrigo Pereira" > > To: "Struts Users Mailing List" > > Sent: Saturday, February 03, 2007 10:39 PM > > Subject: Struts-Faces: validator > > > > > >> hi All, > >> does anybody know if validator work with struts-faces? > >> I have read a lot of tutorials on the Internet, but no success at all > >> > >> > >> Thanks, > >> Rodrigo Pereira > >> > >> - > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > >> -- > >> No virus found in this incoming message. > >> Checked by AVG Free Edition. > >> Version: 7.5.432 / Virus Database: 268.17.20/664 - Release Date: 2/02/2007 > >> 15:42 > >> > >> > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts-Faces: validator
Yes it does work, I am using on every single page. Rodrigo Pereira <[EMAIL PROTECTED]> wrote: hi All, does anybody know if validator work with struts-faces? I have read a lot of tutorials on the Internet, but no success at all Thanks, Rodrigo Pereira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts-Faces: FormBean and ManagedBean
myfaces tags gives you extermely simple way of creating your ui ...that,s all ..the rest is struts Rukka <[EMAIL PROTECTED]> wrote: Not trying to hijack the thread. Just a curious question. What is the reasons/benefits of using Struts-Myfaces-Tiles combo? I mean MyFaces instead of jsp. Thanks rukka PETER BLIZNAK wrote: > Hi Rodrigo, > must admit I am not familiar with ajax4jsf tags. My setup is > Struts-Myfaces-Tiles and I have pages I have to prepopulate pages with radio > and check boxes based on what is coming from LDAP - for that I am forwarding > to Struts action which then populates action form and the I am using same > form bean in my dataTable tag. Does that ajax tag require to use manages bean > - or could you just provide it with action form bean ???. > P > > > Rodrigo Pereira wrote: Hi Peter, > thanks for your reply. > I want to have an actionForm act as a managed bean just to use ajax ( > ajax4jfs tags ). > Basically I want to populate 4 fields according to the value of another field. > > > Thanks, > Rodrigo Pereira > > > On 2/1/07, PETER BLIZNAK wrote: > >> Hi Rodrigo, >> I do not have an answer to your question, but let me ask you why would you >> wanted to have actionForm act as a managed bean? I am guessing it is because >> you want to use it for loading data into dataTable component. If that is a >> case you don't have to use managedBean - any "ordinary" bean would do - so >> you can use your actionForm bean for dataTable. It works well for me. >> Regards, >> Peter. >> >> Rodrigo Pereira wrote: Hi all, >> is it possible for a class to play both roles: Struts FormBean, and >> JSF ManagesBean? >> I mean, can I declare it on faces-config.xml, and struts-config.xml? >> >> Thanks, >> Rodrigo Pereira >> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts-Faces: FormBean and ManagedBean
Hi Rodrigo, must admit I am not familiar with ajax4jsf tags. My setup is Struts-Myfaces-Tiles and I have pages I have to prepopulate pages with radio and check boxes based on what is coming from LDAP - for that I am forwarding to Struts action which then populates action form and the I am using same form bean in my dataTable tag. Does that ajax tag require to use manages bean - or could you just provide it with action form bean ???. P Rodrigo Pereira <[EMAIL PROTECTED]> wrote: Hi Peter, thanks for your reply. I want to have an actionForm act as a managed bean just to use ajax ( ajax4jfs tags ). Basically I want to populate 4 fields according to the value of another field. Thanks, Rodrigo Pereira On 2/1/07, PETER BLIZNAK wrote: > Hi Rodrigo, > I do not have an answer to your question, but let me ask you why would you > wanted to have actionForm act as a managed bean? I am guessing it is because > you want to use it for loading data into dataTable component. If that is a > case you don't have to use managedBean - any "ordinary" bean would do - so > you can use your actionForm bean for dataTable. It works well for me. > Regards, > Peter. > > Rodrigo Pereira wrote: Hi all, > is it possible for a class to play both roles: Struts FormBean, and > JSF ManagesBean? > I mean, can I declare it on faces-config.xml, and struts-config.xml? > > Thanks, > Rodrigo Pereira > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts-Faces: FormBean and ManagedBean
Hi Rodrigo, I do not have an answer to your question, but let me ask you why would you wanted to have actionForm act as a managed bean? I am guessing it is because you want to use it for loading data into dataTable component. If that is a case you don't have to use managedBean - any "ordinary" bean would do - so you can use your actionForm bean for dataTable. It works well for me. Regards, Peter. Rodrigo Pereira <[EMAIL PROTECTED]> wrote: Hi all, is it possible for a class to play both roles: Struts FormBean, and JSF ManagesBean? I mean, can I declare it on faces-config.xml, and struts-config.xml? Thanks, Rodrigo Pereira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Collection of Options
--- Rick Reumann <[EMAIL PROTECTED]> wrote: > PETER BLIZNAK wrote: > > Hi there, > > I run into something I cant figure perhaps someone > > here can help me to shed some light on it. > > > > Basically I have dynamic table - meaning I iterate > > over supplied colection and build up table. No > problem > > there that is simple stuff. Confusion starts when > one > > of the columns must be list of options (or > drop-down > > list) and then all need to get preselected with > > different values. > > I have dealt with dynamic radio and check boxes > but > > this seem to be different situation. I know how to > > preselect ONE option box...but if there are part > one > > the collection I seemed to lost handle on it. > > > > If I have one option box then I can use something > like > > this > > > > > collection="sitesList" > > property="siteId" labelProperty="siteName" /> > > > > Not sure exactly what you mean? Does the select > above need to be a > multiple select box? If so as long as siteName_1 is > a String[] or List > you should be fine. I don't think that's what's you > are asking though. > If it is a regular single select than as long as > siteName_1 happens to > match one of the values in sitesList than it will > show up selected. > > I'm not sure what "sitesList" should have to do with > it unless sitesList > is unique per row? If so then you'll have to pull > sitesList from > whatever property you happen to be iterating over. > > > Basically you answered my question in your last sentence. Also I reliazed I would need to use "optionsCollection" instead "options" and then declare "id" for a bean I am iterating on. Everything works now. Thanks for your help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Collection of Options
Hi there, I run into something I cant figure perhaps someone here can help me to shed some light on it. Basically I have dynamic table - meaning I iterate over supplied colection and build up table. No problem there that is simple stuff. Confusion starts when one of the columns must be list of options (or drop-down list) and then all need to get preselected with different values. I have dealt with dynamic radio and check boxes but this seem to be different situation. I know how to preselect ONE option box...but if there are part one the collection I seemed to lost handle on it. If I have one option box then I can use something like this and then I can use property="siteName_1" to preselect what I need but if "siteList" is itself part of the outer collection then what??? Any help would be appreciated Peter. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]