[Wicket-user] Problem in unit tests
Argh ! Unit testing is way too hard in wicket. I'm using a custom implementation of WebSession in my application. The problem arises when I use the MockWebApplication class for testing, which creates and uses WebSession for tests and my page classes which depend on my implementation of WebSession cant work with it. I can't implement another MockWebApplication, because getSession() in WebApplication has package access, and it's critical for setting up the session. Has anybody solved such problems ? Does anybody know the preferred way of unit testing (not functional testing) the pages ? Regards Iman
Re: [Wicket-user] Problem with multiple submit buttons in form
Thanks Andrew (and everyone) -- my dumb mistake. [I'm in the cleanup phase of the beta for my new app; I'll send a link to wicket-user pretty soon to try out.] --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Problem in unit tests
On 10/30/05, Iman RahmatiZadeh [EMAIL PROTECTED] wrote: Argh ! Unit testing is way too hard in wicket. I'm using a custom implementation of WebSession in my application. The problem arises when I use the MockWebApplication class for testing, which creates and uses WebSession for tests and my page classes which depend on my implementation of WebSession cant work with it. I can't implement another MockWebApplication, because getSession() in WebApplication has package access, and it's critical for setting up the session. Has anybody solved such problems ? Does anybody know the preferred way of unit testing (not functional testing) the pages ? Where does MockWebApplication create its own WebSession??? It uses WebApplication.getSessionFactory().newSession() which is Wickets standard means and works nicely in my unit tests. WicketTester is derived from MockWebApplication and provides some convience method. May be that is what your are looking for. What IMO would be nice if MockWebApplication would delegate to my application object instead of being derived from WebApplication. Reason: Today I basically have to copy MyApplication to MyMockApplication and changes the derived class to MockWebApplication. If MockWebApplication would delegate to an application object, there were no more need to do so. Juergen --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Problem in unit tests
Ok, Thanks. My mistake. In fact I was looking for something like the one you suggested, delegating the whole scenario to my application object. One more question, what's your strategy for unit testing ? From what I saw in SortableTableHeadersTest ,would it be: 1- Setup the application, page and stuff 2- Feed the needed data to the page (probably with injection) 3- Setup request and response, and process the request cycle 4- Validate the generated page against some previously generated page The last step is quite easy in simple applications, but in bigger ones, where the page style, or various tag attributes change frequently i'm looking for a more abstract way of validating the markup than just a string equality check. Regards, Iman On 10/30/05, Juergen Donnerstag [EMAIL PROTECTED] wrote: On 10/30/05, Iman RahmatiZadeh [EMAIL PROTECTED] wrote: Argh ! Unit testing is way too hard in wicket. I'm using a custom implementation of WebSession in my application. The problem arises when I use the MockWebApplication class for testing, which creates and uses WebSession for tests and my page classes which depend on my implementation of WebSession cant work with it. I can't implement another MockWebApplication, because getSession() in WebApplication has package access, and it's critical for setting up the session. Has anybody solved such problems ? Does anybody know the preferred way of unit testing (not functional testing) the pages ?Where does MockWebApplication create its own WebSession??? It usesWebApplication.getSessionFactory().newSession() which is Wicketsstandard means and works nicely in my unit tests. WicketTester is derived from MockWebApplication and provides someconvience method. May be that is what your are looking for.What IMO would be nice if MockWebApplication would delegate to myapplication object instead of being derived from WebApplication. Reason: Today I basically have to copy MyApplication toMyMockApplication and changes the derived class to MockWebApplication.If MockWebApplication would delegate to an application object, therewere no more need to do so. Juergen---This SF.Net email is sponsored by the JBoss Inc.Get Certified Today * Register for a JBoss Training CourseFree Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Problem in unit tests
Please see if WicketTester is more appropriate for you. An other choice could be jWebUnit. But it requires a servlet container and is pure html validation Juergen On 10/30/05, Iman RahmatiZadeh [EMAIL PROTECTED] wrote: Ok, Thanks. My mistake. In fact I was looking for something like the one you suggested, delegating the whole scenario to my application object. One more question, what's your strategy for unit testing ? From what I saw in SortableTableHeadersTest ,would it be: 1- Setup the application, page and stuff 2- Feed the needed data to the page (probably with injection) 3- Setup request and response, and process the request cycle 4- Validate the generated page against some previously generated page The last step is quite easy in simple applications, but in bigger ones, where the page style, or various tag attributes change frequently i'm looking for a more abstract way of validating the markup than just a string equality check. Regards, Iman On 10/30/05, Juergen Donnerstag [EMAIL PROTECTED] wrote: On 10/30/05, Iman RahmatiZadeh [EMAIL PROTECTED] wrote: Argh ! Unit testing is way too hard in wicket. I'm using a custom implementation of WebSession in my application. The problem arises when I use the MockWebApplication class for testing, which creates and uses WebSession for tests and my page classes which depend on my implementation of WebSession cant work with it. I can't implement another MockWebApplication, because getSession() in WebApplication has package access, and it's critical for setting up the session. Has anybody solved such problems ? Does anybody know the preferred way of unit testing (not functional testing) the pages ? Where does MockWebApplication create its own WebSession??? It uses WebApplication.getSessionFactory().newSession() which is Wickets standard means and works nicely in my unit tests. WicketTester is derived from MockWebApplication and provides some convience method. May be that is what your are looking for. What IMO would be nice if MockWebApplication would delegate to my application object instead of being derived from WebApplication. Reason: Today I basically have to copy MyApplication to MyMockApplication and changes the derived class to MockWebApplication. If MockWebApplication would delegate to an application object, there were no more need to do so. Juergen --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Filtering double messages
Hi, is there a way to show feedback messages which are duplicate (same text) only once to the user? I looked at the IFeedbackMessageFilter but this seems to be unusable for this kind of filtering because you can only decide message-by-message, it also can't be achieved by using a derived FeedbackMessagesModel because of the final methods... Regards, Ralf --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Tab / Tabed-Page /Tabview Component?
Hi all, is there a Tabed-Page component for Wicket avaiable? Just like this: http://209.61.157.8:8080/taglibs/ ... Thanks, Dave -- Rent-a-Developer David Liebeherr Tel.: 0721 3504990 mail: [EMAIL PROTECTED] SUN Certified Java Associate (SCJA) --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Re: Tab / Tabed-Page /Tabview Component?
Dear Dave, dear wicket developers, I had the same question some weeks ago. There once was an example called TabPage and is still available in a silent corner of the CVS. But the Example no longer works with Wicket 1.1. I think a tabbed page is a core component for web development and should be availabe with wicket. Please hel pus, Wicket developers! Thanks in advance Stefan Lindner --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Validating two components
Does Wicket provide a mechanism to validate two components? For instance, I'm taking credit card info and need to validate that the expiration month and year, both represented by individual select lists, are valid.
Re: [Wicket-user] Validating two components
You can do this in your onsubmit handler. ie Form...onSubmit() { CreditCardInfo=(CreditCardInfo)getModelObject(); if (.validation failed test) { error(something is wrong); } } Does this make sense? -Igor On 10/30/05, Nick Heudecker [EMAIL PROTECTED] wrote: Does Wicket provide a mechanism to validate two components? For instance, I'm taking credit card info and need to validate that the expiration month and year, both represented by individual select lists, are valid.
Re: [Wicket-user] Validating two components
Thanks. I knew I could do that, but I was hoping to be able to put that into a CustomValidator subclass.On 10/30/05, Igor Vaynberg [EMAIL PROTECTED] wrote:You can do this in your onsubmit handler. ie Form...onSubmit() { CreditCardInfo=(CreditCardInfo)getModelObject(); if (.validation failed test) { error(something is wrong); } } Does this make sense? -Igor On 10/30/05, Nick Heudecker [EMAIL PROTECTED] wrote: Does Wicket provide a mechanism to validate two components? For instance, I'm taking credit card info and need to validate that the expiration month and year, both represented by individual select lists, are valid.
Re: [Wicket-user] Validating two components
I dont think there is anything preventing you from doing that. ie TextField td1=new TextField(...); TextField td2=new TextField(...); td2.add(new MyValidator(td1, td2)); -Igor On 10/30/05, Nick Heudecker [EMAIL PROTECTED] wrote: Thanks. I knew I could do that, but I was hoping to be able to put that into a CustomValidator subclass.On 10/30/05, Igor Vaynberg [EMAIL PROTECTED] wrote:You can do this in your onsubmit handler. ie Form...onSubmit() { CreditCardInfo=(CreditCardInfo)getModelObject(); if (.validation failed test) { error(something is wrong); } } Does this make sense? -Igor On 10/30/05, Nick Heudecker [EMAIL PROTECTED] wrote: Does Wicket provide a mechanism to validate two components? For instance, I'm taking credit card info and need to validate that the expiration month and year, both represented by individual select lists, are valid.
Re: [Wicket-user] Re: Tab / Tabed-Page /Tabview Component?
why is it a core component? It is mostly a design issue if you ask me. Because under neath it are just links that are setting a panel (or switching visibility) How would such a component look like? On 10/30/05, Stefan Lindner [EMAIL PROTECTED] wrote: Dear Dave, dear wicket developers,I had the same question some weeks ago. There once was an example calledTabPage and is still available in a silent corner of the CVS. But theExample no longer works with Wicket 1.1. I think a tabbed page is a corecomponent for web development and should be availabe with wicket. Pleasehel pus, Wicket developers!Thanks in advanceStefan Lindner--- This SF.Net email is sponsored by the JBoss Inc.Get Certified Today * Register for a JBoss Training CourseFree Certification Exam for All Training Attendees Through End of 2005Visit http://www.jboss.com/services/certification for more information___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Re: Tab / Tabed-Page /Tabview Component?
I agree with Johan. Tabs are by no means a core component. In fact, you can accomplish tabs easily using a ListView and some CSS, so it's definitely a design issue as Johan mentioned. See these for the CSS to create tabs: http://www.alistapart.com/articles/slidingdoors/ http://www.alistapart.com/articles/slidingdoors2/ --Andrew On 10/30/05, Johan Compagner [EMAIL PROTECTED] wrote: why is it a core component? It is mostly a design issue if you ask me. Because under neath it are just links that are setting a panel (or switching visibility) How would such a component look like? On 10/30/05, Stefan Lindner [EMAIL PROTECTED] wrote: Dear Dave, dear wicket developers,I had the same question some weeks ago. There once was an example calledTabPage and is still available in a silent corner of the CVS. But theExample no longer works with Wicket 1.1. I think a tabbed page is a corecomponent for web development and should be availabe with wicket. Pleasehel pus, Wicket developers!Thanks in advanceStefan Lindner--- This SF.Net email is sponsored by the JBoss Inc.Get Certified Today * Register for a JBoss Training CourseFree Certification Exam for All Training Attendees Through End of 2005Visit http://www.jboss.com/services/certification for more information___Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] replace ognl.
In my opinion, there's no need for another indirection. From what I've seen, new users are already confused about models, making them even more complicated isn't imho the way to go. I think that Ognl models should be separated from the core and put to extensions. That would also get rid of ognl as a dependecy. Just my 2c. -Matej Johan Compagner wrote: Ok now we released 1.1 i have committed the ognl replacement It is not yet plugable yet we first need to see what we will or can support to bring back ognl for specific things. (plugable or in wicket extentions as its own model?) This is the current javadoc it explains what is possible now: This class parses expressions to lookup or set a value on the object that is given. The supported expressions are: property: This can can then be a bean property with get and set method. Or if a map is given as an object it will be lookup with the property as a key when there is not get method for that property. property1.property2: Both properties are lookup as written above. If property1 evaluates to null then if there is a setMethod (or if it is a map) and the Class of the property has a default constructor then the object will be constructed and set on the object. property.index: If the property is a List or Array then the second property can be a index on that list like: 'mylist.0' this expression will also map on a getProperty(index) or setProperty(index,value) methods. If the object is a List then the list will grow automaticaly if the index is greater then the size Index or map properties can also be written as: property[index] or property[key] On 10/28/05, *Phil Kulak* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I like the idea of being able to plug in OGNL if you really need it. Now that I think about it, I've got a couple ChoiceRenderers that call functions using OGNL. Although, it probably would be very easy to rewrite these by just implementing the interface myself, and much more efficient. --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list [EMAIL PROTECTED] mailto:[EMAIL PROTECTED].net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Discussion about strategy
I use wicket for over months and develop one project with it. So i have a suggestion for wicket core or wicket-stuff. All of us know,ACL is necessary for a project. Just a simple example, name here is user name Password(label) here is user password(TextField) ... ... ... ... ... ... ... ... ... ... ... ... If the viewer is a administrator,he can see the password,and other users can't see the password. The common users will see the following table. name here is user name ... ... ... ... ... ... ... ... ... ... ... ... In the simple ways,just set the label and textfield invisible.You also can add a wicket container as the parent ofthe label and textfield.Just the container visible. But both of themare not flexible. So i just design a IStrategy interface and many components based on wicket components like label,TextField and other components. The IStrategy interface control the visiblity ,readonly, disabled and other propertiesof the component. It will make the component flexible. I also add jaas and dao together so the component can control itself. How about the design. I need more options about it. 雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱 雅虎助手¨D搜索、杀毒、防骚扰 雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱 雅虎助手¨D搜索、杀毒、防骚扰
Re: [Wicket-user] replace ognl.
I agree with Matej. Eelco On 10/30/05, Matej Knopp [EMAIL PROTECTED] wrote: In my opinion, there's no need for another indirection. From what I've seen, new users are already confused about models, making them even more complicated isn't imho the way to go. I think that Ognl models should be separated from the core and put to extensions. That would also get rid of ognl as a dependecy. Just my 2c. -Matej Johan Compagner wrote: Ok now we released 1.1 i have committed the ognl replacement It is not yet plugable yet we first need to see what we will or can support to bring back ognl for specific things. (plugable or in wicket extentions as its own model?) This is the current javadoc it explains what is possible now: This class parses expressions to lookup or set a value on the object that is given. The supported expressions are: property: This can can then be a bean property with get and set method. Or if a map is given as an object it will be lookup with the property as a key when there is not get method for that property. property1.property2: Both properties are lookup as written above. If property1 evaluates to null then if there is a setMethod (or if it is a map) and the Class of the property has a default constructor then the object will be constructed and set on the object. property.index: If the property is a List or Array then the second property can be a index on that list like: 'mylist.0' this expression will also map on a getProperty(index) or setProperty(index,value) methods. If the object is a List then the list will grow automaticaly if the index is greater then the size Index or map properties can also be written as: property[index] or property[key] On 10/28/05, *Phil Kulak* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I like the idea of being able to plug in OGNL if you really need it. Now that I think about it, I've got a couple ChoiceRenderers that call functions using OGNL. Although, it probably would be very easy to rewrite these by just implementing the interface myself, and much more efficient. --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list [EMAIL PROTECTED] mailto:[EMAIL PROTECTED].net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user