Re: Wicket 1.5 migration questions
> Maybe you could simply use > response.renderCSSReference(getRequest().getContextPath() + > "/global/css/styles.css"); > or is there a problem with it? That didn't fix request.getUrl().toString() returning an empty string when called from ResourceReference.getExtension() - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5 migration questions
On 12.09.2012 22:50, Alec Swan wrote: I tested your implementation and was able to pull global/css/styles.css from the browser. However, the following code threw an exception: response.renderCSSReference(new MyPackageResourceReference(MyResources.class, "css/styles.css"), "screen"); Maybe you could simply use response.renderCSSReference( getRequest().getContextPath() + "/global/css/styles.css"); or is there a problem with it? Christoph - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket/Scala where to start?
Why don't you take a look at a work I have been doing, called "Gamboa Project" ? It is a project where I build several Maven archetypes for Wicket/Scala architectures (integrated with Spring or Java EE) and using JPA, CouchDB, or MongoDB as the persistent store. By the way, I'm going be at JavaOne talking about that. You are welcome :-) https://github.com/brunoborges/gamboa-project Ideas are welcome too! *Bruno Borges* (11) 99564-9058 *www.brunoborges.com* On Mon, Sep 10, 2012 at 5:03 AM, Martijn Lindhout < martijn.lindh...@gmail.com> wrote: > Hi all, > > I'm addicted to Wicket for years, and recently became interested in Scala > (a bit late? ;-)). Can anyone help me out where to start with integrating > the two? There are some posts about it on the list, but they're all pretty > outdated... > > Regards, > > -- > Martijn Lindhout >
Re: [announce] Wicket-CDI for Wicket 6.0.0 released
This is really great Igor, thanks. I am preparing my slides for my Wicket/Java EE session at JavaOne, and this just came in perfect time. I'll update my archetype and some slides to show this and let everyone know about =) *Bruno Borges* (11) 99564-9058 *www.brunoborges.com* On Wed, Sep 12, 2012 at 12:44 AM, Alexander Morozov < alexander.v.moro...@gmail.com> wrote: > Great news! Thanks. I'll wait for 6.1.0 :) > > > > - > -- > http://www.linkedin.com/in/amorozov > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/announce-Wicket-CDI-for-Wicket-6-0-0-released-tp4651924p4651935.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: Wicket 1.5 migration questions
Thanks, Christoph. I tested your implementation and was able to pull global/css/styles.css from the browser. However, the following code threw an exception: response.renderCSSReference(new MyPackageResourceReference(MyResources.class, "css/styles.css"), "screen"); I also tried: response.renderCSSReference(new MyPackageResourceReference(MyResources.class, "global/css/styles.css"), "screen"); In fact request.getUrl().toString() inside of getName() returns an empty string when called from ResourceReference.getExtension(). Alec On Wed, Sep 12, 2012 at 1:56 PM, Christoph Leiter wrote: > On 12.09.2012 21:38, Alec Swan wrote: >>> >>> PackageResourceReference IS-A ResourceReference and neither has a no-arg >>> constructor. >> >> My point exactly. That's why I can't just do mountResource("/global", >> new MyRR()) as Martin suggested. > > > My quick try: > > public class MyPackageResourceReference extends PackageResourceReference { > > private final String prefix; > > public MyPackageResourceReference(Class scope, String prefix) { > super(scope, "dummy"); > this.prefix = prefix; > } > > @Override > public String getName() { > Request request = RequestCycle.get().getRequest(); > String url = request.getUrl().toString(); > if (!url.startsWith(prefix)) { > throw new IllegalStateException(); > } > return url.substring(prefix.length()); > } > > } > > Use it like: > mountResource("/global", new MyPackageResourceReference(MyResources.class, > "global/")); > > It needs to know where it is mounted so it can remove the prefix. Maybe > there's a more elegant way around this but it works. > > > Christoph > > > - > 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: Wicket 1.5 migration questions
On 12.09.2012 21:38, Alec Swan wrote: PackageResourceReference IS-A ResourceReference and neither has a no-arg constructor. My point exactly. That's why I can't just do mountResource("/global", new MyRR()) as Martin suggested. My quick try: public class MyPackageResourceReference extends PackageResourceReference { private final String prefix; public MyPackageResourceReference(Class scope, String prefix) { super(scope, "dummy"); this.prefix = prefix; } @Override public String getName() { Request request = RequestCycle.get().getRequest(); String url = request.getUrl().toString(); if (!url.startsWith(prefix)) { throw new IllegalStateException(); } return url.substring(prefix.length()); } } Use it like: mountResource("/global", new MyPackageResourceReference(MyResources.class, "global/")); It needs to know where it is mounted so it can remove the prefix. Maybe there's a more elegant way around this but it works. Christoph - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5 migration questions
> PackageResourceReference IS-A ResourceReference and neither has a no-arg > constructor. My point exactly. That's why I can't just do mountResource("/global", new MyRR()) as Martin suggested. > To see examples of how to implement your own PackageResourceReference take a > look at its children such as CssResourceReference for example and how it > initialized itself via the #getResource() method. Yes, I already looked at samples and PackageResourceReference#getResource implementation. Believe me I am not a big fan of typing emails :) I understand what Martin is suggesting but I don't see how I can call mountResource("/global", new MyRR()) with no-arg MyRR constructor. Moreover, I don't understand how or where to pass request parameters so that they can be retrieved in my implementation of ResourceReference#getName(). In 1.4 it was all straightforward: Application.getSharedResources().putClassAlias(GlobalResourceScope.class, "global") And then different callers can invoke any of the following and have all JavaScript URLs prefixed with global/. request.renderJavaScript(new GlobalJavascriptResourceReference(GlobalResourceScope.class, "js/common.js")); request.renderJavaScript(new GlobalJavascriptResourceReference(GlobalResourceScope.class, "js/events.js")); request.renderJavaScript(new GlobalJavascriptResourceReference(GlobalResourceScope.class, "js/debug.js")); Sorry for being so dense on this one. Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
[Announce] WicketStuff 1.4.21 is released
Hello, WicketStuff Core projects version 1.4.21 have been released and shortly will be available at Maven Central repository. They are built against Apache Wicket 1.4.21. The changelog is: Andrei Costescu (2): Patch (reviewed) from Andrei Costache. (option not to force a value in the text field when behavior is attached) Merge branch 'core-1.4.x' of https://costescuandrei%40gmail@github.com/wicketstuff/core.git into core-1.4.x Martin Grigorov (1): Merge pull request #145 from zeratul021/core-1.4.x Martin Tzvetanov Grigorov (1): wicketstuff-core-1.4.21 Michael O'Cleirigh (1): Add readme to core-1.4.x branch. zeratul021 (1): Fixed URL separation character The projects can be retrieved from Maven like this: org.wicketstuff wicketstuff-progressbar 1.4.21 The release tag is here: https://github.com/wicketstuff/core/tree/wicketstuff-core-1.4.21 Issues can be reported here: https://github.com/wicketstuff/core/issues The Project Wiki is available here: https://github.com/wicketstuff/core/wiki The WicketStuff team! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Wicket 1.5 migration questions
PackageResourceReference IS-A ResourceReference and neither has a no-arg constructor. To see examples of how to implement your own PackageResourceReference take a look at its children such as CssResourceReference for example and how it initialized itself via the #getResource() method. ~ Thank you, Paul Bors PS: Wicket itself is full of examples, the power of open source :) -Original Message- From: Alec Swan [mailto:alecs...@gmail.com] Sent: Wednesday, September 12, 2012 2:00 PM To: users@wicket.apache.org Subject: Re: Wicket 1.5 migration questions I tried Martin's approach but it didn't work because RequestCycle.get().getRequest().getRequestParameters() is empty when accessed from inside getName(). Maybe I am doing it wrong, so here are some questions: 1. PackageResourceReference does not have a no-arg constructor, so what parameter should I pass from MyPackageResourceReference() to super(..)? 2. How are the callers supposed to use MyPackageResourceReference if its constructor does not take parameters? In the past they would call request.renderJavaScript(new MyPackageResourceReference("relative/path/file.js")), but you suggest that constructor is not taking any parameters. Thanks, Alec On Wed, Sep 12, 2012 at 11:56 AM, Paul Bors wrote: > Hey Alec, > > I think Martin was referring to his earlier reply on Sep 06, 2012; 2:02pm from the thread when he asked you to try and extend PackageResourceReference and then mount your resources as: > mountResource("/global", new MyPackageResourceReference()) > > Give that a try and let us know how it works out :) > > ~ Thank you, >Paul Bors > > PS: Martin would know better, he's a developer on Wicket's team (you can tell from his e-mail address). > I'm just another fellow Wicket-er. > > -Original Message- > From: Martin Grigorov [mailto:mgrigo...@apache.org] > Sent: Wednesday, September 12, 2012 11:04 AM > To: users@wicket.apache.org > Subject: Re: Wicket 1.5 migration questions > > Hi Alec, > > See my previous response. Try it and then come back. > > On Wed, Sep 12, 2012 at 5:43 PM, Alec Swan wrote: >> Paul, I looked at IResource and ResourceReference classes but still >> can't figure out how to implement an alternative to putClassAlias. >> >> In 1.4 you could do putClassAlias(GlobalResourceScope.class, >> "global") and after that all new >> ResourceReference(GlobalResourceScope.class, >> "relative/path/file.js") would automatically be accessible from >> http://../global/relative/path/file.js. So, I could easily call >> response.renderJavaScript(new >> JavaScriptReference(GlobalResourceScope.class, >> "relative/path/file.js")) anywhere in the code without mounting >> relative/path/file.js explicitly in Application#init. >> >> In 1.5 I have three options: mountResource, mountPackage and >> mount(IRequestMapper). >> >> mountResource requires me to mount each individual resource file in >> Application, which is not what I want because we have a lot of >> resource files and we add them often. >> mountPackage works with pages only, but reflects the concept that I >> need to implement for resource files. >> mount(IRequestMapper) - I think I should be able to use this method >> to implement what I want. I noticed that there are a few >> IRequestMapper implementations, which one should I extend? >> >> Thanks, >> >> Alec >> >> On Tue, Sep 11, 2012 at 2:32 PM, Paul Bors wrote: >>> I never said that, I just gave you an alternate way of achieving the >>> same thing :) >>> >>> I'm not familiar nor did I ever use the >>> SharedResources#putClassAlias() method, but given the API for >>> SharedResources it seems to have been moved or removed. >>> >>> Wicket 1.4.x (has it at): >>> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/SharedResourc >>> e s.html# putClassAlias(java.lang.Class, java.lang.String) >>> >>> Wicket 1.5.x (does not list it, at least not in the same class name): >>> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/SharedResourc >>> e >>> s.html >>> >>> If adding the resources to the root of the war works, why bother? >>> Unless you're packaging a reusable component or you use dynamic >>> resources, but having a static URL might indicate otherwise. >>> >>> Take a look at IResource and the many different implementations of >>> it and see which one can help you most, or implement your own either >>> from scratch or extending an existing one :) >>> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/resou >>> r >>> ce/IRes >>> ource.html >>> >>> ~ Thank you, >>> Paul Bors >>> >>> -Original Message- >>> From: Alec Swan [mailto:alecs...@gmail.com] >>> Sent: Tuesday, September 11, 2012 11:42 AM >>> To: users@wicket.apache.org >>> Subject: Re: Wicket 1.5 migration questions >>> I take it by global you mean http://myServer:###/myWebApp/global? >>> Yes. >>> If so, why don't you just add the folder to the root of your war? >>> Good point, I could do that, but I'd rather keep my
RE: JavaDoc for Wicket 6
Sorry I think I might have read your question wrong, if you're looking for the JavaDoc artifact you can grab it via maven by using the "javadoc" classifier or you can search the Maven central repository and download it via your web browser from: http://search.maven.org/#artifactdetails%7Corg.apache.wicket%7Cwicket-core%7 C6.0.0%7Cjar ~ Thank you, Paul Bors -Original Message- From: Paul Bors [mailto:p...@bors.ws] Sent: Wednesday, September 12, 2012 2:00 PM To: users@wicket.apache.org Subject: RE: JavaDoc for Wicket 6 It's linked off Wicket's home page at http://wicket.apache.org/ under the Releases section in parenthesis "(docs)": http://ci.apache.org/projects/wicket/apidocs/6.0.x/ ~ Thank you, Paul Bors -Original Message- From: Andrea Del Bene [mailto:an.delb...@gmail.com] Sent: Wednesday, September 12, 2012 1:18 PM To: users@wicket.apache.org Subject: JavaDoc for Wicket 6 I've seen that version 6.0.0 has adopted also a new structure for its distribution archives. So far I didn't find where the JavaDoc for this version can be downloaded . Are they available only online? - 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: JavaDoc for Wicket 6
It's linked off Wicket's home page at http://wicket.apache.org/ under the Releases section in parenthesis "(docs)": http://ci.apache.org/projects/wicket/apidocs/6.0.x/ ~ Thank you, Paul Bors -Original Message- From: Andrea Del Bene [mailto:an.delb...@gmail.com] Sent: Wednesday, September 12, 2012 1:18 PM To: users@wicket.apache.org Subject: JavaDoc for Wicket 6 I've seen that version 6.0.0 has adopted also a new structure for its distribution archives. So far I didn't find where the JavaDoc for this version can be downloaded . Are they available only online? - 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: Wicket 1.5 migration questions
I tried Martin's approach but it didn't work because RequestCycle.get().getRequest().getRequestParameters() is empty when accessed from inside getName(). Maybe I am doing it wrong, so here are some questions: 1. PackageResourceReference does not have a no-arg constructor, so what parameter should I pass from MyPackageResourceReference() to super(..)? 2. How are the callers supposed to use MyPackageResourceReference if its constructor does not take parameters? In the past they would call request.renderJavaScript(new MyPackageResourceReference("relative/path/file.js")), but you suggest that constructor is not taking any parameters. Thanks, Alec On Wed, Sep 12, 2012 at 11:56 AM, Paul Bors wrote: > Hey Alec, > > I think Martin was referring to his earlier reply on Sep 06, 2012; 2:02pm > from the thread when he asked you to try and extend PackageResourceReference > and then mount your resources as: > mountResource("/global", new MyPackageResourceReference()) > > Give that a try and let us know how it works out :) > > ~ Thank you, >Paul Bors > > PS: Martin would know better, he's a developer on Wicket's team (you can tell > from his e-mail address). > I'm just another fellow Wicket-er. > > -Original Message- > From: Martin Grigorov [mailto:mgrigo...@apache.org] > Sent: Wednesday, September 12, 2012 11:04 AM > To: users@wicket.apache.org > Subject: Re: Wicket 1.5 migration questions > > Hi Alec, > > See my previous response. Try it and then come back. > > On Wed, Sep 12, 2012 at 5:43 PM, Alec Swan wrote: >> Paul, I looked at IResource and ResourceReference classes but still >> can't figure out how to implement an alternative to putClassAlias. >> >> In 1.4 you could do putClassAlias(GlobalResourceScope.class, "global") >> and after that all new ResourceReference(GlobalResourceScope.class, >> "relative/path/file.js") would automatically be accessible from >> http://../global/relative/path/file.js. So, I could easily call >> response.renderJavaScript(new >> JavaScriptReference(GlobalResourceScope.class, >> "relative/path/file.js")) anywhere in the code without mounting >> relative/path/file.js explicitly in Application#init. >> >> In 1.5 I have three options: mountResource, mountPackage and >> mount(IRequestMapper). >> >> mountResource requires me to mount each individual resource file in >> Application, which is not what I want because we have a lot of >> resource files and we add them often. >> mountPackage works with pages only, but reflects the concept that I >> need to implement for resource files. >> mount(IRequestMapper) - I think I should be able to use this method to >> implement what I want. I noticed that there are a few IRequestMapper >> implementations, which one should I extend? >> >> Thanks, >> >> Alec >> >> On Tue, Sep 11, 2012 at 2:32 PM, Paul Bors wrote: >>> I never said that, I just gave you an alternate way of achieving the >>> same thing :) >>> >>> I'm not familiar nor did I ever use the >>> SharedResources#putClassAlias() method, but given the API for >>> SharedResources it seems to have been moved or removed. >>> >>> Wicket 1.4.x (has it at): >>> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/SharedResource >>> s.html# putClassAlias(java.lang.Class, java.lang.String) >>> >>> Wicket 1.5.x (does not list it, at least not in the same class name): >>> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/SharedResource >>> s.html >>> >>> If adding the resources to the root of the war works, why bother? >>> Unless you're packaging a reusable component or you use dynamic >>> resources, but having a static URL might indicate otherwise. >>> >>> Take a look at IResource and the many different implementations of it >>> and see which one can help you most, or implement your own either >>> from scratch or extending an existing one :) >>> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/resour >>> ce/IRes >>> ource.html >>> >>> ~ Thank you, >>> Paul Bors >>> >>> -Original Message- >>> From: Alec Swan [mailto:alecs...@gmail.com] >>> Sent: Tuesday, September 11, 2012 11:42 AM >>> To: users@wicket.apache.org >>> Subject: Re: Wicket 1.5 migration questions >>> I take it by global you mean http://myServer:###/myWebApp/global? >>> Yes. >>> If so, why don't you just add the folder to the root of your war? >>> Good point, I could do that, but I'd rather keep my current folder >>> structure. >>> >>> So, does it mean that putClassAlias functionality is gone in 1.5? >>> >>> Thanks, >>> >>> Alec >>> >>> - >>> 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: Wicket 1.5 migration questions
Hey Alec, I think Martin was referring to his earlier reply on Sep 06, 2012; 2:02pm from the thread when he asked you to try and extend PackageResourceReference and then mount your resources as: mountResource("/global", new MyPackageResourceReference()) Give that a try and let us know how it works out :) ~ Thank you, Paul Bors PS: Martin would know better, he's a developer on Wicket's team (you can tell from his e-mail address). I'm just another fellow Wicket-er. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Wednesday, September 12, 2012 11:04 AM To: users@wicket.apache.org Subject: Re: Wicket 1.5 migration questions Hi Alec, See my previous response. Try it and then come back. On Wed, Sep 12, 2012 at 5:43 PM, Alec Swan wrote: > Paul, I looked at IResource and ResourceReference classes but still > can't figure out how to implement an alternative to putClassAlias. > > In 1.4 you could do putClassAlias(GlobalResourceScope.class, "global") > and after that all new ResourceReference(GlobalResourceScope.class, > "relative/path/file.js") would automatically be accessible from > http://../global/relative/path/file.js. So, I could easily call > response.renderJavaScript(new > JavaScriptReference(GlobalResourceScope.class, > "relative/path/file.js")) anywhere in the code without mounting > relative/path/file.js explicitly in Application#init. > > In 1.5 I have three options: mountResource, mountPackage and > mount(IRequestMapper). > > mountResource requires me to mount each individual resource file in > Application, which is not what I want because we have a lot of > resource files and we add them often. > mountPackage works with pages only, but reflects the concept that I > need to implement for resource files. > mount(IRequestMapper) - I think I should be able to use this method to > implement what I want. I noticed that there are a few IRequestMapper > implementations, which one should I extend? > > Thanks, > > Alec > > On Tue, Sep 11, 2012 at 2:32 PM, Paul Bors wrote: >> I never said that, I just gave you an alternate way of achieving the >> same thing :) >> >> I'm not familiar nor did I ever use the >> SharedResources#putClassAlias() method, but given the API for >> SharedResources it seems to have been moved or removed. >> >> Wicket 1.4.x (has it at): >> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/SharedResource >> s.html# putClassAlias(java.lang.Class, java.lang.String) >> >> Wicket 1.5.x (does not list it, at least not in the same class name): >> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/SharedResource >> s.html >> >> If adding the resources to the root of the war works, why bother? >> Unless you're packaging a reusable component or you use dynamic >> resources, but having a static URL might indicate otherwise. >> >> Take a look at IResource and the many different implementations of it >> and see which one can help you most, or implement your own either >> from scratch or extending an existing one :) >> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/resour >> ce/IRes >> ource.html >> >> ~ Thank you, >> Paul Bors >> >> -Original Message- >> From: Alec Swan [mailto:alecs...@gmail.com] >> Sent: Tuesday, September 11, 2012 11:42 AM >> To: users@wicket.apache.org >> Subject: Re: Wicket 1.5 migration questions >> >>> I take it by global you mean http://myServer:###/myWebApp/global? >> Yes. >> >>> If so, why don't you just add the folder to the root of your war? >> Good point, I could do that, but I'd rather keep my current folder >> structure. >> >> So, does it mean that putClassAlias functionality is gone in 1.5? >> >> Thanks, >> >> Alec >> >> - >> 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 > -- 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
JavaDoc for Wicket 6
I've seen that version 6.0.0 has adopted also a new structure for its distribution archives. So far I didn't find where the JavaDoc for this version can be downloaded . Are they available only online? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: disabling ajax submit button
Which wicket version ? (I ask because I see you are using several calls that are deprecated in 1.5). Besides, within the declaration of your inner class, don't try to access the variable you are defining (and without declaring it final, it should normally not compile anyway). Not changing the deprecated calls, this should probably look like : add(new SimpleAttributeModifier("disabled", "disabled")); target.addComponent(this); Original Message *Subject: *disabling ajax submit button *From: *Anna Simbirtsev *To: *users@wicket.apache.org *Date: *2012-09-12 Hi I am trying to disable ajax submit button after it has been clicked. AjaxSubmitLink submitButton1 = new AjaxSubmitLink("submitButton1") { private static final long serialVersionUID = 1L; protected void onSubmit(AjaxRequestTarget target, final Form form) { submitButton1.add( new SimpleAttributeModifier("disabled", "disabled")); target.addComponent(submitButton1); } This does not work.:(
Re: wicket-select2 as AutoCompleteTextField replacement
Ok, will try that, thanks! -Tom On 12.09.2012, at 17:23, Igor Vaynberg wrote: > you need to define your own createSearchChoice function and pass it to > the config. see the docs on the demo site. > > -igor > > On Wed, Sep 12, 2012 at 2:33 AM, Thomas Götz wrote: >> I want to use wicket-select2 as a replacement for Wicket's >> AutoCompleteTextField. Is it somehow possible to accept user input that is >> not contained in the list of choices? Say, my choices list returns [A, B, C] >> but user may also enter "D" in the textfield. How can I achieve this? >> >> -Tom - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket-select2 as AutoCompleteTextField replacement
you need to define your own createSearchChoice function and pass it to the config. see the docs on the demo site. -igor On Wed, Sep 12, 2012 at 2:33 AM, Thomas Götz wrote: > I want to use wicket-select2 as a replacement for Wicket's > AutoCompleteTextField. Is it somehow possible to accept user input that is > not contained in the list of choices? Say, my choices list returns [A, B, C] > but user may also enter "D" in the textfield. How can I achieve this? > >-Tom > > > - > 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: Wicket 1.5 migration questions
Hi Alec, See my previous response. Try it and then come back. On Wed, Sep 12, 2012 at 5:43 PM, Alec Swan wrote: > Paul, I looked at IResource and ResourceReference classes but still > can't figure out how to implement an alternative to putClassAlias. > > In 1.4 you could do putClassAlias(GlobalResourceScope.class, "global") > and after that all new ResourceReference(GlobalResourceScope.class, > "relative/path/file.js") would automatically be accessible from > http://../global/relative/path/file.js. So, I could easily call > response.renderJavaScript(new > JavaScriptReference(GlobalResourceScope.class, > "relative/path/file.js")) anywhere in the code without mounting > relative/path/file.js explicitly in Application#init. > > In 1.5 I have three options: mountResource, mountPackage and > mount(IRequestMapper). > > mountResource requires me to mount each individual resource file in > Application, which is not what I want because we have a lot of > resource files and we add them often. > mountPackage works with pages only, but reflects the concept that I > need to implement for resource files. > mount(IRequestMapper) - I think I should be able to use this method to > implement what I want. I noticed that there are a few IRequestMapper > implementations, which one should I extend? > > Thanks, > > Alec > > On Tue, Sep 11, 2012 at 2:32 PM, Paul Bors wrote: >> I never said that, I just gave you an alternate way of achieving the same >> thing :) >> >> I'm not familiar nor did I ever use the SharedResources#putClassAlias() >> method, but given the API for SharedResources it seems to have been moved or >> removed. >> >> Wicket 1.4.x (has it at): >> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/SharedResources.html# >> putClassAlias(java.lang.Class, java.lang.String) >> >> Wicket 1.5.x (does not list it, at least not in the same class name): >> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/SharedResources.html >> >> If adding the resources to the root of the war works, why bother? >> Unless you're packaging a reusable component or you use dynamic resources, >> but having a static URL might indicate otherwise. >> >> Take a look at IResource and the many different implementations of it and >> see which one can help you most, or implement your own either from scratch >> or extending an existing one :) >> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/resource/IRes >> ource.html >> >> ~ Thank you, >> Paul Bors >> >> -Original Message- >> From: Alec Swan [mailto:alecs...@gmail.com] >> Sent: Tuesday, September 11, 2012 11:42 AM >> To: users@wicket.apache.org >> Subject: Re: Wicket 1.5 migration questions >> >>> I take it by global you mean http://myServer:###/myWebApp/global? >> Yes. >> >>> If so, why don't you just add the folder to the root of your war? >> Good point, I could do that, but I'd rather keep my current folder >> structure. >> >> So, does it mean that putClassAlias functionality is gone in 1.5? >> >> Thanks, >> >> Alec >> >> - >> 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 > -- 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
disabling ajax submit button
Hi I am trying to disable ajax submit button after it has been clicked. AjaxSubmitLink submitButton1 = new AjaxSubmitLink("submitButton1") { private static final long serialVersionUID = 1L; protected void onSubmit(AjaxRequestTarget target, final Form form) { submitButton1.add( new SimpleAttributeModifier("disabled", "disabled")); target.addComponent(submitButton1); } This does not work.:(
Re: Wicket 1.5 migration questions
Paul, I looked at IResource and ResourceReference classes but still can't figure out how to implement an alternative to putClassAlias. In 1.4 you could do putClassAlias(GlobalResourceScope.class, "global") and after that all new ResourceReference(GlobalResourceScope.class, "relative/path/file.js") would automatically be accessible from http://../global/relative/path/file.js. So, I could easily call response.renderJavaScript(new JavaScriptReference(GlobalResourceScope.class, "relative/path/file.js")) anywhere in the code without mounting relative/path/file.js explicitly in Application#init. In 1.5 I have three options: mountResource, mountPackage and mount(IRequestMapper). mountResource requires me to mount each individual resource file in Application, which is not what I want because we have a lot of resource files and we add them often. mountPackage works with pages only, but reflects the concept that I need to implement for resource files. mount(IRequestMapper) - I think I should be able to use this method to implement what I want. I noticed that there are a few IRequestMapper implementations, which one should I extend? Thanks, Alec On Tue, Sep 11, 2012 at 2:32 PM, Paul Bors wrote: > I never said that, I just gave you an alternate way of achieving the same > thing :) > > I'm not familiar nor did I ever use the SharedResources#putClassAlias() > method, but given the API for SharedResources it seems to have been moved or > removed. > > Wicket 1.4.x (has it at): > http://wicket.apache.org/apidocs/1.4/org/apache/wicket/SharedResources.html# > putClassAlias(java.lang.Class, java.lang.String) > > Wicket 1.5.x (does not list it, at least not in the same class name): > http://wicket.apache.org/apidocs/1.5/org/apache/wicket/SharedResources.html > > If adding the resources to the root of the war works, why bother? > Unless you're packaging a reusable component or you use dynamic resources, > but having a static URL might indicate otherwise. > > Take a look at IResource and the many different implementations of it and > see which one can help you most, or implement your own either from scratch > or extending an existing one :) > http://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/resource/IRes > ource.html > > ~ Thank you, > Paul Bors > > -Original Message- > From: Alec Swan [mailto:alecs...@gmail.com] > Sent: Tuesday, September 11, 2012 11:42 AM > To: users@wicket.apache.org > Subject: Re: Wicket 1.5 migration questions > >> I take it by global you mean http://myServer:###/myWebApp/global? > Yes. > >> If so, why don't you just add the folder to the root of your war? > Good point, I could do that, but I'd rather keep my current folder > structure. > > So, does it mean that putClassAlias functionality is gone in 1.5? > > Thanks, > > Alec > > - > 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: HazelCast and Atmosphere Integration with Wicket 6
Then you probably didn't register the EventBus in your application's init method. Please take a look at the demo-application I've setup: https://github.com/papegaaij/wicket-atmosphere-quickstart It contains the minimal configuration needed for wicket-atmosphere. Best regards, Emond On Wednesday 12 September 2012 04:40:41 esajjkh wrote: > Thanks for your help and support. I am using now wicket-atmosphere 0.4 > snapshot and atmosphere 1.0.0 . > > I managed the reference of applicationclass in MyHazelcastBroadcaster class. > Both classes looks like this now: > > class MyApplicationClass extends AuthenticatedWebApplication{ > > . > @Override > protected void init() { > super.init(); > bc = (MyHazelCastBroadcaster) > BroadcasterFactory.getDefault().get(MY_EVENT); > bc.setUp(); > *bc.setApplication(this);* // setting the application in > MyHazelCastBroadcaster > > eventBus = new EventBus(this, bc); > > > } > } > > and in MyHazelBroadcaster class I am publishing the event like this: > > EventBus.get(myapplication).post(message) > > Now it throws exception in EventBus class > on*application.getMetaData(EVENT_BUS_KEY)* call, as it doesn't find any > metadata associated with this event bus :( > Any help pease? Tack > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/HazelCast-and-Atmosphere-Integra > tion-with-Wicket-6-tp4651891p4651939.html Sent from the Users forum mailing > list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: HazelCast and Atmosphere Integration with Wicket 6
Thanks for your help and support. I am using now wicket-atmosphere 0.4 snapshot and atmosphere 1.0.0 . I managed the reference of applicationclass in MyHazelcastBroadcaster class. Both classes looks like this now: class MyApplicationClass extends AuthenticatedWebApplication{ . @Override protected void init() { super.init(); bc = (MyHazelCastBroadcaster) BroadcasterFactory.getDefault().get(MY_EVENT); bc.setUp(); *bc.setApplication(this);* // setting the application in MyHazelCastBroadcaster eventBus = new EventBus(this, bc); } } and in MyHazelBroadcaster class I am publishing the event like this: EventBus.get(myapplication).post(message) Now it throws exception in EventBus class on*application.getMetaData(EVENT_BUS_KEY)* call, as it doesn't find any metadata associated with this event bus :( Any help pease? Tack -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/HazelCast-and-Atmosphere-Integration-with-Wicket-6-tp4651891p4651939.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: wicket-select2 as AutoCompleteTextField replacement
Hi, If you only need a static list of initial choices (non ajax), you should be able to simply use select2's tagging support with something like (didn't test it): // model is your IModel for the selected data Select2Choice choice = new Select2Choice("choice", model); choice.getSettings().setTags("A", "B", "C"); You can of course also use a Select2MultiChoice for multiple choices. Now if you need Ajax support, it's somewhat more complex, though for the simple case where you don't need to mix static choices and ajax, you could use a standard Select2Choice (or MultiChoice), and in the query method of your choice provider prepend the query string to the list of results. On Wed 12 Sep 2012 11:33:38 CEST, Thomas Götz wrote: I want to use wicket-select2 as a replacement for Wicket's AutoCompleteTextField. Is it somehow possible to accept user input that is not contained in the list of choices? Say, my choices list returns [A, B, C] but user may also enter "D" in the textfield. How can I achieve this? -Tom - 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-select2 as AutoCompleteTextField replacement
I want to use wicket-select2 as a replacement for Wicket's AutoCompleteTextField. Is it somehow possible to accept user input that is not contained in the list of choices? Say, my choices list returns [A, B, C] but user may also enter "D" in the textfield. How can I achieve this? -Tom - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org