Re: Best way to trap Enter key in a form in a modal window
Hi, On Mon, Dec 3, 2012 at 1:05 PM, Chris Colman chr...@stepaheadsoftware.comwrote: I understand that with a form in a modal window you must explicitly declare an AjaxButton component because modal windows require AJAX comms (BTW this should probably be mentioned in the Form Javadoc page somewhere: http://ci.apache.org/projects/wicket/apidocs/6.0.x/) I didn't get what should be better explained ? However, what is the best approach to providing a 'catch all' so that if the user presses the 'Enter' key while focus is on any field in the form the normal submit takes place? See Form#setDefaultButton. Not sure whether this will help in Ajax form submit though. Additionally check https://github.com/kinabalu/wicket-mousetrap/ -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
wicket-library.com session expiring too early
Hello *, I try filing this bug (whishlist) here, because I haven't found any contact email on the wicket-library.com website. As a wicket newbie, I use wicket-library.com examples a lot. However reading through Java/HTML code, understanding what's going on, identifying relevant lines of code, copying them in your own project and testing them takes quite a bit of time. That time usually exceeds the configured time for the user session at wicket-library.com, at least for a newbie like me. That results in page expired messages when you go back to your browser window and click another source file to look at. You then have to go back to the website home, choose your example again and walk through the links to reach the source file you were looking for. All this makes the already steep (*) wicket learning curve even harder, because it breaks concentration while studying examples. Would it be possible to raise the session timeout at wicket-library.com? (*) in general pull-MVC frameworks are harder to learn than push-MVC ones, I don't mean to say it's a wicket specific challenge. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket-library.com session expiring too early
Hi, The examples are hosted for free by this hosting provider. The short session timeout is one of their requirements to keep the used memory low. You can always download the .war file from http://central.maven.org/maven2/org/apache/wicket/wicket-examples/ and run them locally with as big session timeout as you need. On Mon, Dec 3, 2012 at 2:46 PM, Lucio Crusca lu...@sulweb.org wrote: Hello *, I try filing this bug (whishlist) here, because I haven't found any contact email on the wicket-library.com website. As a wicket newbie, I use wicket-library.com examples a lot. However reading through Java/HTML code, understanding what's going on, identifying relevant lines of code, copying them in your own project and testing them takes quite a bit of time. That time usually exceeds the configured time for the user session at wicket-library.com, at least for a newbie like me. That results in page expired messages when you go back to your browser window and click another source file to look at. You then have to go back to the website home, choose your example again and walk through the links to reach the source file you were looking for. All this makes the already steep (*) wicket learning curve even harder, because it breaks concentration while studying examples. Would it be possible to raise the session timeout at wicket-library.com? (*) in general pull-MVC frameworks are harder to learn than push-MVC ones, I don't mean to say it's a wicket specific challenge. - 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 http://jweekend.com/
Re: Wicket and Struts together have a problem when not adding mountpath to the Wicket-Page
Yeah, that is working but that's in fact also a workaround. I don't want to mount all my pages. Or do I understand something wrong... My webapp has a login and should not have any mountpaths... (except of Loginpage itself). Kind Regards Christoph -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Struts-together-have-a-problem-when-not-adding-mountpath-to-the-Wicket-Page-tp4654359p4654426.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 and Struts together have a problem when not adding mountpath to the Wicket-Page
Well, Wicket has no idea that you use Struts and even less where are the pages managed by Struts. What about the approach with UrlRenderer#renderContextRelativeUrl() ? On Mon, Dec 3, 2012 at 3:10 PM, cknafl chr.kn...@gmail.com wrote: Yeah, that is working but that's in fact also a workaround. I don't want to mount all my pages. Or do I understand something wrong... My webapp has a login and should not have any mountpaths... (except of Loginpage itself). Kind Regards Christoph -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Struts-together-have-a-problem-when-not-adding-mountpath-to-the-Wicket-Page-tp4654359p4654426.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
UrlResourceReference escapes too much?
Hi, I am trying to render a reference to a Javascript library which is stored somewhere in my webapp directory using UrlResourceReference: public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference(new UrlResourceReference(Url.parse(public/scripts/jquery-ui-1.8.6.custom.min.js)) .setContextRelative(true))); } This does not work, because our wicket servlet is using a prefix (nui), and thus the URL to the resource (corrently) contains .. but this is escaped for some reason to ::. So the URL generated by the ResourceReference is e.g. http://localhost:8080/app/nui/::/public/scripts/jquery-ui-1.8.6.custom.min.js; leading to a 404. The correct URL would be http://localhost:8080/app/nui/../public/scripts/jquery-ui-1.8.6.custom.min.js; As far as I can see, ParentPathReferenceRewriter does the escaping. Am I using the API not correctly? Thanks for your help! Best Regards, Andreas - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: UrlResourceReference escapes too much?
Hi, Try with org.apache.wicket.markup.head.JavaScriptHeaderItem#forUrl() This method cares about context relative urls. On Mon, Dec 3, 2012 at 4:06 PM, Andreas Kappler andreas.kapp...@jato-consulting.de wrote: Hi, I am trying to render a reference to a Javascript library which is stored somewhere in my webapp directory using UrlResourceReference: public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(**JavaScriptHeaderItem.**forReference(new UrlResourceReference(Url.**parse(public/scripts/jquery-**ui-1.8.6.custom.min.js)) .setContextRelative(true))); } This does not work, because our wicket servlet is using a prefix (nui), and thus the URL to the resource (corrently) contains .. but this is escaped for some reason to ::. So the URL generated by the ResourceReference is e.g. http://localhost:8080/app/**nui/::/public/scripts/jquery-** ui-1.8.6.custom.min.jshttp://localhost:8080/app/nui/::/public/scripts/jquery-ui-1.8.6.custom.min.js leading to a 404. The correct URL would be http://localhost:8080/app/** nui/../public/scripts/jquery-**ui-1.8.6.custom.min.jshttp://localhost:8080/app/nui/../public/scripts/jquery-ui-1.8.6.custom.min.js As far as I can see, ParentPathReferenceRewriter does the escaping. Am I using the API not correctly? Thanks for your help! Best Regards, Andreas --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: UrlResourceReference escapes too much?
Hi Martin, thanks for your quick reply, it does indeed work with forUrl but what I didn't mention before is that I am using a ResourceReference because I want to declare a dependency using ResourceReference#getDependencies. Is there a way to do this? Best Regards, Andreas Am 03.12.2012 16:10, schrieb Martin Grigorov: Hi, Try with org.apache.wicket.markup.head.JavaScriptHeaderItem#forUrl() This method cares about context relative urls. On Mon, Dec 3, 2012 at 4:06 PM, Andreas Kappler andreas.kapp...@jato-consulting.de wrote: Hi, I am trying to render a reference to a Javascript library which is stored somewhere in my webapp directory using UrlResourceReference: public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(**JavaScriptHeaderItem.**forReference(new UrlResourceReference(Url.**parse(public/scripts/jquery-**ui-1.8.6.custom.min.js)) .setContextRelative(true))); } This does not work, because our wicket servlet is using a prefix (nui), and thus the URL to the resource (corrently) contains .. but this is escaped for some reason to ::. So the URL generated by the ResourceReference is e.g. http://localhost:8080/app/**nui/::/public/scripts/jquery-** ui-1.8.6.custom.min.jshttp://localhost:8080/app/nui/::/public/scripts/jquery-ui-1.8.6.custom.min.js leading to a 404. The correct URL would be http://localhost:8080/app/** nui/../public/scripts/jquery-**ui-1.8.6.custom.min.jshttp://localhost:8080/app/nui/../public/scripts/jquery-ui-1.8.6.custom.min.js As far as I can see, ParentPathReferenceRewriter does the escaping. Am I using the API not correctly? Thanks for your help! Best Regards, Andreas --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-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: UrlResourceReference escapes too much?
I'm not sure. I have to debug it to be able to say what happens. On Mon, Dec 3, 2012 at 4:16 PM, Andreas Kappler andreas.kapp...@jato-consulting.de wrote: Hi Martin, thanks for your quick reply, it does indeed work with forUrl but what I didn't mention before is that I am using a ResourceReference because I want to declare a dependency using ResourceReference#**getDependencies. Is there a way to do this? Best Regards, Andreas Am 03.12.2012 16:10, schrieb Martin Grigorov: Hi, Try with org.apache.wicket.markup.head.**JavaScriptHeaderItem#forUrl() This method cares about context relative urls. On Mon, Dec 3, 2012 at 4:06 PM, Andreas Kappler andreas.kappler@jato-**consulting.de andreas.kapp...@jato-consulting.de wrote: Hi, I am trying to render a reference to a Javascript library which is stored somewhere in my webapp directory using UrlResourceReference: public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference(new UrlResourceReference(Url.parse(public/scripts/jquery-*** *ui-1.8.6.custom.min.js)) .setContextRelative(true))); } This does not work, because our wicket servlet is using a prefix (nui), and thus the URL to the resource (corrently) contains .. but this is escaped for some reason to ::. So the URL generated by the ResourceReference is e.g. http://localhost:8080/app/nui/::/public/scripts/jquery-http://localhost:8080/app/**nui/::/public/scripts/jquery-** ui-1.8.6.custom.min.jshttp://**localhost:8080/app/nui/::/** public/scripts/jquery-ui-1.8.**6.custom.min.jshttp://localhost:8080/app/nui/::/public/scripts/jquery-ui-1.8.6.custom.min.js leading to a 404. The correct URL would be http://localhost:8080/app/** nui/../public/scripts/jquery-ui-1.8.6.custom.min.jshttp:/** /localhost:8080/app/nui/../**public/scripts/jquery-ui-1.8.** 6.custom.min.jshttp://localhost:8080/app/nui/../public/scripts/jquery-ui-1.8.6.custom.min.js As far as I can see, ParentPathReferenceRewriter does the escaping. Am I using the API not correctly? Thanks for your help! Best Regards, Andreas --** --**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.orghttp://apache.org users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: which server?
Tomcat is stable, very widely used, and has lots of documentation / examples out there. Jetty also works well. We normally deploy on Tomcat (7.x now) On Mon, Dec 3, 2012 at 10:28 AM, Lucio Crusca lu...@sulweb.org wrote: Hello *, I'm approaching my 1st web application deployment (be it wicket or else). It will have only one user, so raw performance is not a priority. I have to choose an application server. Is there a recommended app server for wicket? How common is Glassfish in production environments? Is Tomcat enough? Is Jetty a reasonable choice? Thanks in advance Lucio. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket-library.com session expiring too early
In data lunedì 3 dicembre 2012 14:51:35, Martin Grigorov ha scritto: You can always download the .war file from http://central.maven.org/maven2/org/apache/wicket/wicket-examples/ and run them locally with as big session timeout as you need. Thanks, I've deployed locally. How do I raise the session timeout? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket-library.com session expiring too early
In data lunedì 3 dicembre 2012 19:58:55, Lucio Crusca ha scritto: Thanks, I've deployed locally. How do I raise the session timeout? Never mind, I've found it: session-config session-timeout5/session-timeout in web.xml. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: master branch compiler error in core?
Just pushed a hack that solves the problem. Pull and try again. Yah! That works. It's a pity clirr's file separator agnostic solution is so verbose heh! Given that it is Java based I hoped clirr could have used package style separators i.e. the period '.' but they don't work with it. On Mon, Dec 3, 2012 at 1:47 AM, Chris Colman chr...@stepaheadsoftware.comwrote: Bingo! - it's the difference between *nix and Windows. When I change the forward slashes to backslashes in the clirr ignored section's className element it works - for Windows at least!! There's a good chance that backslashes will probably break for *nix but even though I have a machine with Linux available I don't have any build environments set up on it yet. ignored difference classNameorg\apache\wicket\feedback\FeedbackCollector/className method*/method differenceType7014/differenceType /difference /ignored I tried replacing / with . but that failed also. It seems like clirr has not been written in a 'directory separator' agnostic way. Which is a pity as the most recent release seems to be in 2005 - so maybe the clirr devs aren't as active as with other projects. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Monday, 3 December 2012 8:39 AM To: users@wicket.apache.org Subject: Re: master branch compiler error in core? im on osx -igor On Sun, Dec 2, 2012 at 4:37 AM, Martin Grigorov mgrigo...@apache.org wrote: I use Ubuntu 12. BuildBot (the CI) is some Unix too ( http://ci.apache.org/builders/wicket-master). I cannot test builds on Windows here. On Sun, Dec 2, 2012 at 1:29 PM, Chris Colman chr...@stepaheadsoftware.comwrote: I'm still having the problem. I can see the clirr exclusions Igor added and they seem fine according to the (vary sparse) Clirr doco. What platform are you and Igor building on? I'm building on: Win XP Java 1.6.0_31 4GB RAM -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Friday, 30 November 2012 11:52 PM To: users@wicket.apache.org Subject: Re: master branch compiler error in core? No errors here. Igor added an exclusion in parent pom.xml for this change. https://git-wip- us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=c3d4744 8d1b f5b5d0e8207bb8c0cf605cef8c18c On Fri, Nov 30, 2012 at 1:36 PM, Chris Colman chr...@stepaheadsoftware.comwrote: I've just updated the master branch and I get the following build errors: [INFO] --- clirr-maven-plugin:2.5:check (clirr-check) @ wicket-core --- [INFO] Comparing to version: 6.0.0 [ERROR] org.apache.wicket.feedback.FeedbackCollector: Method 'public java.util.List collect()' is now final [ERROR] org.apache.wicket.feedback.FeedbackCollector: Method 'public java.util.List collect(org.apache.wicket.feedback.IFeedbackMessageFilter)' is now final [ERROR] org.apache.wicket.feedback.FeedbackCollector: Method 'public org.apache.wicket.feedback.FeedbackCollector setIncludeSession(boolean)' is now final [ERROR] org.apache.wicket.feedback.FeedbackCollector: Method 'public org.apache.wicket.feedback.FeedbackCollector setRecursive(boolean)' is now final [INFO] Am I doing something wrong or is there an error in the latest source? -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - 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 http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Best way to trap Enter key in a form in a modal window
Hi, On Mon, Dec 3, 2012 at 1:05 PM, Chris Colman chr...@stepaheadsoftware.comwrote: I understand that with a form in a modal window you must explicitly declare an AjaxButton component because modal windows require AJAX comms (BTW this should probably be mentioned in the Form Javadoc page somewhere: http://ci.apache.org/projects/wicket/apidocs/6.0.x/) I didn't get what should be better explained ? The part about using a form in a ModalWindow. Form's current Javadoc contains no mention of how to use a form in a ModalWindow i.e. the implicit handling of form submit will not work properly when the form is in a ModalWindow - it requires AJAX submit. However, what is the best approach to providing a 'catch all' so that if the user presses the 'Enter' key while focus is on any field in the form the normal submit takes place? See Form#setDefaultButton. Not sure whether this will help in Ajax form submit though. Additionally check https://github.com/kinabalu/wicket-mousetrap/ -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: a question on different data grid components available for wicket
Martin, All grid functionality seems to be ported to jquery... I have pushed the changes master. https://github.com/wicketstuff/core/commit/85920962aa601e6114234caa9e7b2304c603ba49 It would be nice if someone with a real application using inMethod grid can give it a try. Cheers, Ernesto On Sat, Dec 1, 2012 at 5:40 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Martin, On Sat, Dec 1, 2012 at 5:20 PM, Martin Grigorov mgrigo...@apache.orgwrote: Well done, Ernesto ! Since YUI implementation will be preserved for some time I think it is OK to commit directly in master branch. The announcement for WicketStuff 6.4.0 will have a special note about this change with a description how to use the old YUI impl. Ok. I will add a useYui flag and some javadoc for it, Another problem that I see is that Select All checkbox is not selected after using it. Thanks for the feedback, I will try fix that and the other issues tomorrow. On Sat, Dec 1, 2012 at 5:07 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Martin. On Wed, Nov 28, 2012 at 9:25 AM, Martin Grigorov mgrigo...@apache.org wrote: On Wed, Nov 28, 2012 at 9:22 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Hi, On Wed, Nov 28, 2012 at 9:14 AM, Martin Grigorov mgrigo...@apache.org wrote: Hi, InMethod Grid is more smarter. It supports column reordering, resizing, better Ajax support. But it is no active maintainer at the moment. Different community members provide patches when they need fixes but that's all. It is also based on Yahoo UI v.2. Maybe it is time to try to rewrite all column reordering, re-sizing logic based on jquery (instead of YUI). Now that jquery comes for free with wicket 6.x I'm sure many users will be happy of such change. Even upgrading to YUI 3 will be a big improvement. The same is valid for wicket-datetime module. I have managed to port grid functionality to use jquery. See [1] (just deployed a temporary version of the sample application). Issues. 1- sorting columns do not update grid properly. 2- Tree grid column reordering do work yet. I will try to fix those tomorrow. The only needed dependency is jquery itself. I will add a flag that allows to choose between jquery and YUI backed grid (with default to jquery;-). Shall I commit those changes? Create a branch? Or a patch? References, 1-http://antiliasoft.com/inmethod-grid-examples/ -- Regards - Ernesto Reinaldo Barreiro Antilia Soft http://antiliasoft.com/ http://antiliasoft.com/antilia -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ -- Regards - Ernesto Reinaldo Barreiro Antilia Soft http://antiliasoft.com/ http://antiliasoft.com/antilia
Re: Best way to trap Enter key in a form in a modal window
Hi, On Mon, Dec 3, 2012 at 10:11 PM, Chris Colman chr...@stepaheadsoftware.comwrote: Hi, On Mon, Dec 3, 2012 at 1:05 PM, Chris Colman chr...@stepaheadsoftware.comwrote: I understand that with a form in a modal window you must explicitly declare an AjaxButton component because modal windows require AJAX comms (BTW this should probably be mentioned in the Form Javadoc page somewhere: http://ci.apache.org/projects/wicket/apidocs/6.0.x/) I didn't get what should be better explained ? The part about using a form in a ModalWindow. Form's current Javadoc contains no mention of how to use a form in a ModalWindow i.e. the implicit handling of form submit will not work properly when the form is in a ModalWindow - it requires AJAX submit. This is not necessarily true, I think. If the modal contains a Page (in an iframe) and not a panel, in that case submit can be a standard submit. -- Regards - Ernesto Reinaldo Barreiro Antilia Soft http://antiliasoft.com/ http://antiliasoft.com/antilia
Model is null after submit, using FormComponentPanel
Hello, I want to create a reusable component for use as part of a form, for this class use FormComponentPanel, As the following article. https://cwiki.apache.org/WICKET/creating-custom-formcomponentpanels-to-build-valid-objects-using-wickets-form-validation-logic.html My problem is that when I submit the internal components (TextFields), updated its model to null, instead of updating the model with the entered string, the method mytextfield.getConvertedInput () returns null during the call to UpdateModel (). Does anyone know what might be happening?. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Model-is-null-after-submit-using-FormComponentPanel-tp4654441.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: select2 integration -Duplicate(selected) value are appear in drop down box
I can't detect anything wrong with your implementation on first sight. Is it possible that you can reproduce the described behavior in a Quickstart? -Tom On 01.12.2012, at 03:09, Madasamy mcruncher madas...@mcruncher.com wrote: FooProvider implementation is public class FooProvider extends TextChoiceProviderFoo { FooService fooService=new FooService(); @Override protected String getDisplayText(Foo fooChoice) { return fooChoice.getName(); } @Override protected Object getId(Foo fooChoice) { return fooChoice.getName; } @Override public void query(String term, int page, ResponseFoo response) { response.addAll(queryMatches(term, page, 10)); response.setHasMore(response.size() == 10); } @Override public CollectionFoo toChoices(CollectionString ids) { ArrayListFoo foos = new ArrayListFoo(); for (String id : ids) { foos.add(fooService.findFooByName(id)); } return foos; } } private ListFoo queryMatches(String term, int page, int pageSize) { ListFoo result = new ArrayListFoo(); term = term.toUpperCase(); final int offset = page * pageSize; int matched = 0; for ( Foo foo : getAllFoos()) { if (result.size() == pageSize) { break; } if (foo.getName().toUpperCase().contains(term)) { matched++; if (matched offset) { result.add(foo); } } } return result; } public ListFoo getAllFoos() { //return all foos return fooService.findAll(); } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Form Validation not called
Hi community, I've got a little problem here with a real simple form. Everything is working fine except the validation of my Validator which is never called. I've set a breakpoint to the onvalidation method... nothing. I think I am missunderstanding the architecture of form/validation. Here's the sample code: ** *** Page ** public class MyTestPage extends HomePage { /** * */ private static final long serialVersionUID = 6374488865423191635L; private IModelArticle article = Model.of(new Article()); public MyTestPage() { this(null); } public MyTestPage(PageParameters params) { super(params); add(new FeedbackPanel(testPage.feedback, new ComponentFeedbackMessageFilter(this))); add(new MyTestForm(testPage.myForm, article)); } class MyTestForm extends FormArticle { /** * */ private static final long serialVersionUID = -1961809427855436256L; public MyTestForm(String id, IModelArticle model) { super(id, new CompoundPropertyModelArticle(model)); TextFieldString myText = new TextFieldString(testPage.myText, new PropertyModelString(getModel(), EAN)); add(myText); DropDownChoiceArticleStatus myDropDown = new DropDownChoiceArticleStatus(testPage.myDropDown, new PropertyModelArticleStatus(getModel(), status), Arrays.asList(ArticleStatus.values())); add(myDropDown); AjaxButton btSave = new AjaxButton(testPage.save, MyTestForm.this) { @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { Article article = ((Article) getParent().getDefaultModelObject()); // save article - working } @Override protected void onError(AjaxRequestTarget target, Form? form) { // add feedback panel here - but this is never called } }; add(btSave); Button btCancel = new Button(testPage.cancel) { @Override public void onSubmit() { setResponsePage(HomePage.class); } }; btCancel.setDefaultFormProcessing(false); add(btCancel); add(new ArticleValidator(myDropDown, myText)); } } } ** *** Validator ** public class ArticleValidator extends AbstractValidatorArticle implements IValidatorArticle { //... } Thanks for help. Regards, Erik -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-Validation-not-called-tp4654443.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: Best way to trap Enter key in a form in a modal window
The other important thing to mention in Form's Javadoc is that a form in a ModalWindow can not be closed without AJAX. i.e. you can't do the close in the standard Form.onSubmit handler as that is given no AjaxRequestTarget parameter which is required to perform the ModalWindow close. Trying to close it in the implicit way results in the browser throwing up a pop up asking the user if they want to Leave this page or Stay on this page - which is pretty bad. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, 3 December 2012 11:18 PM To: users@wicket.apache.org Subject: Re: Best way to trap Enter key in a form in a modal window Hi, On Mon, Dec 3, 2012 at 1:05 PM, Chris Colman chr...@stepaheadsoftware.comwrote: I understand that with a form in a modal window you must explicitly declare an AjaxButton component because modal windows require AJAX comms (BTW this should probably be mentioned in the Form Javadoc page somewhere: http://ci.apache.org/projects/wicket/apidocs/6.0.x/) I didn't get what should be better explained ? However, what is the best approach to providing a 'catch all' so that if the user presses the 'Enter' key while focus is on any field in the form the normal submit takes place? See Form#setDefaultButton. Not sure whether this will help in Ajax form submit though. Additionally check https://github.com/kinabalu/wicket-mousetrap/ -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Setting focus in a form in a ModalWindow
What about this: Form myForm = new Form(form); add(myForm); final Component myComponentToFocus = ...; myForm.add(myComponentToFocus); final ModalWindow modalWindow = new ModalWindow(modal) { @Override public void show(AjaxRequestTarget target) { super.show(target); target.focusComponent(myComponentToFocus); } }; add(modalWindow); modalWindow.setContent(myForm); AjaxLink opener = new AjaxLink(link) { @Override public void onClick(AjaxRequestTarget target) { modalWindow.show(target); } }; add(opener); -Tom When you have a form in a standard page you can trap the 'onload' event to set the focus but I couldn't find any useful event to trap when a form is opened up in a Modal Window - the 'onload' applies to the page loading, not the ModalWindow (I'm pretty sure). The 'least worst' solution I have found is to trap the 'onmouseover' and set the focus in that, after the focus is set I set a flag to stop it re-setting the focus every time the mouse re-enters the form. It's still not perfect but it's a lot better than 'no focus'. I've included the code below if anyone is interested. Is there a better event to be trapping to set the focus? class PanelWithAForm extends Panel { ... protected boolean focusSet = false; @Override protected void onBeforeRender() { // Need to reset the focusSet at each re-render - onInitialize is only called once regardless of how many times the modal is opened from the hosting page instance super.onBeforeRender(); focusSet = false; } protected void onInitialize() { super.onInitialize(); add(new AjaxEventBehavior(onmouseover) { protected void onEvent(AjaxRequestTarget target) { if ( !focusSet ) { target.focusComponent(fieldToFocusOn); focusSet = true; } } }); } ... } - 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, There are better qualified people to answer this, but... Are the components actually passing validation? Pre-validation the model would be null - if the validation fails the model would be null. If the component validates then the model would be updated with the valid value. Col. -Original Message- From: Raul [mailto:ralva...@netwie.com] Sent: Tuesday, 4 December 2012 8:35 AM To: users@wicket.apache.org Subject: Model is null after submit, using FormComponentPanel Hello, I want to create a reusable component for use as part of a form, for this class use FormComponentPanel, As the following article. https://cwiki.apache.org/WICKET/creating-custom-formcomponentpanels-to-build-valid-objects-using-wickets-form-validation-logic.html My problem is that when I submit the internal components (TextFields), updated its model to null, instead of updating the model with the entered string, the method mytextfield.getConvertedInput () returns null during the call to UpdateModel (). Does anyone know what might be happening?. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Model-is-null-after-submit-using-FormComponentPanel-tp4654441.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 EMAIL DISCLAIMER This email message and its attachments are confidential and may also contain copyright or privileged material. If you are not the intended recipient, you may not forward the email or disclose or use the information contained in it. If you have received this email message in error, please advise the sender immediately by replying to this email and delete the message and any associated attachments. Any views, opinions, conclusions, advice or statements expressed in this email message are those of the individual sender and should not be relied upon as the considered view, opinion, conclusions, advice or statement of this company except where the sender expressly, and with authority, states them to be the considered view, opinion, conclusions, advice or statement of this company. Every care is taken but we recommend that you scan any attachments for viruses. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
a weird exception when update Panel
Hi Folks, On one of my v6.1 wick page there is a set of tabs and a main panel. When user click on a new tab it will trigger an ajax behavior and create a different panel to update the main panel. Sometimes I've seen below exception if I click the tab quickly once the page is loaded. But it didn't happen everytime. Even it happened I refresh the page and wait for few second, then click the tabs again the page will work well without any exception. On the main panel java I've tried to override the getStatelessHint() to return false but it help nothing of this weird exception. Any one have the idea how to fix it? Many thanks in advance! Exception detail below - Unexpected RuntimeException Last cause: Cannot find behavior with id '1' on component 'com.myapp.web.common.LogsPanel:includeMainPanel:includeMain' in page '[Page class = com.myapp.web.home.HomePage, id = 6, render count = 1]'. Perhaps the behavior did not properly implement getStatelessHint() and returned 'true' to indicate that it is stateless instead of returning 'false' to indicate that it is stateful. Stacktrace Root cause: org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior with id '1' on component 'com.myapp.web.common.LogsPanel:includeMainPanel:includeMain' in page '[Page class = com.myapp.web.home.HomePage, id = 6, render count = 1]'. Perhaps the behavior did not properly implement getStatelessHint() and returned 'true' to indicate that it is stateless instead of returning 'false' to indicate that it is stateful. at org.apache.wicket.Behaviors.getBehaviorById(Behaviors.java:303) at org.apache.wicket.Component.getBehaviorById(Component.java:4479) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:246) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:226) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:814) at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253) at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210) at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281) at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231) at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) at java.lang.Thread.run(Thread.java:722) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/a-weird-exception-when-update-Panel-tp4654448.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