Re: Label not updating on AJaxButton submit
Hi, At http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/ you can see how to mount IResource (thru ResourceReference). Your IResource (even better extend AbstractResource) impl shoud do something like: MultipartServletWebRequest multipartServletWebRequest = new MultipartServletWebRequestImpl(httpServletRequest, , Bytes.MAX, ); // to get the FileItem's use: multipartServletWebRequest.getFiles(); Your form should point to the mount point of this IResource. See above article for example. Also see http://www.petrikainulainen.net/programming/tips-and-tricks/wicket-https-tutorial-part-three-creating-a-secure-form-submit-from-a-non-secure-page/ About AjaxChannel - each Ajax** component and behavior has a method getChannel(). Override it and return AjaxChannel with different name for all Ajax components/behaviors which should not be serialized at the client side. On Tue, Jan 17, 2012 at 8:27 AM, malebu milton.qura...@gmail.com wrote: Martin, Would you be kind enough to give an example? I tried the following: ajaxSimpleUploadForm.add(new AjaxButton(uploadVideoSubmit) { @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { AbstractResourceStreamWriter writer = new AbstractResourceStreamWriter() { @Override public void write(Response output) { for(FileUpload upload : uploads) { System.out.println(new Date() + : + Start Reading); try { long size = upload.getSize(); BufferedReader fileReader = new BufferedReader(new InputStreamReader(upload.getInputStream())); ByteArrayOutputStream os = new ByteArrayOutputStream(); int i; int counter = 0; while((i = fileReader.read()) != -1) { counter ++; os.write(i); if(counter == 100) { long osSize = os.size(); int p = Float.valueOf((100 * osSize) / size).intValue(); counter = 0; if(p percent) { percent = p; p = 0; } } } os.flush(); os.close(); System.out.println(new Date() + : + File read successfully); } catch(IOException ie) { VideoUploadPanel.this.error(There was a problem uploading the file); } } } }; getRequestCycle().scheduleRequestHandlerAfterCurrent( new ResourceStreamRequestHandler(writer); ... } The progress bar still does't get updated. Here is the response.. Note the delay of 8 seconds marked in bold? Thats when the file is getting uploaded. Tue Jan 17 02:21:38 EST 2012: Loading value.. Tue Jan 17 02:21:39 EST 2012: Updating Component Tue Jan 17 02:21:39 EST 2012: Loading value.. Tue Jan 17 02:21:40 EST 2012: Updating Component Tue Jan 17 *02:21:40 EST 2012*: Loading value.. Tue Jan 17 02:21:43 EST 2012: Start Reading Tue Jan 17 02:21:48 EST 2012: File read successfully Tue Jan 17 *02:21:48 EST 2012*: Updating Component Tue Jan 17 02:21:48 EST 2012: Loading value.. Tue Jan 17 02:21:50 EST 2012: Updating Component Tue Jan 17 02:21:50 EST 2012: Loading value.. Tue Jan 17 02:21:51 EST 2012: Updating Component Tue Jan 17 02:21:51 EST 2012: Loading value.. Tue Jan 17 02:21:52 EST 2012: Updating Component Any help / example would really be a life saver. I couldnt find much example online on IResource and AjaxChannel -Milton Martin Grigorov-4 wrote Hi, I think the Ajax calls are serialized. The page instance can be used by a single request at any time. So you submit the form and this request acquires the lock on the page. AjaxSelfTimerUpdatingBehavior cannot use the page until the first request unlock it. Additionally the Ajax calls are serialized at the client side (JavaScript). See AjaxChannel class for more information about this. To be able to do what you want I suggest to use IResource to upload to. This way there wont be lock on the server side and with AjaxChannels with different names at the client side you will solve both problems. On Mon, Jan 16, 2012 at 2:51 AM, malebu lt;milton.quranda@gt; wrote: I have a requirement where i have to upload a video from a page
Re: WiQuery disabling tabs
If anyone cares, I found a solution... I'm guessing the previous solution isn't working because the statement is probably output before the page is actually rendered. Therefore i did the following: tabs.add(new AbstractBehavior() { @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); StringBuilder js = new StringBuilder(); if (isNewObject) { for (int i = 1; i 6; i++) { js.append(tabs.disable(i).getStatement()).append(;); } } response.renderOnDomReadyJavascript(js.toString()); } }); If anyone thinks this is faulty or has a better solution, I'd like to know! Kind regards, Marco On 16 January 2012 17:20, Marco Springer marcosprin...@gmail.com wrote: Hi all, *The problem: * tabs not disabled on first render. *The source:* I'm adding the Tabs class from WiQuery 1.2.4 like so: tabs = new Tabs(tabs); tabs.setOutputMarkupId(true); CompoundPropertyModelWafer waferModel = new CompoundPropertyModelWafer(getDefaultModel()); tabs.add(new GeneralInfoPanel(general_info, waferModel)); tabs.add(new MaterialSpecificationPanel(material_spec, waferModel)); tabs.add(new LazyTabPanel(layers, waferModel, LayersFragment.class)); tabs.add(new LazyTabPanel(batches, waferModel, BatchFragment.class)); tabs.add(new LazyTabPanel(logbook, waferModel, LogbookFragment.class)); tabs.add(new DocumentsPanel(documents, waferModel)); *// isNewObject set to true when the Wafer object contained in the waferModel is a new Wafer. // When a new Wafer is show in this panel, disable the rest of the tabs for now:* if (isNewObject) { for (int i = 1; i 6; i++) tabs.disable(i); } add(tabs); *The question:* I thought this would be a proper way to disable those tabs, apparently it isn't. If I call the disable function through ajax afterwards, like disable(target, 1), it's fine. Anyone an idea how you would disable a single (or multiple) tabs on the first initial render? Kind regards, Marco
Re: WiQuery disabling tabs
On Tue, Jan 17, 2012 at 9:15 AM, Marco Springer marcosprin...@gmail.com wrote: If anyone cares, I found a solution... I'm guessing the previous solution isn't working because the statement is probably output before the page is actually rendered. Therefore i did the following: tabs.add(new AbstractBehavior() { @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); StringBuilder js = new StringBuilder(); if (isNewObject) { for (int i = 1; i 6; i++) { js.append(tabs.disable(i).getStatement()).append(;); } } response.renderOnDomReadyJavascript(js.toString()); Move this line inside the if. No need to render empty JS. } }); If anyone thinks this is faulty or has a better solution, I'd like to know! Kind regards, Marco On 16 January 2012 17:20, Marco Springer marcosprin...@gmail.com wrote: Hi all, *The problem: * tabs not disabled on first render. *The source:* I'm adding the Tabs class from WiQuery 1.2.4 like so: tabs = new Tabs(tabs); tabs.setOutputMarkupId(true); CompoundPropertyModelWafer waferModel = new CompoundPropertyModelWafer(getDefaultModel()); tabs.add(new GeneralInfoPanel(general_info, waferModel)); tabs.add(new MaterialSpecificationPanel(material_spec, waferModel)); tabs.add(new LazyTabPanel(layers, waferModel, LayersFragment.class)); tabs.add(new LazyTabPanel(batches, waferModel, BatchFragment.class)); tabs.add(new LazyTabPanel(logbook, waferModel, LogbookFragment.class)); tabs.add(new DocumentsPanel(documents, waferModel)); *// isNewObject set to true when the Wafer object contained in the waferModel is a new Wafer. // When a new Wafer is show in this panel, disable the rest of the tabs for now:* if (isNewObject) { for (int i = 1; i 6; i++) tabs.disable(i); } add(tabs); *The question:* I thought this would be a proper way to disable those tabs, apparently it isn't. If I call the disable function through ajax afterwards, like disable(target, 1), it's fine. Anyone an idea how you would disable a single (or multiple) tabs on the first initial render? Kind regards, Marco -- 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: WiQuery disabling tabs
Ah ofcourse! Tnx. On 17 January 2012 09:19, Martin Grigorov mgrigo...@apache.org wrote: On Tue, Jan 17, 2012 at 9:15 AM, Marco Springer marcosprin...@gmail.com wrote: If anyone cares, I found a solution... I'm guessing the previous solution isn't working because the statement is probably output before the page is actually rendered. Therefore i did the following: tabs.add(new AbstractBehavior() { @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); StringBuilder js = new StringBuilder(); if (isNewObject) { for (int i = 1; i 6; i++) { js.append(tabs.disable(i).getStatement()).append(;); } } response.renderOnDomReadyJavascript(js.toString()); Move this line inside the if. No need to render empty JS. } }); If anyone thinks this is faulty or has a better solution, I'd like to know! Kind regards, Marco On 16 January 2012 17:20, Marco Springer marcosprin...@gmail.com wrote: Hi all, *The problem: * tabs not disabled on first render. *The source:* I'm adding the Tabs class from WiQuery 1.2.4 like so: tabs = new Tabs(tabs); tabs.setOutputMarkupId(true); CompoundPropertyModelWafer waferModel = new CompoundPropertyModelWafer(getDefaultModel()); tabs.add(new GeneralInfoPanel(general_info, waferModel)); tabs.add(new MaterialSpecificationPanel(material_spec, waferModel)); tabs.add(new LazyTabPanel(layers, waferModel, LayersFragment.class)); tabs.add(new LazyTabPanel(batches, waferModel, BatchFragment.class)); tabs.add(new LazyTabPanel(logbook, waferModel, LogbookFragment.class)); tabs.add(new DocumentsPanel(documents, waferModel)); *// isNewObject set to true when the Wafer object contained in the waferModel is a new Wafer. // When a new Wafer is show in this panel, disable the rest of the tabs for now:* if (isNewObject) { for (int i = 1; i 6; i++) tabs.disable(i); } add(tabs); *The question:* I thought this would be a proper way to disable those tabs, apparently it isn't. If I call the disable function through ajax afterwards, like disable(target, 1), it's fine. Anyone an idea how you would disable a single (or multiple) tabs on the first initial render? Kind regards, Marco -- 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: Controlling URL of static cacheable resources
Maybe I am getting pedantic as I was thinking in terms of speed of operation for a server that's getting hammered with thousands of hits per hour. It's quicker to test the first few chars of a URL string for a match with 'startsWith' than it is to iterate through to almost the end of each URL string to see if it 'contains' a substring. Any URL will fail to match on comparison of the first character if they don't have a 'w' at the beginning which makes startsWith a 'fast fail' test for most URLs it processes. I think that's probably why the Servlet Spec chooses to do filter and servlet path matching via a 'starts with' strategy without support for wildcards except at the very end of a pattern. Many of the URLs requested are very long and I try to avoid string parsing of lots of thousands of long strings wherever I can - there's already enough of that going on without adding to the work load. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Tuesday, 17 January 2012 7:08 PM To: users@wicket.apache.org Subject: Re: Controlling URL of static cacheable resources Hi Chris, With IResourceCachingStrategy you can pre/suf-fix the resource name with my.namespace.static, for example. This way your filter will be able to recognize it. It is the same as adding the /static/ segment. Just at different place. On Mon, Jan 16, 2012 at 10:49 PM, Chris Colman chr...@stepaheadsoftware.com wrote: ** ** I'm trying to make static resources have a distinguishable part of their URL near the beginning of the URL to enable easy configuration of third party filters that need to ignore requests for static resources and just proceed along the filter chain. ** ** I've looked up the operation of org.apache.wicket.request.resource.caching.IResourceCachingStrategy#dec orat eUrl but it appears that it only has the ability to make changes near the end of the resource URL after all the major segments of the URL have already been set ie., after this part ** ** /wicket/resource/org.apache.wicket rest of pathname.ClassName ** ** What I am trying to do is get all static resources to end up with a distinguishable URL that starts off something like: ** ** /wicket/resource/static/pathname.ClassName ** ** so I can configure a filter to ignore /wicket/resource/static/* ** ** In BasicResourceReferenceHandler.mapHandler() perhaps after adding the resource identifier segment: ** ** segments.add(getContext().getResourceIdentifier()); ** ** it could append an extra segment for static resources: ** ** final IResource resource = reference.getResource(); ** ** // if static resource if (resource instanceof IStaticCacheableResource) { segments.add(static); } ** ** And so end up with /wicket/resource/static/org.apache.wicket ... ** ** ** ** ** ** I also observed that Wicketstuff resources don't use the /wicket namespace prefix. They just start out at ** ** /resources/org.name.project.MyClass.script.js ** ** So they'd need a separate ignore entry in the filter. ** ** ** ** Yours sincerely, ** ** Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together ** ** **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au //chr...@stepahead.com.au Website: http://www.pagebloom.com http://develop.stepaheadsoftware.com ** ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: WiQuery disabling tabs
Yes I (and perhaps we) care. Unfortunately Google has decided that the WiQuery google group should die, leaving us with no mailinglist... Fortunately most of the WiQuery committers are also on this mailinglist. Any suggestions you have will be taken into account during our ever lasting upgrade efforts for WiQuery. Simply calling tab.disable(i); will not work as this function returns a jQuery statement. If you do not use that nothing changes :S You should use Tabs#setDisabled(ArrayItemOptionsIntegerItemOptions disabled). This will disable all tabs that you specify upon first render. If you want to disable any tab after first render you should use an ajax call and call Tabs#disable(AjaxRequestTarget, int). If there is a bug in WiQuery then please report it here: http://code.google.com/p/wiquery/issues/entry Hielke Hoeve -Original Message- From: Marco Springer [mailto:marcosprin...@gmail.com] Sent: dinsdag 17 januari 2012 9:16 To: users@wicket.apache.org Subject: Re: WiQuery disabling tabs If anyone cares, I found a solution... I'm guessing the previous solution isn't working because the statement is probably output before the page is actually rendered. Therefore i did the following: tabs.add(new AbstractBehavior() { @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); StringBuilder js = new StringBuilder(); if (isNewObject) { for (int i = 1; i 6; i++) { js.append(tabs.disable(i).getStatement()).append(;); } } response.renderOnDomReadyJavascript(js.toString()); } }); If anyone thinks this is faulty or has a better solution, I'd like to know! Kind regards, Marco On 16 January 2012 17:20, Marco Springer marcosprin...@gmail.com wrote: Hi all, *The problem: * tabs not disabled on first render. *The source:* I'm adding the Tabs class from WiQuery 1.2.4 like so: tabs = new Tabs(tabs); tabs.setOutputMarkupId(true); CompoundPropertyModelWafer waferModel = new CompoundPropertyModelWafer(getDefaultModel()); tabs.add(new GeneralInfoPanel(general_info, waferModel)); tabs.add(new MaterialSpecificationPanel(material_spec, waferModel)); tabs.add(new LazyTabPanel(layers, waferModel, LayersFragment.class)); tabs.add(new LazyTabPanel(batches, waferModel, BatchFragment.class)); tabs.add(new LazyTabPanel(logbook, waferModel, LogbookFragment.class)); tabs.add(new DocumentsPanel(documents, waferModel)); *// isNewObject set to true when the Wafer object contained in the waferModel is a new Wafer. // When a new Wafer is show in this panel, disable the rest of the tabs for now:* if (isNewObject) { for (int i = 1; i 6; i++) tabs.disable(i); } add(tabs); *The question:* I thought this would be a proper way to disable those tabs, apparently it isn't. If I call the disable function through ajax afterwards, like disable(target, 1), it's fine. Anyone an idea how you would disable a single (or multiple) tabs on the first initial render? Kind regards, Marco
Re: Update component after background thread is finished
Martin Grigorov-4 wrote Yes. Just add both to the target when the data is available Well, I have now managed to get both the textarea updated while my background thread is running, and the dropdownchoice updated when the thread is finished. For that I use an AbstractAjaxTimerBehavior that I add to the textarea component (I guess I could also add it to my Page). Then, on the onTimer() method I add the textarea and/or the dropdownchoice to the target. So far, so good. The only problem now is that the timer is running all the time, even when I do not needed (i.e. even when the background thread is not running). I would like to start the timer when I launch the background thread and stop it when the thread is finished. I saw here (https://issues.apache.org/jira/browse/WICKET-1525) that there are plans to have a resettable timer. I tried to use the AbstractAjaxRestartableTimerBehavior class provided there, but I have encountered a problem. I create an AbstractAjaxRestartableTimerBehavior timer and add it to my Page. In the onTimer() method I check whether I have to update the textarea and the dropdownchoice and, if so, I add them to the target. If I find out that the background thread has finished, I also stop the timer (i.e. I stop the timer inside the onTimer() method). Everything works fine until I stop the timer. The onTimer() method finishes ok, but then I get an Access Denied message on the browser and the following warning: WARN - RequestListenerInterface - behavior not enabled; ignore call. Behavior test.web.gui.Index$1@17574b9 at component [Page class = test.web.gui.Index, id = 1, render count = 2] More details: My Page consists of a textarea, a timer and a form. The form contains the dropdownchoice. I have tried adding the timer to the textarea, but get the same error (but for the textarea component). I have tried submitting the form via Ajax and normally. Same error. Hope you know what the problem is and can help me. Cheers, Humberto -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Update-component-after-background-thread-is-finished-tp4300126p4303428.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: WiQuery disabling tabs
Your suggestion: if (((IModelWafer) getDefaultModel()).getObject().getId() == 0) { ArrayItemOptionsIntegerItemOptions options = new ArrayItemOptionsIntegerItemOptions(); for (int i = 1; i 6; i++) { options.add(new IntegerItemOptions(i)); } tabs.setDisabled(options); } My code sauce: if (((IModelWafer) getDefaultModel()).getObject().getId() == 0) { tabs.add(new AbstractBehavior() { @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); StringBuilder js = new StringBuilder(); for (int i = 1; i 6; i++) { js.append(tabs.disable(i).getStatement()).append(;); } response.renderOnDomReadyJavascript(js.toString()); } }); } Yup I'm going for your suggestion. Thanks Hielke. Regards, Marco On 17 January 2012 15:05, Hielke Hoeve hielke.ho...@topicus.nl wrote: Yes I (and perhaps we) care. Unfortunately Google has decided that the WiQuery google group should die, leaving us with no mailinglist... Fortunately most of the WiQuery committers are also on this mailinglist. Any suggestions you have will be taken into account during our ever lasting upgrade efforts for WiQuery. Simply calling tab.disable(i); will not work as this function returns a jQuery statement. If you do not use that nothing changes :S You should use Tabs#setDisabled(ArrayItemOptionsIntegerItemOptions disabled). This will disable all tabs that you specify upon first render. If you want to disable any tab after first render you should use an ajax call and call Tabs#disable(AjaxRequestTarget, int). If there is a bug in WiQuery then please report it here: http://code.google.com/p/wiquery/issues/entry Hielke Hoeve -Original Message- From: Marco Springer [mailto:marcosprin...@gmail.com] Sent: dinsdag 17 januari 2012 9:16 To: users@wicket.apache.org Subject: Re: WiQuery disabling tabs If anyone cares, I found a solution... I'm guessing the previous solution isn't working because the statement is probably output before the page is actually rendered. Therefore i did the following: tabs.add(new AbstractBehavior() { @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); StringBuilder js = new StringBuilder(); if (isNewObject) { for (int i = 1; i 6; i++) { js.append(tabs.disable(i).getStatement()).append(;); } } response.renderOnDomReadyJavascript(js.toString()); } }); If anyone thinks this is faulty or has a better solution, I'd like to know! Kind regards, Marco On 16 January 2012 17:20, Marco Springer marcosprin...@gmail.com wrote: Hi all, *The problem: * tabs not disabled on first render. *The source:* I'm adding the Tabs class from WiQuery 1.2.4 like so: tabs = new Tabs(tabs); tabs.setOutputMarkupId(true); CompoundPropertyModelWafer waferModel = new CompoundPropertyModelWafer(getDefaultModel()); tabs.add(new GeneralInfoPanel(general_info, waferModel)); tabs.add(new MaterialSpecificationPanel(material_spec, waferModel)); tabs.add(new LazyTabPanel(layers, waferModel, LayersFragment.class)); tabs.add(new LazyTabPanel(batches, waferModel, BatchFragment.class)); tabs.add(new LazyTabPanel(logbook, waferModel, LogbookFragment.class)); tabs.add(new DocumentsPanel(documents, waferModel)); *// isNewObject set to true when the Wafer object contained in the waferModel is a new Wafer. // When a new Wafer is show in this panel, disable the rest of the tabs for now:* if (isNewObject) { for (int i = 1; i 6; i++) tabs.disable(i); } add(tabs); *The question:* I thought this would be a proper way to disable those tabs, apparently it isn't. If I call the disable function through ajax afterwards, like disable(target, 1), it's fine. Anyone an idea how you would disable a single (or multiple) tabs on the first initial render? Kind regards, Marco - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
JavaScript links - correct URL generated?
Wicket rendered this page: http://www.myurl.com.au/content/newArticle/o/76429/ar/486 It is mounted at /content/newArticle using a UrlPathPageParametersEncoder And /o/76429/ar/486 are named paramters as per 1.4 style Wicket generates the following a tag when it rendered the page: a style=float: right; wicket:id=loginBtn id=loginBtn21 href=# view-source:http://web.barcodedirect.com.au/content/newArticle/o/76429/ ar/486 onclick=var wcall=wicketAjaxGet(#039;../../../../newArticle?3-1.IBehaviorListener.0 -body-systemPanel-loginSubpanel-loginBtn#039;,function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$(#039;loginBtn21#039;) != null;}.bind(this));return !wcall;img src=/images/arrowRight16.png view-source:http://web.barcodedirect.com.au/images/arrowRight16.png alt=Sign in title=Sign in//a Now this works fine in a browser and does what it should when the user clicks on the login button but the problem has arisen in 1.5 when the Google robot crawls the site. I don't know why it tries to request a URL with a href=# and JavaScript but it does and the results aren't good. Google makes a request to: http://www.myurl.com.au/content/newArticle?3-1.IBehaviorListener.0-body- systemPanel-loginSubpanel-loginBtn#039 Which fails because the URL does not contain the required named parameters above: /o/76429/ar/486 It's like AJAX/Javascript assumes that named parameters stored in the path are not important when it comes to generating a new URL with it's own named parameters (i.e. the IBehaviorListener).
Re: JavaScript links - correct URL generated?
Are you still on 1.5-SNAPSHOT ? This have been fixed with WICKET-4290 few days ago On Tue, Jan 17, 2012 at 3:35 PM, Chris Colman chr...@stepaheadsoftware.com wrote: Wicket rendered this page: http://www.myurl.com.au/content/newArticle/o/76429/ar/486 It is mounted at /content/newArticle using a UrlPathPageParametersEncoder And /o/76429/ar/486 are named paramters as per 1.4 style Wicket generates the following a tag when it rendered the page: a style=float: right; wicket:id=loginBtn id=loginBtn21 href=# view-source:http://web.barcodedirect.com.au/content/newArticle/o/76429/ ar/486 onclick=var wcall=wicketAjaxGet(#039;../../../../newArticle?3-1.IBehaviorListener.0 -body-systemPanel-loginSubpanel-loginBtn#039;,function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$(#039;loginBtn21#039;) != null;}.bind(this));return !wcall;img src=/images/arrowRight16.png view-source:http://web.barcodedirect.com.au/images/arrowRight16.png alt=Sign in title=Sign in//a Now this works fine in a browser and does what it should when the user clicks on the login button but the problem has arisen in 1.5 when the Google robot crawls the site. I don't know why it tries to request a URL with a href=# and JavaScript but it does and the results aren't good. Google makes a request to: http://www.myurl.com.au/content/newArticle?3-1.IBehaviorListener.0-body- systemPanel-loginSubpanel-loginBtn#039 Which fails because the URL does not contain the required named parameters above: /o/76429/ar/486 It's like AJAX/Javascript assumes that named parameters stored in the path are not important when it comes to generating a new URL with it's own named parameters (i.e. the IBehaviorListener). -- 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: Update component after background thread is finished
On Tue, Jan 17, 2012 at 3:19 PM, humcasma humca...@gmail.com wrote: Martin Grigorov-4 wrote Yes. Just add both to the target when the data is available Well, I have now managed to get both the textarea updated while my background thread is running, and the dropdownchoice updated when the thread is finished. For that I use an AbstractAjaxTimerBehavior that I add to the textarea component (I guess I could also add it to my Page). Then, on the onTimer() method I add the textarea and/or the dropdownchoice to the target. So far, so good. The only problem now is that the timer is running all the time, even when I do not needed (i.e. even when the background thread is not running). I would like to start the timer when I launch the background thread and stop it when the thread is finished. I saw here (https://issues.apache.org/jira/browse/WICKET-1525) that there are plans to have a resettable timer. I tried to use the If I understand you correctly then all you need is just timerBehavior.stop(). You don't need the restart functionality. You can also remove the behavior from the component and add new behavior instance later if you need it. Btw WICKET-1525 is implemented in Wicket 6.0 AbstractAjaxRestartableTimerBehavior class provided there, but I have encountered a problem. I create an AbstractAjaxRestartableTimerBehavior timer and add it to my Page. In the onTimer() method I check whether I have to update the textarea and the dropdownchoice and, if so, I add them to the target. If I find out that the background thread has finished, I also stop the timer (i.e. I stop the timer inside the onTimer() method). Everything works fine until I stop the timer. The onTimer() method finishes ok, but then I get an Access Denied message on the browser and the following warning: WARN - RequestListenerInterface - behavior not enabled; ignore call. Behavior test.web.gui.Index$1@17574b9 at component [Page class = test.web.gui.Index, id = 1, render count = 2] More details: My Page consists of a textarea, a timer and a form. The form contains the dropdownchoice. I have tried adding the timer to the textarea, but get the same error (but for the textarea component). I have tried submitting the form via Ajax and normally. Same error. Hope you know what the problem is and can help me. Cheers, Humberto -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Update-component-after-background-thread-is-finished-tp4300126p4303428.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 -- 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: Update component after background thread is finished
Martin Grigorov-4 wrote If I understand you correctly then all you need is just timerBehavior.stop(). You don't need the restart functionality. You can also remove the behavior from the component and add new behavior instance later if you need it. Btw WICKET-1525 is implemented in Wicket 6.0 Then I did not explained me right :-). I have a form that invokes a lengthy process as a background thread when it is submitted. The form can be submitted many times. So I want the timer to start working when the form is submitted (and the thread is launched), and to stop working when the thread finishes. Using the resettable timer I get the previously mentioned error. I have now tried to add and remove the timer behavior as you said, but did not work, probably because my knowledge of Wicket is limited and I am doing something wrong. I have invoked textarea.add(timer) within the form's onSubmit(), and added textarea to the ajax's target. I also invoke textarea.remove(timer) within the timer's onTimer() method. Nothing happens (i.e. the Timer is not started). Cheers, Humberto -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Update-component-after-background-thread-is-finished-tp4300126p4303675.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: Update component after background thread is finished
Pastebin you code. On Tue, Jan 17, 2012 at 4:44 PM, humcasma humca...@gmail.com wrote: Martin Grigorov-4 wrote If I understand you correctly then all you need is just timerBehavior.stop(). You don't need the restart functionality. You can also remove the behavior from the component and add new behavior instance later if you need it. Btw WICKET-1525 is implemented in Wicket 6.0 Then I did not explained me right :-). I have a form that invokes a lengthy process as a background thread when it is submitted. The form can be submitted many times. So I want the timer to start working when the form is submitted (and the thread is launched), and to stop working when the thread finishes. Using the resettable timer I get the previously mentioned error. I have now tried to add and remove the timer behavior as you said, but did not work, probably because my knowledge of Wicket is limited and I am doing something wrong. I have invoked textarea.add(timer) within the form's onSubmit(), and added textarea to the ajax's target. I also invoke textarea.remove(timer) within the timer's onTimer() method. Nothing happens (i.e. the Timer is not started). Cheers, Humberto -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Update-component-after-background-thread-is-finished-tp4300126p4303675.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 -- 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: JavaScript links - correct URL generated?
Yes, on the 1.5-SNAPSHOT - pulling updates every few hours =] In our latest version of the app the problem is indeed fixed - what I think I'm seeing now is the result of google requesting the bad links it cached when the problem was present. If I make requests to those links give a 301 redirect to the home page or whatever Google should uncache the bad links after a while. Thanks, Chris -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Wednesday, 18 January 2012 1:42 AM To: users@wicket.apache.org Subject: Re: JavaScript links - correct URL generated? Are you still on 1.5-SNAPSHOT ? This have been fixed with WICKET-4290 few days ago On Tue, Jan 17, 2012 at 3:35 PM, Chris Colman chr...@stepaheadsoftware.com wrote: Wicket rendered this page: http://www.myurl.com.au/content/newArticle/o/76429/ar/486 It is mounted at /content/newArticle using a UrlPathPageParametersEncoder And /o/76429/ar/486 are named paramters as per 1.4 style Wicket generates the following a tag when it rendered the page: a style=float: right; wicket:id=loginBtn id=loginBtn21 href=# view-source:http://web.barcodedirect.com.au/content/newArticle/o/76429/ ar/486 onclick=var wcall=wicketAjaxGet(#039;../../../../newArticle?3-1.IBehaviorListener.0 -body-systemPanel-loginSubpanel-loginBtn#039;,function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$(#039;loginBtn21#039;) != null;}.bind(this));return !wcall;img src=/images/arrowRight16.png view-source:http://web.barcodedirect.com.au/images/arrowRight16.png alt=Sign in title=Sign in//a Now this works fine in a browser and does what it should when the user clicks on the login button but the problem has arisen in 1.5 when the Google robot crawls the site. I don't know why it tries to request a URL with a href=# and JavaScript but it does and the results aren't good. Google makes a request to: http://www.myurl.com.au/content/newArticle?3-1.IBehaviorListener.0-body- systemPanel-loginSubpanel-loginBtn#039 Which fails because the URL does not contain the required named parameters above: /o/76429/ar/486 It's like AJAX/Javascript assumes that named parameters stored in the path are not important when it comes to generating a new URL with it's own named parameters (i.e. the IBehaviorListener). -- 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
Re: context-relative CSS-Url wrong in styled/variant HTML page
On Tue, Jan 17, 2012 at 9:50 PM, datazuul ralf.eichin...@pixotec.de wrote: I set style of session like this in my WebApplication: public Session newSession(final Request request, final Response response) { return new WicketWebSession(request).setStyle(style1); Can you try without calling .setStyle(). I think your problem is not related to that call. } when I call HomePage the right markup is retrieved: HomePage_style1.html. BUT: the context-relative URL of the css (and images) which is fix coded in markup file like this: href=style1/css/style.css or src=images/ is rendered finally to href=../style1/css/style.css or src=../images/ (when I look in the source code in browser), so all style is missing (when I change in Firebug again back to href=style1/css/style.css the style is fine...) Also the context relative images are rendered with a leading ../images/ instead the correct images/... Anything wrong I did in a styled/variant markup file? do I have to use relative URLs different for styled/variant pages? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/context-relative-CSS-Url-wrong-in-styled-variant-HTML-page-tp4304686p4304686.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 -- 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: context-relative CSS-Url wrong in styled/variant HTML page
you are somehow right... ;-( When I remove setStyle and copy HomePage_style1.html to HomePage.html the css link is rendered wrong, too. Under embedded Jetty I did work, but not under Tomcat (it is the standard apache-tomcat 6.0.29). I am totally confused... I did several Wicket applications before... -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/context-relative-CSS-Url-wrong-in-styled-variant-HTML-page-tp4304686p4304801.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: JavaScript links - correct URL generated?
This was also no doubt caused by a naughty build script here which pulled in old versions of the wicket jars! -Original Message- From: Chris Colman [mailto:chr...@stepaheadsoftware.com] Sent: Wednesday, 18 January 2012 6:32 AM To: users@wicket.apache.org Subject: RE: JavaScript links - correct URL generated? Yes, on the 1.5-SNAPSHOT - pulling updates every few hours =] In our latest version of the app the problem is indeed fixed - what I think I'm seeing now is the result of google requesting the bad links it cached when the problem was present. If I make requests to those links give a 301 redirect to the home page or whatever Google should uncache the bad links after a while. Thanks, Chris -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Wednesday, 18 January 2012 1:42 AM To: users@wicket.apache.org Subject: Re: JavaScript links - correct URL generated? Are you still on 1.5-SNAPSHOT ? This have been fixed with WICKET-4290 few days ago On Tue, Jan 17, 2012 at 3:35 PM, Chris Colman chr...@stepaheadsoftware.com wrote: Wicket rendered this page: http://www.myurl.com.au/content/newArticle/o/76429/ar/486 It is mounted at /content/newArticle using a UrlPathPageParametersEncoder And /o/76429/ar/486 are named paramters as per 1.4 style Wicket generates the following a tag when it rendered the page: a style=float: right; wicket:id=loginBtn id=loginBtn21 href=# view-source:http://web.barcodedirect.com.au/content/newArticle/o/76429 / ar/486 onclick=var wcall=wicketAjaxGet(#039;../../../../newArticle?3-1.IBehaviorListener. 0 -body-systemPanel-loginSubpanel-loginBtn#039;,function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$(#039;loginBtn21#039;) != null;}.bind(this));return !wcall;img src=/images/arrowRight16.png view-source:http://web.barcodedirect.com.au/images/arrowRight16.png alt=Sign in title=Sign in//a Now this works fine in a browser and does what it should when the user clicks on the login button but the problem has arisen in 1.5 when the Google robot crawls the site. I don't know why it tries to request a URL with a href=# and JavaScript but it does and the results aren't good. Google makes a request to: http://www.myurl.com.au/content/newArticle?3-1.IBehaviorListener.0-body - systemPanel-loginSubpanel-loginBtn#039 Which fails because the URL does not contain the required named parameters above: /o/76429/ar/486 It's like AJAX/Javascript assumes that named parameters stored in the path are not important when it comes to generating a new URL with it's own named parameters (i.e. the IBehaviorListener). -- 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Shibboleth Integration
I figured out a solution. Here is how the get the eppn I needed in Wicket: final HttpServletRequest request =(HttpServletRequest)getRequestCycle().getRequest().getContainerRequest(); String eppn = request.getAttribute(eppn) != null ? request.getAttribute(eppn).toString() : not set; The application I was working in has multiple forms of authentication. The login process allows user to access the application from several bookmarkable pages which redirect to different authentication systems. I was having problems as I was redirecting after login and the page I was jumping to was not secured by Shibboleth directly. The attribute for eppn had to be grabbed after returning from the Shibboleth login page and before redirecting to the home page. The file that tells Shibboleth what to secure was in httpd.conf in /etc/apache2. On 01/16/2012 04:28 PM, Jered Myers wrote: I am attempting to integrate with Shibboleth using Tomcat 6 and Wicket 1.4.18. I don't want to get into too much detail on Shibboleth in this list, but I was wonder in anybody had already done this and is able to get the eppn attribute back after successfully logging in. I need to know the user that is logging in for my Wicket application and all of the login is completed on the Shibboleth identity providers login page. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Auto Create of resource references fails
Using 1.5-SNAPSHOT and I just noticed these messages in the log ever since switching to 1.5. I checked the log history and these types of errors never appeared in the 1.4 based app: 2012/01/18 10:54:51.840 WARN - ResourceReferenceRegistry - Asked to auto-create a ResourceReference, but ResourceReferenceRegistry.createDefaultResourceReference() return null. [scope: org.apache.wicket.ajax.AbstractDefaultAjaxBehavior; name: indicator-ver-1326193494000.gif; locale: null; style: null; variation: null] When this is requested: /wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/indi cator-ver-1326193494000.gif It is completely repeatable. Yours sincerely, Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together Sydney: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au mailto://chr...@stepahead.com.au Website: http://www.pagebloom.com blocked::http://www.pagebloom.com/ http://develop.stepaheadsoftware.com blocked::http://develop.stepaheadsoftware.com/
Re: Get Wicket to ignore wicket parameters
On Tue, Jan 17, 2012 at 4:01 PM, Steve Fatula st...@neobits.com wrote: I have taken over management of a site using wicket, which I was woefully unfamiliar with. Have been able to do some screens, modify them, add stuff, etc. without much trouble. However, the overflow flow I am not familiar with. The site had some web pages that were stateful and had a sort bar. That was removed. Wicket parms in the url are encoded. So, a previous link might look like: www.site.com/something.html?page=2z=afhyewifewicfhewichewicvhweripcvh These pages were indexed by the search engines. Now that the sort functions are gone, and, we've made the page a stateless page, requests to pages with the wicket parms (in the z=) now return an error as so: 2012-01-17 10:55:36,700 (TP-Processor23) [ RequestCycle.java:1432:ERROR] unable to find component with path someProductList:productList:topToolbars:2:toolbar:headers:2:header:orderByLink on stateless page Wel, is true of course since that's been removed. However, we want pages to still work, just, ignore the wicket stuff. Can this be handled via some method in wicket? i.e., something that can tell wicket to ignore the wicket stuff for the specific page in question? Some stuff in the query string are still used on those pages, just want to not process the wicket stateful stuff. Or, is it best handled with mod_rewrite in Httpd? I'm sure it can be handled in Wicket, but even then I'd default to mod_rewrite for something as simple as always remove parameter X from query string for pages A, B, C. To me dealing with old URLs is better done at that level rather than cluttering the application with it. -- Jeremy Thomerson http://wickettraining.com *Need a CMS for Wicket? Use Brix! http://brixcms.org*
Re: Wicket spring security sample app
On Sun, Jan 15, 2012 at 12:36:48PM +0200, Martin Grigorov wrote: See https://github.com/jwcarman/Wicketopia Maybe I missed something, but I wasn't able to do a mvn jetty:run or did the war package run after generating a war file. brian -- Brian Lavender http://www.brie.com/brian/ There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. Professor C. A. R. Hoare The 1980 Turing award lecture - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Trying get Spring security working
It looks like you are missing the apache commons logging jar based on the stack trace. I believe it is a dependency for spring You may also need sflj and/or log4j. Sent from my iPhone On Jan 18, 2012, at 1:08 AM, Brian Lavender br...@brie.com wrote: Can someone tell me what I am missing with my Spring Security integration? I attached the source. In case the attachment doesn't go through, here it is. http://brie.com/brian/wicket/authbar.zip https://cwiki.apache.org/WICKET/spring-security-and-wicket-auth-roles.html I get the following error. Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory I took the sample from the examples on Wicket-auth-roles and I tried adding in the spring security and I get a whole stack trace complaining about unable to get a log factory. brian -- Brian Lavender http://www.brie.com/brian/ There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. Professor C. A. R. Hoare The 1980 Turing award lecture authbar.zip - 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
wicket appl architecture
Hi I am currently developing an application using Wicket + Spring + Hibernate. So far everything is smooth and I use a lot of Ajax which works perfectly fine. Now I need to provide options for data entry via mobile devices like Andriod (Samsing Tab) + iOS (iPad). My initial plan was to develop web based UI specific to suit these devices so that it reduces the complexity of developing for multiple platform. But now, I need offline usage as the signal strength can vary from place to place, so web based option is ruled out. (not sure if options like gears for offline usage will work in mobile devices). Also I need to use device specific native features like camera to upload photos from the device. So I am planning to develop separate front end for iOS Andrioid. Is this the right approach ? What will be the communication layer between Server Mobile applications ? REST ? If not what else. Please suggest. Also advice on the libraries that will help me get there.. regards, nazeem -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-appl-architecture-tp4305917p4305917.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