Re: Button component not enabled in FireFox
Wicket: 1.4.16 FireFox:3.5.4 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Button-component-not-enabled-in-FireFox-tp3675168p3677363.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Custom PagingNavigation Back-Button -Problem
Solved the problem. My assumption about the RequestListenerInterface was wrong. What i am doing now: In my page i prevent Browser Caching: protected void configureResponse() { super.configureResponse(); WebResponse response = getWebRequestCycle().getWebResponse(); response.setHeader(Cache-Control, no-cache, max-age=0,must-revalidate, no-store); response.setHeader(Expires,-1); response.setHeader(Pragma,no-cache); } The problem was located in my DataProvider: public int size() { //That solved my problem: if(technicalInfoRepository.countAllEntities() == 0) technicalInfoRepository.load(, null, null, null, null); return filteringStrategy.getFiltered( new LinkedList ITechnicalInfo(technicalInfoRepository .findAll(all(ITechnicalInfo.class.size(); } When i clicked on the back-button my Repository was empty. No i am loading the repository again if its size is null. By the way: I am using the InMemoryRepositories of the sourceforge project domian. I am using this kind of repository because my Application solely uses Web Services as its data source. In order to get a good compromise between caching and the number of web service calls i'm saving a reference to the repositories in the DataProvider or in the Page (Panel, Component, whatever). Whenever possible i use a transient reference (but that wasn't the problem in this case). So this is just a thin cache for user specific data. For data that is reusable for all users i use ehcache. If you've got any suggestions on alternative approaches i would really appreciate that. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Custom-PagingNavigation-Back-Button-Problem-tp3666779p3677549.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Refreshing captcha image
use ajaxlink instead of ajaxsubmitlink .. On Tue, Jul 19, 2011 at 8:37 AM, Alec Swan alecs...@gmail.com wrote: Hello, We have a form with some required fields and a captcha image with CaptchaImageResource. Everything works great, but the default Wicket captcha component displays text which is hard to read for end-users. I added an AjaxSubmitLink(reCaptcha) button which should allow the user to re-generate the captcha image. However, the image does not get refreshed. The code is shown below. Is there a problem with the code or some recommended way to allow the end-user to regenerate captcha text? @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { password = blah1;//newPassword(); CaptchaImageResource captchaImageResource = new CaptchaImageResource(password); NonCachingImage imgCaptcha = new NonCachingImage(captchaImage, captchaImageResource); imgCaptcha.setOutputMarkupId(true); // required for AjaxFallbackLink addOrReplace(imgCaptcha); if (target != null) { target.addComponent(imgCaptcha); } } Thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- thank you, regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
[Migration 1.5]: exception handling in request cycle
Hi, I'm trying to plug into the new request cycle processor of 1.5-RC5.1. I am following the instructions in the wiki page, but I seem to have run into some out-of-date info. So, according to: https://cwiki.apache.org/WICKET/migration-to-wicket-15.html#MigrationtoWicket1.5-RequestCycle: 1) I must create a class implementing IRequestCycleListener 2) I must bind my listener during application init() with getRequestCycleListeners().add(...); My problem is that previously when we extended the WebRequestCycle, we would preserve the default exception handling by using: @Override public Page onRuntimeException(Page page, RuntimeException e) { return super.onRuntimeException(page, e); } Now, the wiki page claims that in my listener I can: public void onException(Exception ex) { /*do nothing*/} However, the new listener interface forces you to return a handler (IRequestHandler), it does not return void as claimed in the wiki. So what do I do to return something that will tell Wicket to proceed with its default Exception handling? The actual signature is: public IRequestHandler onException(RequestCycle cycle, Exception ex) { // what do I return in order not to interfere? } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [Migration 1.5]: exception handling in request cycle
See the last point at https://cwiki.apache.org/confluence/display/WICKET/RequestCycle+in+Wicket+1.5 Please update the wiki page after this. The Migration wiki page has a Note point at the top that there is a Wiki label at the bottom clicking on which will show you all pages with info about 1.5. It seems this note is not quite visible to the users. Ideas how to improve that is welcome! On Tue, Jul 19, 2011 at 12:35 PM, Alexandros Karypidis akary...@yahoo.gr wrote: Hi, I'm trying to plug into the new request cycle processor of 1.5-RC5.1. I am following the instructions in the wiki page, but I seem to have run into some out-of-date info. So, according to: https://cwiki.apache.org/WICKET/migration-to-wicket-15.html#MigrationtoWicket1.5-RequestCycle: 1) I must create a class implementing IRequestCycleListener 2) I must bind my listener during application init() with getRequestCycleListeners().add(...); My problem is that previously when we extended the WebRequestCycle, we would preserve the default exception handling by using: @Override public Page onRuntimeException(Page page, RuntimeException e) { return super.onRuntimeException(page, e); } Now, the wiki page claims that in my listener I can: public void onException(Exception ex) { /*do nothing*/} However, the new listener interface forces you to return a handler (IRequestHandler), it does not return void as claimed in the wiki. So what do I do to return something that will tell Wicket to proceed with its default Exception handling? The actual signature is: public IRequestHandler onException(RequestCycle cycle, Exception ex) { // what do I return in order not to interfere? } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [Migration 1.5]: exception handling in request cycle
Ok, thx. In terms of improving the wiki, I guess my source of confusion was that I was reading: https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-RequestCycle I fixed the signature of onException(...) and also added some comments in the sample request listener implementation (indicating that you may return null). Finally, I added a link to the page you directed me to in the Exception Handling section immediately afterwards which only mentioned the exception mapper. This should help one find that the mapper is used only in case all of the listeners return null. Alex. - Original Message From: Martin Grigorov mgrigo...@apache.org To: users@wicket.apache.org Sent: Tue, July 19, 2011 12:47:54 PM Subject: Re: [Migration 1.5]: exception handling in request cycle See the last point at https://cwiki.apache.org/confluence/display/WICKET/RequestCycle+in+Wicket+1.5 Please update the wiki page after this. The Migration wiki page has a Note point at the top that there is a Wiki label at the bottom clicking on which will show you all pages with info about 1.5. It seems this note is not quite visible to the users. Ideas how to improve that is welcome! On Tue, Jul 19, 2011 at 12:35 PM, Alexandros Karypidis akary...@yahoo.gr wrote: Hi, I'm trying to plug into the new request cycle processor of 1.5-RC5.1. I am following the instructions in the wiki page, but I seem to have run into some out-of-date info. So, according to: https://cwiki.apache.org/WICKET/migration-to-wicket-15.html#MigrationtoWicket1.5-RequestCycle: : 1) I must create a class implementing IRequestCycleListener 2) I must bind my listener during application init() with getRequestCycleListeners().add(...); My problem is that previously when we extended the WebRequestCycle, we would preserve the default exception handling by using: @Override public Page onRuntimeException(Page page, RuntimeException e) { return super.onRuntimeException(page, e); } Now, the wiki page claims that in my listener I can: public void onException(Exception ex) { /*do nothing*/} However, the new listener interface forces you to return a handler (IRequestHandler), it does not return void as claimed in the wiki. So what do I do to return something that will tell Wicket to proceed with its default Exception handling? The actual signature is: public IRequestHandler onException(RequestCycle cycle, Exception ex) { // what do I return in order not to interfere? } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How can i trace the requested urls?
Hi, i try to log the page-urls user has visited. I would like to create a log file for every session and log the traces there. My first intent to use a filter for that is not working because servlet spec only allows /* and *. for wildcards. So my url /Overview.html/param1/1/param2/2 is not matching and filter isn't called. Is wicket providing an entry point for that? Thanks Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How can i trace the requested urls?
See the web container's access log. On Tue, Jul 19, 2011 at 3:38 PM, Mike Mander wicket-m...@gmx.de wrote: Hi, i try to log the page-urls user has visited. I would like to create a log file for every session and log the traces there. My first intent to use a filter for that is not working because servlet spec only allows /* and *. for wildcards. So my url /Overview.html/param1/1/param2/2 is not matching and filter isn't called. Is wicket providing an entry point for that? Thanks Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How can i trace the requested urls?
Am 19.07.2011 14:59, schrieb Martin Grigorov: See the web container's access log. On Tue, Jul 19, 2011 at 3:38 PM, Mike Manderwicket-m...@gmx.de wrote: Hi, i try to log the page-urls user has visited. I would like to create a log file for every session and log the traces there. My first intent to use a filter for that is not working because servlet spec only allows /* and *. for wildcards. So my url /Overview.html/param1/1/param2/2 is not matching and filter isn't called. Is wicket providing an entry point for that? Thanks Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org Hm i don't think that i can solve my problem by filter the access.log. At first it's hard to test the external log file. On the other i couldn't find any session grouping logs there. Do you know another place to go? While debugging i saw already the requested url. But i don't know exactly where to put my logger in. Thanks Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How can i trace the requested urls?
Did you take a look at Wicket's request logger? Martijn On Tue, Jul 19, 2011 at 3:21 PM, Mike Mander wicket-m...@gmx.de wrote: Am 19.07.2011 14:59, schrieb Martin Grigorov: See the web container's access log. On Tue, Jul 19, 2011 at 3:38 PM, Mike Manderwicket-m...@gmx.de wrote: Hi, i try to log the page-urls user has visited. I would like to create a log file for every session and log the traces there. My first intent to use a filter for that is not working because servlet spec only allows /* and *. for wildcards. So my url /Overview.html/param1/1/param2/2 is not matching and filter isn't called. Is wicket providing an entry point for that? Thanks Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org Hm i don't think that i can solve my problem by filter the access.log. At first it's hard to test the external log file. On the other i couldn't find any session grouping logs there. Do you know another place to go? While debugging i saw already the requested url. But i don't know exactly where to put my logger in. Thanks Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
FileUpload + locked PageMap
Hi, I've implemented the /org.apache.wicket.markup.html.form.upload.FileUpload /and /FileUploadField /components to upload big files ( 200MB). In the meantime of uploading the client (user browser) is not able to complete any other Ajax-Call even in another Tab (Firefox / InternetExplorer). This is a problem. But a bigger one is this Exception: org.apache.wicket.RequestCycle - org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap null is still locked which occurs, if the File is much bigger. How can i fix this problem. I think my other problem depends on it? Thanks a lot in Advance for any helpful answer. Matty -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/FileUpload-locked-PageMap-tp3678158p3678158.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Unit testing wicket
Hi Niranjan, If I add more than one test case, setUp method is called more than twice and wicket throws the exception Application name can only be set once.. You may want to take a look at http://wicketpagetest.sourceforge.net which is much easier to use. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
enable submit button obly when all fields are filled
Hi all, I wonder if there is a simple way to enable the submit button of a form only when all fields of this form are filled? Thanks to AjaxFormComponentUpdatingBehavior, I can enable my button when I fill a field, but I want enable my button only when all fields are filled and I don't know how to do that. Is there a method like AjaxFormComponentUpdatingBehavior but for entire form? thanks -- *Mathilde Pellerin* Ingénieur en développement de logiciel STATLIFE tel : 01.42.11.64.88 mail : mathilde.pelle...@statlife.fr
wicket as template engine
I know I could use freemarker, velocity or any other tool. But these tools require me to create a full blown template model up front as wicket allows for a bunch of models chained togeter pulling data from different sources when they are needed. I have a set of load of panels that create a single Page. The customer wants me to export page contents to pdf so I thought I could: 1. create a print skin for the panels 2. render the panels/page using print skin to the external html file. 3. use some html to pdf rendering tool (like flying saucer) 4. serve pdf as with content-disposition: attachment Everything is easy apart from 1). Can you advise? lg -- Leszek Gawronhttp://lgawron.posterous.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: enable submit button obly when all fields are filled
use javascript, im sure there are at least 10 jquery plugins that can do that... -igor On Tue, Jul 19, 2011 at 8:29 AM, Mathilde Pellerin mathilde.pelle...@statlife.fr wrote: Hi all, I wonder if there is a simple way to enable the submit button of a form only when all fields of this form are filled? Thanks to AjaxFormComponentUpdatingBehavior, I can enable my button when I fill a field, but I want enable my button only when all fields are filled and I don't know how to do that. Is there a method like AjaxFormComponentUpdatingBehavior but for entire form? thanks -- *Mathilde Pellerin* Ingénieur en développement de logiciel STATLIFE tel : 01.42.11.64.88 mail : mathilde.pelle...@statlife.fr - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Refreshing captcha image
That worked. Thank you Vineet! On Tue, Jul 19, 2011 at 2:17 AM, vineet semwal vineetsemwal1...@gmail.com wrote: use ajaxlink instead of ajaxsubmitlink .. On Tue, Jul 19, 2011 at 8:37 AM, Alec Swan alecs...@gmail.com wrote: Hello, We have a form with some required fields and a captcha image with CaptchaImageResource. Everything works great, but the default Wicket captcha component displays text which is hard to read for end-users. I added an AjaxSubmitLink(reCaptcha) button which should allow the user to re-generate the captcha image. However, the image does not get refreshed. The code is shown below. Is there a problem with the code or some recommended way to allow the end-user to regenerate captcha text? @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { password = blah1;//newPassword(); CaptchaImageResource captchaImageResource = new CaptchaImageResource(password); NonCachingImage imgCaptcha = new NonCachingImage(captchaImage, captchaImageResource); imgCaptcha.setOutputMarkupId(true); // required for AjaxFallbackLink addOrReplace(imgCaptcha); if (target != null) { target.addComponent(imgCaptcha); } } Thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- thank you, regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Issues with HeaderResponseContainerFilteringHeaderResponse
We're making our application skinable, but I'm having some trouble getting user specified css into the right place in the header. We're working in a distributed environment, so instead of saving their css in the file system we're putting it in our database, and in order to get the cascade to work properly we need to add this css after all the others. Here's how I'm adding it: StandardPage.java onInitialize() //Add any override style Tenant tenant = MyWebSession.get().getTenant(); Css css = cssRepository.GetStyleByTenant(tenant); if(tenant.getBranding() css != null) { add(new Label(style, css.getStyle())); } } StandardPage.html wicket:head style type=text/css wicket:id=style/style /wicket:head - So the issue is that thet style tag comes before all my header contributions. I've tried specifying a header response decorator like so: Application.java public static final String HEADER_FILTER_NAME = myHeaderBucket; init() { super.init(); setHeaderResponseDecorator(new IHeaderResponseDecorator() { HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter[] filters = {new CssAcceptingHeaderResponseFilter(HEADER_FILTER_NAME)}; @Override public IHeaderResponse decorate(IHeaderResponse response) { return new HeaderResponseContainerFilteringHeaderResponse(response, HEADER_FILTER_NAME, filters); } }); } StandardPage.html wicket:head div wicket:id=myHeaderBucket/div style type=text/css wicket:id=style/style /wicket:head -- Unfortunately I'm getting this exception when I instantiate a page: 12:28:04,097 INFO [STDOUT] 2011-07-19 12:28:04.096 [http-127.0.0.1-8080-1] [127.0.0.1] [T:2] [U:3 - joe_sharp] [com.transverse.bleep.wicket.desktop.DesktopPage] ERROR org.apache.wicket.RequestCycle 1529 - Exception in rendering component: [MarkupContainer [Component id = headerBucket]] org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = headerBucket]] at org.apache.wicket.Component.renderComponent(Component.java:2729) ~[wicket-1.4.17.jar:1.4.17] at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539) ~[wicket-1.4.17.jar:1.4.17] at org.apache.wicket.Component.render(Component.java:2521) ~[wicket-1.4.17.jar:1.4.17] ... Caused by: java.lang.RuntimeException: there was an error processing the header response - you tried to render a bucket of response from HeaderResponseContainerFilteringHeaderResponse, but it had not yet run and been closed. this should occur when the header container that is standard in wicket renders, so perhaps you have done something to keep that from rendering? at org.apache.wicket.resource.filtering.HeaderResponseFilteredResponseContainer.onComponentTagBody(HeaderResponseFilteredResponseContainer.java:67) ~[wicket-1.4.17.jar:1.4.17] at org.apache.wicket.Component.renderComponent(Component.java:2690) ~[wicket-1.4.17.jar:1.4.17] ... 81 common frames omitted Any ideas on what I'm doing wrong? Is there an easier approach I can take? Thanks, Loren
AjaxLink onclick being called twice
Has anyone had any problems using an AjaxLink where the onclick method is being called twice? I'm trying to use an AjaxLink to load a ModalWindow but the second time it's being called, the ModalWindow thinks that the window has already loaded so it returns nothing. mail2web.com What can On Demand Business Solutions do for you? http://link.mail2web.com/Business/SharePoint - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxLink onclick being called twice
Has anyone had any problems using an AjaxLink where the onclick method is being called twice? I'm trying to use an AjaxLink to load a ModalWindow but the second time it's being called, the ModalWindow thinks that the window has already loaded so it returns nothing. mail2web - Check your email from the web at http://link.mail2web.com/mail2web - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxLink onclick being called twice
Has anyone had any problems using an AjaxLink where the onclick method is being called twice? I'm trying to use an AjaxLink to load a ModalWindow but the second time it's being called, the ModalWindow thinks that the window has already loaded so it returns nothing. mail2web.com What can On Demand Business Solutions do for you? http://link.mail2web.com/Business/SharePoint - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxLink onclick being called twice
Has anyone had any problems using an AjaxLink where the onclick method is being called twice? I'm trying to use an AjaxLink to load a ModalWindow but the second time it's being called, the ModalWindow thinks that the window has already loaded so it returns nothing. mail2web.com What can On Demand Business Solutions do for you? http://link.mail2web.com/Business/SharePoint - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re-Captcha with WiQuery ButtonBehavior causes Channel busy - postponing
Hello, We have a re-captcha button which refreshes captcha password image. It works fine until we add WiQuery ButtonBehavior to the button. With this behavior the captcha image is no longer refreshed and Wicked Ajax Debugger displays INFO: Channel busy - postponing. The following is a code snippet which describes the problem. Uncommenting add(new ButtonBehavior()) breaks re-captcha functionality. Please help, Thanks new AjaxLink(reCaptcha) { @Override public void onClick(AjaxRequestTarget target) { password = newPassword(); CaptchaImageResource captchaImageResource = new CaptchaImageResource(password); NonCachingImage imgCaptcha = new NonCachingImage(captchaImage, captchaImageResource); imgCaptcha.setOutputMarkupId(true); SignUpForm.this.addOrReplace(imgCaptcha); if (target != null) { target.addComponent(imgCaptcha); } } }//.add(new ButtonBehavior()) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket as template engine
Search the mailing list archives for things like emailing pages. There have been a lot of discussions about the topic that will help you. On 2011 7 19 10:32, Leszek Gawron lgaw...@apache.org wrote: I know I could use freemarker, velocity or any other tool. But these tools require me to create a full blown template model up front as wicket allows for a bunch of models chained togeter pulling data from different sources when they are needed. I have a set of load of panels that create a single Page. The customer wants me to export page contents to pdf so I thought I could: 1. create a print skin for the panels 2. render the panels/page using print skin to the external html file. 3. use some html to pdf rendering tool (like flying saucer) 4. serve pdf as with content-disposition: attachment Everything is easy apart from 1). Can you advise? lg -- Leszek Gawron http://lgawron.posterous.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Button component not enabled in FireFox
Can you reproduce this issue in a quickstart project and attach it to JIRA? Wicket: 1.4.16 FireFox:3.5.4 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Button-component-not-enabled-in-FireFox-tp3675168p3677363.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Page De-Serialization and memory
Martin, The reason I was interested in Wicket memory usage was because of the potential use of Scala traits, rather than the two possible Java approaches, might be compelling when it comes to memory usage. First, the two Java approaches: proxy/wrapper object or bundle everything into the base class. The proxy/wrapper approach lets one have a single implementation that can be share by multiple classes. The down side is that proxy/wrapper object requires an additional reference in the class using it and hence additional memory usage. The bundle everything into the base class approach violates OOP 101 dictum about having small objects focused on their own particular behavior thus avoiding bloat. (Not executable Java/Scala code below.) interface Parent { getParent setParent } // Potentially shared implementation class ParentProxy implements Parent { parent getParent = parent setParent(parent) = this.parent = parent } // Issue: Has additional instance variable: parentProxy class CompWithProxy with Parent { parentProxy = new ParentProxy getParent = parentProxy.getParent setParent(parent) = parentProxy.setParent(parent) } // Issue: Does not share implementation class CompAllInOne with Parent { parent getParent = parent setParent(parent) = this.parent = parent } Wicket has taken the bundle everything into base class in order to lessen memory usage - a certainly reasonable Java approach to the problem. With Scala one can do the following: // Shared implementation trait ParentTrait { parent getParent = parent setParent(parent) = this.parent = parent } // Uses implementation class Comp with ParentTrait The implementation, ParentTrait, can be used by any number of classes. In addition, one can add to a base class any number of such implementation traits sharing multiple implementations across multiple classes. So, can using such approach result in smaller (less in-memory) object in Scala than in Java? The ParentTrait does not really save very much. I assume that its only the Page class and sub-classes that do not have parent components in Wicket, so the savings per Page component tree is very small indeed. But, there are other behaviors that can be converted to traits, for example, Models. Many of the instance variables in the Java Models which take memory can be converted to methods return values which only add to the size of the class, not to every instance of the class. Also, with Model traits that use Component self-types, one can do away with IComponentAssignedModel wrapping and such. So, how to demonstrate such memory differences. I created stripped down versions of the Component and Label classes in both Java and Scala (only ids and Models) . Created different Model usage scenarios with Model object in Java and Traits in Scala, and, finally, serialized (Java Serialization) the result comparing the size of the resulting array of bytes. There are two runs, one with all Strings being the empty string and the next where all strings are 10-character strings: The Java versions (empty string): Label.Empty 99 Label.ReadOnly 196 Label.ReadWrite 159 Label.Resource 333 Label.Property 223 Label.ComponentProperty 351 Label.CompoundProperty 208 The Scala versions (empty string): Label.Empty 79 Label.ReadOnly 131 Label.ReadWrite 150 Label.Resource 164 Label.Property 207 Label.ComponentProperty 134 Label.CompoundProperty 184 The Java versions (10-character strings): Label.Empty 109 Label.ReadOnly 214 Label.ReadWrite 177 Label.Resource 359 Label.Property 241 Label.ComponentProperty 369 Label.CompoundProperty 218 The Scala versions (10-character strings): Label.Empty 89 Label.ReadOnly 149 Label.ReadWrite 168 Label.Resource 190 Label.Property 225 Label.ComponentProperty 152 Label.CompoundProperty 194 [Note that the Java Label.Empty result is misleading since in Wicket there is no memory overhead when a Component has no Model.] While this does indicate that using Model traits with Scala will result in less memory usage than the comparable Java approach, Java Serialization adds a whole lot of extra stuff to the array of bytes that masks the true change in in-memory usage. With Java Serialization, the class descriptor for each instance serialized is also added to the byte array and, it is this, that takes up most of the array of bytes. Thinking about it, I realized that Java Serialization is rather a blunt tool when it comes to the requirement of (Scala) Wicket Page serialization. Java Serialization creates a byte array that is rather self-contained/self-descriptive in its content. This is not required for (Scala) Wicket which has very specific requirements and use-cases. But first, before I describe what I did, here are the results. The byte array size data
Re: AjaxLink onclick being called twice
So you click the link and the modal displays, you dismiss the modal, click the link again and nothing happens? Is the behavior consistent across browsers? -Clint On Tue, Jul 19, 2011 at 4:18 PM, wic...@geofflancaster.com wic...@geofflancaster.com wrote: Has anyone had any problems using an AjaxLink where the onclick method is being called twice? I'm trying to use an AjaxLink to load a ModalWindow but the second time it's being called, the ModalWindow thinks that the window has already loaded so it returns nothing. mail2web.com – What can On Demand Business Solutions do for you? http://link.mail2web.com/Business/SharePoint - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Issues with HeaderResponseContainerFilteringHeaderResponse
To start, don't use a Label to contribute css. Use a header contributor. That's what they're made for. On 2011 7 19 13:22, Loren Cole loren.c...@gmail.com wrote: We're making our application skinable, but I'm having some trouble getting user specified css into the right place in the header. We're working in a distributed environment, so instead of saving their css in the file system we're putting it in our database, and in order to get the cascade to work properly we need to add this css after all the others. Here's how I'm adding it: StandardPage.java onInitialize() //Add any override style Tenant tenant = MyWebSession.get().getTenant(); Css css = cssRepository.GetStyleByTenant(tenant); if(tenant.getBranding() css != null) { add(new Label(style, css.getStyle())); } } StandardPage.html wicket:head style type=text/css wicket:id=style/style /wicket:head - So the issue is that thet style tag comes before all my header contributions. I've tried specifying a header response decorator like so: Application.java public static final String HEADER_FILTER_NAME = myHeaderBucket; init() { super.init(); setHeaderResponseDecorator(new IHeaderResponseDecorator() { HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter[] filters = {new CssAcceptingHeaderResponseFilter(HEADER_FILTER_NAME)}; @Override public IHeaderResponse decorate(IHeaderResponse response) { return new HeaderResponseContainerFilteringHeaderResponse(response, HEADER_FILTER_NAME, filters); } }); } StandardPage.html wicket:head div wicket:id=myHeaderBucket/div style type=text/css wicket:id=style/style /wicket:head -- Unfortunately I'm getting this exception when I instantiate a page: 12:28:04,097 INFO [STDOUT] 2011-07-19 12:28:04.096 [http-127.0.0.1-8080-1] [127.0.0.1] [T:2] [U:3 - joe_sharp] [com.transverse.bleep.wicket.desktop.DesktopPage] ERROR org.apache.wicket.RequestCycle 1529 - Exception in rendering component: [MarkupContainer [Component id = headerBucket]] org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = headerBucket]] at org.apache.wicket.Component.renderComponent(Component.java:2729) ~[wicket-1.4.17.jar:1.4.17] at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539) ~[wicket-1.4.17.jar:1.4.17] at org.apache.wicket.Component.render(Component.java:2521) ~[wicket-1.4.17.jar:1.4.17] ... Caused by: java.lang.RuntimeException: there was an error processing the header response - you tried to render a bucket of response from HeaderResponseContainerFilteringHeaderResponse, but it had not yet run and been closed. this should occur when the header container that is standard in wicket renders, so perhaps you have done something to keep that from rendering? at org.apache.wicket.resource.filtering.HeaderResponseFilteredResponseContainer.onComponentTagBody(HeaderResponseFilteredResponseContainer.java:67) ~[wicket-1.4.17.jar:1.4.17] at org.apache.wicket.Component.renderComponent(Component.java:2690) ~[wicket-1.4.17.jar:1.4.17] ... 81 common frames omitted Any ideas on what I'm doing wrong? Is there an easier approach I can take? Thanks, Loren
Re: FileUpload + locked PageMap
Am i the first one who wants to use the FileUpload Components for uploading big files? i doubt this ;) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/FileUpload-locked-PageMap-tp3678158p3680039.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org