Re: A few more newbie questions
Are you basically wanting each users' browser to be notified of some change in state on the server? Well, there are a couple of ways to go about this. You can either implement server "push" or you can have your application "poll" via Ajax. On Fri, Sep 12, 2008 at 8:52 PM, walnutmon <[EMAIL PROTECTED]> wrote: > > Because a wicket application runs on a server, could you have an internet > application has a listener that responds to messages sent from another > instance of the web app in another browser through a static object that can > send targeted "announcements", or messages? > > > A little psuedo... > > > class MyWebApp extends WicketWebApp{ >private static UserInstances; >getHomePage() >{ >Page freshHomePageInstance = new > FreshPageClass(UserInstances.getMessageSender()); >UserInstances.add(freshHomePageInstance); >return freshHomePageInstance; >} >} > >class FreshPageClass{ > >onMessage(messageContents) >{ >//does something with the message, make ajax call >} >} > >class UserInstances >{ >private final static messageSender; >static getMessageSender() >{ >return messageSender; >} >sendMessageToAllUsers(message){...} >sendMessageToSomeUser(userInstance, message){...} >} > > > Hopefully that makes some sense, it's a kind of half baked idea, just > wondering if it's feasible. > > > -- > View this message in context: > http://www.nabble.com/A-few-more-newbie-questions-tp19466367p19466367.html > Sent from the Wicket - User mailing list archive at Nabble.com. > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mysterious classnotfoundexceptions
are you using a framework that uses classloaders on top of the web app classloaders?? this is a very very bad idea. especially with wicket or with clustering in general.. you really shouldnt do that. For wicket we have a solution please look at the: org.apache.wicket.settings.IApplicationSettings#getClassResolver() and implement your own classresolver (give them the Ofbiz classloaders) johan On Fri, Sep 12, 2008 at 11:55 PM, Ritesh Trivedi <[EMAIL PROTECTED]>wrote: > > I am not - but I am using Apache Ofbiz inside tomcat, Wicket being used as > a > front end to Ofbiz component. Ofbiz has its ClassLoaders which it creates. > May be thats an issue or may be it messes up in hot deploy mode when the > webapp is reloaded due to recompilation. > > Does wicket print anywhere in the logs which classloader its using to load > the class? > > > > igor.vaynberg wrote: > > > > are you using any interesting class reloading tools like javarebel, etc? > > > > -igor > > > > On Fri, Sep 12, 2008 at 2:31 PM, Ritesh Trivedi > > <[EMAIL PROTECTED]> wrote: > >> > >> Every once in a while I get these classnotfoundexceptions for some odd > >> reason > >> which I cant figure out why. The class does exist (its a panel as you > can > >> tell from the classname) and is serializeable with one of the members > >> IClusterable. It happens atleast few times a day and dont know why - > >> > >> Will appreciate any pointers or how to go about debugging these kind of > >> issues... > >> > >> Here is the stacktrace. > >> > >> The URL that causes this > >> http://localhost/search/bizfon 4000/true/ > >> > >> THe resulting URL in the browser > >> > http://localhost/?wicket:interface=:16:bodyContentContainer:leftBarPanel:searchForm::IFormSubmitListener > :: > >> > >> Exception report > >> > >> message > >> > >> description The server encountered an internal error () that prevented > it > >> from fulfilling this request. > >> > >> exception > >> > >> javax.servlet.ServletException: Filter execution threw an exception > >> > >> root cause > >> > >> java.lang.NoClassDefFoundError: > >> com/neobits/web/panels/VerticalLinkItemListWithCountPanel > >>java.lang.Class.getDeclaredFields0(Native Method) > >>java.lang.Class.privateGetDeclaredFields(Class.java:2259) > >>java.lang.Class.getDeclaredField(Class.java:1852) > >> > java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1582) > >>java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52) > >>java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:408) > >>java.security.AccessController.doPrivileged(Native Method) > >>java.io.ObjectStreamClass.(ObjectStreamClass.java:400) > >>java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:297) > >>java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:531) > >> > >> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552) > >>java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466) > >> > >> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552) > >>java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466) > >> > >> > java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699) > >>java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) > >>java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) > >> > >> org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:393) > >> > >> > org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:228) > >> > >> > org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:706) > >> > >> > org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:311) > >>org.apache.wicket.Session.getPage(Session.java:751) > >> > >> > org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:448) > >> > >> > org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCyclePr > >> -- > >> View this message in context: > >> > http://www.nabble.com/Mysterious-classnotfoundexceptions-tp19464494p19464494.html > >> Sent from the Wicket - User mailing list archive at Nabble.com. > >> > >> > >> - > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > View this message in context: > http://www.nabble.com/Mysterious-classnotfoundexceptions-tp19464494p19464767.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For add
Re: Automated testing of Wicket applications
go for it if you want, its a 5 minute thing anyways. and yes, there should be a setting that is off by default in both dev and prod modes. -igor On Fri, Sep 12, 2008 at 4:04 PM, James Carman <[EMAIL PROTECTED]> wrote: > Done: > > https://issues.apache.org/jira/browse/WICKET-1830 > > If you don't mind, I'd like to take a stab at this. I can submit a > patch. Do you want me to develop it against trunk or the 1.3 branch? > I assume you want this to be optional in development mode so that we > don't screw up all of the generated markup matching test cases that > wicket (and other projects probably) have. > > > On Fri, Sep 12, 2008 at 6:04 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: >> open a jira issue and we can whip it up >> >> -igor >> >> On Fri, Sep 12, 2008 at 2:54 PM, James Carman >> <[EMAIL PROTECTED]> wrote: >>> That might be pretty cool! I can see how that might help constructing >>> your unit tests. >>> >>> On Fri, Sep 12, 2008 at 5:03 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: we can always make it so there is a setting that outputs the full path as an attribute of a component if that is helpful. eg -igor On Fri, Sep 12, 2008 at 12:18 PM, German Morales <[EMAIL PROTECTED]> wrote: > 2008/9/12 Jan Stette <[EMAIL PROTECTED]> > >> Hi German, thanks for an interesting reply. >> >> Ruby probably wouldn't be appropriate in our environment, but it's still >> interesting to see the principles involved in writing tests using it. >> Some >> points I'm not clear about: >> >> When Wicket generates pages, as far as I can tell, the wicket:id that's >> stated in the markup just shows the local wicket:id, not the full path. >> So >> how can you refer to the item by the whole path, as in your example? (Is >> there a way to change which ids are rendered in the markup?) > > > Yes, the wicket id is not usable to search the components, because wicket > adds some extra characters in runtime. > > Normally, the "name" attribute should be good enough, and that's what we > are > using. > > From FormComponent#getInputName: >/** > * Gets the string to be used for the name attribute of the form > element. Generated > * using the path from the form to the component, excluding the form > itself. ... > * ... > */ > > You should see attributes generated like: > panel1:panel2:form:panel3:innerForm:whateverElse:YourComponentID > > I'm also interested in what you say about using generated attributes. One >> of the problems we're facing is that our application is highly dynamic, >> the >> exact structure of a page depends on user configuration and setup. So I >> was >> thinking about something like using AttributeModifiers to set known ids >> on >> certain key components on a page. Is this what you mean by "generated >> attributes"? > > > Yes, that's a possible way. Also i was mentioning it for components that > do > not have a name, like Links. > They are not FormComponents, but you still want to find them. > > >> Then, to make it all more interesting, there's Ajax. Our application >> makes >> heavy use of Ajax, so components come and go on a page in response to >> Ajax >> updates. I'm not sure which ids are available for identifying components >> in >> this case. Looking at pages in FireBug, I can't see wicket:id tags at >> all, >> but I'm not sure if that's missing something... Is this something you >> have >> dealt with in your testing? > > >> >> Regards, >> Jan >> >> >> 2008/9/12 German Morales <[EMAIL PROTECTED]> >> >> > Hi Jan, >> > >> > We are using Watir, which lets you write tests in ruby. >> > >> > And we are using mainly wicket generated names for identification of >> > components, but sometimes we use generated attributes too (for example >> >> > does not have name), or just the text in the html. >> > >> > Since the code is all in ruby, it is in theory easy to refactor in case >> of >> > some changes. >> > For example, you can do this: >> > >> > textfield = ie.text_field(:name, >> "your:very:long:wicket:generated:name") >> > >> > or, in case of page changes... >> > >> > constant_defined_somewhere = "your:very:long:wicket" >> > textfield = ie.text_field(:name, constant_defined_somewhere + >> > ":generated:name") >> > >> > then you could fix all tests just changing the constant. >> > Well, this is an explanation of a quick solution to your particular >> > case >> of >> > changing the hierarchy. >> > But the idea is that you have a full (and good) programming language to >> do >> > things "right": refactoring,
Re: Automated testing of Wicket applications
Ah sorry, you must have beat me to it by seconds! https://issues.apache.org/jira/browse/WICKET-1831 I'll close mine off as a dupe... With regards to scheduling, it would be really great to have this in 1.3.5 if it's not a big change. Thanks, Jan 2008/9/13 James Carman <[EMAIL PROTECTED]> > Done: > > https://issues.apache.org/jira/browse/WICKET-1830 > > If you don't mind, I'd like to take a stab at this. I can submit a > patch. Do you want me to develop it against trunk or the 1.3 branch? > I assume you want this to be optional in development mode so that we > don't screw up all of the generated markup matching test cases that > wicket (and other projects probably) have. > > > On Fri, Sep 12, 2008 at 6:04 PM, Igor Vaynberg <[EMAIL PROTECTED]> > wrote: > > open a jira issue and we can whip it up > > > > -igor > > > > On Fri, Sep 12, 2008 at 2:54 PM, James Carman > > <[EMAIL PROTECTED]> wrote: > >> That might be pretty cool! I can see how that might help constructing > >> your unit tests. > >> > >> On Fri, Sep 12, 2008 at 5:03 PM, Igor Vaynberg <[EMAIL PROTECTED]> > wrote: > >>> we can always make it so there is a setting that outputs the full path > >>> as an attribute of a component if that is helpful. > >>> > >>> eg > >>> > >>> > >>> > >>> -igor > >>> > >>> On Fri, Sep 12, 2008 at 12:18 PM, German Morales > >>> <[EMAIL PROTECTED]> wrote: > 2008/9/12 Jan Stette <[EMAIL PROTECTED]> > > > Hi German, thanks for an interesting reply. > > > > Ruby probably wouldn't be appropriate in our environment, but it's > still > > interesting to see the principles involved in writing tests using it. > Some > > points I'm not clear about: > > > > When Wicket generates pages, as far as I can tell, the wicket:id > that's > > stated in the markup just shows the local wicket:id, not the full > path. So > > how can you refer to the item by the whole path, as in your example? > (Is > > there a way to change which ids are rendered in the markup?) > > > Yes, the wicket id is not usable to search the components, because > wicket > adds some extra characters in runtime. > > Normally, the "name" attribute should be good enough, and that's what > we are > using. > > From FormComponent#getInputName: > /** > * Gets the string to be used for the name attribute of the form > element. Generated > * using the path from the form to the component, excluding the > form > itself. ... > * ... > */ > > You should see attributes generated like: > panel1:panel2:form:panel3:innerForm:whateverElse:YourComponentID > > I'm also interested in what you say about using generated attributes. > One > > of the problems we're facing is that our application is highly > dynamic, the > > exact structure of a page depends on user configuration and setup. > So I > > was > > thinking about something like using AttributeModifiers to set known > ids on > > certain key components on a page. Is this what you mean by > "generated > > attributes"? > > > Yes, that's a possible way. Also i was mentioning it for components > that do > not have a name, like Links. > They are not FormComponents, but you still want to find them. > > > > Then, to make it all more interesting, there's Ajax. Our application > makes > > heavy use of Ajax, so components come and go on a page in response to > Ajax > > updates. I'm not sure which ids are available for identifying > components > > in > > this case. Looking at pages in FireBug, I can't see wicket:id tags > at all, > > but I'm not sure if that's missing something... Is this something > you have > > dealt with in your testing? > > > > > > Regards, > > Jan > > > > > > 2008/9/12 German Morales <[EMAIL PROTECTED]> > > > > > Hi Jan, > > > > > > We are using Watir, which lets you write tests in ruby. > > > > > > And we are using mainly wicket generated names for identification > of > > > components, but sometimes we use generated attributes too (for > example > > > > > does not have name), or just the text in the html. > > > > > > Since the code is all in ruby, it is in theory easy to refactor in > case > > of > > > some changes. > > > For example, you can do this: > > > > > > textfield = ie.text_field(:name, > > "your:very:long:wicket:generated:name") > > > > > > or, in case of page changes... > > > > > > constant_defined_somewhere = "your:very:long:wicket" > > > textfield = ie.text_field(:name, constant_defined_somewhere + > > > ":generated:name") > > > > > > then you could fix all tests just changing the constant. > > > Well, this is an explanation of a quick solution to your particular > case > > of > > > chang
Re: Automated testing of Wicket applications
Done: https://issues.apache.org/jira/browse/WICKET-1830 If you don't mind, I'd like to take a stab at this. I can submit a patch. Do you want me to develop it against trunk or the 1.3 branch? I assume you want this to be optional in development mode so that we don't screw up all of the generated markup matching test cases that wicket (and other projects probably) have. On Fri, Sep 12, 2008 at 6:04 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > open a jira issue and we can whip it up > > -igor > > On Fri, Sep 12, 2008 at 2:54 PM, James Carman > <[EMAIL PROTECTED]> wrote: >> That might be pretty cool! I can see how that might help constructing >> your unit tests. >> >> On Fri, Sep 12, 2008 at 5:03 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: >>> we can always make it so there is a setting that outputs the full path >>> as an attribute of a component if that is helpful. >>> >>> eg >>> >>> >>> >>> -igor >>> >>> On Fri, Sep 12, 2008 at 12:18 PM, German Morales >>> <[EMAIL PROTECTED]> wrote: 2008/9/12 Jan Stette <[EMAIL PROTECTED]> > Hi German, thanks for an interesting reply. > > Ruby probably wouldn't be appropriate in our environment, but it's still > interesting to see the principles involved in writing tests using it. > Some > points I'm not clear about: > > When Wicket generates pages, as far as I can tell, the wicket:id that's > stated in the markup just shows the local wicket:id, not the full path. > So > how can you refer to the item by the whole path, as in your example? (Is > there a way to change which ids are rendered in the markup?) Yes, the wicket id is not usable to search the components, because wicket adds some extra characters in runtime. Normally, the "name" attribute should be good enough, and that's what we are using. From FormComponent#getInputName: /** * Gets the string to be used for the name attribute of the form element. Generated * using the path from the form to the component, excluding the form itself. ... * ... */ You should see attributes generated like: panel1:panel2:form:panel3:innerForm:whateverElse:YourComponentID I'm also interested in what you say about using generated attributes. One > of the problems we're facing is that our application is highly dynamic, > the > exact structure of a page depends on user configuration and setup. So I > was > thinking about something like using AttributeModifiers to set known ids on > certain key components on a page. Is this what you mean by "generated > attributes"? Yes, that's a possible way. Also i was mentioning it for components that do not have a name, like Links. They are not FormComponents, but you still want to find them. > Then, to make it all more interesting, there's Ajax. Our application > makes > heavy use of Ajax, so components come and go on a page in response to Ajax > updates. I'm not sure which ids are available for identifying components > in > this case. Looking at pages in FireBug, I can't see wicket:id tags at > all, > but I'm not sure if that's missing something... Is this something you > have > dealt with in your testing? > > Regards, > Jan > > > 2008/9/12 German Morales <[EMAIL PROTECTED]> > > > Hi Jan, > > > > We are using Watir, which lets you write tests in ruby. > > > > And we are using mainly wicket generated names for identification of > > components, but sometimes we use generated attributes too (for example > > > does not have name), or just the text in the html. > > > > Since the code is all in ruby, it is in theory easy to refactor in case > of > > some changes. > > For example, you can do this: > > > > textfield = ie.text_field(:name, > "your:very:long:wicket:generated:name") > > > > or, in case of page changes... > > > > constant_defined_somewhere = "your:very:long:wicket" > > textfield = ie.text_field(:name, constant_defined_somewhere + > > ":generated:name") > > > > then you could fix all tests just changing the constant. > > Well, this is an explanation of a quick solution to your particular case > of > > changing the hierarchy. > > But the idea is that you have a full (and good) programming language to > do > > things "right": refactoring, reuse, and so on. > > > > Beware: > > Watir does not always runs perfectly... the tests are somehow dependent > on > > timing, which depends on the machine you run the tests, and other > factors. > > This is specially problematic in ajax calls. > > That means that sometimes we get errors, then we run the same test again > > and > > it works. > > >
Re: Automated testing of Wicket applications
That sounds very promising, thanks! Jan 2008/9/12 Pointbreak <[EMAIL PROTECTED]<[EMAIL PROTECTED]> > > > Also, have you > > successfully tested Ajax applications using Selenium-RC and Junit? > > I have, and Selenium works really well for testing wicket ajax > applications. Only thing I had to do was to add a script to the pages > that helps selenium figure out when ajax requests are finished. See this > thread: http://www.nabble.com/Ajax-testing-with-Selenium-td19204133.html > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: Automated testing of Wicket applications
open a jira issue and we can whip it up -igor On Fri, Sep 12, 2008 at 2:54 PM, James Carman <[EMAIL PROTECTED]> wrote: > That might be pretty cool! I can see how that might help constructing > your unit tests. > > On Fri, Sep 12, 2008 at 5:03 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: >> we can always make it so there is a setting that outputs the full path >> as an attribute of a component if that is helpful. >> >> eg >> >> >> >> -igor >> >> On Fri, Sep 12, 2008 at 12:18 PM, German Morales >> <[EMAIL PROTECTED]> wrote: >>> 2008/9/12 Jan Stette <[EMAIL PROTECTED]> >>> Hi German, thanks for an interesting reply. Ruby probably wouldn't be appropriate in our environment, but it's still interesting to see the principles involved in writing tests using it. Some points I'm not clear about: When Wicket generates pages, as far as I can tell, the wicket:id that's stated in the markup just shows the local wicket:id, not the full path. So how can you refer to the item by the whole path, as in your example? (Is there a way to change which ids are rendered in the markup?) >>> >>> >>> Yes, the wicket id is not usable to search the components, because wicket >>> adds some extra characters in runtime. >>> >>> Normally, the "name" attribute should be good enough, and that's what we are >>> using. >>> >>> From FormComponent#getInputName: >>>/** >>> * Gets the string to be used for the name attribute of the form >>> element. Generated >>> * using the path from the form to the component, excluding the form >>> itself. ... >>> * ... >>> */ >>> >>> You should see attributes generated like: >>> panel1:panel2:form:panel3:innerForm:whateverElse:YourComponentID >>> >>> I'm also interested in what you say about using generated attributes. One of the problems we're facing is that our application is highly dynamic, the exact structure of a page depends on user configuration and setup. So I was thinking about something like using AttributeModifiers to set known ids on certain key components on a page. Is this what you mean by "generated attributes"? >>> >>> >>> Yes, that's a possible way. Also i was mentioning it for components that do >>> not have a name, like Links. >>> They are not FormComponents, but you still want to find them. >>> >>> Then, to make it all more interesting, there's Ajax. Our application makes heavy use of Ajax, so components come and go on a page in response to Ajax updates. I'm not sure which ids are available for identifying components in this case. Looking at pages in FireBug, I can't see wicket:id tags at all, but I'm not sure if that's missing something... Is this something you have dealt with in your testing? >>> >>> Regards, Jan 2008/9/12 German Morales <[EMAIL PROTECTED]> > Hi Jan, > > We are using Watir, which lets you write tests in ruby. > > And we are using mainly wicket generated names for identification of > components, but sometimes we use generated attributes too (for example > does not have name), or just the text in the html. > > Since the code is all in ruby, it is in theory easy to refactor in case of > some changes. > For example, you can do this: > > textfield = ie.text_field(:name, "your:very:long:wicket:generated:name") > > or, in case of page changes... > > constant_defined_somewhere = "your:very:long:wicket" > textfield = ie.text_field(:name, constant_defined_somewhere + > ":generated:name") > > then you could fix all tests just changing the constant. > Well, this is an explanation of a quick solution to your particular case of > changing the hierarchy. > But the idea is that you have a full (and good) programming language to do > things "right": refactoring, reuse, and so on. > > Beware: > Watir does not always runs perfectly... the tests are somehow dependent on > timing, which depends on the machine you run the tests, and other factors. > This is specially problematic in ajax calls. > That means that sometimes we get errors, then we run the same test again > and > it works. > > Hope this helps, > > German > > 2008/9/12 Jan Stette <[EMAIL PROTECTED]> > > > This is a bit of a general question: I'd be interested in hearing about > how > > people do automated tests of their Wicket applications. I'm thinking > about > > system tests of the full application, not unit tests. > > > > There are of course tools like Selenium which let you automate actions on > a > > web application. My colleagues with experience of this from other > > applications tell me that one of the main challenges is to stop test > cases >>
Re: Mysterious classnotfoundexceptions
ah, i assumed you were seeing this in production...some times you can get these kinds of errors because of hot deployment. -igor On Fri, Sep 12, 2008 at 2:55 PM, Ritesh Trivedi <[EMAIL PROTECTED]> wrote: > > I am not - but I am using Apache Ofbiz inside tomcat, Wicket being used as a > front end to Ofbiz component. Ofbiz has its ClassLoaders which it creates. > May be thats an issue or may be it messes up in hot deploy mode when the > webapp is reloaded due to recompilation. > > Does wicket print anywhere in the logs which classloader its using to load > the class? > > > > igor.vaynberg wrote: >> >> are you using any interesting class reloading tools like javarebel, etc? >> >> -igor >> >> On Fri, Sep 12, 2008 at 2:31 PM, Ritesh Trivedi >> <[EMAIL PROTECTED]> wrote: >>> >>> Every once in a while I get these classnotfoundexceptions for some odd >>> reason >>> which I cant figure out why. The class does exist (its a panel as you can >>> tell from the classname) and is serializeable with one of the members >>> IClusterable. It happens atleast few times a day and dont know why - >>> >>> Will appreciate any pointers or how to go about debugging these kind of >>> issues... >>> >>> Here is the stacktrace. >>> >>> The URL that causes this >>> http://localhost/search/bizfon 4000/true/ >>> >>> THe resulting URL in the browser >>> http://localhost/?wicket:interface=:16:bodyContentContainer:leftBarPanel:searchForm::IFormSubmitListener:: >>> >>> Exception report >>> >>> message >>> >>> description The server encountered an internal error () that prevented it >>> from fulfilling this request. >>> >>> exception >>> >>> javax.servlet.ServletException: Filter execution threw an exception >>> >>> root cause >>> >>> java.lang.NoClassDefFoundError: >>> com/neobits/web/panels/VerticalLinkItemListWithCountPanel >>>java.lang.Class.getDeclaredFields0(Native Method) >>>java.lang.Class.privateGetDeclaredFields(Class.java:2259) >>>java.lang.Class.getDeclaredField(Class.java:1852) >>>java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1582) >>>java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52) >>>java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:408) >>>java.security.AccessController.doPrivileged(Native Method) >>>java.io.ObjectStreamClass.(ObjectStreamClass.java:400) >>>java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:297) >>>java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:531) >>> >>> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552) >>>java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466) >>> >>> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552) >>>java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466) >>> >>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699) >>>java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) >>>java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) >>> >>> org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:393) >>> >>> org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:228) >>> >>> org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:706) >>> >>> org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:311) >>>org.apache.wicket.Session.getPage(Session.java:751) >>> >>> org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:448) >>> >>> org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCyclePr >>> -- >>> View this message in context: >>> http://www.nabble.com/Mysterious-classnotfoundexceptions-tp19464494p19464494.html >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- > View this message in context: > http://www.nabble.com/Mysterious-classnotfoundexceptions-tp19464494p19464767.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mysterious classnotfoundexceptions
I am not - but I am using Apache Ofbiz inside tomcat, Wicket being used as a front end to Ofbiz component. Ofbiz has its ClassLoaders which it creates. May be thats an issue or may be it messes up in hot deploy mode when the webapp is reloaded due to recompilation. Does wicket print anywhere in the logs which classloader its using to load the class? igor.vaynberg wrote: > > are you using any interesting class reloading tools like javarebel, etc? > > -igor > > On Fri, Sep 12, 2008 at 2:31 PM, Ritesh Trivedi > <[EMAIL PROTECTED]> wrote: >> >> Every once in a while I get these classnotfoundexceptions for some odd >> reason >> which I cant figure out why. The class does exist (its a panel as you can >> tell from the classname) and is serializeable with one of the members >> IClusterable. It happens atleast few times a day and dont know why - >> >> Will appreciate any pointers or how to go about debugging these kind of >> issues... >> >> Here is the stacktrace. >> >> The URL that causes this >> http://localhost/search/bizfon 4000/true/ >> >> THe resulting URL in the browser >> http://localhost/?wicket:interface=:16:bodyContentContainer:leftBarPanel:searchForm::IFormSubmitListener:: >> >> Exception report >> >> message >> >> description The server encountered an internal error () that prevented it >> from fulfilling this request. >> >> exception >> >> javax.servlet.ServletException: Filter execution threw an exception >> >> root cause >> >> java.lang.NoClassDefFoundError: >> com/neobits/web/panels/VerticalLinkItemListWithCountPanel >>java.lang.Class.getDeclaredFields0(Native Method) >>java.lang.Class.privateGetDeclaredFields(Class.java:2259) >>java.lang.Class.getDeclaredField(Class.java:1852) >>java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1582) >>java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52) >>java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:408) >>java.security.AccessController.doPrivileged(Native Method) >>java.io.ObjectStreamClass.(ObjectStreamClass.java:400) >>java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:297) >>java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:531) >> >> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552) >>java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466) >> >> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552) >>java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466) >> >> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699) >>java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) >>java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) >> >> org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:393) >> >> org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:228) >> >> org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:706) >> >> org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:311) >>org.apache.wicket.Session.getPage(Session.java:751) >> >> org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:448) >> >> org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCyclePr >> -- >> View this message in context: >> http://www.nabble.com/Mysterious-classnotfoundexceptions-tp19464494p19464494.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Mysterious-classnotfoundexceptions-tp19464494p19464767.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Automated testing of Wicket applications
That might be pretty cool! I can see how that might help constructing your unit tests. On Fri, Sep 12, 2008 at 5:03 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > we can always make it so there is a setting that outputs the full path > as an attribute of a component if that is helpful. > > eg > > > > -igor > > On Fri, Sep 12, 2008 at 12:18 PM, German Morales > <[EMAIL PROTECTED]> wrote: >> 2008/9/12 Jan Stette <[EMAIL PROTECTED]> >> >>> Hi German, thanks for an interesting reply. >>> >>> Ruby probably wouldn't be appropriate in our environment, but it's still >>> interesting to see the principles involved in writing tests using it. Some >>> points I'm not clear about: >>> >>> When Wicket generates pages, as far as I can tell, the wicket:id that's >>> stated in the markup just shows the local wicket:id, not the full path. So >>> how can you refer to the item by the whole path, as in your example? (Is >>> there a way to change which ids are rendered in the markup?) >> >> >> Yes, the wicket id is not usable to search the components, because wicket >> adds some extra characters in runtime. >> >> Normally, the "name" attribute should be good enough, and that's what we are >> using. >> >> From FormComponent#getInputName: >>/** >> * Gets the string to be used for the name attribute of the form >> element. Generated >> * using the path from the form to the component, excluding the form >> itself. ... >> * ... >> */ >> >> You should see attributes generated like: >> panel1:panel2:form:panel3:innerForm:whateverElse:YourComponentID >> >> I'm also interested in what you say about using generated attributes. One >>> of the problems we're facing is that our application is highly dynamic, the >>> exact structure of a page depends on user configuration and setup. So I >>> was >>> thinking about something like using AttributeModifiers to set known ids on >>> certain key components on a page. Is this what you mean by "generated >>> attributes"? >> >> >> Yes, that's a possible way. Also i was mentioning it for components that do >> not have a name, like Links. >> They are not FormComponents, but you still want to find them. >> >> >>> Then, to make it all more interesting, there's Ajax. Our application makes >>> heavy use of Ajax, so components come and go on a page in response to Ajax >>> updates. I'm not sure which ids are available for identifying components >>> in >>> this case. Looking at pages in FireBug, I can't see wicket:id tags at all, >>> but I'm not sure if that's missing something... Is this something you have >>> dealt with in your testing? >> >> >>> >>> Regards, >>> Jan >>> >>> >>> 2008/9/12 German Morales <[EMAIL PROTECTED]> >>> >>> > Hi Jan, >>> > >>> > We are using Watir, which lets you write tests in ruby. >>> > >>> > And we are using mainly wicket generated names for identification of >>> > components, but sometimes we use generated attributes too (for example >>> >>> > does not have name), or just the text in the html. >>> > >>> > Since the code is all in ruby, it is in theory easy to refactor in case >>> of >>> > some changes. >>> > For example, you can do this: >>> > >>> > textfield = ie.text_field(:name, >>> "your:very:long:wicket:generated:name") >>> > >>> > or, in case of page changes... >>> > >>> > constant_defined_somewhere = "your:very:long:wicket" >>> > textfield = ie.text_field(:name, constant_defined_somewhere + >>> > ":generated:name") >>> > >>> > then you could fix all tests just changing the constant. >>> > Well, this is an explanation of a quick solution to your particular case >>> of >>> > changing the hierarchy. >>> > But the idea is that you have a full (and good) programming language to >>> do >>> > things "right": refactoring, reuse, and so on. >>> > >>> > Beware: >>> > Watir does not always runs perfectly... the tests are somehow dependent >>> on >>> > timing, which depends on the machine you run the tests, and other >>> factors. >>> > This is specially problematic in ajax calls. >>> > That means that sometimes we get errors, then we run the same test again >>> > and >>> > it works. >>> > >>> > Hope this helps, >>> > >>> > German >>> > >>> > 2008/9/12 Jan Stette <[EMAIL PROTECTED]> >>> > >>> > > This is a bit of a general question: I'd be interested in hearing about >>> > how >>> > > people do automated tests of their Wicket applications. I'm thinking >>> > about >>> > > system tests of the full application, not unit tests. >>> > > >>> > > There are of course tools like Selenium which let you automate actions >>> on >>> > a >>> > > web application. My colleagues with experience of this from other >>> > > applications tell me that one of the main challenges is to stop test >>> > cases >>> > > from being very brittle by relying on the details of the generated >>> > markup. >>> > > It would be nice if it was possible to target components on a page in a >>> > way >>> > > that related them back to roughly the hierarchy of Wicket components. >>>
Re: Mysterious classnotfoundexceptions
are you using any interesting class reloading tools like javarebel, etc? -igor On Fri, Sep 12, 2008 at 2:31 PM, Ritesh Trivedi <[EMAIL PROTECTED]> wrote: > > Every once in a while I get these classnotfoundexceptions for some odd reason > which I cant figure out why. The class does exist (its a panel as you can > tell from the classname) and is serializeable with one of the members > IClusterable. It happens atleast few times a day and dont know why - > > Will appreciate any pointers or how to go about debugging these kind of > issues... > > Here is the stacktrace. > > The URL that causes this > http://localhost/search/bizfon 4000/true/ > > THe resulting URL in the browser > http://localhost/?wicket:interface=:16:bodyContentContainer:leftBarPanel:searchForm::IFormSubmitListener:: > > Exception report > > message > > description The server encountered an internal error () that prevented it > from fulfilling this request. > > exception > > javax.servlet.ServletException: Filter execution threw an exception > > root cause > > java.lang.NoClassDefFoundError: > com/neobits/web/panels/VerticalLinkItemListWithCountPanel >java.lang.Class.getDeclaredFields0(Native Method) >java.lang.Class.privateGetDeclaredFields(Class.java:2259) >java.lang.Class.getDeclaredField(Class.java:1852) >java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1582) >java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52) >java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:408) >java.security.AccessController.doPrivileged(Native Method) >java.io.ObjectStreamClass.(ObjectStreamClass.java:400) >java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:297) >java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:531) >java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552) >java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466) >java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552) >java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466) > > java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699) >java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) >java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) >org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:393) > > org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:228) > > org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:706) > > org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:311) >org.apache.wicket.Session.getPage(Session.java:751) > > org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:448) > > org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCyclePr > -- > View this message in context: > http://www.nabble.com/Mysterious-classnotfoundexceptions-tp19464494p19464494.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: integration Spring/Wicket/Hibernate problem with injection bean
in his very first email he said he is stuck on jdk1.4 -igor On Fri, Sep 12, 2008 at 2:31 PM, jcgarciam <[EMAIL PROTECTED]> wrote: > > Hi everyone and let me thanks you guys for this awesome framework, now back > to the topic :) > > you can use SpringComponentInjector from the wicket-spring-anot, see the > following example which is shown at > http://cwiki.apache.org/WICKET/spring.html#Spring-AnnotationbasedApproach > http://cwiki.apache.org/WICKET/spring.html#Spring-AnnotationbasedApproach : > > class MyApplication extends WebApplication { >public void init() { >super.init(); >addComponentInstantiationListener(new > SpringComponentInjector(this)); >} > } > > class EditContact extends WebPage { > @SpringBean > private ContactDao dao; > > @SpringBean(name="userDao") > private UserDao userDao; > > public EditContact(long userId) { > ... > } > } > > > mahone9 wrote: >> >> Thanks for ur quick response. >> I already read this article. But I don´t like this approach calling this >> creation Proxy stuff when I need it for >> from a Wicket-Bean. >> >> private ContactDao dao = >> LazyInitProxyFactory.createProxy(ContractDao.class, >> new IProxyTargetLocator() { >> public Object locateProxyTarget() { >> return >> ((MyApplication)Application.get()).getSpringContext().getBean("contactDao"); >> } >> } >>} >> >> I´m knew to it and I´m struggeling for the right solution. >> Is there no possibility to tell spring or wicket to do that in the >> background. >> >> I´m just don´t want to care about it... is it now a dao bean or simple >> bean or this special kind of wicket bean which I have to instantiate in >> another way. >> >> What I want is simple to set this stuff in the applicationContext file. >> >> And that spring does the injection throug the "setter-method". >> >> Thanks in advance for ur comments. >> I apprciate it very much. >> >> Cheers Phil >> >> > > -- > View this message in context: > http://www.nabble.com/integration-Spring-Wicket-Hibernate-problem-with-injection-bean-tp19462602p19464502.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: integration Spring/Wicket/Hibernate problem with injection bean
Hi everyone and let me thanks you guys for this awesome framework, now back to the topic :) you can use SpringComponentInjector from the wicket-spring-anot, see the following example which is shown at http://cwiki.apache.org/WICKET/spring.html#Spring-AnnotationbasedApproach http://cwiki.apache.org/WICKET/spring.html#Spring-AnnotationbasedApproach : class MyApplication extends WebApplication { public void init() { super.init(); addComponentInstantiationListener(new SpringComponentInjector(this)); } } class EditContact extends WebPage { @SpringBean private ContactDao dao; @SpringBean(name="userDao") private UserDao userDao; public EditContact(long userId) { ... } } mahone9 wrote: > > Thanks for ur quick response. > I already read this article. But I don´t like this approach calling this > creation Proxy stuff when I need it for > from a Wicket-Bean. > > private ContactDao dao = > LazyInitProxyFactory.createProxy(ContractDao.class, > new IProxyTargetLocator() { > public Object locateProxyTarget() { > return > ((MyApplication)Application.get()).getSpringContext().getBean("contactDao"); > } > } >} > > I´m knew to it and I´m struggeling for the right solution. > Is there no possibility to tell spring or wicket to do that in the > background. > > I´m just don´t want to care about it... is it now a dao bean or simple > bean or this special kind of wicket bean which I have to instantiate in > another way. > > What I want is simple to set this stuff in the applicationContext file. > > And that spring does the injection throug the "setter-method". > > Thanks in advance for ur comments. > I apprciate it very much. > > Cheers Phil > > -- View this message in context: http://www.nabble.com/integration-Spring-Wicket-Hibernate-problem-with-injection-bean-tp19462602p19464502.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Mysterious classnotfoundexceptions
Every once in a while I get these classnotfoundexceptions for some odd reason which I cant figure out why. The class does exist (its a panel as you can tell from the classname) and is serializeable with one of the members IClusterable. It happens atleast few times a day and dont know why - Will appreciate any pointers or how to go about debugging these kind of issues... Here is the stacktrace. The URL that causes this http://localhost/search/bizfon 4000/true/ THe resulting URL in the browser http://localhost/?wicket:interface=:16:bodyContentContainer:leftBarPanel:searchForm::IFormSubmitListener:: Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Filter execution threw an exception root cause java.lang.NoClassDefFoundError: com/neobits/web/panels/VerticalLinkItemListWithCountPanel java.lang.Class.getDeclaredFields0(Native Method) java.lang.Class.privateGetDeclaredFields(Class.java:2259) java.lang.Class.getDeclaredField(Class.java:1852) java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1582) java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52) java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:408) java.security.AccessController.doPrivileged(Native Method) java.io.ObjectStreamClass.(ObjectStreamClass.java:400) java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:297) java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:531) java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552) java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466) java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552) java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466) java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699) java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:393) org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:228) org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:706) org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:311) org.apache.wicket.Session.getPage(Session.java:751) org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:448) org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCyclePr -- View this message in context: http://www.nabble.com/Mysterious-classnotfoundexceptions-tp19464494p19464494.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: integration Spring/Wicket/Hibernate problem with injection bean
there was also a project that integrated commons-attributes instead of the springbean annot so your code would be /** @SpringBean */ private dao; instead of the jdk5 version @SpringBean private dao; -igor On Fri, Sep 12, 2008 at 1:39 PM, mahone9 <[EMAIL PROTECTED]> wrote: > > Hmmm, i thought about it too. But is it the best practise or an acceptable > hack ??? > > With ur mentioned approach I have always to be aware of wicket beans in > order to handle them in that special way. > > Is it somehow possible to hook into any bean instantiation class (or > beanFactory etc.)... and tell spring if any wicket bean comes into then > handle it in a special way. > > Are there any other options ??? > > Thanks > > > > -- > View this message in context: > http://www.nabble.com/AW%3A-integration-Spring-Wicket-Hibernate-problem-with-injection-bean-tp19462976p19463709.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Automated testing of Wicket applications
we can always make it so there is a setting that outputs the full path as an attribute of a component if that is helpful. eg -igor On Fri, Sep 12, 2008 at 12:18 PM, German Morales <[EMAIL PROTECTED]> wrote: > 2008/9/12 Jan Stette <[EMAIL PROTECTED]> > >> Hi German, thanks for an interesting reply. >> >> Ruby probably wouldn't be appropriate in our environment, but it's still >> interesting to see the principles involved in writing tests using it. Some >> points I'm not clear about: >> >> When Wicket generates pages, as far as I can tell, the wicket:id that's >> stated in the markup just shows the local wicket:id, not the full path. So >> how can you refer to the item by the whole path, as in your example? (Is >> there a way to change which ids are rendered in the markup?) > > > Yes, the wicket id is not usable to search the components, because wicket > adds some extra characters in runtime. > > Normally, the "name" attribute should be good enough, and that's what we are > using. > > From FormComponent#getInputName: >/** > * Gets the string to be used for the name attribute of the form > element. Generated > * using the path from the form to the component, excluding the form > itself. ... > * ... > */ > > You should see attributes generated like: > panel1:panel2:form:panel3:innerForm:whateverElse:YourComponentID > > I'm also interested in what you say about using generated attributes. One >> of the problems we're facing is that our application is highly dynamic, the >> exact structure of a page depends on user configuration and setup. So I >> was >> thinking about something like using AttributeModifiers to set known ids on >> certain key components on a page. Is this what you mean by "generated >> attributes"? > > > Yes, that's a possible way. Also i was mentioning it for components that do > not have a name, like Links. > They are not FormComponents, but you still want to find them. > > >> Then, to make it all more interesting, there's Ajax. Our application makes >> heavy use of Ajax, so components come and go on a page in response to Ajax >> updates. I'm not sure which ids are available for identifying components >> in >> this case. Looking at pages in FireBug, I can't see wicket:id tags at all, >> but I'm not sure if that's missing something... Is this something you have >> dealt with in your testing? > > >> >> Regards, >> Jan >> >> >> 2008/9/12 German Morales <[EMAIL PROTECTED]> >> >> > Hi Jan, >> > >> > We are using Watir, which lets you write tests in ruby. >> > >> > And we are using mainly wicket generated names for identification of >> > components, but sometimes we use generated attributes too (for example >> >> > does not have name), or just the text in the html. >> > >> > Since the code is all in ruby, it is in theory easy to refactor in case >> of >> > some changes. >> > For example, you can do this: >> > >> > textfield = ie.text_field(:name, >> "your:very:long:wicket:generated:name") >> > >> > or, in case of page changes... >> > >> > constant_defined_somewhere = "your:very:long:wicket" >> > textfield = ie.text_field(:name, constant_defined_somewhere + >> > ":generated:name") >> > >> > then you could fix all tests just changing the constant. >> > Well, this is an explanation of a quick solution to your particular case >> of >> > changing the hierarchy. >> > But the idea is that you have a full (and good) programming language to >> do >> > things "right": refactoring, reuse, and so on. >> > >> > Beware: >> > Watir does not always runs perfectly... the tests are somehow dependent >> on >> > timing, which depends on the machine you run the tests, and other >> factors. >> > This is specially problematic in ajax calls. >> > That means that sometimes we get errors, then we run the same test again >> > and >> > it works. >> > >> > Hope this helps, >> > >> > German >> > >> > 2008/9/12 Jan Stette <[EMAIL PROTECTED]> >> > >> > > This is a bit of a general question: I'd be interested in hearing about >> > how >> > > people do automated tests of their Wicket applications. I'm thinking >> > about >> > > system tests of the full application, not unit tests. >> > > >> > > There are of course tools like Selenium which let you automate actions >> on >> > a >> > > web application. My colleagues with experience of this from other >> > > applications tell me that one of the main challenges is to stop test >> > cases >> > > from being very brittle by relying on the details of the generated >> > markup. >> > > It would be nice if it was possible to target components on a page in a >> > way >> > > that related them back to roughly the hierarchy of Wicket components. >> Or >> > > even better, if individual parts of the page (links, input fields, >> > buttons >> > > etc.) could be identified in a way that didn't break when there were >> > > changes >> > > to the Wicket component hierarchy (say, new grouping components being >> > > inserted higher up in the component tree).
Re: integration Spring/Wicket/Hibernate problem with injection bean
Hmmm, i thought about it too. But is it the best practise or an acceptable hack ??? With ur mentioned approach I have always to be aware of wicket beans in order to handle them in that special way. Is it somehow possible to hook into any bean instantiation class (or beanFactory etc.)... and tell spring if any wicket bean comes into then handle it in a special way. Are there any other options ??? Thanks -- View this message in context: http://www.nabble.com/AW%3A-integration-Spring-Wicket-Hibernate-problem-with-injection-bean-tp19462976p19463709.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax & dropdowns
Thank you Matej. The final solution for IE6 (should anyone else hit this lovely dom bug) is to toggle the style.display for the relevant component(s) via appendJavascript for the image. Cheers, Scott On Fri, Sep 12, 2008 at 1:54 AM, Matej Knopp <[EMAIL PROTECTED]> wrote: > prepend/append javascript should work. > > -Matej > > On Thu, Sep 11, 2008 at 11:15 PM, Scott Swank <[EMAIL PROTECTED]> wrote: >> This is apparently an IE6 bug, in that inserting an image in the dom >> above the select screws up the tabindex/focus in some way. If I have >> the span/image already in the dom and I just toggle display:block vs. >> display:hidden then things work. >> >> Is there any way that I populate the tag of the wicket ajax >> response so that I can use dhtml to toggle my display? >> >> Thank you! >> >> Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: integration Spring/Wicket/Hibernate problem with injection bean
Well, Wicket is an unmanaged framework, so you're going to have a hard time getting it to use spring to instantiate and inject beans for you. However, you can move this proxy creation logic up into a superclass if you wish: public class BasePage extends WebPage { protected Object springProxy(Class beanType) { ... } protected Object springProxy(Class beanType, String beanName) { ... } } That might clean up your code a bit. You'd probably have to do a little more homework to get unit tests to work properly, though. On Fri, Sep 12, 2008 at 3:52 PM, Agent Mahone <[EMAIL PROTECTED]> wrote: > Thanks for ur quick response. > I already read this article. But I don´t like this approach calling this > creation Proxy stuff when I need it for > from a Wicket-Bean. > > > private ContactDao dao = LazyInitProxyFactory.createProxy(ContractDao.class, > new IProxyTargetLocator() { > public Object locateProxyTarget() { > return > ((MyApplication)Application.get()).getSpringContext().getBean("contactDao"); > } > } > } > I´m knew to it and I´m struggeling for the right solution. > Is there no possibility to tell spring or wicket to do that in the background. > > I´m just don´t want to care about it... is it now a dao bean or simple bean > or this special kind of wicket bean which I have to instantiate in another > way. > > What I want is simple to set this stuff in the applicationContext file. > > And that spring does the injection throug the "setter-method". > > Thanks in advance for ur comments. > I apprciate it very much. > > Cheers Phil > > __ > Do You Yahoo!? > Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz > gegen Massenmails. > http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: integration Spring/Wicket/Hibernate problem with injection bean
Thanks for ur quick response. I already read this article. But I don´t like this approach calling this creation Proxy stuff when I need it for from a Wicket-Bean. private ContactDao dao = LazyInitProxyFactory.createProxy(ContractDao.class, new IProxyTargetLocator() { public Object locateProxyTarget() { return ((MyApplication)Application.get()).getSpringContext().getBean("contactDao"); } } } I´m knew to it and I´m struggeling for the right solution. Is there no possibility to tell spring or wicket to do that in the background. I´m just don´t want to care about it... is it now a dao bean or simple bean or this special kind of wicket bean which I have to instantiate in another way. What I want is simple to set this stuff in the applicationContext file. And that spring does the injection throug the "setter-method". Thanks in advance for ur comments. I apprciate it very much. Cheers Phil -- View this message in context: http://www.nabble.com/integration-Spring-Wicket-Hibernate-problem-with-injection-bean-tp19462602p19462930.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: integration Spring/Wicket/Hibernate problem with injection bean
Thanks for ur quick response. I already read this article. But I don´t like this approach calling this creation Proxy stuff when I need it for from a Wicket-Bean. private ContactDao dao = LazyInitProxyFactory.createProxy(ContractDao.class, new IProxyTargetLocator() { public Object locateProxyTarget() { return ((MyApplication)Application.get()).getSpringContext().getBean("contactDao"); } } } I´m knew to it and I´m struggeling for the right solution. Is there no possibility to tell spring or wicket to do that in the background. I´m just don´t want to care about it... is it now a dao bean or simple bean or this special kind of wicket bean which I have to instantiate in another way. What I want is simple to set this stuff in the applicationContext file. And that spring does the injection throug the "setter-method". Thanks in advance for ur comments. I apprciate it very much. Cheers Phil __ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com
Re: integration Spring/Wicket/Hibernate problem with injection bean
You could use (warning: shameless plug coming) Apache Commons Proxy to create proxies that would lookup your spring beans at runtime. On Fri, Sep 12, 2008 at 3:30 PM, mahone9 <[EMAIL PROTECTED]> wrote: > > Hi @all > I´m new to spring and wicket. I´d like to know how is it possible to inject > wicket beans in a smart way??? > > My preconditions are: using jdk 1.4 > > > for example: my applicationContext.xml file looks like. > > > > > > > > > > > > class LoginPanel extends xxx.wicket.Panel > > > Setting through a setter method in LoginUseCase works fine. > > But the setting through a setter method like for loginPanel dosnt work. The > useCase is always null !!! > > setUseCase(LoginUseCase useCase) { >this.useCase = useCase; > } > > I´ve read that wicket is an unmanaged framework and it can´t work in this > way. > It´s recommend to use the annotions command @springbean: xxx etc... > But I´m looking for another way??? Is there one??? > > Can somebody provide an example, how to solve this??? > > Any help would kindly appreciate > > Cheers Phil > > > > > -- > View this message in context: > http://www.nabble.com/integration-Spring-Wicket-Hibernate-problem-with-injection-bean-tp19462602p19462602.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: integration Spring/Wicket/Hibernate problem with injection bean
Have you read this page: http://cwiki.apache.org/WICKET/spring.html On Fri, Sep 12, 2008 at 3:30 PM, mahone9 <[EMAIL PROTECTED]> wrote: > > Hi @all > I´m new to spring and wicket. I´d like to know how is it possible to inject > wicket beans in a smart way??? > > My preconditions are: using jdk 1.4 > > > for example: my applicationContext.xml file looks like. > > > > > > > > > > > > class LoginPanel extends xxx.wicket.Panel > > > Setting through a setter method in LoginUseCase works fine. > > But the setting through a setter method like for loginPanel dosnt work. The > useCase is always null !!! > > setUseCase(LoginUseCase useCase) { >this.useCase = useCase; > } > > I´ve read that wicket is an unmanaged framework and it can´t work in this > way. > It´s recommend to use the annotions command @springbean: xxx etc... > But I´m looking for another way??? Is there one??? > > Can somebody provide an example, how to solve this??? > > Any help would kindly appreciate > > Cheers Phil > > > > > -- > View this message in context: > http://www.nabble.com/integration-Spring-Wicket-Hibernate-problem-with-injection-bean-tp19462602p19462602.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
integration Spring/Wicket/Hibernate problem with injection bean
Hi @all I´m new to spring and wicket. I´d like to know how is it possible to inject wicket beans in a smart way??? My preconditions are: using jdk 1.4 for example: my applicationContext.xml file looks like. class LoginPanel extends xxx.wicket.Panel Setting through a setter method in LoginUseCase works fine. But the setting through a setter method like for loginPanel dosnt work. The useCase is always null !!! setUseCase(LoginUseCase useCase) { this.useCase = useCase; } I´ve read that wicket is an unmanaged framework and it can´t work in this way. It´s recommend to use the annotions command @springbean: xxx etc... But I´m looking for another way??? Is there one??? Can somebody provide an example, how to solve this??? Any help would kindly appreciate Cheers Phil -- View this message in context: http://www.nabble.com/integration-Spring-Wicket-Hibernate-problem-with-injection-bean-tp19462602p19462602.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Automated testing of Wicket applications
2008/9/12 Jan Stette <[EMAIL PROTECTED]> > Hi German, thanks for an interesting reply. > > Ruby probably wouldn't be appropriate in our environment, but it's still > interesting to see the principles involved in writing tests using it. Some > points I'm not clear about: > > When Wicket generates pages, as far as I can tell, the wicket:id that's > stated in the markup just shows the local wicket:id, not the full path. So > how can you refer to the item by the whole path, as in your example? (Is > there a way to change which ids are rendered in the markup?) Yes, the wicket id is not usable to search the components, because wicket adds some extra characters in runtime. Normally, the "name" attribute should be good enough, and that's what we are using. >From FormComponent#getInputName: /** * Gets the string to be used for the name attribute of the form element. Generated * using the path from the form to the component, excluding the form itself. ... * ... */ You should see attributes generated like: panel1:panel2:form:panel3:innerForm:whateverElse:YourComponentID I'm also interested in what you say about using generated attributes. One > of the problems we're facing is that our application is highly dynamic, the > exact structure of a page depends on user configuration and setup. So I > was > thinking about something like using AttributeModifiers to set known ids on > certain key components on a page. Is this what you mean by "generated > attributes"? Yes, that's a possible way. Also i was mentioning it for components that do not have a name, like Links. They are not FormComponents, but you still want to find them. > Then, to make it all more interesting, there's Ajax. Our application makes > heavy use of Ajax, so components come and go on a page in response to Ajax > updates. I'm not sure which ids are available for identifying components > in > this case. Looking at pages in FireBug, I can't see wicket:id tags at all, > but I'm not sure if that's missing something... Is this something you have > dealt with in your testing? > > Regards, > Jan > > > 2008/9/12 German Morales <[EMAIL PROTECTED]> > > > Hi Jan, > > > > We are using Watir, which lets you write tests in ruby. > > > > And we are using mainly wicket generated names for identification of > > components, but sometimes we use generated attributes too (for example > > > does not have name), or just the text in the html. > > > > Since the code is all in ruby, it is in theory easy to refactor in case > of > > some changes. > > For example, you can do this: > > > > textfield = ie.text_field(:name, > "your:very:long:wicket:generated:name") > > > > or, in case of page changes... > > > > constant_defined_somewhere = "your:very:long:wicket" > > textfield = ie.text_field(:name, constant_defined_somewhere + > > ":generated:name") > > > > then you could fix all tests just changing the constant. > > Well, this is an explanation of a quick solution to your particular case > of > > changing the hierarchy. > > But the idea is that you have a full (and good) programming language to > do > > things "right": refactoring, reuse, and so on. > > > > Beware: > > Watir does not always runs perfectly... the tests are somehow dependent > on > > timing, which depends on the machine you run the tests, and other > factors. > > This is specially problematic in ajax calls. > > That means that sometimes we get errors, then we run the same test again > > and > > it works. > > > > Hope this helps, > > > > German > > > > 2008/9/12 Jan Stette <[EMAIL PROTECTED]> > > > > > This is a bit of a general question: I'd be interested in hearing about > > how > > > people do automated tests of their Wicket applications. I'm thinking > > about > > > system tests of the full application, not unit tests. > > > > > > There are of course tools like Selenium which let you automate actions > on > > a > > > web application. My colleagues with experience of this from other > > > applications tell me that one of the main challenges is to stop test > > cases > > > from being very brittle by relying on the details of the generated > > markup. > > > It would be nice if it was possible to target components on a page in a > > way > > > that related them back to roughly the hierarchy of Wicket components. > Or > > > even better, if individual parts of the page (links, input fields, > > buttons > > > etc.) could be identified in a way that didn't break when there were > > > changes > > > to the Wicket component hierarchy (say, new grouping components being > > > inserted higher up in the component tree). > > > > > > I realise this isn't the responsibility of Wicket, but are there ways > in > > > which Wicket can help here, e.g. by generating ids or other attributes > > > inside the markup in a way that makes it easier to locate items on a > > page? > > > Are there other tools than Selenium that people use, that makes things > > > easier? > > > > > > I'm l
Re: Newbie Question: Dynamically Building Form Elements
Haha, first off, thanks for all the responses, I'm glad the community is active :) I took a look at the Wicket Rad, it looks pretty cool, I think he referenced it so that I can actually see how some of that stuff works, and get a handle on what Wicket is capable of, it was a bit over my head. I then took a look at ListView, and I saw the setReuseItems() function, used to be setOptimizeSomething()... but they deprecated it, apparently they did so just to make the name more meaningful, because it appears the two do the same thing. Thanks again! jwcarman wrote: > > Where's the fun in that? ;) Sorry, I should have mentioned that you > need to setup your ListView to reuse the items if you're doing things > as you say. > > On Fri, Sep 12, 2008 at 10:10 AM, Igor Vaynberg <[EMAIL PROTECTED]> > wrote: >> did you also explain about setreuseitems(true) to them after >> suggesting a listview? >> >> -igor >> >> On Fri, Sep 12, 2008 at 3:35 AM, James Carman >> <[EMAIL PROTECTED]> wrote: >>> Does this person really need a RAD tool for what they're trying to do? >>> All they need to do is display a list of an arbitrary number of radio >>> buttons. Wouldn't ListView suffice in this situation? That's all >>> they asked for. The XP folks would say, "Do the simplest thing that >>> works." >>> >>> On Fri, Sep 12, 2008 at 3:56 AM, wfaler <[EMAIL PROTECTED]> wrote: Jonathan Locke wrote: > > also see wicket-rad if appropriate > A http://sites.google.com/site/wicketrad URL could be useful, so here it is . :) The org.wicketrad.propertyeditor package in the wicket-rad-core module has a bunch of Panels you might want to look at for your problem. The exact problem regarding Radio buttins you (Justin) are talking about can be solved with the org.wicketrad.propertyeditor.input.RadioGroupInput class (it uses an implementation of IChoiceSource to retrieve the number of radio buttons). -- View this message in context: http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19451340.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19461052.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Automated testing of Wicket applications
> Also, have you > successfully tested Ajax applications using Selenium-RC and Junit? I have, and Selenium works really well for testing wicket ajax applications. Only thing I had to do was to add a script to the pages that helps selenium figure out when ajax requests are finished. See this thread: http://www.nabble.com/Ajax-testing-with-Selenium-td19204133.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Automated testing of Wicket applications
Thanks Peter, those are interesting links. As for the question I asked of German as well, are you able to get the full wicket path for components, or just the local wicket:ids? If the latter, how do you deal with components that can be instantiated multiple times on a page? Also, have you successfully tested Ajax applications using Selenium-RC and Junit? Regards, Jan 2008/9/12 Peter Thomas <[EMAIL PROTECTED]> > On Fri, Sep 12, 2008 at 8:12 PM, German Morales <[EMAIL PROTECTED] > >wrote: > > > Hi Jan, > > > > We are using Watir, which lets you write tests in ruby. > > > > For those who don't want to use Ruby, Watij is the Java equivalent of > Watir. http://watij.com/ > > But the problem with both Watij and Watir is that you have to use Microsoft > Internet Explorer. FireFox is not supported. > > I use Selenium-RC with JUnit, works fine for me. I wrote some code to run > JUnit test methods in guranteed order for functional tests and also > "clickAndWait". > > About the problem of tests being brittle and being able to use the Wicket > id-s etc. you can look at this wiki page on JMeter and Wicket: > > > http://cwiki.apache.org/WICKET/wicket-and-jmeter-with-regular-expressions.html > > I haven't tried but maybe you can apply some of the ideas there to Selenium > tests. So if you know the wicket:id beforehand, you could possibly access > the component you need. > > - Peter. > > And we are using mainly wicket generated names for identification of > > components, but sometimes we use generated attributes too (for example > > > does not have name), or just the text in the html. > > > > Since the code is all in ruby, it is in theory easy to refactor in case > of > > some changes. > > For example, you can do this: > > > > textfield = ie.text_field(:name, > "your:very:long:wicket:generated:name") > > > > or, in case of page changes... > > > > constant_defined_somewhere = "your:very:long:wicket" > > textfield = ie.text_field(:name, constant_defined_somewhere + > > ":generated:name") > > > > then you could fix all tests just changing the constant. > > Well, this is an explanation of a quick solution to your particular case > of > > changing the hierarchy. > > But the idea is that you have a full (and good) programming language to > do > > things "right": refactoring, reuse, and so on. > > > > Beware: > > Watir does not always runs perfectly... the tests are somehow dependent > on > > timing, which depends on the machine you run the tests, and other > factors. > > This is specially problematic in ajax calls. > > That means that sometimes we get errors, then we run the same test again > > and > > it works. > > > > Hope this helps, > > > > German > > > > 2008/9/12 Jan Stette <[EMAIL PROTECTED]> > > > > > This is a bit of a general question: I'd be interested in hearing about > > how > > > people do automated tests of their Wicket applications. I'm thinking > > about > > > system tests of the full application, not unit tests. > > > > > > There are of course tools like Selenium which let you automate actions > on > > a > > > web application. My colleagues with experience of this from other > > > applications tell me that one of the main challenges is to stop test > > cases > > > from being very brittle by relying on the details of the generated > > markup. > > > It would be nice if it was possible to target components on a page in a > > way > > > that related them back to roughly the hierarchy of Wicket components. > Or > > > even better, if individual parts of the page (links, input fields, > > buttons > > > etc.) could be identified in a way that didn't break when there were > > > changes > > > to the Wicket component hierarchy (say, new grouping components being > > > inserted higher up in the component tree). > > > > > > I realise this isn't the responsibility of Wicket, but are there ways > in > > > which Wicket can help here, e.g. by generating ids or other attributes > > > inside the markup in a way that makes it easier to locate items on a > > page? > > > Are there other tools than Selenium that people use, that makes things > > > easier? > > > > > > I'm looking forward to hearing about how other Wicket users deal with > > these > > > issues! > > > > > > Regards, > > > Jan > > > > > >
Re: Automated testing of Wicket applications
Hi German, thanks for an interesting reply. Ruby probably wouldn't be appropriate in our environment, but it's still interesting to see the principles involved in writing tests using it. Some points I'm not clear about: When Wicket generates pages, as far as I can tell, the wicket:id that's stated in the markup just shows the local wicket:id, not the full path. So how can you refer to the item by the whole path, as in your example? (Is there a way to change which ids are rendered in the markup?) I'm also interested in what you say about using generated attributes. One of the problems we're facing is that our application is highly dynamic, the exact structure of a page depends on user configuration and setup. So I was thinking about something like using AttributeModifiers to set known ids on certain key components on a page. Is this what you mean by "generated attributes"? Then, to make it all more interesting, there's Ajax. Our application makes heavy use of Ajax, so components come and go on a page in response to Ajax updates. I'm not sure which ids are available for identifying components in this case. Looking at pages in FireBug, I can't see wicket:id tags at all, but I'm not sure if that's missing something... Is this something you have dealt with in your testing? Regards, Jan 2008/9/12 German Morales <[EMAIL PROTECTED]> > Hi Jan, > > We are using Watir, which lets you write tests in ruby. > > And we are using mainly wicket generated names for identification of > components, but sometimes we use generated attributes too (for example > does not have name), or just the text in the html. > > Since the code is all in ruby, it is in theory easy to refactor in case of > some changes. > For example, you can do this: > > textfield = ie.text_field(:name, "your:very:long:wicket:generated:name") > > or, in case of page changes... > > constant_defined_somewhere = "your:very:long:wicket" > textfield = ie.text_field(:name, constant_defined_somewhere + > ":generated:name") > > then you could fix all tests just changing the constant. > Well, this is an explanation of a quick solution to your particular case of > changing the hierarchy. > But the idea is that you have a full (and good) programming language to do > things "right": refactoring, reuse, and so on. > > Beware: > Watir does not always runs perfectly... the tests are somehow dependent on > timing, which depends on the machine you run the tests, and other factors. > This is specially problematic in ajax calls. > That means that sometimes we get errors, then we run the same test again > and > it works. > > Hope this helps, > > German > > 2008/9/12 Jan Stette <[EMAIL PROTECTED]> > > > This is a bit of a general question: I'd be interested in hearing about > how > > people do automated tests of their Wicket applications. I'm thinking > about > > system tests of the full application, not unit tests. > > > > There are of course tools like Selenium which let you automate actions on > a > > web application. My colleagues with experience of this from other > > applications tell me that one of the main challenges is to stop test > cases > > from being very brittle by relying on the details of the generated > markup. > > It would be nice if it was possible to target components on a page in a > way > > that related them back to roughly the hierarchy of Wicket components. Or > > even better, if individual parts of the page (links, input fields, > buttons > > etc.) could be identified in a way that didn't break when there were > > changes > > to the Wicket component hierarchy (say, new grouping components being > > inserted higher up in the component tree). > > > > I realise this isn't the responsibility of Wicket, but are there ways in > > which Wicket can help here, e.g. by generating ids or other attributes > > inside the markup in a way that makes it easier to locate items on a > page? > > Are there other tools than Selenium that people use, that makes things > > easier? > > > > I'm looking forward to hearing about how other Wicket users deal with > these > > issues! > > > > Regards, > > Jan > > >
Re: Automated testing of Wicket applications
Actually there are more platforms for watir ( http://wtr.rubyforge.org/platforms.html): FireWatir and SafariWatir. I gave a quick try to FireWatir some time ago, with no much success, but they continue working on it. They mention also "a Watir interface that uses Selenium". 2008/9/12 Peter Thomas <[EMAIL PROTECTED]> > > On Fri, Sep 12, 2008 at 8:12 PM, German Morales <[EMAIL PROTECTED] >wrote: > > > Hi Jan, > > > > We are using Watir, which lets you write tests in ruby. > > > > For those who don't want to use Ruby, Watij is the Java equivalent of > Watir. http://watij.com/ > > But the problem with both Watij and Watir is that you have to use Microsoft > Internet Explorer. FireFox is not supported. > > I use Selenium-RC with JUnit, works fine for me. I wrote some code to run > JUnit test methods in guranteed order for functional tests and also > "clickAndWait". > > About the problem of tests being brittle and being able to use the Wicket > id-s etc. you can look at this wiki page on JMeter and Wicket: > > http://cwiki.apache.org/WICKET/wicket-and-jmeter-with-regular-expressions.html > > I haven't tried but maybe you can apply some of the ideas there to Selenium > tests. So if you know the wicket:id beforehand, you could possibly access > the component you need. > > - Peter. > > And we are using mainly wicket generated names for identification of > > components, but sometimes we use generated attributes too (for example > > does not have name), or just the text in the html. > > > > Since the code is all in ruby, it is in theory easy to refactor in case of > > some changes. > > For example, you can do this: > > > > textfield = ie.text_field(:name, "your:very:long:wicket:generated:name") > > > > or, in case of page changes... > > > > constant_defined_somewhere = "your:very:long:wicket" > > textfield = ie.text_field(:name, constant_defined_somewhere + > > ":generated:name") > > > > then you could fix all tests just changing the constant. > > Well, this is an explanation of a quick solution to your particular case of > > changing the hierarchy. > > But the idea is that you have a full (and good) programming language to do > > things "right": refactoring, reuse, and so on. > > > > Beware: > > Watir does not always runs perfectly... the tests are somehow dependent on > > timing, which depends on the machine you run the tests, and other factors. > > This is specially problematic in ajax calls. > > That means that sometimes we get errors, then we run the same test again > > and > > it works. > > > > Hope this helps, > > > > German > > > > 2008/9/12 Jan Stette <[EMAIL PROTECTED]> > > > > > This is a bit of a general question: I'd be interested in hearing about > > how > > > people do automated tests of their Wicket applications. I'm thinking > > about > > > system tests of the full application, not unit tests. > > > > > > There are of course tools like Selenium which let you automate actions on > > a > > > web application. My colleagues with experience of this from other > > > applications tell me that one of the main challenges is to stop test > > cases > > > from being very brittle by relying on the details of the generated > > markup. > > > It would be nice if it was possible to target components on a page in a > > way > > > that related them back to roughly the hierarchy of Wicket components. Or > > > even better, if individual parts of the page (links, input fields, > > buttons > > > etc.) could be identified in a way that didn't break when there were > > > changes > > > to the Wicket component hierarchy (say, new grouping components being > > > inserted higher up in the component tree). > > > > > > I realise this isn't the responsibility of Wicket, but are there ways in > > > which Wicket can help here, e.g. by generating ids or other attributes > > > inside the markup in a way that makes it easier to locate items on a > > page? > > > Are there other tools than Selenium that people use, that makes things > > > easier? > > > > > > I'm looking forward to hearing about how other Wicket users deal with > > these > > > issues! > > > > > > Regards, > > > Jan > > > > >
Re: Automated testing of Wicket applications
On Fri, Sep 12, 2008 at 8:12 PM, German Morales <[EMAIL PROTECTED]>wrote: > Hi Jan, > > We are using Watir, which lets you write tests in ruby. > For those who don't want to use Ruby, Watij is the Java equivalent of Watir. http://watij.com/ But the problem with both Watij and Watir is that you have to use Microsoft Internet Explorer. FireFox is not supported. I use Selenium-RC with JUnit, works fine for me. I wrote some code to run JUnit test methods in guranteed order for functional tests and also "clickAndWait". About the problem of tests being brittle and being able to use the Wicket id-s etc. you can look at this wiki page on JMeter and Wicket: http://cwiki.apache.org/WICKET/wicket-and-jmeter-with-regular-expressions.html I haven't tried but maybe you can apply some of the ideas there to Selenium tests. So if you know the wicket:id beforehand, you could possibly access the component you need. - Peter. And we are using mainly wicket generated names for identification of > components, but sometimes we use generated attributes too (for example > does not have name), or just the text in the html. > > Since the code is all in ruby, it is in theory easy to refactor in case of > some changes. > For example, you can do this: > > textfield = ie.text_field(:name, "your:very:long:wicket:generated:name") > > or, in case of page changes... > > constant_defined_somewhere = "your:very:long:wicket" > textfield = ie.text_field(:name, constant_defined_somewhere + > ":generated:name") > > then you could fix all tests just changing the constant. > Well, this is an explanation of a quick solution to your particular case of > changing the hierarchy. > But the idea is that you have a full (and good) programming language to do > things "right": refactoring, reuse, and so on. > > Beware: > Watir does not always runs perfectly... the tests are somehow dependent on > timing, which depends on the machine you run the tests, and other factors. > This is specially problematic in ajax calls. > That means that sometimes we get errors, then we run the same test again > and > it works. > > Hope this helps, > > German > > 2008/9/12 Jan Stette <[EMAIL PROTECTED]> > > > This is a bit of a general question: I'd be interested in hearing about > how > > people do automated tests of their Wicket applications. I'm thinking > about > > system tests of the full application, not unit tests. > > > > There are of course tools like Selenium which let you automate actions on > a > > web application. My colleagues with experience of this from other > > applications tell me that one of the main challenges is to stop test > cases > > from being very brittle by relying on the details of the generated > markup. > > It would be nice if it was possible to target components on a page in a > way > > that related them back to roughly the hierarchy of Wicket components. Or > > even better, if individual parts of the page (links, input fields, > buttons > > etc.) could be identified in a way that didn't break when there were > > changes > > to the Wicket component hierarchy (say, new grouping components being > > inserted higher up in the component tree). > > > > I realise this isn't the responsibility of Wicket, but are there ways in > > which Wicket can help here, e.g. by generating ids or other attributes > > inside the markup in a way that makes it easier to locate items on a > page? > > Are there other tools than Selenium that people use, that makes things > > easier? > > > > I'm looking forward to hearing about how other Wicket users deal with > these > > issues! > > > > Regards, > > Jan > > >
Re: Automated testing of Wicket applications
Hi Jan, We are using Watir, which lets you write tests in ruby. And we are using mainly wicket generated names for identification of components, but sometimes we use generated attributes too (for example does not have name), or just the text in the html. Since the code is all in ruby, it is in theory easy to refactor in case of some changes. For example, you can do this: textfield = ie.text_field(:name, "your:very:long:wicket:generated:name") or, in case of page changes... constant_defined_somewhere = "your:very:long:wicket" textfield = ie.text_field(:name, constant_defined_somewhere + ":generated:name") then you could fix all tests just changing the constant. Well, this is an explanation of a quick solution to your particular case of changing the hierarchy. But the idea is that you have a full (and good) programming language to do things "right": refactoring, reuse, and so on. Beware: Watir does not always runs perfectly... the tests are somehow dependent on timing, which depends on the machine you run the tests, and other factors. This is specially problematic in ajax calls. That means that sometimes we get errors, then we run the same test again and it works. Hope this helps, German 2008/9/12 Jan Stette <[EMAIL PROTECTED]> > This is a bit of a general question: I'd be interested in hearing about how > people do automated tests of their Wicket applications. I'm thinking about > system tests of the full application, not unit tests. > > There are of course tools like Selenium which let you automate actions on a > web application. My colleagues with experience of this from other > applications tell me that one of the main challenges is to stop test cases > from being very brittle by relying on the details of the generated markup. > It would be nice if it was possible to target components on a page in a way > that related them back to roughly the hierarchy of Wicket components. Or > even better, if individual parts of the page (links, input fields, buttons > etc.) could be identified in a way that didn't break when there were > changes > to the Wicket component hierarchy (say, new grouping components being > inserted higher up in the component tree). > > I realise this isn't the responsibility of Wicket, but are there ways in > which Wicket can help here, e.g. by generating ids or other attributes > inside the markup in a way that makes it easier to locate items on a page? > Are there other tools than Selenium that people use, that makes things > easier? > > I'm looking forward to hearing about how other Wicket users deal with these > issues! > > Regards, > Jan >
Re: Newbie Question: Dynamically Building Form Elements
Where's the fun in that? ;) Sorry, I should have mentioned that you need to setup your ListView to reuse the items if you're doing things as you say. On Fri, Sep 12, 2008 at 10:10 AM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > did you also explain about setreuseitems(true) to them after > suggesting a listview? > > -igor > > On Fri, Sep 12, 2008 at 3:35 AM, James Carman > <[EMAIL PROTECTED]> wrote: >> Does this person really need a RAD tool for what they're trying to do? >> All they need to do is display a list of an arbitrary number of radio >> buttons. Wouldn't ListView suffice in this situation? That's all >> they asked for. The XP folks would say, "Do the simplest thing that >> works." >> >> On Fri, Sep 12, 2008 at 3:56 AM, wfaler <[EMAIL PROTECTED]> wrote: >>> >>> >>> Jonathan Locke wrote: also see wicket-rad if appropriate >>> A http://sites.google.com/site/wicketrad URL could be useful, so here it is >>> . :) >>> >>> The org.wicketrad.propertyeditor package in the wicket-rad-core module has a >>> bunch of Panels you might want to look at for your problem. >>> >>> The exact problem regarding Radio buttins you (Justin) are talking about can >>> be solved with the org.wicketrad.propertyeditor.input.RadioGroupInput class >>> (it uses an implementation of IChoiceSource to retrieve the number of radio >>> buttons). >>> -- >>> View this message in context: >>> http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19451340.html >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
GMap2-Issue with AJax
Hi all, I filed a Bugreport for Gmap2: http://wicketstuff.org/jira/browse/WSGMAPP-11 Can anyone reconstruct this behavior or has already solved the Problem? I´m kinda stuck here and have not the tiniest bit of an idea how to debug this :/ Regards Markus
Re: Newbie Question: Dynamically Building Form Elements
did you also explain about setreuseitems(true) to them after suggesting a listview? -igor On Fri, Sep 12, 2008 at 3:35 AM, James Carman <[EMAIL PROTECTED]> wrote: > Does this person really need a RAD tool for what they're trying to do? > All they need to do is display a list of an arbitrary number of radio > buttons. Wouldn't ListView suffice in this situation? That's all > they asked for. The XP folks would say, "Do the simplest thing that > works." > > On Fri, Sep 12, 2008 at 3:56 AM, wfaler <[EMAIL PROTECTED]> wrote: >> >> >> Jonathan Locke wrote: >>> >>> also see wicket-rad if appropriate >>> >> A http://sites.google.com/site/wicketrad URL could be useful, so here it is >> . :) >> >> The org.wicketrad.propertyeditor package in the wicket-rad-core module has a >> bunch of Panels you might want to look at for your problem. >> >> The exact problem regarding Radio buttins you (Justin) are talking about can >> be solved with the org.wicketrad.propertyeditor.input.RadioGroupInput class >> (it uses an implementation of IChoiceSource to retrieve the number of radio >> buttons). >> -- >> View this message in context: >> http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19451340.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tracking logged in users / SessionStore questions
are your cookies disabled? -igor On Thu, Sep 11, 2008 at 11:46 PM, behlma <[EMAIL PROTECTED]> wrote: > > Now another question has popped up. My bulletin board overview page, the one > displaying all currently active/guests users and forums is a (stateless) > BookmarkablePage. To be able to track the (guest) users however, I'm calling > getSession().bind() in the page's constructor. > > The session gets bound the very first time I access the page (and I'm > displayed as a guest user). The url (www.myurl.com/forum) at this point > however has no notion of jsessionid whatsoever, so if I simply refresh the > page, a new session gets bound, now displaying two guests. Consequently, for > every refresh a new session is spawned. > > Now I understand that this is the correct behaviour, but is there any way > around people being able to spawn thousands of sessions :) ? > > -- > View this message in context: > http://www.nabble.com/Tracking-logged-in-users---SessionStore-questions-tp19273568p19450432.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form values lost on converter error when inside table
I think you can make a quick test by implementing a simple reuse strategy which directly returns the existingItems iterator.. Lorenzo Bolzani wrote: 2008/9/12 Serkan Camurcuoglu <[EMAIL PROTECTED]>: if you were using a listview, you should have called setReuseItems(true) on it.. Maybe there exists something similar for DataView.. ListView javadoc says: "If you nest a ListView in a Form, ALLWAYS set this property to true, as otherwise validation will not work properly. " Hi Serkan, think you very much for the reply, we looked for something similar but we completely missed that. I think could be useful to report the same warning in the DataView and DataTable javadoc (or maybe just Form). Anyway in our example we are using a DataView and that method is not present. We found a setReuseStrategy both on DataView and on DataTable but none of the provided strategies (default and reuseIfEquals) worked. What is the ReuseStrategy providing a behavior equivalent to setReuseItems(true)? I suspect is ReuseIfModelsEqualStrategy and we have to define a custom model with the correct equals but I'm not sure and I'm looking for a confirm. Thanks again. Bye Lorenzo - 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: Apache FOP and Wicket
Sure, it is possible, but it is tedious and verbose compared to using Freemarker or another scripting language. Using Wicket for this will only add more code and complexity to the process, and it's not like you need component based control of the markup you are creating, so Wicket is simply overkill for this task. Wicket isn't a golden hammer, even though it is great at what it does/is meant for :) Remember, you have to create both the java-side and the html-side for every variable you put in your markup, instead of just outputting ${var} where you need it :) -- Edvin Adrian Wiesmann skrev: Why not? I was remembering that Wicket can manage any markup, not just HTML . . Am I missing something ? Not sure. If you do, so do I :) I have written a renderer which takes an XML containing some UI description and either generates Swing, HTML (Wicket), PDF (FOP) or CSV from the same UI description (but from different templates). Although you can ask Wicket to generate the PDF, there is no direct link between FOP and Wicket. Wicket only calls my renderer and forwards the generated file to the user via HTTP. The problem with having Wicket generate your FOP files will be that you will have to write all UI elements on your own because there are no classes/objects you can use. hth, Adrian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Med vennlig hilsen Edvin Syse Programutvikler www.sysedata.no / [EMAIL PROTECTED] Tlf: 333 49700 / Faks: 333 49701 Adresse: Møllegaten 12, 3111 Tønsberg Syse Data AS -Profesjonelle IT-tjenester - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache is freezing CPU
hello thank you for your words. Martijn Dashorst wrote: > > With that many users you probably have session retention. Try to > profile your app with yourkit or another profiler. Failing that, you > could look at the numbers using jmap and jstat. > > Martijn > On 9/11/08, jmatt <[EMAIL PROTECTED]> wrote: >> >> We have a server with more or les 30K daily pageviews with 6k unique >> users. >> Its content is mainly all dynamic but lately we've been experimenting >> some >> problems at peak hours. >> >> That's some of our info: >> >> Celeron(R) 2.0GHz Processor >> 1 GB RAM >> >> Timeout 120 >> KeepAlive On >> MaxKeepAliveRequests 100 >> KeepAliveTimeout 2 >> >> >> StartServers 8 >> MinSpareServers 5 >> MaxSpareServers 20 >> ServerLimit 256 >> MaxClients 256 >> MaxRequestsPerChild 4000 >> >> >> >> ServerLimit 256 >> StartServers 2 >> MaxClients 150 >> MinSpareThreads 25 >> MaxSpareThreads 75 >> ThreadsPerChild 25 >> MaxRequestsPerChild 0 >> >> >> I think that we shouldn't have the problems we have, it's not that much >> visits! >> >> Please advise... we've tried tons of configurations and we don't know >> what >> it could be... Or maybe it's not apache... >> >> Thanks! >> >> - >> Popular free programming ebooks,free database ebooks,free OS ebooks >> download >> at http://www.ebook-x.com/ http://www.ebook-x.com/ >> -- >> View this message in context: >> http://www.nabble.com/Apache-is-freezing-CPU-tp19427394p19427394.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > Become a Wicket expert, learn from the best: http://wicketinaction.com > Apache Wicket 1.3.4 is released > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - Popular free programming ebooks,free database ebooks,free OS ebooks download at http://www.ebook-x.com/ http://www.ebook-x.com/ -- View this message in context: http://www.nabble.com/Apache-is-freezing-CPU-tp19427394p19455356.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form values lost on converter error when inside table
2008/9/12 Serkan Camurcuoglu <[EMAIL PROTECTED]>: > if you were using a listview, you should have called setReuseItems(true) on > it.. Maybe there exists something similar for DataView.. ListView javadoc > says: > > "If you nest a ListView in a Form, ALLWAYS set this property to true, as > otherwise validation will not work properly. " > Hi Serkan, think you very much for the reply, we looked for something similar but we completely missed that. I think could be useful to report the same warning in the DataView and DataTable javadoc (or maybe just Form). Anyway in our example we are using a DataView and that method is not present. We found a setReuseStrategy both on DataView and on DataTable but none of the provided strategies (default and reuseIfEquals) worked. What is the ReuseStrategy providing a behavior equivalent to setReuseItems(true)? I suspect is ReuseIfModelsEqualStrategy and we have to define a custom model with the correct equals but I'm not sure and I'm looking for a confirm. Thanks again. Bye Lorenzo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form values lost on converter error when inside table
if you were using a listview, you should have called setReuseItems(true) on it.. Maybe there exists something similar for DataView.. ListView javadoc says: "If you nest a ListView in a Form, ALLWAYS set this property to true, as otherwise validation will not work properly. " Lorenzo Bolzani wrote: Hi, I'need to display some editable values inside an HTML table. The form contains both string and numeric values. If I submit an invalid numeric value an error is reporter but all other values are lost. Using a simple form this does not happens, it happens only when we had the "table part". I think we have done something wrong with the dataview and the dataProvider but we cannot see what's wrong. Following this article (we skipped the detachable part) http://liminescence.blogspot.com/2007/12/wicket-html-table-implementation.html I defined a very simple DataProvider protected List readAll() { return Arrays.asList(new Bean("a", 1), new Bean("b", 2)); } a simple dataView @Override protected void populateItem(Item item) { Bean bean = (Bean) item.getModelObject(); item.setModel(new CompoundPropertyModel(bean)); item.add(new TextField("rock")); item.add(new TextField("number")); } and added this to a form final DataView personDataView = new PersonDataView("beanList", dataProvider); form.add(personDataView); This is the markup Rock Number When I type an invalid value for the "number" field the "rock" field is reset to the default value and the input from the user is lost. What are we doing wrong? Thanks, bye Lorenzo - 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]
Automated testing of Wicket applications
This is a bit of a general question: I'd be interested in hearing about how people do automated tests of their Wicket applications. I'm thinking about system tests of the full application, not unit tests. There are of course tools like Selenium which let you automate actions on a web application. My colleagues with experience of this from other applications tell me that one of the main challenges is to stop test cases from being very brittle by relying on the details of the generated markup. It would be nice if it was possible to target components on a page in a way that related them back to roughly the hierarchy of Wicket components. Or even better, if individual parts of the page (links, input fields, buttons etc.) could be identified in a way that didn't break when there were changes to the Wicket component hierarchy (say, new grouping components being inserted higher up in the component tree). I realise this isn't the responsibility of Wicket, but are there ways in which Wicket can help here, e.g. by generating ids or other attributes inside the markup in a way that makes it easier to locate items on a page? Are there other tools than Selenium that people use, that makes things easier? I'm looking forward to hearing about how other Wicket users deal with these issues! Regards, Jan
Re: Newbie Question: Dynamically Building Form Elements
Nope, probably not, but he can take a look at the code for a sample on how to achieve exactly what he wants. jwcarman wrote: > > Does this person really need a RAD tool for what they're trying to do? > All they need to do is display a list of an arbitrary number of radio > buttons. Wouldn't ListView suffice in this situation? That's all > they asked for. The XP folks would say, "Do the simplest thing that > works." > > On Fri, Sep 12, 2008 at 3:56 AM, wfaler <[EMAIL PROTECTED]> wrote: >> >> >> Jonathan Locke wrote: >>> >>> also see wicket-rad if appropriate >>> >> A http://sites.google.com/site/wicketrad URL could be useful, so here it >> is >> . :) >> >> The org.wicketrad.propertyeditor package in the wicket-rad-core module >> has a >> bunch of Panels you might want to look at for your problem. >> >> The exact problem regarding Radio buttins you (Justin) are talking about >> can >> be solved with the org.wicketrad.propertyeditor.input.RadioGroupInput >> class >> (it uses an implementation of IChoiceSource to retrieve the number of >> radio >> buttons). >> -- >> View this message in context: >> http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19451340.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19453574.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie Question: Dynamically Building Form Elements
Does this person really need a RAD tool for what they're trying to do? All they need to do is display a list of an arbitrary number of radio buttons. Wouldn't ListView suffice in this situation? That's all they asked for. The XP folks would say, "Do the simplest thing that works." On Fri, Sep 12, 2008 at 3:56 AM, wfaler <[EMAIL PROTECTED]> wrote: > > > Jonathan Locke wrote: >> >> also see wicket-rad if appropriate >> > A http://sites.google.com/site/wicketrad URL could be useful, so here it is > . :) > > The org.wicketrad.propertyeditor package in the wicket-rad-core module has a > bunch of Panels you might want to look at for your problem. > > The exact problem regarding Radio buttins you (Justin) are talking about can > be solved with the org.wicketrad.propertyeditor.input.RadioGroupInput class > (it uses an implementation of IChoiceSource to retrieve the number of radio > buttons). > -- > View this message in context: > http://www.nabble.com/Newbie-Question%3A--Dynamically-Building-Form-Elements-tp19447802p19451340.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JasperReport in IFrame
Hello Eelco, It is possible for the jasperreport to be display in iframe in html format? because the example that comes with the wicket-contrib-jasperreports the pdf is embeded in the page through the object tag. If it is possible also for the html export to be view in iframe inside the page? Thanks a lot. Cheers. -- View this message in context: http://www.nabble.com/JasperReport-in-IFrame-tp19453299p19453299.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WicketTester feature request
2008/9/12 Timo Rantalaiho <[EMAIL PROTECTED]> > On Thu, 11 Sep 2008, Jan Stette wrote: > > Absolutely, I see what you're saying. Part of the problem here may be > that > > on the project I'm working on, WicketTester is indeed used to do > > integration/functional tests. I'm not sure why this was done in the > first > > place, but it does seem to work - most of the time! I guess the API that > > WicketTester provides for performing actions like clicking links, > submitting > > forms etc. was convenient to drive from the system test harness, possibly > > simpler than actually driving a "real" web front end. > > > > Anyway, if this really is an abuse of WicketTester that you have no > > intention of supporting, then please say so! > > Well, I don't know if it's so black and white, but the > reality is that there are a lot of bugs and feature requests > in Wicket compared to the development effort available, so > prioritisation happens inevitably. In theory, it sounds like > a good idea to support RequestCycle lifecycle methods, and > it would make sense for WicketTester to mimic the real > behaviour as close as possible, but in practice it might > require some heavy debugging and coding that don't come out > of nowhere :) Of course, I understand! And -- without meaning to put you off -- there's another > important point to consider, which is the backwards > compatibility of the changes. Making changes deep in 1.3 or > 1.4 WicketTester code at the moment might produce unwanted > effects in existing projects making heavy use of > WicketTester and having worked around its quirks. This can > happen even with legitimate bug fixes, and is sometimes > necessary. But sometimes you just need to leave bugs in, > because fixing them would break too much existing code. Absolutely. This was just a suggestion for something to consider for 1.5, I would not expect any of this to be changed in 1.3 or 1.4 at all. > Still, there seems to be one case where this happens with just the basic > > WicketTester functionality. First, creating a WicketTester: > > > > XWicketTester.createRequestCycle() line: 436 > > What is this line? Are you explicitly creating the > RequestCycle? Sorry, that's a call stack from our test code running. So that call to create a request cycle was made from line 199 in WicketTester's MockWebApplication.java. We have overridden createRequestCycle in our extended wicket tester, which is why it gives that class name. Anyway, your comments have been helpful for me to understand what the situation is regarding WicketTester, we'll have to have a think about how to best proceed. I would be interested in hearing about how other people do automated tests for their Wicket applications - but that's probably the topic for another thread! Thanks, Jan
Form values lost on converter error when inside table
Hi, I'need to display some editable values inside an HTML table. The form contains both string and numeric values. If I submit an invalid numeric value an error is reporter but all other values are lost. Using a simple form this does not happens, it happens only when we had the "table part". I think we have done something wrong with the dataview and the dataProvider but we cannot see what's wrong. Following this article (we skipped the detachable part) http://liminescence.blogspot.com/2007/12/wicket-html-table-implementation.html I defined a very simple DataProvider protected List readAll() { return Arrays.asList(new Bean("a", 1), new Bean("b", 2)); } a simple dataView @Override protected void populateItem(Item item) { Bean bean = (Bean) item.getModelObject(); item.setModel(new CompoundPropertyModel(bean)); item.add(new TextField("rock")); item.add(new TextField("number")); } and added this to a form final DataView personDataView = new PersonDataView("beanList", dataProvider); form.add(personDataView); This is the markup Rock Number When I type an invalid value for the "number" field the "rock" field is reset to the default value and the input from the user is lost. What are we doing wrong? Thanks, bye Lorenzo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax & dropdowns
prepend/append javascript should work. -Matej On Thu, Sep 11, 2008 at 11:15 PM, Scott Swank <[EMAIL PROTECTED]> wrote: > This is apparently an IE6 bug, in that inserting an image in the dom > above the select screws up the tabindex/focus in some way. If I have > the span/image already in the dom and I just toggle display:block vs. > display:hidden then things work. > > Is there any way that I populate the tag of the wicket ajax > response so that I can use dhtml to toggle my display? > > Thank you! > > Scott > > On Wed, Sep 10, 2008 at 5:57 PM, Scott Swank <[EMAIL PROTECTED]> wrote: >> Matej, >> >> I duplicated this scenario in a simple Wicket page and I do not see >> the problem, so this seems to be the result of some other interaction >> rather than a Wicket javascript bug. I will post back once I have a >> better sense of the issue. >> >> Thank you, >> Scott > I am seeing a focus issue when an > AjaxFormComponentUpdatingBehavior("onblur") is fired from a form > component and the next form component is a drop down. When I then tab > out of the drop down I go to the 1st item on the page rather than the > next item on the form. > > This only occurs in IE6, and only if an element prior to the dropdown > is updated. Here are the ajax logs from IE6 and Firefox3. I suspect > that this behavior is related to the fact that I see details such as > the following for FF3, but not for IE6. > > - > 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: Can we have a prefix in the subject line for any emails from this mailing list?
The list software produces a valid RFC 2919 List-Id header - any decent mail user agent should be able to filter based on that. As alluded to by Ryan, Gmail recognises this and will create a new filter in like three clicks. Charlie. 2008/9/10 Ryan Gravener <[EMAIL PROTECTED]> > switch to gmail > > On Wed, Sep 10, 2008 at 12:43 PM, Vernon <[EMAIL PROTECTED]> wrote: > > > Emails from this mailing list quickly jam up my email account. Since > there > > isn't a filter for this email account, I have to move emails to another > > folder by hand. It would be very helpful if the subject line with a > prefix > > like [wicket-user] so that I know what the email is about. > > > > Thanks. >
Re: Wicket 1.3.4 + SWFObject
Sure! AutoInstallShockwaveComponent.java import java.util.Hashtable; import java.util.Map; import java.util.Set; import org.apache.wicket.ResourceReference; import org.apache.wicket.behavior.HeaderContributor; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.apache.wicket.protocol.http.RequestUtils; /** * Classe permettant d'afficher un fichier *.swf tout en ayant une fonction * d'auto-installation du FlashPlayer si la version courante n'est pas * suffisante. Ne fonctionne pas du tout si javascript est désactivé (affiche le * contenu alternatif). * * @see http://code.google.com/p/swfobject/";>SWFObject * @version 11/09/2008 */ public final class AutoInstallShockWaveComponent extends Panel { /** Modèle contenu alternatif par défaut (si non précisé). */ private static final IModel DEFAULT_ALTERNATIVE_CONTENT = new Model( "Unable to display flash content!You either have JavaScript disabled or your browser doesn't support SWFObject.http://www.adobe.com/go/getflashplayer\";>http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\"; alt=\"Get Adobe Flash player\" />"); private final Map flashvars = new Hashtable(); private final Map params = new Hashtable(); private final Map attributes = new Hashtable(); /** * Constructeur minimal. Spécifie l'url du fichier swf + ses dimensions. * * @param id *[EMAIL PROTECTED] Panel#getId()} * @param swfFullURL *Adresse URL relative ou absolue du fichier *.swf à utiliser. * @param width *Largeur du fichier swf. * @param height *Hauteur du fichier swf. */ public AutoInstallShockWaveComponent(String id, final String swfFullURL, final String width, final String height) { this(id, swfFullURL, width, height, "9", null); } /** * Constructeur complet. Spécifie la version minimale de flash, ainsi que le * contenu alternatif à afficher. * * @param id *[EMAIL PROTECTED] Panel#getId()} * @param swfFullURL *Adresse URL relative ou absolue du fichier *.swf à utiliser. * @param width *Largeur du fichier swf. * @param height *Hauteur du fichier swf. * @param flashMinimumVersion *Version minimale de Flash (p.ex, "9.0.0") * @param alternative *Contenu alternatif, typiquement une [EMAIL PROTECTED] String} ou un *[EMAIL PROTECTED] IModel}. Passez null pour utiliser le *contenu alternatif par défaut (infos + lien vers flash *player). */ public AutoInstallShockWaveComponent(String id, final String swfFullURL, final String width, final String height, final String flashMinimumVersion, Object alternative) { super(id); add(HeaderContributor.forJavaScript(new ResourceReference(AutoInstallShockWaveComponent.class, "swfobject.js"))); final WebMarkupContainer swf = new WebMarkupContainer("swf"); swf.setOutputMarkupId(true); add(swf); add(new Label("js", new Model() { public Object getObject() { StringBuilder b = new StringBuilder(512); b.append("");b.append(NL); b.append("