Re: StringResourceModel with unknown array parameters
i ii schreef: should be in core, no? -1, it is much too specific. Regards, Erik. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Swarm/Wasp or wicket-auth-roles or ?
If you checkout the Wicket sources, you'll find a wicket-auth-roles-example project. Regards, Erik. mfs wrote: Also if someone could point to some examples of wicket-auth-roles usage...I could still see many for swarm but have not really for auth-roles..may be I an not looking at the right place..please point - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Swarm/Wasp or wicket-auth-roles or ?
Actually, the examples Scott sent are better I think. Regards, Erik. Erik van Oosten schreef: If you checkout the Wicket sources, you'll find a wicket-auth-roles-example project. mfs wrote: Also if someone could point to some examples of wicket-auth-roles usage - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket-spring dependency in maven repository
Doug Donohoe wrote: I'm using wicket-spring-annot and ran into a small problem with maven dependencies. The wicket-spring-annot project depends on wicket-spring. This has come up a number of times already. Hopefully not as often in the future as it is now also on the wiki :) http://cwiki.apache.org/WICKET/spring.html Regards, Erik. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LoadableDetachableModel and load() method question
Hi Warren, It should not be called twice. Not within the same request that is. Possible causes: - you have 2 model instances instead of 1 - there is a bug in Wicket If you are sure it the latter, please provide a quickstart and add it to a new Jira issue. Regards, Erik. Warren wrote: I have a page that displays a lot of labels and two text field. It is refreshed thru an AjaxFormSubmitBehavior that just refreshes the same page with a new item using a LoadableDetachableModel. I need to update the item displayed and retrieve a new one. I am doing this within the load method. protected Object load() { // Update last Item // Retrieve next Item } Everything works, but load() gets called twice. I understand why that happens, but I only need it to be called once. I can use a flag to make the body of load run once, but this does not seem very clean and I can see it causing problems. Is there a better way to achieve what I am trying to do? Thanks, Warren Bell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with DateTextField in wicket 1.3
Please create a Jira issue. Maurice On Fri, Apr 18, 2008 at 4:45 AM, Vadim Tesis [EMAIL PROTECTED] wrote: all, i'm trying to move from wicket-1.3.0-rc2 to wicket-1.3.3. for some reason i started having problems with DateTextField. it's displaying an error in java script: Line: 2072Error: Object doesn't support this property or method it looks like the error comes from file: yuiloader-beta.js line:2072: this.moduleInfo = lang.merge(YUI.info.moduleInfo); which gets called from the script generated in my page: if (typeof wicketYuiLoader == 'undefined') { wicketYuiLoader = new YAHOO.util.YUILoader({ base: resources/org.apache.wicket.extensions.yui.YuiLib/, filter: RAW, allowRollup: false, require: [wicket-date],onSuccess: function() { wicketCalendarInitFinished = true;while (wicketCalendarInits.length 0) {wicketCalendarInits.pop()(); }} }); if i switch back to wicket-1.3.0-rc2, the error goes away. below is my markup and java code. does anyone have any suggestions on how to fix the issue? Thanks, Vadim here's the markup: div class=controlinput type=text name=textStart wicket:id=textStart//div here's java code: final DateField df = new DateField(textStart, new PropertyModel(this, PROP_START)) { private static final long serialVersionUID = 1L; @Override protected DateTextField newDateTextField(final String id_, final PropertyModel model_) { return (new DateTextField(id_, model_, new StyleDateConverter(S-, true))); } }; getForm().add(df); _ Pack up or back up–use SkyDrive to transfer files or keep extra copies. Learn how. http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_packup_042008 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with DateTextField in wicket 1.3
Try to clear your browser caches, maybe there is an old js lib still used On 4/18/08, Vadim Tesis [EMAIL PROTECTED] wrote: all, i'm trying to move from wicket-1.3.0-rc2 to wicket-1.3.3. for some reason i started having problems with DateTextField. it's displaying an error in java script: Line: 2072Error: Object doesn't support this property or method it looks like the error comes from file: yuiloader-beta.js line:2072: this.moduleInfo = lang.merge(YUI.info.moduleInfo); which gets called from the script generated in my page: if (typeof wicketYuiLoader == 'undefined') { wicketYuiLoader = new YAHOO.util.YUILoader({ base: resources/org.apache.wicket.extensions.yui.YuiLib/, filter: RAW, allowRollup: false, require: [wicket-date],onSuccess: function() { wicketCalendarInitFinished = true;while (wicketCalendarInits.length 0) {wicketCalendarInits.pop()(); }} }); if i switch back to wicket-1.3.0-rc2, the error goes away. below is my markup and java code. does anyone have any suggestions on how to fix the issue? Thanks, Vadim here's the markup: div class=controlinput type=text name=textStart wicket:id=textStart//div here's java code: final DateField df = new DateField(textStart, new PropertyModel(this, PROP_START)) { private static final long serialVersionUID = 1L; @Override protected DateTextField newDateTextField(final String id_, final PropertyModel model_) { return (new DateTextField(id_, model_, new StyleDateConverter(S-, true))); } }; getForm().add(df); _ Pack up or back up–use SkyDrive to transfer files or keep extra copies. Learn how. http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_packup_042008 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WicketTester: persistant error msg?
Attach that unit test to a jira issue On 4/18/08, Michael Perkonigg [EMAIL PROTECTED] wrote: Hello, I tried to test a form with a required field. First I submitted without setting a value and got an error message as expected. Then I set the value and submitted again but again got the error message as if it wouldn't be cleared or something. Is there a problem with them or did I miss how to clear them? Thanks, Mike - 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: how to recover the maxlength value
If you do that on the client side with some js scripts anyway, why not reading the attributes value itself of the dom element? On 4/18/08, aynif [EMAIL PROTECTED] wrote: Hi, I want to recover the maxlength value of the year field rather than ...append(', 4, ')... as in the code below (4 is the maxlength value) : final TextField year = new TextField(year); myForm.add(year); year.setOutputMarkupId(true); final TextField month = new TextField(month); month.setOutputMarkupId(true); myForm.add(month); year.add(new AttributeModifier(OnKeyUp, true, new Model() { @Override public Object getObject() { StringBuffer st = new StringBuffer(); st.append(Autotab(').append(year.getMarkupId()).append(', 4, '). append(month.getMarkupId()).append(')); return st.toString(); } })); -- View this message in context: http://www.nabble.com/how-to-recover-the-maxlength-value-tp16761987p16761987.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: WicketTester.startPage(page) throws No requestCycle is currently set
Somehow something detaches everything when it shouldnt have done it yet in your example. Upload your test to a jira issue On 4/17/08, Federico Fanton [EMAIL PROTECTED] wrote: On Wed, 16 Apr 2008 16:16:36 +0200 Frank Bille [EMAIL PROTECTED] wrote: tester.createRequestCycle() (or something). Though I thought it was called for you in startPage. It's good that we will take a look at it for WNG. Thanks for your answer! I'm sorry, but I can't figure out how to use that call.. Now my testcase is WicketTester c = new WicketTester(); c.createRequestCycle(); c.startPage(new HomePage()); But I'm still getting No requestCycle is currently set.. Before that, I have a there was an error cleaning up target [EMAIL PROTECTED] class = org.apache.wicket.util.tester.DummyHomePage, id = 1, version = 0]-testPage-interface org.apache.wicket.markup.html.link.ILinkListener.ILinkListener (request paramaters: [RequestParameters componentPath=1:testPage pageMapName=null versionNumber=0 interfaceName=ILinkListener componentId=null behaviorId=null urlDepth=-1 parameters={} onlyProcessIfPathActive=false]). Sorry for not mentioning this earlier :/ - 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: Exception starting filter WicketFilter on Glassfish
Or the other way around. Are you somehow including your own servlet.jar in your webapp. And is that one picked up that shouldnt be picked up On 4/17/08, PJ Pillai [EMAIL PROTECTED] wrote: Hello, I deployed my first hello world application on Glass Fish server. I am using Netbeans 6. I am getting following error: WebModule[/MyApp]PWC1270: Exception starting filter WicketFilter java.lang.NoClassDefFoundError: javax/servlet/Filter at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) Please help Thanks, Pravin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can I use LazyLoad or something like it with a modal?
Use it in the modal page or panel. So that the modal window is shown On 4/16/08, taygolf [EMAIL PROTECTED] wrote: That is what I looked at which brought about this question. I guess you are saying that I can use it with a modal? Should I be trying to use it where the modal is created or should I be using it on the page the the modal shows? I am just confused by it. Also is there a way to set the sleep time to something other than a static time. In other words can i set it to sleep until the query is done? Thanks T Gerolf Seitz wrote: take a look at AjaxLazyLoadPanel. this might do the trick. Gerolf On Wed, Apr 16, 2008 at 4:52 PM, taygolf [EMAIL PROTECTED] wrote: Ok here is my issue. I have a modal that has a lot of information in it and it has to get back a large amount of data from the database and it is taking about 4 seconds to load because of all the data. I wish I was allowed to fliter the data more so there was not so much information but I do not get to make that decision. Anyway when you click on the button to open the modal it takes about 4 or 5 seconds for the modal window to open. I would like to have something like lazyload has come up and show that the application is working and loading the modal instead of the screen just sitting there. If it just sits there while it is trying to load the user will click the button multiple times thinking the application is broken. So can I Lazy load a modal window? Or is there a better approach to tellign the user to wait for 5 seconds for the modal window to open? Thanks T -- View this message in context: http://www.nabble.com/Can-I-use-LazyLoad-or-something-like-it-with-a-modal--tp16722524p16722524.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] -- View this message in context: http://www.nabble.com/Can-I-use-LazyLoad-or-something-like-it-with-a-modal--tp16722524p16726065.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: BookmarkablePageLink linksTo() bug?
No it doesnt take that into account, previously we hadnt even access to the page params. Now we do if you do the rigth constructor call so maybe we can do something like that, make a jira issue. On 4/16/08, Ritz123 [EMAIL PROTECTED] wrote: Hi, Just wondering if linksTo(Page) method of BookmarkablePageLink has a bug since it doesnt take into account the Page parameters to check whether the page being linked in the context of parameters, if PageParameters are specified. In theory since Bookmarkable page being a dynamic page will be different based on what params are getting passed even though the page class name is still the same. Currently this causes page links for the DataTable based page to not work since autoenable will always show the links disabled. Just a thought... -- View this message in context: http://www.nabble.com/BookmarkablePageLink-linksTo%28%29-bug--tp16726486p16726486.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: testing a link
1) In your java code the link's wicket:id is back but in your test you use links 2) You have a space in the Tester.assertLabel ( links: linkLabel, Access); 3) What is it you want to test with the Link? remember tester.clickLink Frank On Thu, Apr 17, 2008 at 2:36 PM, aynif [EMAIL PROTECTED] wrote: Hello ev'ry body, First, I apologize for my poor English. I want to know how to perform a link test in JUnit. This is my code : Final List String values = ; Link myButton = new Link ( back) ( Private static final long serialVersionUID = 1L; @ Override Public void onClick () ( SetResponsePage (New Page (...)); ) ); Add (myButton); If (values.isEmpty ()) MyButton.setVisible (false); in the Test class, i add these lines : ... Tester.assertComponent ( links, Link.class); Tester.assertLabel ( links: linkLabel, Access); ... My test fails and i have a NullPointerException Thanks for yoyr help -- View this message in context: http://www.nabble.com/testing-a-link-tp16743958p16743958.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: am I doing right? entities no Serializables.
On Fri, Apr 18, 2008 at 11:50:59PM -0300, Fernando Wermus wrote: I try to spend the less memory I can using LoadableDetachableModel. But if the user is filling up a form for a new entity I think I have two options, one serialize and the other create a kind of dto. I don't like the first because I don't want my domain model be modified by the web tier (Serializable interface) and I don't like the second because I prefer languages as Smalltalk, Grovee or Ruby which you don't need dtos either serializable interfaces. That's why I was speaking up. I like wicket and maybe I could find another way. Those other languages are not magical. They still have serializable and non-serializable objects. An object containing a reference to a file handle or database connection will not be serializable in any language. You just don't get to find out that your object wasn't (safely) serializable until you restore it and it starts failing. Java's Serializable interface is just a marker, a way of telling the serialization code that your object does not contain file handles, database connections, or other such things that can't be safely serialized. Since I never put these things in my entities, I routinely mark all my entities as Serializable. I do not consider it a case of the web tier leaking into my domain model (I assume this is what you meant by modified by the web tier). jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: StringResourceModel with unknown array parameters
i come up with easy solution. thanks for help: .properties attendees.names=All attendees include: {0} webpage // example list, but do not know size of list at all times ListString attendees = new ArrayListString(); attendees.add(Attendee 1); attendees.add(Attendee 2); attendees.add(Attendee 3); add(new Label(attendee-names, new StringResourceModel(attendees.names, this, null, new Object[]{ Arrays.toString(attendees.toArray()) }))); output: All attendees include: [Attendee 1, Attendee 2, Attendee 3] Date: Fri, 18 Apr 2008 09:22:12 -0700 From: [EMAIL PROTECTED] To: users@wicket.apache.org Subject: Re: StringResourceModel with unknown array parameters On Fri, Apr 18, 2008 at 8:49 AM, Enrique Rodriguez [EMAIL PROTECTED] wrote: ... Cool, I just had to do something similar yesterday. I ended up ... I coded this up for your example: MyApp.properties label.attendees=All attendees include: ${attendees} Usage = ListString attendees = new ArrayListString(); attendees.add( Johan ); attendees.add( James ); add( new AttendeeLabel( attendees, label.attendees, this, attendees ) ); Code public class AttendeeLabel extends Label { public AttendeeLabel( String id, String resourceKey, Component component, ListString attendees ) { super( id, new StringResourceModel( resourceKey, component, new Model( new Attendees( attendees ) ) ) ); } private static class Attendees implements Serializable { private ListString attendees; public Attendees( ListString attendees ) { this.attendees = attendees; } public String getAttendees() { StringBuffer sb = new StringBuffer(); for ( IteratorString iterator = attendees.iterator(); iterator.hasNext(); ) { String attendee = iterator.next(); sb.append( attendee ); if ( iterator.hasNext() ) { sb.append( ); } } return sb.toString(); } } } HTH, Enrique - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: StringResourceModel with unknown array parameters
On Sat, Apr 19, 2008 at 01:00:09PM +, i ii wrote: i come up with easy solution. thanks for help: .properties attendees.names=All attendees include: {0} webpage // example list, but do not know size of list at all times ListString attendees = new ArrayListString(); attendees.add(Attendee 1); attendees.add(Attendee 2); attendees.add(Attendee 3); add(new Label(attendee-names, new StringResourceModel(attendees.names, this, null, new Object[]{ Arrays.toString(attendees.toArray()) }))); output: All attendees include: [Attendee 1, Attendee 2, Attendee 3] You might also want to look at Strings.join in Wicket or StringUtils.join in commons.lang. jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
clarification on page versioning
I have a page which displays a [login box] (if not logged in) or an info box [user name|logout link] if logged in. I implemented this as follows: User user = BaseSession.get().getLoggedInUser(); if (user == null) { add(new Login(login)); } else { add(new CurrentProfile(login)); } Both Login and CurrentProfile are subclasses of Panel. When the login form is submitted or the logout link is submitted, in order to get the page to re-render, I had to use this code: setResponsePage(getPage().getClass()); // need to use class so page is re-rendered As a new wicket user, I'd like a clarification on why this is necessary. If I used this code: setResponsePage(getPage()); ... which appears to be the default behavior if setResponsePage() isn't called ... then the page is simply displayed without re-rendering (e.g., after login, the login box is still shown). So, my question is what's the difference between the two? Is there a way to mark a page as needing re-rendering? Is my solution the correct way in Wicket? This also raises the question about how many pages are stored in the page map. For example, if I were to login and logout 10 times in a row ... would there be 20 pages in the page map? Is there a way to clear out the page map for a page? In my case, I invalidate the session on logout, so the above case isn't an issue in this exact case. I'm more concerned about someone who navigates my site and visits hundreds of pages. How do I keep the session from filling up with old pages? Finally, is there a best practice to debug/monitor session size and page map size? Thanks, -Doug -- View this message in context: http://www.nabble.com/clarification-on-page-versioning-tp16783638p16783638.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: clarification on page versioning
Both Login and CurrentProfile are subclasses of Panel. When the login form is submitted or the logout link is submitted, in order to get the page to re-render, I had to use this code: setResponsePage(getPage().getClass()); In this case the page isn't re-rendered, it is re-created, i.e. a new instance of your page class is instantiated, which then does the add(new CurrentProfile()) in its constructor. In the default behavior you're getting the exact same page instance you initially created and in which you said add(new Login()). To replace the login panel with the profile panel, keep a reference to the login panel and in your form submit method do this: login.replaceWith(new CurrentProfile()) This removes the login panel from the page and, as the method name suggests, replaces it with the CurrentProfile instance. Remember the latter in a field too, if you ever want to switch back. This way you only have one page and swap out its components instead of creating new page instances. Hope this helps Carl-Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: clarification on page versioning
Thanks for the post. I'd probably have to do an anonymous subclass of my Login panel. It doesn't know about it's parent or what the parent might like to swap in when a logged in user is present. I'll look under the covers of replaceWith() - I basically want to do whatever replaceWith() does without actually replacing anything. -Doug Carl-Eric Menzel-5 wrote: Both Login and CurrentProfile are subclasses of Panel. When the login form is submitted or the logout link is submitted, in order to get the page to re-render, I had to use this code: setResponsePage(getPage().getClass()); In this case the page isn't re-rendered, it is re-created, i.e. a new instance of your page class is instantiated, which then does the add(new CurrentProfile()) in its constructor. In the default behavior you're getting the exact same page instance you initially created and in which you said add(new Login()). To replace the login panel with the profile panel, keep a reference to the login panel and in your form submit method do this: login.replaceWith(new CurrentProfile()) This removes the login panel from the page and, as the method name suggests, replaces it with the CurrentProfile instance. Remember the latter in a field too, if you ever want to switch back. This way you only have one page and swap out its components instead of creating new page instances. Hope this helps Carl-Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/clarification-on-page-versioning-tp16783638p16784204.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: clarification on page versioning
Doug Donohoe wrote: I'd probably have to do an anonymous subclass of my Login panel. It doesn't know about it's parent or what the parent might like to swap in when a logged in user is present. I'll look under the covers of replaceWith() - I basically want to do whatever replaceWith() does without actually replacing anything. replaceWith() is provided by Component and knows all it needs to do it. You shouldn't have to do anything to use it. Carl-Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket+Userforum integration?
Jan Kriesten wrote: hi, jforum is actually not so bad - rafael does a great job on it and it took some inspiration out of his work. i think there is a complete rewrite undergoing for v3.x (with some bigger sponsors as far as i have read). did'nt say jforum were bad, just wanted to know if there were any real competition:) if i'd had more time i would love to implement my own... Yeah, although it could be a little trival.. best regards, --- jan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to design tables that support 50-100K rows?
Probably could:) James Carman wrote: In Hibernate, couldn't you just use get(Class entityClass, Serializable id) rather than doing the whole uniqueResult() stuff? On Thu, Apr 17, 2008 at 9:09 AM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Using jpa you can do it this way: private BaseEntity findById(String table, Long id) { Query query = entityManager.createQuery(select p from + table + p where p.id= + id); return (BaseEntity) query.getSingleResult(); } private List findBaseEntity(int first, int count, String property, boolean ascending, String table) { Query query = entityManager.createQuery(select p from + table + p order by p.:property :sort); query.setParameter(property, property); if (ascending) { query.setParameter(sort, asc); } else { query.setParameter(sort, desc); } query.setFirstResult(first); query.setMaxResults(count); return (ListBaseEntity) query.getResultList(); } and this in hibernate: public Promo findPromo(Long id) { Criteria criteria = getHibernateSession().createCriteria(Promo.class); criteria.add(Restrictions.eq(id, id)); return (Promo) criteria.uniqueResult(); } public ListPromo findPromo(int first, int count, String property, boolean ascending, Company company) { Criteria criteria = getHibernateSession().createCriteria(Promo.class) .add(Restrictions.eq(company, company)); criteria.setMaxResults(count); criteria.setFirstResult(first); if (ascending) { criteria.addOrder(Order.asc(property)); } else { criteria.addOrder(Order.desc(property)); } return (ListPromo) criteria.list(); } public int promoCount(Company company) { Criteria criteria = getHibernateSession().createCriteria(Promo.class) .add(Restrictions.eq(company, company)); criteria.setProjection(Projections.rowCount()); Object obj = criteria.uniqueResult(); return (Integer) obj; } gumnaam23 wrote: I have done this, and it works quite nicely. Be warned though, the biggest bottle neck in this, is the loading of the data from database. So for best performance, you should read only one page's worth data at a time from your DB (in your case 500). If you load the whole data, and use some thing like a list iterator, you will not get any performance benefit. Unfortunately ANSI SQL has no syntax for pagination of results. So you have 2 choices. 1) Keep an open DB cursor , and retrieve as much data as you want per page rendering. But this ties your cursor to the user session. Not a very good idea. 2) Use the vendor specific way to get paginated results. Almost all major vendors support pagination of query results in their own idiosyncratic way. If you go with approach 2, you can even use the AjaxFallbackDefaultDataTable, which will do all the pagination etc for you, and with AJAX to boost. You only need to provide a SortableDataProvider, which implements the size() and iterate(int lower, int upper) calls. Your size() call should fetch a total count of items. i.e. select count(*) and the iterate(int lower, int upper) should retrieve the query results between lower and upper limit. And with sortable data provider, you even get sorting for free. (I mean the UI, you do have to write the back end implementation your self). For my case, I use iBatis for DB access, so it is really easy to write DB Vendor specific queries and yet retain the pagination abstraction. If I need to work with another DB , I can easily swap the pagination query part. Hope this has helped. PhilipJohnson wrote: * Finally, when I am displaying Page 1 containing 500 rows (using something like PageableListView), I'd like to only populate my model with rows 1-500 from my backing store. Let's say the user then clicks on Page 3: at that point, I'd like to go retrieve rows 1001-1500 from my backing store and populate my model for rows 1001-1500. How would one go about doing this? Would it be possible to kind of sketch out the approach for me? -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - 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] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684
Re: Can I use LazyLoad or something like it with a modal?
Other thing you can use to alert the user in a gmail mode (loading...) is to add an AjaxCallDecorator to the link that pop ups the modal window, and using javascript to show/hide this message Gerolf Seitz wrote: take a look at AjaxLazyLoadPanel. this might do the trick. Gerolf On Wed, Apr 16, 2008 at 4:52 PM, taygolf [EMAIL PROTECTED] wrote: Ok here is my issue. I have a modal that has a lot of information in it and it has to get back a large amount of data from the database and it is taking about 4 seconds to load because of all the data. I wish I was allowed to fliter the data more so there was not so much information but I do not get to make that decision. Anyway when you click on the button to open the modal it takes about 4 or 5 seconds for the modal window to open. I would like to have something like lazyload has come up and show that the application is working and loading the modal instead of the screen just sitting there. If it just sits there while it is trying to load the user will click the button multiple times thinking the application is broken. So can I Lazy load a modal window? Or is there a better approach to tellign the user to wait for 5 seconds for the modal window to open? Thanks T -- View this message in context: http://www.nabble.com/Can-I-use-LazyLoad-or-something-like-it-with-a-modal--tp16722524p16722524.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] -- View this message in context: http://www.nabble.com/Can-I-use-LazyLoad-or-something-like-it-with-a-modal--tp16722524p16786316.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: problem with DateTextField in wicket 1.3
i've tried that, didn't help. the issue occurs with at least 2 browsers: IE 7 and Firefox 2.0 Date: Sat, 19 Apr 2008 10:20:57 +0200 From: [EMAIL PROTECTED] To: users@wicket.apache.org Subject: Re: problem with DateTextField in wicket 1.3 Try to clear your browser caches, maybe there is an old js lib still used On 4/18/08, Vadim Tesis [EMAIL PROTECTED] wrote: all, i'm trying to move from wicket-1.3.0-rc2 to wicket-1.3.3. for some reason i started having problems with DateTextField. it's displaying an error in java script: Line: 2072Error: Object doesn't support this property or method it looks like the error comes from file: yuiloader-beta.js line:2072: this.moduleInfo = lang.merge(YUI.info.moduleInfo); which gets called from the script generated in my page: if (typeof wicketYuiLoader == 'undefined') { wicketYuiLoader = new YAHOO.util.YUILoader({ base: resources/org.apache.wicket.extensions.yui.YuiLib/, filter: RAW, allowRollup: false, require: [wicket-date], onSuccess: function() { wicketCalendarInitFinished = true; while (wicketCalendarInits.length 0) { wicketCalendarInits.pop()(); } } }); if i switch back to wicket-1.3.0-rc2, the error goes away. below is my markup and java code. does anyone have any suggestions on how to fix the issue? Thanks, Vadimhere's the markup: div class=controlinput type=text name=textStart wicket:id=textStart//div here's java code: final DateField df = new DateField(textStart, new PropertyModel(this, PROP_START)) { private static final long serialVersionUID = 1L; @Override protected DateTextField newDateTextField(final String id_, final PropertyModel model_) { return (new DateTextField(id_, model_, new StyleDateConverter(S-, true))); } }; getForm().add(df); _ Pack up or back up–use SkyDrive to transfer files or keep extra copies. Learn how. http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_packup_042008 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Use video conversation to talk face-to-face with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_042008
Re: clarification on page versioning
I meant I'd look under the covers to see if I could find a way to force the page to re-render without adding an entry to the page map. Maybe I 'm missing something. With regards to my page map question, I'm searching for a description of how the history mechanism works and what controls one has to limit the size of the page map. Anyone have any insights on this? -Doug Carl-Eric Menzel-5 wrote: Doug Donohoe wrote: I'd probably have to do an anonymous subclass of my Login panel. It doesn't know about it's parent or what the parent might like to swap in when a logged in user is present. I'll look under the covers of replaceWith() - I basically want to do whatever replaceWith() does without actually replacing anything. replaceWith() is provided by Component and knows all it needs to do it. You shouldn't have to do anything to use it. Carl-Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/clarification-on-page-versioning-tp16783638p16787301.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: clarification on page versioning
with diskstore (default in 1.3) each pagemap only contains one page. the rest are spooled to disk. -igor On Sat, Apr 19, 2008 at 1:22 PM, Doug Donohoe [EMAIL PROTECTED] wrote: I meant I'd look under the covers to see if I could find a way to force the page to re-render without adding an entry to the page map. Maybe I 'm missing something. With regards to my page map question, I'm searching for a description of how the history mechanism works and what controls one has to limit the size of the page map. Anyone have any insights on this? -Doug Carl-Eric Menzel-5 wrote: Doug Donohoe wrote: I'd probably have to do an anonymous subclass of my Login panel. It doesn't know about it's parent or what the parent might like to swap in when a logged in user is present. I'll look under the covers of replaceWith() - I basically want to do whatever replaceWith() does without actually replacing anything. replaceWith() is provided by Component and knows all it needs to do it. You shouldn't have to do anything to use it. Carl-Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/clarification-on-page-versioning-tp16783638p16787301.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: problem with DateTextField in wicket 1.3
i tried to modify the quick start and it works fine there. it looks like it's conflicting with wicketstuff-yui-1.3.0 which is using yui 2.2.2. i did some searching and it looked that someone was working on porting wicketstuff-yui to 2.3.0. was it completed, if yes, where can i get the source? i'm using wicketstuff-yui for dropdown menus, is there anything else i could use to work around the issue? Thanks, Vadim From: [EMAIL PROTECTED] To: users@wicket.apache.org Subject: RE: problem with DateTextField in wicket 1.3 Date: Sat, 19 Apr 2008 18:34:10 + i've tried that, didn't help. the issue occurs with at least 2 browsers: IE 7 and Firefox 2.0 Date: Sat, 19 Apr 2008 10:20:57 +0200 From: [EMAIL PROTECTED] To: users@wicket.apache.org Subject: Re: problem with DateTextField in wicket 1.3 Try to clear your browser caches, maybe there is an old js lib still used On 4/18/08, Vadim Tesis [EMAIL PROTECTED] wrote: all, i'm trying to move from wicket-1.3.0-rc2 to wicket-1.3.3. for some reason i started having problems with DateTextField. it's displaying an error in java script: Line: 2072Error: Object doesn't support this property or method it looks like the error comes from file: yuiloader-beta.js line:2072: this.moduleInfo = lang.merge(YUI.info.moduleInfo); which gets called from the script generated in my page: if (typeof wicketYuiLoader == 'undefined') { wicketYuiLoader = new YAHOO.util.YUILoader({ base: resources/org.apache.wicket.extensions.yui.YuiLib/, filter: RAW, allowRollup: false, require: [wicket-date], onSuccess: function() { wicketCalendarInitFinished = true; while (wicketCalendarInits.length 0) { wicketCalendarInits.pop()(); } } }); if i switch back to wicket-1.3.0-rc2, the error goes away. below is my markup and java code. does anyone have any suggestions on how to fix the issue? Thanks, Vadimhere's the markup: div class=controlinput type=text name=textStart wicket:id=textStart//div here's java code: final DateField df = new DateField(textStart, new PropertyModel(this, PROP_START)) { private static final long serialVersionUID = 1L; @Override protected DateTextField newDateTextField(final String id_, final PropertyModel model_) { return (new DateTextField(id_, model_, new StyleDateConverter(S-, true))); } }; getForm().add(df); _ Pack up or back up–use SkyDrive to transfer files or keep extra copies. Learn how. http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_packup_042008 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Use video conversation to talk face-to-face with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_042008 _ More immediate than e-mail? Get instant access with Windows Live Messenger. http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_instantaccess_042008
Re: clarification on page versioning
Probably you should move this code in onBeforeRender() (and use addOrReplace(). This way every time you'll have the right panel. On Sat, 2008-04-19 at 07:28 -0700, Doug Donohoe wrote: I have a page which displays a [login box] (if not logged in) or an info box [user name|logout link] if logged in. I implemented this as follows: User user = BaseSession.get().getLoggedInUser(); if (user == null) { add(new Login(login)); } else { add(new CurrentProfile(login)); } Both Login and CurrentProfile are subclasses of Panel. When the login form is submitted or the logout link is submitted, in order to get the page to re-render, I had to use this code: setResponsePage(getPage().getClass()); // need to use class so page is re-rendered As a new wicket user, I'd like a clarification on why this is necessary. If I used this code: setResponsePage(getPage()); ... which appears to be the default behavior if setResponsePage() isn't called ... then the page is simply displayed without re-rendering (e.g., after login, the login box is still shown). So, my question is what's the difference between the two? Is there a way to mark a page as needing re-rendering? Is my solution the correct way in Wicket? This also raises the question about how many pages are stored in the page map. For example, if I were to login and logout 10 times in a row ... would there be 20 pages in the page map? Is there a way to clear out the page map for a page? In my case, I invalidate the session on logout, so the above case isn't an issue in this exact case. I'm more concerned about someone who navigates my site and visits hundreds of pages. How do I keep the session from filling up with old pages? Finally, is there a best practice to debug/monitor session size and page map size? Thanks, -Doug - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Session created every time
Guys, I have a page which contains an ExternalLink and Label, shouldnt the wicket session be created/initialized when that page is rendered given it contains Statefull components..? Currently whenever i send subsequent request to the page, the wicket session is re-created.. -- View this message in context: http://www.nabble.com/Session-created-every-time-tp16790567p16790567.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: Session created every time
you dont have any stateless components on that page... -igor On Sat, Apr 19, 2008 at 10:12 PM, mfs [EMAIL PROTECTED] wrote: Guys, I have a page which contains an ExternalLink and Label, shouldnt the wicket session be created/initialized when that page is rendered given it contains Statefull components..? Currently whenever i send subsequent request to the page, the wicket session is re-created.. -- View this message in context: http://www.nabble.com/Session-created-every-time-tp16790567p16790567.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]