Re: One button in a form shall show result in new tab
Hi, Martin Grigorov writes: > > On Tue, May 31, 2022 at 6:50 AM Joachim Schrod wrote: > > > > So I need to have the > > following functionality for this button: > > -- Before the submit, a target attribute "_blank" get's added to the > > form. > > -- The form is submittet, by this button. (I.e., its onSubmit() must > > be called.) > > -- Afterwards, the target attribute is deleted from the form. > > > > I'm looking for best practice to achieve that functionality with the > > available Wicket API. I.e., I want to prepend and append Javascript to > > the Wicket-supplied submit functionality of a button or ajax submit > > action. I have looked at Javadoc and source code of the following > > classes (and their superclasses) and didn't found any hook/method > > where I can achieve my desired result: > > -- AjaxRequestAttributes: No methods to prepend/append JS code. > > Actually this is the one you need ^^ > atrts.getAjaxCallListeners().add(new > AjaxCallListener().onBefore("...").onComplete("...")); > > see also onBeforeSend() and onAfter() Thanks a lot for this tip, it worked like a charm. I learned something new about Wicket; that's always a good thing. :-) When I did read "Listener" in the classe name, I associated it with some callback or event hook on the server side -- seems, that I need to pay more attention to the AJAX mechanisms, how they work. Cheers, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
One button in a form shall show result in new tab
Hi, I'm tasked with upgrading an application from Wicket 7 to Wicket 9. There is one class with a heavy code smell: it relies on a Wicket internal realization. (Which promptly doesn't work any more in Wicket 9...) This email is part of my search for a better realization method. The use case: -- There is a form with lots of submit buttons. -- One button realizes a "show as pdf" functionality. -- The PDF shall be shown in a new tab. -- It shall be possible to use the button while still working on the form. This is a form submit -- the PDF shall show the then current content of the page. (Validation is not an issue in this case, the submit and form processing will succeed.) -- After showing a PDF representation of the form, it shall be possible to use the other buttons in this form, which are part of the HTML sequence of pages. I cannot use Javascript popups, as too many browsers block them. (In fact, my own developer browser blocks them. ;-)) So I need to have the following functionality for this button: -- Before the submit, a target attribute "_blank" get's added to the form. -- The form is submittet, by this button. (I.e., its onSubmit() must be called.) -- Afterwards, the target attribute is deleted from the form. The previous programmer in this project simply copied the Javascript code for an AjaxSubmitLink from Wicket 7 and enriched it with adding/deleting the form attribute. Not the smartest move, indeed; but it was working all this time I'm looking for best practice to achieve that functionality with the available Wicket API. I.e., I want to prepend and append Javascript to the Wicket-supplied submit functionality of a button or ajax submit action. I have looked at Javadoc and source code of the following classes (and their superclasses) and didn't found any hook/method where I can achieve my desired result: -- AjaxRequestAttributes: No methods to prepend/append JS code. -- AjaxSubmitLink: No methods to manipulate the emmitted JS code. -- AjaxFormSubmitBehavior: No methods to manipulate the emmitted JS code. -- Button: has getOnClickScript(), but this is empty. -- AjaxButton: doesn't redefine getOnClickScript(), so no gain to be get here either. FWIW: The application uses getCspSettings().blocking().disabled(). There's too much JS code in HTML that I don't want to touch in this round of update; that's a step after the Wicket 9 migration. Thus, currently I have no qualms to add JS code to HTML "onsubmit" attributes if that's the way to go at the moment. I'm looking for something like #prependJavaScript() and #appendJavaScript() in AjaxRequestTarget -- but not in the response handling, instead for the code that triggers the click event. tl;dr: How can I specify JS code that's executed before and after a (specific) button or ajax submit of a form? Here's hoping for some tips, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Question / Modular FormComponents / FormComponentPanels / AbstractFormValidator and problems with model updates
onentPanel(...)); >>>>> f.add(new AddressFormComponentPanel(...)); >>>>> >>>>> Both, PersonFormComponentPanel and AddressFormComponentPanel >>>>> are simple >>>>> panels, now, and it is working so far. >>>>> >>>>> Now, I have a special use-case, which needs to add an >>>>> AbstractFormValidator to the form. >>>>> >>>>> Not to bypass the inner required textfields validations of >>>>> PersonFormComponentPanel, I can implement >>>>> FormComponent[] getDependentFormComponents(){...} >>>>> of the AbstractFormValidator. >>>>> >>>>> BUT, it requieres to return FormComponents, not simple panels. >>>>> So, my idea was, just changing the implementation of >>>>> PersonFormComponentPanel extends Panel to >>>>> PersonFormComponentPanel extends >>>>> FormComponentPanel, so the entire PersonFormComponentPanel >>>>> acts as >>>>> FormComponent to be able to fullfill the FormComponent[] >>>>> getDependentFormComponents(){...} return value. >>>>> >>>>> Unfortunately this is not working, and I dont know why... >>>>> My getInnerMostModel() of the PropertyResolver is always null >>>>> and the >>>>> formcomponents model-update does not succeed / >>>>> WicketRuntimeException. >>>>> >>>>> Maybe it has something todo with the need to implement >>>>> setConvertedInput() / getConvertedInput() which is mentioned >>>>> in the javadoc >>>>> of FormComponentPanel? >>>>> >>>>> I'm not sure about that... maybe someone can help here? >>>>> >>>>> So... these are my questions: >>>>> Is it a good idea to implement such a case extending >>>>> FormComponentPanel, >>>>> or is FormComponentPanel for other purposes? >>>>> >>>>> How can I achieve the binding of the dependend formcomponents >>>>> to the >>>>> AbstractFormValidator, without exposing the inner >>>>> formcomponents of the >>>>> PersonFormComponentPanel by providing a method like >>>>> PersonFormComponentPanel.getAllInnerFormComponents()? >>>>> >>>>> Am I able to keep the idea of extending FormComponentPanel by >>>>> implementing getConvertedInput(), but how to to that right? >>>>> >>>>> Thanx a lot for help >>>>> kind regards >>>>> Parick >>>>> -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Using tags messes up css
On 03/04/15 22:03, Andreas Lundblad wrote: > I've noticed that tags such as messes up > the CSS sometimes. > > In my particular example I have > > div.formRows > div { > display: table-row; > } > > and when I try to put an enclosure around a table row, the CSS child > selector doesn't work. > > Is there an easy workaround (except switching deployment mode)? Add @Override protected void onRender () { IMarkupSettings markupSettings = Application.get().getMarkupSettings(); boolean stripWicketTags = markupSettings.getStripWicketTags(); markupSettings.setStripWicketTags(true); super.onRender(); markupSettings.setStripWicketTags(stripWicketTags); } with an appropriate Javadoc to your respective classes. (I changed line breaks to fit in 70 columns.) Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AJAX-Behavior that decides activation of a link
On 01/08/15 08:15, Ernesto Reinaldo Barreiro wrote: > Hi, > > I would use server side activation. Implemented as in > > 1- You can create your own events, e.g. [1]. One that is a wrapper of AJAX > request target (e.g. AtivateLinksEvent). > 2- Your links will listen for AtivateLinksEvents and decide if they should > be enabled or not (and add themselves to ART on AtivateLinksEvent). > > > References: > > 1- > https://github.com/reiern70/antilia-bits/blob/master/bgprocess/src/main/java/com/antilia/panel/TaskLaunchedEvent.java I don't grasp your intent completely. I get that I can define my own event classes server-side. I don't get how that helps me client side. My problem is: How do I communicate to client-side within an event handler that attrs.event.preventDefault() shall be called for exactly that event handler or not. Wicket provides a static pre-made decision via AjaxRequestAttributes; I want a dynamic one. I looked at the code you cited, and the enable/disable decision is done server-side, right? But how does introduction of a new event type help with my problem client-side? Adding the links to ART on some event won't change anything, as this won't influence the _original DOM event_ (attrs.event) that controls if default action is taken or not. I also can't see how that new Wicket event type would give me access to that DOM event I want to influence. Sorry, but I don't get it. Maybe your Wicket usage is way above my head? Or, do you mean that the server shall decide, according to previous user actions, that the link is enabled from now on and then shall change the link in an ART? Also disabling it back, as needed? That's hard to do, some parameter for the enable/disable decision are external availability of resources that are checked at the moment of link activation. (The actual link almost always works. The behavior shall implement proper error checking and reporting in case of unavailable resources or other errors that are beyond the user's realm.) Thanks for your answer, and for digging out that link, Joachim > On Thu, Jan 8, 2015 at 2:15 AM, Joachim Schrod wrote: > >> Hi, >> >> I have a class of links where some of them sometimes shall not >> trigger. The decision is made server-side according to current state. >> >> At first sight, the realization seems to be not that straight forward: >> -- I add an AJAX behavior to these link that allows default action >> and computes if the link action shall be prevented. >> -- The AJAX behavior has an AJAX call listener (complete handler) >> that may call attrs.event.preventDefault() if the link shall >> not be triggered. >> -- The decision if the link shall not be triggered is >> communicated by the AJAX request to the complete handler via >> an HiddenField that is updated in the AJAX request. Delivery >> of the decision via JSON is difficult, as we also want to >> update other DOM elements with the response (feedback why the >> link was not triggered). >> >> Do I miss something? Is there a completely different approach that >> I could take? >> >> Or: Is there a better way to communicate the decision if the link >> shall be triggered to the call listener? Introducing a hidden field >> for that purpose seems to be awkward, for me. >> >> I would be thankful for any comments or recommendations. >> >> Joachim >> >> -- >> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- >> Joachim Schrod, Roedermark, Germany >> Email: jsch...@acm.org >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AJAX-Behavior that decides activation of a link
On 01/08/15 15:50, Boris Goldowsky wrote: > If I¹m understanding you correctly, wouldn¹t it be sufficient to code this > as > a simple AjaxLink, which responds with a regular AJAX > update when the link is disabled, or uses setResponsePage when it¹s > enabled? The link in question delivers a PDF document, and has target="_blank" to do that in a new tab. In fact, there are several of these links, and only some of that have the controlling behavior. Thus prevention of the default action is essential, to prevent opening a new tab. I also had a solution that used window.open() in JS -- but that code wasn't any prettier. I think what I'm looking for is a way to add some client data to an ART target that I can access client-side, e.g., in an AJAX call listener. Thanks for your comments, Joachim > On 1/7/15, 9:15 PM, "Joachim Schrod" wrote: > >>Hi, >> >>I have a class of links where some of them sometimes shall not >>trigger. The decision is made server-side according to current state. >> >>At first sight, the realization seems to be not that straight forward: >> -- I add an AJAX behavior to these link that allows default action >>and computes if the link action shall be prevented. >> -- The AJAX behavior has an AJAX call listener (complete handler) >>that may call attrs.event.preventDefault() if the link shall >>not be triggered. >> -- The decision if the link shall not be triggered is >>communicated by the AJAX request to the complete handler via >>an HiddenField that is updated in the AJAX request. Delivery >>of the decision via JSON is difficult, as we also want to >>update other DOM elements with the response (feedback why the >>link was not triggered). >> >>Do I miss something? Is there a completely different approach that >>I could take? >> >>Or: Is there a better way to communicate the decision if the link >>shall be triggered to the call listener? Introducing a hidden field >>for that purpose seems to be awkward, for me. >> >>I would be thankful for any comments or recommendations. >> >> Joachim >> -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AJAX-Behavior that decides activation of a link
Hi, I have a class of links where some of them sometimes shall not trigger. The decision is made server-side according to current state. At first sight, the realization seems to be not that straight forward: -- I add an AJAX behavior to these link that allows default action and computes if the link action shall be prevented. -- The AJAX behavior has an AJAX call listener (complete handler) that may call attrs.event.preventDefault() if the link shall not be triggered. -- The decision if the link shall not be triggered is communicated by the AJAX request to the complete handler via an HiddenField that is updated in the AJAX request. Delivery of the decision via JSON is difficult, as we also want to update other DOM elements with the response (feedback why the link was not triggered). Do I miss something? Is there a completely different approach that I could take? Or: Is there a better way to communicate the decision if the link shall be triggered to the call listener? Introducing a hidden field for that purpose seems to be awkward, for me. I would be thankful for any comments or recommendations. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Form-Validators and invisible form components
Hi, I have a form with a date input that may be invisible. If it is visible, its value must be after another date input's value. I established a FormValidator that checks that condition. It knows about the potential invisibility and handles it. Now, for most pages Wicket outputs the warning IFormValidator in form `form` depends on a component that has been removed from the page or is no longer visible. Offending component id `inhaber1.arbeitSeit`. I thought about disabling the FormValidator if its dependent component is invisible -- but then I realized that isEnabled() of validator-behaviors is not checked and that's not the route to go. FWIW, I think that's a mis-feature. Form.validateFormValidator(IFormValidator) should check isEnabled(). Checking isEnabled() also in FormComponent.validateValidators() is a different question, I can't find a use case for it. Thus, my question: how may I realize checks over several form components where one of them may be invisible? Here's hoping for a hint in the right direction, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Best practice sought: Register client change at server
I didn't know that I can introduce my own event names, I thought I had to use one of the pre-defined ones. Thanks for that enlightenment, it works like a charm. Joachim On 07/11/14 12:01, Martin Grigorov wrote: > page.add(new AjaxEventBehavior("my-special-event") {...}); > > in JS code: jQuery(document).triggerHandler('my-special-event'); > > Voila! > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > > On Fri, Jul 11, 2014 at 10:15 AM, Sven Meier wrote: > >> an AjaxEventBehavior, but I don't have a component to attach it to. >>> >> >> You have a page, don't you? >> Otherwise you can request a resource via Ajax too. >> >> Regards >> Sven >> >> >> >> >> On 07/11/2014 02:47 AM, Joachim Schrod wrote: >> >>> Hi, >>> >>> In a Wicket application I have JQuery code that triggers after a >>> certain time of user inactivity. I need to tell server-side about >>> that inactivity. No problem, I thought, just issue an AJAX request. >>> >>> Well, looking around I found several possibilities to do that as a >>> side effect, but no component at first hand that is made up for >>> that task. I thought that's strange, it doesn't sound as a remote >>> demand. So my question is about best practice for this use case. >>> >>> Namely: I have a change on client-side that I want to communicate >>> to server-side. No changes in DOM are associated. Just like >>> triggering an AjaxLink where onClick() does not call any methods on >>> target. I know about the JavaScript function Wicket.Ajax.ajax() and >>> its arguments. My problem is choosing the right component server-side. >>> >>> An AjaxEventBehavior would be the right thing, but I don't have a >>> component to attach it to. The worst solution would be a hidden >>> AjaxLink. IMO I simply need to establish a listener URL that >>> triggers some method, an URL that I can use in a Wicket.Ajax.ajax() >>> call -- but I don't find the Wicket component that supplies me with >>> that functionality. >>> >>> How can I do that? >>> Or is my focus on the Wicket.Ajax.ajax() JS interface blocking my >>> view on another solution that's better? >>> >>> I know my way around Wicket's code and documentation. Thus, a hint >>> like "start with class XYZ" would be very much appreciated, I don't >>> need a full solution with code. I'm surely missing something >>> obvious and would severely appreciate any help or tips. >>> >>> Cheers, >>> Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Best practice sought: Register client change at server
On 07/11/14 04:44, Ernesto Reinaldo Barreiro wrote: > On Fri, Jul 11, 2014 at 2:47 AM, Joachim Schrod wrote: >> >> An AjaxEventBehavior would be the right thing, but I don't have a >> component to attach it to. The worst solution would be a hidden >> AjaxLink. IMO I simply need to establish a listener URL that >> triggers some method, an URL that I can use in a Wicket.Ajax.ajax() >> call -- but I don't find the Wicket component that supplies me with >> that functionality. > > Maybe this can be of some help > > https://github.com/reiern70/antilia-bits/tree/master/client-sign-out-parent Yes, very illustrating. While I eventually ended up with a different solution, this code showed me an alternative way that I will keep in mind for the future. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Best practice sought: Register client change at server
Hi, In a Wicket application I have JQuery code that triggers after a certain time of user inactivity. I need to tell server-side about that inactivity. No problem, I thought, just issue an AJAX request. Well, looking around I found several possibilities to do that as a side effect, but no component at first hand that is made up for that task. I thought that's strange, it doesn't sound as a remote demand. So my question is about best practice for this use case. Namely: I have a change on client-side that I want to communicate to server-side. No changes in DOM are associated. Just like triggering an AjaxLink where onClick() does not call any methods on target. I know about the JavaScript function Wicket.Ajax.ajax() and its arguments. My problem is choosing the right component server-side. An AjaxEventBehavior would be the right thing, but I don't have a component to attach it to. The worst solution would be a hidden AjaxLink. IMO I simply need to establish a listener URL that triggers some method, an URL that I can use in a Wicket.Ajax.ajax() call -- but I don't find the Wicket component that supplies me with that functionality. How can I do that? Or is my focus on the Wicket.Ajax.ajax() JS interface blocking my view on another solution that's better? I know my way around Wicket's code and documentation. Thus, a hint like "start with class XYZ" would be very much appreciated, I don't need a full solution with code. I'm surely missing something obvious and would severely appreciate any help or tips. Cheers, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Visual HTML diff in Wicket?
On 02/06/14 10:53, Martin Dietze wrote: > In my system there is an editorial submodule for creating HTML > contents. As I am about to add a versioning history to it, I'd > like to add some kind of visualisation of what changed from edit > to edit. > > Does anyone here know of something like a library for this that > can be used conveniently in a Wicket-based application? Free > would be nice, but commercial (depending on the price, of > course) would be an option, too. We've used google-diff-match-patch with success. http://code.google.com/p/google-diff-match-patch/ It's not on Maven Central, though. (That's an issue in the issue tracker, sind March 2011...) There is a Maven repo structure in their SVN repos, but without proper release support. sksamuel forked it for that reason and uploaded it to Maven Central: https://github.com/sksamuel/diffpatch HTH, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AW: set session-timeout
On 10/22/13 15:32, Martin Grigorov wrote: > On Tue, Oct 22, 2013 at 4:27 PM, Joachim Schrod wrote: > >> On 10/22/13 10:34, christoph.ma...@t-systems.com wrote: >> > If I do this in my WicketApplication class, in the init() >> > method I get java.lang.reflect.UndeclaredThrowableException. >> > But if I add this to my base page it works. Is there any >> > possibility to do this in the WicketApplication class? >> >> You have to redefine WebApplication#newSession(). >> >> It can't be done in init(), as no session exists yet. And you must >> set the Session timeout for each new session anew. >> >> Without having tried it, code like >> >> @Override >> public Session newSession(Request request, Response response) { >> Session session = super.newSession(request, response); >> >> >> ((ServletWebRequest)request).getContainerRequest().getSession().setMaxInactiveInterval(TIMEOUT); >> > > ALARM! > getSession() is the same as getSession(true). I.e. it will create a new > http session for each and every http request, even for static resources. > > Wicket creates Wicket Session when Session.get() is used, but creates Http > Session only when wicketSession.bind() is called. Interesting to hear; I'd have thought that works. Tricky thing, that. As I wrote, I didn't try the code; I just copied the access to HttpSession from the posts below. But, since wicketSession.bind() is final, one cannot subclass Session and redefine it either, to set the timeout there. (Much too many methods of Wicket classes are final, without really good reason; I copy them to my applications making the methods non-final much too often. :-( ) Martin, what would you propose to be the hook that allows to establish a different session timeout application-wide within your Java application? I hadn't had yet that case, web.xml suffices by now, but it would be good to know for the future. Cheers, Joachim >> return session; >> } >> >> should work. Maybe check that request is really a >> ServletWebRequest. (This is also a good place to set the locale.) >> >> HTH, >> Joachim >> >> > >> > -Ursprüngliche Nachricht- >> > Von: francois meillet [mailto:francois.meil...@gmail.com] >> > Gesendet: Montag, 21. Oktober 2013 16:34 >> > An: users@wicket.apache.org >> > Betreff: Re: set session-timeout >> > >> > HttpSession httpSession = ((ServletWebRequest) >> RequestCycle.get().getRequest()).getContainerRequest().getSession(); >> > httpSession.setMaxInactiveInterval(timeOut); >> > >> > François >> > >> > >> > On Mon, Oct 21, 2013 at 4:12 PM, Martin Grigorov > >wrote: >> > >> >> >> >> http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.6/a >> >> pi/javax/servlet/http/HttpSession.html#setMaxInactiveInterval(int) >> >> >> >> >> >> On Mon, Oct 21, 2013 at 4:44 PM, wrote: >> >> >> >> > Hello, >> >> > >> >> > in my application i have set the errorpage for expired pages like >> this: >> >> > >> >> > getApplicationSettings().setPageExpiredErrorPage(Timeout.class); >> >> > >> >> > Now I want to make the time until the application expires >> configurable. >> >> > How can I do this? Can I set this in the WicketApplication.init()? -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AW: set session-timeout
On 10/22/13 10:34, christoph.ma...@t-systems.com wrote: > If I do this in my WicketApplication class, in the init() > method I get java.lang.reflect.UndeclaredThrowableException. > But if I add this to my base page it works. Is there any > possibility to do this in the WicketApplication class? You have to redefine WebApplication#newSession(). It can't be done in init(), as no session exists yet. And you must set the Session timeout for each new session anew. Without having tried it, code like @Override public Session newSession(Request request, Response response) { Session session = super.newSession(request, response); ((ServletWebRequest)request).getContainerRequest().getSession().setMaxInactiveInterval(TIMEOUT); return session; } should work. Maybe check that request is really a ServletWebRequest. (This is also a good place to set the locale.) HTH, Joachim > > -Ursprüngliche Nachricht- > Von: francois meillet [mailto:francois.meil...@gmail.com] > Gesendet: Montag, 21. Oktober 2013 16:34 > An: users@wicket.apache.org > Betreff: Re: set session-timeout > > HttpSession httpSession = ((ServletWebRequest) > RequestCycle.get().getRequest()).getContainerRequest().getSession(); > httpSession.setMaxInactiveInterval(timeOut); > > François > > > On Mon, Oct 21, 2013 at 4:12 PM, Martin Grigorov wrote: > >> >> http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.6/a >> pi/javax/servlet/http/HttpSession.html#setMaxInactiveInterval(int) >> >> >> On Mon, Oct 21, 2013 at 4:44 PM, wrote: >> >> > Hello, >> > >> > in my application i have set the errorpage for expired pages like this: >> > >> > getApplicationSettings().setPageExpiredErrorPage(Timeout.class); >> > >> > Now I want to make the time until the application expires configurable. >> > How can I do this? Can I set this in the WicketApplication.init()? -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ajax behaviour for multiple elements
On 10/16/13 11:37, frasese wrote: > > there is a way to update the status of multiple elements with a single ajax > behaviour? > > For example, if we have two different DropDownChoice elements, each one with > its own AjaxFormComponentUpdatingBehavior... when the "onchange" event is > triggered, one has his value updated, but not the other one. > > So, my question is, how to update both? For example, update both with a > button, onclick.. You need to target.add(otherComponent) in your UpdatingBehavior.onUpdate(target), maybe also in onError. HTH, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: FormComponent independent from the Model/Model object
Dmitriy Neretin wrote: > Hi everyone, > > I have a dummy question: > > If I have a panel with a form (not everything is my code) -> > > public class MyPanel{ > > public MyPanel(id, IModel model){ > super(id, new CompoundPropertyModel(model); > > Form form = new Form("id", model); > form.add(new AjaxCheckBox("anyStupidId"); > add(form); > > } > > } > > And I want to add a Component (AjaxCheckBox) to the form above, but this > component shouldn't have anything to do with a model object. Why don't you construct it with an empty model object, i.e., with new Model()? Then the CPM from the panel is not accessed. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [ANNOUNCE] Apache Wicket 6.9.0 released
Martin Grigorov wrote: > On Tue, Jul 2, 2013 at 2:54 AM, Joachim Schrod wrote: >> Martijn Dashorst wrote: >> > >> > Switch between jQuery 1.x and 2.x depending on the user agent. For IE >> > 6/7/8 jQuery ver. 1.x will be used, for any other browser - ver. 2.x. >> > To use this resource reference do in your application's init method: >> > >> > protected void init() { >> > getJavaScriptLibrarySettings() >> > .setJQueryReference(DynamicJQueryResourceReference.INSTANCE); >> > } >> > >> >> Is this mandatory? >> What happens if I don't set that jQuery reference, resp. don't >> include that code? >> Will IE8 users getting served jQuery 2.x? >> >> For me, that's important, we need to support IE8. >> > > By default Wicket uses jQuery 1.10.0, so IE is supported. Thanks for the info! Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [ANNOUNCE] Apache Wicket 6.9.0 released
Martijn Dashorst wrote: > The Apache Wicket PMC is proud to announce Apache Wicket 6.9.0! Thanks a lot for providing these updates. :-) :-) > New and noteworthy > -- > > Switch between jQuery 1.x and 2.x depending on the user agent. For IE > 6/7/8 jQuery ver. 1.x will be used, for any other browser - ver. 2.x. > To use this resource reference do in your application's init method: > > protected void init() { > getJavaScriptLibrarySettings() > .setJQueryReference(DynamicJQueryResourceReference.INSTANCE); > } > Is this mandatory? What happens if I don't set that jQuery reference, resp. don't include that code? Will IE8 users getting served jQuery 2.x? For me, that's important, we need to support IE8. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Graying Out Disabled Buttons/Controls
Timo Schmidt wrote: > On Wed 26.06.2013 07:30, Richard W. Adams wrote: >> >> We have a customer requirement that disabled form buttons be grayed out >> rather than Wicket's default behavior of making them invisible. > > In my experience, disabled form elements are rendered with the disabled > attribute. They are not invisible. And the rest of the thread tracks the problem that that's not the case with your example. But I'd like to add information about "graying out": >> Google has a lot of discussion on the topic, but I didn't see >> a "best practice" solution. Does Wicket provide a way to gray >> out buttons (or any form control, for that matter)? >> >> If we have to override something like onRender(), >> onBeforeRender(), etc. where would be the best place to do >> this? > > By using CSS yoy may style disabled elements as you like: > > button[disabled], input[disabled], select[disabled], textarea[disabled] { >... > } If you've got CSS predefined and can't change it, there's the callback method onDisable(ComponentTag) on your form components that can be overriden to change CSS class of the emittet markup. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket with Spring for IOC
Joachim Schrod wrote: > > 5. If you need Spring beans in a behavior, resource, or any other > non-component >class, you need to tell Wicket about it. For that, you call > > Injector.get().inject(this); > >in that class' constructor. Afterwards, @SpringBean injections >work in that class. For the archives: That statement is not correct. Explicit injection is not needed in behaviors. Since 1.5.x-something, behaviors are auto-injected as well. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket with Spring for IOC
Nick Pratt wrote: > I have the following in my web.xml: > > > *applicationClassName* > com.test.app.MyApplication > > > applicationFactoryClassName > org.apache.wicket.spring.SpringWebApplicationFactory > Hmm, an init-param applicationClassName is not listed in the docs: http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/spring/SpringWebApplicationFactory.html I wouldn't understand what it's good for, as well, as this must always be a class or subclass of Wicket's WebApplication. If one has several of such beans defined, one can use the init-param applicationBean, as spelled out in the docs linked above. But the Mike's error message was that none are found. Cheers, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket with Spring for IOC
Michael Chandler wrote: > > java.lang.IllegalStateException: bean of type > [org.apache.wicket.protocol.http.WebApplication] not found > > Full stack trace below. > > Despite having defined my WebApplication bean in the > applicationContext.xml, this exception appears at start-up, leading > me to believe that it cannot find my applicationContext.xml > configuration, though I feel that I'm pointing Spring and Wicket in > the right direction with the following: > > > contextConfigLocation > classpath:applicationContext.xml > Information about that is found is in Eclipse's console. (I assume a barbone log4j configuration or similar.) E.g., from some start this morning, log records output only simple class names: 10:58:09,184 INFO ContextLoader - Root WebApplicationContext: initialization started 10:58:09,297 INFO XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml] If a log record like the last one is output, your applicationContext.xml is found. If not: with your configuration, you need to place it in src/main/resources. Without a contextConfigLocation, it must be placed in src/main/webapp/WEB-INF. (Standard Maven dir structure assumed.) When you get a log record about the applicationContext.xml read in, there should be another one from class DefaultListableBeanFactory that tells which beans got instantiated. Your bean > must be listed in that log record. Btw, your class FrontOfficeApp is a subclass of WebApplication, isn't it? > Lastly, I have the following in my init() method on the WebApplication object: > > getComponentInstantiationListeners().add(new SpringComponentInjector(this)); That's not relevant; the error happens before. The startup code looks for a Spring bean that's a class or subclass of WebApplication and doesn't find one. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket with Spring for IOC
Michael Chandler wrote: > I'm using Wicket with Spring for dependency injection and at > first really struggled with what appears to be Wicket serializing > my application context. Then you probably don't use wicket-spring. Or you store your app context in a Wicket component, e.g., a page. The "official" documentation is https://cwiki.apache.org/confluence/display/WICKET/spring.html IMHO it's problematic because it tells you first about things you don't want to use. There's a chapter in the new free Wicket guide, but it's very basic as well. So, here's my method / recommendation: 1. I use Maven. One needs a dependency to org.apache.wicket:wicket-spring. 2. My application object is a Spring Bean. It's declared in WEB-INF/applicationContext.xml. web.xml tells about it Load WebApplicationContext of Spring from WEB-INF/applicationContext.xml. org.springframework.web.context.ContextLoaderListener Wicket Application Filter org.apache.wicket.protocol.http.WicketFilter applicationFactoryClassName org.apache.wicket.spring.SpringWebApplicationFactory ignorePaths /js,/css,/images (Adapt your ignorePaths as needed.) 3. Within your application object, you need to call this.getComponentInstantiationListeners().add(new SpringComponentInjector(this)); Usually, it's sufficient to call that in init(). Except if you're using converters that need access to Spring beans, e.g., services. Then, newConverterLocator() is a better place for it. 4. Within your Wicket components, tag Spring beans with an annotation: @SpringBean BeanClass beanObject; Wicket will inject the Spring bean. Of course, you need to *declare* your Spring bean in Spring! I.e., you either need to declare an application-level bean in WEB-INF/applicationContext.xml or you need to trigger annotation scanning by Spring. ( and friends.) 5. If you need Spring beans in a behavior, resource, or any other non-component class, you need to tell Wicket about it. For that, you call Injector.get().inject(this); in that class' constructor. Afterwards, @SpringBean injections work in that class. That's all. It just works. HTH, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Adding HTTP header settings if link is klicked
Stefan Lindner wrote: > I need to place a link to an external url in my wicket page. The > external site requires some special http header parameters (e.g. > X-Redmine-API-Key) for authentication. Doesn't the external URL support Redmine's standard parameter "key" instead of the HTTP request header, too? Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: user interface design: if any error, textbox channge to red ... ...
Bas Gooren wrote: > > To only update the attribute if the component has errors, override > method isEnabled on the behavior, cast the component to a > FormComponent and return !formComponent.isValid(). And remember that you must not use isValid() in onComponentTag() to change tag attributes. You must store the validness in a transient property in onConfigure() or onBeforeRender() and check that that property in onComponentTag(). In fact, at least one component in 6.5.x (which we use currently in our production system) got this wrong as well. Some day, I'll write a post asking why that change was done between 1.4 and 6.x. If it was intentional or by accident. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Spring @Autowire not working
ORACLEADF wrote: > Hi Nick > Thank you. > I create a file applicationContext.xml like the following pic and I use it > in DAO and BO classes : Is your applicationContext.xml read at all? I.e., are your beans actually created? To check: Does your log contains a line like INFO XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml] (Actual format may be different, depends on your logging configuration.) If not, you need to declare the ContextLoaderListener in web.xml, and maybe the location of applicationContext.xml if it's not in WEB-INF. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: FW: VITO:(CC0000002070237):Contracts from OPIB ZM from this week are not available in Signature
malay.na...@kpn.com wrote: > > 4.In which browser(s) the problem appears ? > As reported by the application user, response to this question > is, PDF download is working on Firefox and not working on IE. That is a common problem if the document is requested by HTTPS and not by HTTP, and if in IE the preference "Don't store encrypted pages" is not set. (The exact preference name is different; I don't have an IE with English user interface available.) This behavior of IE is very obscure -- one would think that the ability to store encrypted pages would be enough to show them. If that's the case, one needs to change the caching headers. Per Default, for a generated ByteArrayResource (and PDF-Downloads are often implemented as such) the header Cache-Control: no-cache, must-revalidate is generated. That must be changed. In my experience, just discarding the Cache-Control header suffices. In Wicket 6.x that's done by overriding configureCache(). According to http://stackoverflow.com/questions/1038707/cant-display-pdf-from-https-in-ie-8-on-64-bit-vista one should instead use the header Cache-Control: private and also maybe Accept-Ranges: none For dynamically generated PDF resources the latter ususally doesn't make sense, IMO. Most cant-display-pdf-in-ie problems that I have encountered have this root cause. HTH, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Model for dropdowns in a listview
Per Newgro wrote: > Hi, > > i have to implement a questionnaire but i'm not sure how to capture > the selected values in a model. > > My questionnaire has some questions. The questions have some reply options. > The selected reply options will be assigned to an answer. The > answers are the data i try to capture. > > So i put the questions in a listview and a dropdown for the reply options on > it's item. > But i have no clue how to implement the "business model" containing the > answers. > Every answer is related to one selected reply option. According to your code, your "business model" is a list of QuestionBO objects. Each QuestionBO object seems to have a property with the question and a property for the answer. For the sake of this example, let's assume public class QuestionBO { private String question; private ReplyOptionBO answer; } (Add serializability and other methods as needed.) That your answer is of this class follows from your DropDownChoice declaration below. You'll pass a Wicket model of the list where you want to store the answer to the constructor. If that business model object gets passed to your page, just wrap it. Otherwise, if it's a property of your page, use something like form.add(new QuestionListView("wicket_id", PropertyModel.of(this, "propName")) If it's a member of a larger business model object that's get used elsewhere in this form as well, chomp the 2nd argument and establish the larger object in a CPM at the form or page level. > Can some1 please give me some pointers. Thanks for your support. > Per > > Here some code > > > public class QuestionListView extends ListView { My tip: change to extends PropertyListView if you start working with ListViews. Explore more elaborate model bindings when you have more experience. This establishs a CPM for every list item, you'll be able to access the object properties directly, and don't have to spell out models explicitly. > > public QuestionListView(String id, IModel QuestionBO>> model) { > super(id, model); // Add this, see Javadoc of ListView this.setReuseItems(true); > } > > @Override > protected void populateItem(ListItem item) { > item.add(new Label("questionText", new > PropertyModel(item.getModel(), QuestionBO.TEXT))); This code doesn't make much sense to me. Is QuestionBO.TEXT a constant that's the name of the property with the question text? Anyhow, with the above change, this is just item.add(new Label ("question")) The label will get it's object from the CPM that's established by PLV. > // TODO the null has to be replaced by a smart model assigning > the selected reply option to an answer in the business model > item.add(new DropDownChoice("replyOptions", null, > new LoadableDetachableReplyOptionsModel(item.getModel()), new > ReplyOptionBORenderer())); This changes to item.add(new DropDownChoice("answer", choices, renderer) Again, the DropDownChoice will get it's answer property via the CPM and will just store the answer object in the respective property of the respective list element object. In case your question object list change a lot while the application runs, establish the DB id as selection id in your choice renderer; instead of the index number. > } > } > > public class LoadableDetachableReplyOptionsModel extends > LoadableDetachableModel> { > > private final IModel question; > > public LoadableDetachableReplyOptionsModel(IModel > question) { > this.question = question; > } > > @Override > protected List load() { > return service.loadReplyOptionsFor(question.getObject()); > } > > @Override > public void detach() { > question.detach(); > super.detach(); > } > } > If your answer shall not be stored in the question object, or if it's also not possible to have a class that combines question and answer in one object, it get's a bit more difficult. Then you have to pass a model of a list of answer objects to the constructor as well, and store that in the ListView, to be able to access the answer objects in a model in your DropDownChoice. That can be done, e.g., with a subclass of PropertyModel that references this.answerListModel, knows the list item index, and has appropriate redefinitions for getObject() and setObject() that do the list access. HTH, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: OnChangeAjaxBehavior javadoc note
When I started to use Wicket, I stumbled over that feature as well - and reading Javadoc I often skip the Field Summary until I need the specific fields. OTOH, I learned quickly that OnChangeAjaxBehavior() is often not the behavior I want and won't forget it... :-) Best, Joachim Sven Meier wrote: > What about OnChangeAjaxBehavior#EVENT_NAME's javadoc? Isn't that > sufficient? > > Sven > > On 01/21/2013 08:53 PM, Ondrej Zizka wrote: >> Hi all, >> >> guessing from a name, I would expect these two to do the same: >> >> link.add( new OnChangeAjaxBehavior() { >> @Override protected void onUpdate( AjaxRequestTarget >> target ) { >> ReleaseTraitRowPanel.this.onUpdate( target ); >> } >> }); >> >> link.add( new AjaxFormComponentUpdatingBehavior("onchange"){ >> @Override protected void onUpdate( AjaxRequestTarget >> target ) { >> ReleaseTraitRowPanel.this.onUpdate( target ); >> } >> } ); >> >> However, the first one reacts (and sends AJAX request) on each >> keypress. >> Could this info be added to the javadoc of OnChangeAjaxBehavior? >> >> Thanks, >> Ondra >> >> - >> >> 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 > > Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket + Spring
JCoder wrote: > Hi all, > > Im just trying to setup a basic project structure in Eclipse with > Wicket and Spring. I think its pretty smart to separate both Wicket > and Spring into two different Eclipse projects, isnt it? Thus, I > created an Eclipse project for the Web part and one for the Spring > (and later Hibernate as well) part. > Now when I start Tomcat with Eclipse I get "...Caused by: > java.lang.NoClassDefFoundError: > org/springframework/context/ConfigurableApplicationContext" Then something in your Web project references Spring. When you use wicket-spring, that's the case, for example. You can tell Eclipse that it shall get the Spring jars from your Spring project, then. In your Web project properties, in `Project references'. The Spring jars and all dependent jars must be marked as exported in your Spring projects Java Build Path. But note that in the end, Eclipse will deploy all these jars to the WEB-INF/lib directory of your Tomcat working directory (usually .metadata/.plugins/org.eclipse.wst.server.core/tmp*/wtpwebapps/ in your workspace directory). HTH, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Referring to static files in .jar root directly from HTML, with context added automatically?
Ondrej Zizka wrote: > Hi all, > > I'm wondering if I can refer to static files just from HTML, while > keeping it aware of the context. > > Example: > > .jar contains /favicon.ico . > I'd like to refer to it by . > But when the app is at non-root context, this breaks as it still > points to http://host/favicon.ico . Have you tried to use simply href="favicon.ico"? AFAIK, Wicket adjusts that relativ URL accordingly when you mount your pages to an application "sub-directory". (I fought it changing such URLs some time ago.) HTH, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: what is Wicket 2.x?
Martijn Dashorst wrote: > On Mon, Dec 10, 2012 at 4:39 PM, Joachim Schrod wrote: >> I'd like to add my voice to Martijn's comment that there are still >> people out there who have no choice but to use 1.4. Typically guys >> who have to support Wicket apps on app servers with no servlet-2.5-api. > > I'm not 100% sure, but did you try running a newer wicket (1.5) on ye > old container? Actually, no. The relase notes said "you need to have servlet api 2.5" and I believed them. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: what is Wicket 2.x?
Martin Grigorov wrote: > > Additionally I think that everything that is related to Wicket 1.4 and less > should be removed from the Wiki. I'd like to add my voice to Martijn's comment that there are still people out there who have no choice but to use 1.4. Typically guys who have to support Wicket apps on app servers with no servlet-2.5-api. I'm one of them. :-( Next year, upgrade to JBoss 7 and thus Wicket 6 is hopefully possible. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Deleting Cookies
Corbin, James wrote: > The ListView is not in a form, which is why I am leaving the default for > setReuseItems to false. > I am using a LoadableDetachableModel and verified the load that rereads > the cookies, does in fact get called after I delete them (reset method > call below). If I break in the load of the detachable model, it is > reading that there are still values for the cookies I deleted in the > previous step. > > Basically, here is the body of my Ajax Link's onClick, > > RecentlyViewedItemsCollection c = new > RecentlyViewedItemsCollection(util.getCurrentUser()); > c.reset(); // this actually deletes all the > cookies > getModel().detach(); // this forces the > detachable model to call its > load, which attempts to re-read specific cookies that should no longer > exist > > target.add(RecentlyViewedItemsPanel.this.get("itemContainer")); // > lastly, I refresh the parent (WebMarkupContainer) of the ListView > > I would have expected that when the model's load method is called that it > would see that the cookies were removed, but it still finds them. > Have you confirmed that the cookie store is updated on AJAX requests? (a) are the updated cookies sent, and (b) are they made available properly for your app code; i.e., don't use some previously cached values? I'd wireshark the request and then step through the cookie gathering code to check what values are sent in the AJAX request and where the load() method gets its values from. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Model is null after submit, using FormComponentPanel
Paul Bors wrote: > Assuming that you don't set a model for the FormComponet won't Wicket fail > back to the CompountPropertyModel of the form? Yes, for sure. But you explicitly recommended: >> If you're using CompoundPropertyModel and set the model on your >> FormComponentPanel then your TextField ID and type should be all you >> need for wicket to know which getter/setter to call. I.e., you told Raul that he should set the FormComponentPanel's model. And then he risks getting null values set in his model at the panel level. Please note, that I don't argue for or against storing CompountPropertyModels in FormComponetPanels. I have many places in my applications where storing models is sensible and where the form's CompountPropertyModel is not the right thing, design-wise. And the other way round, too. As a common use case, consider when a FormComponentPanel is actually a reusable model that may be used in several situations. A recent example of mine is a component that handles address input and validation for a person. The base model, available as a CompountPropertyModel at form level, has several persons. So the FormComponentPanel gets passed the right person model (actually, the address model from that person model -- a person might have several addresses!) and uses it. And in such cases, one has to take care that the FormComponent processing lifecycle is properly adapted to such situation. > Who will perform the conversion then? As I've written, quite often it's not the conversion that's the problem, but the updateModel() call that stores FormComponent.convertedInput into the model object. To repeat: On the panel level, no input is available, and convertInput() stores that as null in FormComponent.convertedInput. You need to prevent usage of that stored field in updateModel(), otherwise your model object will end up to be null. Overriding convertInput() is of no use here, if there *is no input* that can be converted. Thus quite clearly, overriding FormComponentPanel#convertInput() is only sensible if you do something with the input values of sub-components, beyond storing them, and if you can compute something that you can place into convertedInput. If it's just about storing and you use a CompountPropertyModel, overriding FormComponentPanel#updateModel() is adequate and sufficient. I hope this makes my arguments clearer. It probably won't help Raul, though. :-( Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Model is null after submit, using FormComponentPanel
Paul Bors wrote: > I would suggest overriding FormComponentPanel#convertInput() only if your > domain object can't be easily converted by Wicket given the model you have. > > If you're using CompoundPropertyModel and set the model on your > FormComponentPanel then your TextField ID and type should be all you need > for wicket to know which getter/setter to call. Really? That's not possible in an 1.4-based application, IMHO. FormComponentPanel is a FormComponent, i.e., it participates in conversion, validation, and update Model. When that FormComponentPanel has an associated model, e.g., a CompoundPropertyModel, its getInputAsArray() will return null, null will be stored as convertedInput, and updateModel() will set the CompoundPropertyModel's object to that null value. When sub-widgets of a FormComponentPanel do all the work necessary, and the FormComponentPanel has a model of its own, I often override updateModel() to be an empty method, to prevent the behavior named above from happening. Best, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Model is null after submit, using FormComponentPanel
Raul wrote: > Thank Col, But I have no validation, my component code is the code of the > component is > > public class CustomerAccountCode extends > FormComponentPanel { > > private FormComponent entity; > private FormComponent office; > private FormComponent dc; > private FormComponent number; > > > public CustomerAccountCode(String id, Model model) { > super(id, model); > > entity = new TextField("entity", new Model()); > office = new TextField("office", new Model()); > dc = new TextField("dc", new Model()); > number = new TextField("number", new Model()); > > onModelChanged(); > add(entity); > add(office); > add(dc); > add(number); > //add(CustomerAccountCodeValidator.getInstance()); > > } > > protected void onModelChanged() { > super.onModelChanged(); > CustomerAccountCodeModel ccc = getModelObject(); > if (ccc != null) { > entity.setModelObject(ccc.getEntity()); > office.setModelObject(ccc.getOffice()); > dc.setModelObject(ccc.getDc()); > number.setModelObject(ccc.getAccount()); > } else { > entity.setModelObject(null); > office.setModelObject(null); > dc.setModelObject(null); > number.setModelObject(null); > } > } Did you try to use PropertyModels of your account object, maybe a CompoundPropertyModel instead of setting the TextField's model objects in the constructor that way? Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: File download through form submit & feedback messages
juhar wrote: > Hi, > > I have a page with a form on it. After the user has submitted the form > successfully (all the fields have validated ok), the server creates a > report-file based on the form values. The file is not created as physical > file on the server, but it is given as download to the user. > > Now, if the user first fills the form incorrectly, there are validator > feedback messages shown. If the user then submits the form with correct > values, the problem is that previous feedback error messages are not > cleared. I can't also create a new feedback message saying something like > "The report was created successfully." The file download response prevents > any updating of the current page. > Have you tried to use a resource link with a) an AJAX action to update your page b) a Call-Decorator that adds "return true" to the onclick-Event. That causes the genuine Resource-Link-Action to be done which initiate a download. c) Maybe also use target="_blank" in your Link-HTML. If there are errors in your download code, you can arrange to show them in a new situation-specific error page. Something like: final ResourceLink downloadPDF = new ResourceLink("downloadPDF", pdfResource); downloadPDF.add(new AjaxEventBehavior ("onclick") { private static final long serialVersionUID = 1L; @Override protected void onEvent (AjaxRequestTarget target) { // update actions for page go here } @Override protected IAjaxCallDecorator getAjaxCallDecorator() { return new AjaxCallDecorator() { private static final long serialVersionUID = 1L; @Override public CharSequence decorateScript(CharSequence script) { return script+"return true;"; } }; } }); This is working 1.4 code (it has to run on JBoss 4, I can't use 1.5ff), no problems with IE8. (pdfResource is a WebResource-subclass object that actually generates a PDF document.) IAjaxCallDecorator is gone in Wicket 6, but there is a replacement for it; that was mentioned on this list recently. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Does a SimpleAttributeModifier Overwrite or Append JavaScript?
eugenebalt wrote: > I can't try right now because of a system failure. > > If I could try it I wouldn't ask it here. I was hoping for a quick response. It overwrites. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Custom CSS for Feedback message is broken in 1.5
Hi, This would change be very well received, from my side. :-) :-) Cheers, Joachim Martin Grigorov wrote: > Hi, > > [X] Other suggestion: (please specify) > > Here is what I think it should be: > - element should have class "feedbackPanel" (this is already the case) > - element(s) should have class that specifies the feedback > message level (currently by default Wicket sets "feedbackPanelLEVEL", > but this is configurable with > org.apache.wicket.markup.html.panel.FeedbackPanel#getCSSClass(FeedbackMessage)) > - the should not have class at all (currently it has the same > class as the element) > - the styling should be done with CSS selectors (e.g. > div.feedbackPanel; div.feedbackPanel li.alert-warn; div.feedbackPanel > li.alert-warn span; ...) > - if custom markup is needed then a custom FeedbackPanel is needed > (one that extends from the default FeedbackPanel or a completely new > one, it depends on the use case) > > > On Sun, Oct 28, 2012 at 6:03 PM, Sebastien wrote: >> Hi, >> >> To sum-up this thread: we have a (not huge, but still) design issue that >> annoys several users. A patch* has been provided but some questions >> remains... >> Given this, I would suggest a kind-of vote about the several points >> discussed earlier, in order to enlighten the dev-team about the preferred >> choice of their (beloved) users.** >> >> Here are some possible options: >> [ ] Please apply the patch as-is. It currently provides 2 methods >> (#getListCSSClass and #getLabelCSSClass), #getCSSClass is marked a >> deprecated until marked as private (or removed) >> [ ] Do not apply the patch as-is, #getCSSClass should be kept (not marked >> as deprecated) >> [ ] Do not apply the patch as-is, I do not agree with the 2 method names. I >> would have preferred: (please specify) >> [ ] This is not an issue; this does not need to be "corrected" >> [ ] Other suggestion: (please specify) >> >> Thanks in advance for your contribution, >> Sebastien >> >> (*) https://issues.apache.org/jira/browse/WICKET-4831 >> (**) Sure, dev-team opinion is also kindly asked! :) > > > Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Custom CSS for Feedback message is broken in 1.5
Martin Grigorov wrote: > Hi, > > Here is an example of the produced markup for an single INFO message: > > > > > > Saved model [TestInputObject > stringProperty = 'test', integerProperty = 100, doubleProperty = 20.5, > booleanProperty = false, integerInRangeProperty = 50, urlProperty = > http://wicket.apache.org, phoneNumberUS = (123) 456-1234, > numberRadioChoice = 1, numbersCheckgroup [], numberRadioGroup= null, > selected sites {], lines [line one, line two, line three]] > > > > > > Why do we need the new getters when you can just use normal CSS selectors: > > div.feedbackPanel {} > div.feedbackPanel span {} > ul.feedbackPanel {} > li.feedbackPanelINFO {} > span.feedbackPanelINFO {} > > What is the big CSS/HTML design problem that I miss ? That feedbackPanelINFO is set both on li and on span. In my current project, CSS styling is not done by us, but by a designer and is shared over several projects, most of them who don't use Wicket. The CSS styling is just for feedbackPanelINFO, not for li.feedbackPanelINFO. AFAIU, similar problems appear in portlet situations, or in other situations where you don't control CSS fully. As Alec mentions, Twitter bootstrap is an other example. Btw, I never wrote that this is a "big" design problem. I just say that IMHO it's an existing one that goes beyond a single project. The standard way we cope in our projects is a more-or-less empty FeedbackPanel subclass with replaced HTML. Not pretty, as we ignore module boundaries for wicket identifiers; but the alternative -- copying the complete code of FeedbackPanel to a project specific class -- wouldn't be good either. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Custom CSS for Feedback message is broken in 1.5
Paul Bors wrote: > Yes, but how would that affect other projects that do expect the CSS to be > applied to the LI or SPAN? > Come to think about it, I could very simple replace the content of both with > my own panels right? > > I think this is a project specific requirement I just want to add my voice that it's not a project specific requirement, but a sound design change that resolves a design bug. That a CSS class applies both to LI and to below-SPAN element, is clearly not appropriate for almost all situations. The proposed change even keeps that, for backward-compatibility. Of course, one can subclass FeedbackPanel and sustitute the HTML code. We do it in all projects. But this is a workaround for a bug in Wicket's HTML/CSS/interface design, and not a to-be-continued asset. Just my 0.03€ (adjusted for inflation), Joachim - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to control IMG/CSS URL-Rewriting in mounted pages?
Thanks for these pointers! I'll check the classes out and see how I can influence their behavior. Cheers, Joachim Bertrand Guay-Paquet wrote: > Hi Joachim, > > I have never inspected them closely, but I think the classes in > play are : > WicketLinkTagHandler > AutoLinkResolver > > As for the usefulness of this process, consider panels. Panels can > be instantiated on any mount path so their links must be adjusted. > > Good luck! > Bertrand > > On 15/08/2012 5:37 PM, Joachim Schrod wrote: >> Well, one answer yet, with an assertion that Wicket does what I >> don't want it to do. :-( >> >> So, is it really not possible to exchange bidirectionally HTML >> files with an HTML designer who does *not* put all his HTML files >> in web root? I thought being able to share files bidirectionally >> with HTML designers was one of the major selling points of Wicket?! >> >> I assume nobody has the energy to really look at my issue. Would it >> help if I put up a minimal example project for download that shows >> my problem? Anybody willing to look then at it? >> >> I don't need a full solution. An hint like "class X does the URL >> rewriting for images" would be most welcome, overwriting that >> behavior with appropriate subclassing is something I can well do on >> my own. >> >> Best, >> Joachim >> >> >> Joachim Schrod wrote: >>> Hi, >>> >>> I'm new to Wicket and write my first application in it. I use >>> "Wicket in Action" and online resources as documentation. (I >>> stumbled already about the 1st few roadblocks owing to changes from >>> Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my >>> question, don't hesitate to just send it. >>> >>> My problem: I have a page that's mounted as URL "cat/entry". In the >>> page's HTML there are links to images and CSS files that start with >>> "..", e.g., "../images/bg_blabla.img". These are no Wicket >>> components, just plain HTML. >>> >>> When Wicket renders the page, it rewrites the image URLs and >>> prepends "../", e.g., the image URL now is output as >>> "../../images/bg_blabla.img". I suppose it tries to adept to the >>> extra path level that I introduced during mount and compensates >>> for it. >>> >>> How can I stop Wicket from adding this "../" prefix? I searched via >>> Google and read through Javadocs, but to no avail. >>> >>> For background: The URL in the HTML file is right... My HTML >>> designers deliver their design files as "cat/entry.html", my mounts >>> just follow their lead. I would like to change their files as >>> little as possible, it makes files swapping back to/with them much >>> easier. >>> >>> I hope somebody here may help me, thanks in advance. >>> >>> Joachim >>> -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to control IMG/CSS URL-Rewriting in mounted pages?
Well, one answer yet, with an assertion that Wicket does what I don't want it to do. :-( So, is it really not possible to exchange bidirectionally HTML files with an HTML designer who does *not* put all his HTML files in web root? I thought being able to share files bidirectionally with HTML designers was one of the major selling points of Wicket?! I assume nobody has the energy to really look at my issue. Would it help if I put up a minimal example project for download that shows my problem? Anybody willing to look then at it? I don't need a full solution. An hint like "class X does the URL rewriting for images" would be most welcome, overwriting that behavior with appropriate subclassing is something I can well do on my own. Best, Joachim Joachim Schrod wrote: > Hi, > > I'm new to Wicket and write my first application in it. I use > "Wicket in Action" and online resources as documentation. (I > stumbled already about the 1st few roadblocks owing to changes from > Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my > question, don't hesitate to just send it. > > My problem: I have a page that's mounted as URL "cat/entry". In the > page's HTML there are links to images and CSS files that start with > "..", e.g., "../images/bg_blabla.img". These are no Wicket > components, just plain HTML. > > When Wicket renders the page, it rewrites the image URLs and > prepends "../", e.g., the image URL now is output as > "../../images/bg_blabla.img". I suppose it tries to adept to the > extra path level that I introduced during mount and compensates for it. > > How can I stop Wicket from adding this "../" prefix? I searched via > Google and read through Javadocs, but to no avail. > > For background: The URL in the HTML file is right... My HTML > designers deliver their design files as "cat/entry.html", my mounts > just follow their lead. I would like to change their files as > little as possible, it makes files swapping back to/with them much > easier. > > I hope somebody here may help me, thanks in advance. > > Joachim > Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: URL params parsing issue if param value contain '='
sumitkathuria wrote: > Hello, > > We are in process of integrating our application with the third party > application and during the auth flow, The wicket is not returning the > correct parameter value when the third party application passes the > parameter value containing = operator. > > After doing the initial investigation, i came to know that there is function > in URL class which splits the query parameter key value string based upon > "=" operator which is causing problem. > > /private static QueryParameter parseQueryParameter(final String qp, final > Charset charset) > { > if (qp.indexOf('=') == -1) > { > // name => empty value > return new QueryParameter(decodeParameter(qp, charset), > ""); > } > > String parts[] = Strings.split(qp, '='); IMO, this call is wrong. It should be String parts[] = Strings.split(qp, '=', 2); I'd file a bug and patch the code locally. > return new QueryParameter(decodeParameter(parts[0], charset), > decodeParameter(parts[1], > charset)); > }/ > > It would be really helpful if some one can suggest me the resolution for > this issue. It is not possible for us to ask third party application for > encoding the URL parameters, we have to do something at our end only. Cheers, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to control IMG/CSS URL-Rewriting in mounted pages?
Yes, that's what I observed and described below. And that behavior is not appropriate for my use case. So, how can I stop Wicket to "make the url relative to the web root no matter what mount path I use for the page"? I want to *change* that: my designer delivers HTML where the images are *not* relative to the web root, but to one directory below. In our HTML files are URLs like "../images/image.img" and I don't want to change these URLs. Alternatively, how can I tell Wicket that the web root has a different prefix just for rewriting these image URLs? Thanks, Joachim Martin Grigorov wrote: > Hi, > > If your images/css are in the web root then use something like > "images/image.img" in your .html. > Wicket will make the url relative to the web root no matter what mount > path you use for the page. > > On Mon, Aug 13, 2012 at 5:41 PM, Joachim Schrod wrote: >> Hi, >> >> I'm new to Wicket and write my first application in it. I use >> "Wicket in Action" and online resources as documentation. (I >> stumbled already about the 1st few roadblocks owing to changes from >> Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my >> question, don't hesitate to just send it. >> >> My problem: I have a page that's mounted as URL "cat/entry". In the >> page's HTML there are links to images and CSS files that start with >> "..", e.g., "../images/bg_blabla.img". These are no Wicket >> components, just plain HTML. >> >> When Wicket renders the page, it rewrites the image URLs and >> prepends "../", e.g., the image URL now is output as >> "../../images/bg_blabla.img". I suppose it tries to adept to the >> extra path level that I introduced during mount and compensates for it. >> >> How can I stop Wicket from adding this "../" prefix? I searched via >> Google and read through Javadocs, but to no avail. >> >> For background: The URL in the HTML file is right... My HTML >> designers deliver their design files as "cat/entry.html", my mounts >> just follow their lead. I would like to change their files as >> little as possible, it makes files swapping back to/with them much >> easier. >> >> I hope somebody here may help me, thanks in advance. >> >> Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: how to get HttpServletRequest in My Application class
wicket user wrote: > > I need to get the HttpServletRequest object in My Application class. In the > WebPage we can get from > > ((HttpServletRequest) ((ServletWebRequest) > getRequest()).getContainerRequest()) > > but its not working in Application class. I'm new to Wicket, but it seems obvious that this is impossible. The application object exists outside of resp. independent of any servlet requests. Only Web pages and their components are concercened with HTTP requests, and thus only they have access. If you want to store or access something from a request in your application object -- which is a singleton that's independent from any request and any session, then there's probably something wrong with your design. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to control IMG/CSS URL-Rewriting in mounted pages?
Hi, I'm new to Wicket and write my first application in it. I use "Wicket in Action" and online resources as documentation. (I stumbled already about the 1st few roadblocks owing to changes from Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my question, don't hesitate to just send it. My problem: I have a page that's mounted as URL "cat/entry". In the page's HTML there are links to images and CSS files that start with "..", e.g., "../images/bg_blabla.img". These are no Wicket components, just plain HTML. When Wicket renders the page, it rewrites the image URLs and prepends "../", e.g., the image URL now is output as "../../images/bg_blabla.img". I suppose it tries to adept to the extra path level that I introduced during mount and compensates for it. How can I stop Wicket from adding this "../" prefix? I searched via Google and read through Javadocs, but to no avail. For background: The URL in the HTML file is right... My HTML designers deliver their design files as "cat/entry.html", my mounts just follow their lead. I would like to change their files as little as possible, it makes files swapping back to/with them much easier. I hope somebody here may help me, thanks in advance. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jsch...@acm.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org