Re: Alternate rows with different color
Following Igor's example, you will need to override the newItem() method. It is inherited into DataView from RefreshingView. Something like: new DataView() { @Override protected item newItem(..) { return new OddEvenItem(...); } } On Wed, Aug 5, 2009 at 12:22 AM, arungupta arun.gu...@gmail.com wrote: Cristi, You are right, I'm a total noob to Wicket :) Anyway digging further ... It seems DataView is most suited for my database-backed repeating view. I'm having difficulty in understanding how to hook DataView and OddEvenItem together. Suggestions ? -Arun Cristi Manole wrote: your solution is definitely better, Igor, but he seems very new to wicket and it was faster to get that working than to explain he needs to change the repeater. at least that's what i thought. On Wed, Aug 5, 2009 at 1:43 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: you guys are more then welcome to head down this badly broken road, or you can look at what i said... -igor On Tue, Aug 4, 2009 at 5:37 PM, Cristi Manolecristiman...@gmail.com wrote: How about public class RunlogPage extends BasePage { private int counter; (...) item.add(new AttributeModifier(class, counter++ % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); ? On Wed, Aug 5, 2009 at 1:33 AM, arungupta arun.gu...@gmail.com wrote: Sweet, that worked :) Now runlog.getId() does not return alternating odd/even numbers so will need to figure out what might ;) Is there anything in the model that might provide that information ? -Arun Cristi Manole wrote: you can always just wrap it... item.add(new AttributeModifier(class, runlog.getId() % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); note that you'll get different colors only if you have defined list-line-odd in your css, added that to page and, of course, if runlog.geId() returns alternating odd/even numbers. On Wed, Aug 5, 2009 at 1:17 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: this was meant as an example for you and can work under 1.3.6 as well as 1.4. look at the source to see what it does, you would use it like so: new refreshingview() { protected item newItem(..) { return new oddevenitem(...); }} btw 1.4.0 is out. -igor On Tue, Aug 4, 2009 at 4:56 PM, arunguptaarun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Gupta arun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
Alternate rows with different color
Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Alternate rows with different color
Not sure if it will help you, but did you also try item.add(new AttributeModifier(class, *true, *new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); ? That would add class to item if it doesn't have it in markup. On Wed, Aug 5, 2009 at 12:36 AM, Arun Gupta arun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Cristi Manole Nova Creator Software www.novacreator.com
Re: Alternate rows with different color
see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Alternate rows with different color
class is already in the markup and did not made any difference. Still getting the same error :( -Arun Cristi Manole wrote: Not sure if it will help you, but did you also try item.add(new AttributeModifier(class, *true, *new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); ? That would add class to item if it doesn't have it in markup. On Wed, Aug 5, 2009 at 12:36 AM, Arun Gupta arun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Cristi Manole Nova Creator Software www.novacreator.com -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818307.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Alternate rows with different color
I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Alternate rows with different color
I think your error is because you're making class either the result of this.list-line-odd or this.list-line-event and this doesn not implement a getter for those. maybe item.add(new AttributeModifier(class, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event)); ? or change/add parantheses ... On Wed, Aug 5, 2009 at 12:56 AM, arungupta arun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Cristi Manole Nova Creator Software www.novacreator.com
Re: Alternate rows with different color
Ah, that kinda explains it. But all AttributeModifier ctors require an IModel. What should I pass for that now ? -Arun Cristi Manole wrote: I think your error is because you're making class either the result of this.list-line-odd or this.list-line-event and this doesn not implement a getter for those. maybe item.add(new AttributeModifier(class, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event)); ? or change/add parantheses ... On Wed, Aug 5, 2009 at 12:56 AM, arungupta arun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Cristi Manole Nova Creator Software www.novacreator.com -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818485.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Alternate rows with different color
this was meant as an example for you and can work under 1.3.6 as well as 1.4. look at the source to see what it does, you would use it like so: new refreshingview() { protected item newItem(..) { return new oddevenitem(...); }} btw 1.4.0 is out. -igor On Tue, Aug 4, 2009 at 4:56 PM, arunguptaarun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Alternate rows with different color
you can always just wrap it... item.add(new AttributeModifier(class, runlog.getId() % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); note that you'll get different colors only if you have defined list-line-odd in your css, added that to page and, of course, if runlog.geId() returns alternating odd/even numbers. On Wed, Aug 5, 2009 at 1:17 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: this was meant as an example for you and can work under 1.3.6 as well as 1.4. look at the source to see what it does, you would use it like so: new refreshingview() { protected item newItem(..) { return new oddevenitem(...); }} btw 1.4.0 is out. -igor On Tue, Aug 4, 2009 at 4:56 PM, arunguptaarun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Cristi Manole Nova Creator Software www.novacreator.com
Re: Alternate rows with different color
OK, trying 1.4 and the sample below, thanks! BTW, the application working fine with 1.3.6 gives the following error with 1.4: ERROR - DiskPageStore - Couldn't load DiskPageStore index from file /Users/arungupta/workspaces/runner~subversion/wicket/runner/target/work/wicket.runner-filestore/DiskPageStoreIndex. java.lang.ClassNotFoundException: org.apache.wicket.util.concurrent.ConcurrentHashMap at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) Any idea ? -Arun igor.vaynberg wrote: this was meant as an example for you and can work under 1.3.6 as well as 1.4. look at the source to see what it does, you would use it like so: new refreshingview() { protected item newItem(..) { return new oddevenitem(...); }} btw 1.4.0 is out. -igor On Tue, Aug 4, 2009 at 4:56 PM, arunguptaarun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818611.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Alternate rows with different color
Sweet, that worked :) Now runlog.getId() does not return alternating odd/even numbers so will need to figure out what might ;) Is there anything in the model that might provide that information ? -Arun Cristi Manole wrote: you can always just wrap it... item.add(new AttributeModifier(class, runlog.getId() % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); note that you'll get different colors only if you have defined list-line-odd in your css, added that to page and, of course, if runlog.geId() returns alternating odd/even numbers. On Wed, Aug 5, 2009 at 1:17 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: this was meant as an example for you and can work under 1.3.6 as well as 1.4. look at the source to see what it does, you would use it like so: new refreshingview() { protected item newItem(..) { return new oddevenitem(...); }} btw 1.4.0 is out. -igor On Tue, Aug 4, 2009 at 4:56 PM, arunguptaarun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Cristi Manole Nova Creator Software www.novacreator.com -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818677.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Alternate rows with different color
How about public class RunlogPage extends BasePage { private int counter; (...) item.add(new AttributeModifier(class, counter++ % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); ? On Wed, Aug 5, 2009 at 1:33 AM, arungupta arun.gu...@gmail.com wrote: Sweet, that worked :) Now runlog.getId() does not return alternating odd/even numbers so will need to figure out what might ;) Is there anything in the model that might provide that information ? -Arun Cristi Manole wrote: you can always just wrap it... item.add(new AttributeModifier(class, runlog.getId() % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); note that you'll get different colors only if you have defined list-line-odd in your css, added that to page and, of course, if runlog.geId() returns alternating odd/even numbers. On Wed, Aug 5, 2009 at 1:17 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: this was meant as an example for you and can work under 1.3.6 as well as 1.4. look at the source to see what it does, you would use it like so: new refreshingview() { protected item newItem(..) { return new oddevenitem(...); }} btw 1.4.0 is out. -igor On Tue, Aug 4, 2009 at 4:56 PM, arunguptaarun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Cristi Manole Nova Creator Software www.novacreator.com -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818677.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Cristi Manole Nova Creator Software www.novacreator.com
Re: Alternate rows with different color
I thought about that as well and so will probably use it for now :) Thanks a lot for the great help as it got me moving fast. I may have more questions later and then will come back. Thanks, -Arun Cristi Manole wrote: How about public class RunlogPage extends BasePage { private int counter; (...) item.add(new AttributeModifier(class, counter++ % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); ? On Wed, Aug 5, 2009 at 1:33 AM, arungupta arun.gu...@gmail.com wrote: Sweet, that worked :) Now runlog.getId() does not return alternating odd/even numbers so will need to figure out what might ;) Is there anything in the model that might provide that information ? -Arun Cristi Manole wrote: you can always just wrap it... item.add(new AttributeModifier(class, runlog.getId() % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); note that you'll get different colors only if you have defined list-line-odd in your css, added that to page and, of course, if runlog.geId() returns alternating odd/even numbers. On Wed, Aug 5, 2009 at 1:17 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: this was meant as an example for you and can work under 1.3.6 as well as 1.4. look at the source to see what it does, you would use it like so: new refreshingview() { protected item newItem(..) { return new oddevenitem(...); }} btw 1.4.0 is out. -igor On Tue, Aug 4, 2009 at 4:56 PM, arunguptaarun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Cristi Manole Nova Creator Software www.novacreator.com -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818677.html Sent from the Wicket - User mailing list archive at Nabble.com
Re: Alternate rows with different color
you guys are more then welcome to head down this badly broken road, or you can look at what i said... -igor On Tue, Aug 4, 2009 at 5:37 PM, Cristi Manolecristiman...@gmail.com wrote: How about public class RunlogPage extends BasePage { private int counter; (...) item.add(new AttributeModifier(class, counter++ % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); ? On Wed, Aug 5, 2009 at 1:33 AM, arungupta arun.gu...@gmail.com wrote: Sweet, that worked :) Now runlog.getId() does not return alternating odd/even numbers so will need to figure out what might ;) Is there anything in the model that might provide that information ? -Arun Cristi Manole wrote: you can always just wrap it... item.add(new AttributeModifier(class, runlog.getId() % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); note that you'll get different colors only if you have defined list-line-odd in your css, added that to page and, of course, if runlog.geId() returns alternating odd/even numbers. On Wed, Aug 5, 2009 at 1:17 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: this was meant as an example for you and can work under 1.3.6 as well as 1.4. look at the source to see what it does, you would use it like so: new refreshingview() { protected item newItem(..) { return new oddevenitem(...); }} btw 1.4.0 is out. -igor On Tue, Aug 4, 2009 at 4:56 PM, arunguptaarun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Cristi Manole Nova Creator Software www.novacreator.com -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818677.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr
Re: Alternate rows with different color
your solution is definitely better, Igor, but he seems very new to wicket and it was faster to get that working than to explain he needs to change the repeater. at least that's what i thought. On Wed, Aug 5, 2009 at 1:43 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: you guys are more then welcome to head down this badly broken road, or you can look at what i said... -igor On Tue, Aug 4, 2009 at 5:37 PM, Cristi Manolecristiman...@gmail.com wrote: How about public class RunlogPage extends BasePage { private int counter; (...) item.add(new AttributeModifier(class, counter++ % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); ? On Wed, Aug 5, 2009 at 1:33 AM, arungupta arun.gu...@gmail.com wrote: Sweet, that worked :) Now runlog.getId() does not return alternating odd/even numbers so will need to figure out what might ;) Is there anything in the model that might provide that information ? -Arun Cristi Manole wrote: you can always just wrap it... item.add(new AttributeModifier(class, runlog.getId() % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); note that you'll get different colors only if you have defined list-line-odd in your css, added that to page and, of course, if runlog.geId() returns alternating odd/even numbers. On Wed, Aug 5, 2009 at 1:17 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: this was meant as an example for you and can work under 1.3.6 as well as 1.4. look at the source to see what it does, you would use it like so: new refreshingview() { protected item newItem(..) { return new oddevenitem(...); }} btw 1.4.0 is out. -igor On Tue, Aug 4, 2009 at 4:56 PM, arunguptaarun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr
Re: Alternate rows with different color
Igor, Yes, I do plan to it the right way. But this got me moving fast for now and validated some other concepts in my application. -Arun Cristi Manole wrote: your solution is definitely better, Igor, but he seems very new to wicket and it was faster to get that working than to explain he needs to change the repeater. at least that's what i thought. On Wed, Aug 5, 2009 at 1:43 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: you guys are more then welcome to head down this badly broken road, or you can look at what i said... -igor On Tue, Aug 4, 2009 at 5:37 PM, Cristi Manolecristiman...@gmail.com wrote: How about public class RunlogPage extends BasePage { private int counter; (...) item.add(new AttributeModifier(class, counter++ % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); ? On Wed, Aug 5, 2009 at 1:33 AM, arungupta arun.gu...@gmail.com wrote: Sweet, that worked :) Now runlog.getId() does not return alternating odd/even numbers so will need to figure out what might ;) Is there anything in the model that might provide that information ? -Arun Cristi Manole wrote: you can always just wrap it... item.add(new AttributeModifier(class, runlog.getId() % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); note that you'll get different colors only if you have defined list-line-odd in your css, added that to page and, of course, if runlog.geId() returns alternating odd/even numbers. On Wed, Aug 5, 2009 at 1:17 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: this was meant as an example for you and can work under 1.3.6 as well as 1.4. look at the source to see what it does, you would use it like so: new refreshingview() { protected item newItem(..) { return new oddevenitem(...); }} btw 1.4.0 is out. -igor On Tue, Aug 4, 2009 at 4:56 PM, arunguptaarun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional
Re: Alternate rows with different color
Cristi, You are right, I'm a total noob to Wicket :) Anyway digging further ... It seems DataView is most suited for my database-backed repeating view. I'm having difficulty in understanding how to hook DataView and OddEvenItem together. Suggestions ? -Arun Cristi Manole wrote: your solution is definitely better, Igor, but he seems very new to wicket and it was faster to get that working than to explain he needs to change the repeater. at least that's what i thought. On Wed, Aug 5, 2009 at 1:43 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: you guys are more then welcome to head down this badly broken road, or you can look at what i said... -igor On Tue, Aug 4, 2009 at 5:37 PM, Cristi Manolecristiman...@gmail.com wrote: How about public class RunlogPage extends BasePage { private int counter; (...) item.add(new AttributeModifier(class, counter++ % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); ? On Wed, Aug 5, 2009 at 1:33 AM, arungupta arun.gu...@gmail.com wrote: Sweet, that worked :) Now runlog.getId() does not return alternating odd/even numbers so will need to figure out what might ;) Is there anything in the model that might provide that information ? -Arun Cristi Manole wrote: you can always just wrap it... item.add(new AttributeModifier(class, runlog.getId() % 2 == 0 ? new Model(list-line-odd) : new Model(list-line-event))); note that you'll get different colors only if you have defined list-line-odd in your css, added that to page and, of course, if runlog.geId() returns alternating odd/even numbers. On Wed, Aug 5, 2009 at 1:17 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: this was meant as an example for you and can work under 1.3.6 as well as 1.4. look at the source to see what it does, you would use it like so: new refreshingview() { protected item newItem(..) { return new oddevenitem(...); }} btw 1.4.0 is out. -igor On Tue, Aug 4, 2009 at 4:56 PM, arunguptaarun.gu...@gmail.com wrote: I've been using 1.3.6 but let me try 1.4 rc build and see where it takes me. Is there an example that shows how it can be used in the above context ? -Arun igor.vaynberg wrote: see org.apache.wicket.markup.repeater.OddEvenItem for a cleaner, simpler way to do this -igor On Tue, Aug 4, 2009 at 4:36 PM, Arun Guptaarun.gu...@gmail.com wrote: Trying to provide different color to alternate rows by following the recommendation at: http://devinvenable.blogspot.com/2007/10/wicket-and-html-style-attributes.html The source code is available at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/java/org/example/runner/runlog/RunlogPage.java?rev=118 Adding the following code: item.add(new AttributeModifier(class, new PropertyModel(this, runlog.getId() % 2 == 0 ? list-line-odd : list-line-event))); at line 104 or 134 gives the following error: -- cut here -- WicketMessage: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class org.example.runner.runlog.RunlogPage$2 expression: list-line-odd at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) -- cut here -- CSS is statically linked as: link rel=stylesheet type=text/css href=css/runlog.css/ The CSS is at: http://kenai.com/projects/runner/sources/subversion/content/wicket/runner/src/main/webapp/css/runlog.css?rev=118 Any idea, what's wrong ? Or a better advise to provide odd/even rows with different colors ? Thanks, -Arun -- Need Application Server ? - Download glassfish.org Blog: http://blogs.sun.com/arungupta - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Alternate-rows-with-different-color-tp24818138p24818321.html Sent from the Wicket - User mailing list archive at Nabble.com