ANN: wicket based demo of stitches release
Hi everyone. Just wanted to let you know that I released stitches with a cool demo and I wouldn't be done yet if it weren't for wicket. While stitches (the backend) doesn't need or use any UI component, for interfacing with the stitches repo, I wouldn't think of using anything but wicket. about the project: http://www.philliprhodes.com/content/stitches-30-seconds The wicket-based demo: (Please be gentle and understand slowness. very underpowered server, wife needs to increase my hobby budget!) http://demo.philliprhodes.com/stitches-client/ Phillip - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Ordering a list component?
I was wondering if anyone had a component that allows you to order a list of items? Thanks, wicket is the best! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ordering a list component?
Sorry, should have been more specific. Allow the user to perform custom ordering of a list of items. Sort of like the palette component, but only half of it. -Original Message- From: Martin Makundi martin.maku...@koodaripalvelut.com Sent: Wednesday, May 27, 2009 10:37am To: users@wicket.apache.org Subject: Re: Ordering a list component? Collections.sort 2009/5/27 Phillip Rhodes spamsu...@rhoderunner.com: I was wondering if anyone had a component that allows you to order a list of items? Thanks, wicket is the best! - 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: DropDownChoice with ChoiceRender problem
Thanks for the solution. I found this post here (so the reader is getting off easy:) http://steve-on-sakai.blogspot.com/2008/12/using-hashmap-with-dropdownchoice.html -Original Message- From: James Carman jcar...@carmanconsulting.com Sent: Tuesday, May 5, 2009 12:55pm To: users@wicket.apache.org Subject: Re: DropDownChoice with ChoiceRender problem On Tue, May 5, 2009 at 9:37 AM, Phillip Rhodes spamsu...@rhoderunner.com wrote: I want to display Yes to the user in the dropdown. If the user selects Yes, I want address.handicapAccess string property to be set to Y Do you still think a map-based rendererer is the way to go? Yes, I would do it that way. That seems easiest to me. I do that stuff sometimes and I declare my map to be static: private static MapString,String CHOICES_MAP = new HashMapString,String(); static { CHOICES_MAP.put(Y, Yes); CHOICES_MAP.put(N, No); CHOICES_MAP.put(U, Unknown); } Then, just use your map in your renderer (I'll leave that exercise up to the reader). You could even use resource keys instead of hard-coded labels. That way, the Yes stuff would be in properties files. Enjoy! - 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: DropDownChoice with ChoiceRender problem
I want to display Yes to the user in the dropdown. If the user selects Yes, I want address.handicapAccess string property to be set to Y Do you still think a map-based rendererer is the way to go? Thank you. -Original Message- From: James Carman jcar...@carmanconsulting.com Sent: Tuesday, May 5, 2009 7:05am To: users@wicket.apache.org Subject: Re: DropDownChoice with ChoiceRender problem So, you want the codes to be the values? Why not use a map-based renderer as opposed to creating a whole new class? On Mon, May 4, 2009 at 9:48 PM, Phillip Rhodes prho...@rhoderunner.com wrote: It's of type String Thanks On May 4, 2009, at 3:23 PM, James Carman wrote: The handicapAccess property is of type? On Mon, May 4, 2009 at 2:29 PM, Phillip Rhodes spamsu...@rhoderunner.com wrote: Hi everyone, Sorry for posting this problem but I have been stuck for far too many hours on this. Using wicket 1.4 Appreciate any help on this very very much. I have a pojo object called address that has a property of handicapAccess I am trying to bind this property to a dropdown list with 3 choices (formated as name/value) Yes/Y No/N Unknown/U If I use the constructor of ChoiceRenderer(String displayExpression), No error, but my property is bound as com.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd If I use the constructor of ChoiceRenderer(java.lang.String displayExpression, java.lang.String idExpression), I get an error org.apache.wicket.WicketRuntimeException: No get method defined for class: class java.lang.String expression: id Although my SelectOption class has getId/setId ListSelectOption options = new ArrayListSelectOption(); options.add(new SelectOption(Yes, Y)); options.add(new SelectOption(No, N)); options.add(new SelectOption(Unknown, U)); //org.apache.wicket.WicketRuntimeException: No get method defined for class: class java.lang.String expression: id ChoiceRenderer choiceRenderer = new ChoiceRenderer(name,id); //this choice render gives it a // handicapAccesscom.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd/handicapAccess //ChoiceRenderer choiceRenderer = new ChoiceRenderer(name); PropertyModel model = new PropertyModel(address, handicapAccess); DropDownChoice ddc = new DropDownChoice(dropDownChoice, model,options,choiceRenderer); //Here's my SelectOption public class SelectOption implements Serializable { /** * */ private static final long serialVersionUID = 1L; private String name; private String id; public SelectOption(String name, String id) { this.name = name; this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getId() { return id; } public void setId(String id) { this.id = id; } } - 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 - 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
DropDownChoice with ChoiceRender problem
Hi everyone, Sorry for posting this problem but I have been stuck for far too many hours on this. Using wicket 1.4 Appreciate any help on this very very much. I have a pojo object called address that has a property of handicapAccess I am trying to bind this property to a dropdown list with 3 choices (formated as name/value) Yes/Y No/N Unknown/U If I use the constructor of ChoiceRenderer(String displayExpression), No error, but my property is bound as com.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd If I use the constructor of ChoiceRenderer(java.lang.String displayExpression, java.lang.String idExpression), I get an error org.apache.wicket.WicketRuntimeException: No get method defined for class: class java.lang.String expression: id Although my SelectOption class has getId/setId ListSelectOption options = new ArrayListSelectOption(); options.add(new SelectOption(Yes, Y)); options.add(new SelectOption(No, N)); options.add(new SelectOption(Unknown, U)); //org.apache.wicket.WicketRuntimeException: No get method defined for class: class java.lang.String expression: id ChoiceRenderer choiceRenderer = new ChoiceRenderer(name,id); //this choice render gives it a // handicapAccesscom.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd/handicapAccess //ChoiceRenderer choiceRenderer = new ChoiceRenderer(name); PropertyModel model = new PropertyModel(address, handicapAccess); DropDownChoice ddc = new DropDownChoice(dropDownChoice, model,options,choiceRenderer); //Here's my SelectOption public class SelectOption implements Serializable { /** * */ private static final long serialVersionUID = 1L; private String name; private String id; public SelectOption(String name, String id) { this.name = name; this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getId() { return id; } public void setId(String id) { this.id = id; } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
setEscapeModelStrings on PropertyColumn?
I have a DefaultDataTable that I am adding PropertyColumn's to. I would like to disable output escaping on the value of the PropertyColumn, but I don't see the setEscapeModelStrings on the PropertyColumn. Any hints? Thank you! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
should i migrate from 1.3.to 1.4?
I am trying to use some components from wicket-stuff that I need to build from the 1.3.5 tag, and to do this, I need to build wicket from the 1.3.5. That's 2 projects that I need to build from source so I can use some components. I am considering migrating to 1.4 so I can use the distributed artifacts. Any reason that I shouldn't do this? Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Which component for gmap for wicket 1.3.5?
Is gmap2 supposed to work with wicket 1.3.5? I am thinking that I would need to upgrade to 1.4. I am getting a NoSuchMethodError. Thanks. WicketMessage: Method onLinkClicked of interface org.apache.wicket.markup.html.link.ILinkListener targeted at component [MarkupContainer [Component id = link]] threw an exception Root cause: java.lang.NoSuchMethodError: wicket.contrib.gmap.GMap2.add([Lorg/apache/wicket/behavior/IBehavior;)Lorg/apache/wicket/Component; at wicket.contrib.gmap.GMap2.init(GMap2.java:128) at wicket.contrib.gmap.GMap2.init(GMap2.java:161) at wicket.contrib.gmap.GMap2.init(GMap2.java:99) -Original Message- From: Martin Funk mafulaf...@googlemail.com Sent: Tuesday, April 21, 2009 3:05am To: users@wicket.apache.org Subject: Re: Which component for gmap for wicket 1.3.5? number 1) it evolved out of 2) mf 2009/4/20 Phillip Rhodes spamsu...@rhoderunner.com I see there are a couple gmap projects if I browse to the SVN repo for wicketstuff. http://wicketstuff.org/maven/repository/org/wicketstuff/ For example: 1) gmap2 (updated Mon, 20 Apr 2009) 2) wicket-contrib-gmap2 (updated on Mon, 01 Dec 2008) I am using wicket 1.3.5 Which component should I be using? Thanks! - 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: Which component for gmap for wicket 1.3.5?
I used the version that is in the wicket maven repo (http://wicketstuff.org/maven/repository/org/wicketstuff/gmap2/) There's a 1.4-SNAPSHOT, and a 1.4-rc2 version in the repo, and I am set to use the 1.4-rc2 release. dependency groupIdorg.wicketstuff/groupId artifactIdgmap2/artifactId version1.4-rc2/version /dependency Thanks. I super appreciate your time. -Original Message- From: Jeremy Thomerson jer...@wickettraining.com Sent: Tuesday, April 21, 2009 1:23pm To: users@wicket.apache.org Subject: Re: Which component for gmap for wicket 1.3.5? Have you pulled it from wicketstuff trunk or the 1.3.X branch? -- Jeremy Thomerson http://www.wickettraining.com On Tue, Apr 21, 2009 at 12:16 PM, Phillip Rhodes spamsu...@rhoderunner.comwrote: Is gmap2 supposed to work with wicket 1.3.5? I am thinking that I would need to upgrade to 1.4. I am getting a NoSuchMethodError. Thanks. WicketMessage: Method onLinkClicked of interface org.apache.wicket.markup.html.link.ILinkListener targeted at component [MarkupContainer [Component id = link]] threw an exception Root cause: java.lang.NoSuchMethodError: wicket.contrib.gmap.GMap2.add([Lorg/apache/wicket/behavior/IBehavior;)Lorg/apache/wicket/Component; at wicket.contrib.gmap.GMap2.init(GMap2.java:128) at wicket.contrib.gmap.GMap2.init(GMap2.java:161) at wicket.contrib.gmap.GMap2.init(GMap2.java:99) -Original Message- From: Martin Funk mafulaf...@googlemail.com Sent: Tuesday, April 21, 2009 3:05am To: users@wicket.apache.org Subject: Re: Which component for gmap for wicket 1.3.5? number 1) it evolved out of 2) mf 2009/4/20 Phillip Rhodes spamsu...@rhoderunner.com I see there are a couple gmap projects if I browse to the SVN repo for wicketstuff. http://wicketstuff.org/maven/repository/org/wicketstuff/ For example: 1) gmap2 (updated Mon, 20 Apr 2009) 2) wicket-contrib-gmap2 (updated on Mon, 01 Dec 2008) I am using wicket 1.3.5 Which component should I be using? Thanks! - 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
Which component for gmap for wicket 1.3.5?
I see there are a couple gmap projects if I browse to the SVN repo for wicketstuff. http://wicketstuff.org/maven/repository/org/wicketstuff/ For example: 1) gmap2 (updated Mon, 20 Apr 2009) 2) wicket-contrib-gmap2 (updated on Mon, 01 Dec 2008) I am using wicket 1.3.5 Which component should I be using? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
When should you use DefaultDataTable vs. ListView ?
I am writing an application and have used both the DefaultDataTable and ListView to display paged data. Besides the feature that DefaultDataTable allows you to sort columns easily, is there any reason to choose one over the other? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Expand/collaspe panel component?
I know that I can write one, but I was looking for a panel that can can expand/collapse if a plus/minus sign is clicked. I will appreciate it if you could point out one. Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: freelance gig
It's just rewriting the UI. Most of the code is behind spring services, so this is hardly a 100% rewrite, it's just a rewrite of the UI layer. Please bear in mind that we are not rewriting the application just to get from webframework a into webframework b. Even if I kept it in webframe a, everything needs to be changed. The entire security paradigm has changed, every screen has changed. Not much reuse will be achieved by trying to enhance the old application. -Original Message- From: Martin Makundi martin.maku...@koodaripalvelut.com Sent: Wednesday, March 25, 2009 2:58pm To: users@wicket.apache.org Subject: Re: freelance gig Don't do it: http://www.joelonsoftware.com/articles/fog69.html ** Martin 2009/3/25 Phillip Rhodes spamsu...@rhoderunner.com: I apologize for this posting, but being a fellow wicket enthusiast who needs some help, I wouldn't have minded seeing such a posting. For our project, we are implementing a new user interface. The existing UI is written using another java-based web framework, and many of the elements of the new interface requires components (i.e. Modal popups, trees) that either do not exist in this framework or are buggy. Most of the application code is in the service layer and not the UI layer, so given the vastly different UI, a total UI rewrite is necessary. The project is to implement a newly redesigned UI using wicket. The wicket UI will interface with an already written suite of spring services that work with hibernate to persist data to the database. In addition to hibernate, the spring services layer will integrate with Lucene. Ideally, the person to do this work is already familiar with wicket, spring, hibernate and Lucene. Of most importance is familiarity with wicket. The work can be done remotely, and we will be working together (splitting out the components, pages, etc) to deliver a new UI. Delivery is slated for mid-may. Please email me (off the mailing list of course) if you are interested, how your experience matches what i need and what your rate requirements are. Thanks, and I apologize for the non-development question. Phillip - 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
best way to obtain component reference?
I am trying to update the label text on a page from a inner class (onSubmit) of my page. I used the page.get(componentid) method, but it returns null. While I could just store the reference to the label as a variable in my page class, I would like to understand how to obtain a reference to it using the wicket API. When I use the following snippet, my get method always return null. Thanks, appreciate the help. public class AdminPage extends WebPage { public AdminPage() { add(new Label(message, If you see this message wicket is properly configured and running)); DMIRequest dmiRequest = new DMIRequest(); Form myform = new Form(myform, new CompoundPropertyModel(dmiRequest)); add(myform); myform.add(new DeleteButton()); } } private class DeleteButton extends Button { private static final long serialVersionUID = 1L; private DeleteButton() { super(delete, new ResourceModel(delete)); setDefaultFormProcessing(true); } @Override public void onSubmit() { Label lbl = new Label(message, Deleted); this.get(message).replaceWith(lbl); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Problem using @SpringBean with Wicket 1.3.5
Kent, I am using 1.3.5 fine with springbean. some differences that I see between your/mine is that I have the protected modifier. Mine: @SpringBean(name = eventService) protected EventService eventService; another difference: Try adding a slash to the beginning of your spring path param-valueclasspath:/applicationContext.xml/param-value Do you have a bean by the name of userRegistrationService in your spring context? In your code, you are just requesting a bean of the type, not by id. try doing a ctx.getBean(userRegistrationService) and make sure it's not null. HTH Phillip On Jan 19, 2009, at 3:30 PM, Kent Larsson wrote: Hi, I've tried to solve this for several hours now, without success, but then again I'm not that experienced. :-) I have an application with Spring beans which I want to use from Wicket, using @SpringBean. To see that Spring works fine I've tried using my bean without the @SpringBean annotation. By having @Override protected void init() { super.init(); ctx = new ClassPathXmlApplicationContext(applicationContext.xml); } public UserRegistrationService getUserRegistrationService() { return (UserRegistrationService) BeanFactoryUtils.beanOfType(ctx, UserRegistrationService.class); } In my class which extends WebApplication (my Application class). It works fine that way! So it must have something to do with how I try to use the @SpringBean annotation. First I have @Override protected void init() { super.init(); addComponentInstantiationListener(new SpringComponentInjector(this)); } In my Application class and in my web.xml I have added context-param param-namecontextConfigLocation/param-name param-valueclasspath:applicationContext.xml/param-value /context-param listener listener- classorg.springframework.web.context.ContextLoaderListener/ listener-class /listener and in my Page where I try to use the UserRegistrationService I have @SpringBean UserRegistrationService userRegistrationService; /** * Constructor... */ public UserRegistrationPage(final PageParameters parameters) { add(new Label(message, userRegistrationService.takeSomeString(hello service) )); } But when I try this I get WicketMessage: Can't instantiate page using constructor public net .mycompany .webcarrot .presentation .pages.UserRegistrationPage(org.apache.wicket.PageParameters) and argument I have a complete stack trace at pastebin (to not pollute the mail with it) http://pastebin.com/f7c12d56c I hope someone more experienced with Wicket than me knows what's going on here. I've tried to solve it for a couple of hours, but I can't find any faults in it (I'm trying to follow the instructions in Wicket in Action). Thank you for your time reading! Any help is HIGHLY appreciated! Have a nice day! Best regards, Kent
ModalWindow gotcha!
I have figured out why my ModalWindow was not working. Declaring the ModalWindow from a panel did not work. The ModalWindow would appear, but the ModalWindow contents (a panel) would be rendered within the parent panel after the ModalWindow was closed. If I declare the ModalWindow in a page, everything was fine. I can still invoke the ModalWindow from a panel, all is good. For now, I am going to declare all my ModalWindows at the page level,and pass these as constructor arguments to my panels. Can we add this as a limitation in the javadocs/faq for the ModelWindow? If I saw this documented, it would have saved me a lot of time! Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
referencing page from panel?
Hi, I have a panel that is on a page and the panel needs to be able to reference another panel on the same page. The panel is a detail form. The detail form contains a link back to the search results. I want to put the link in the detail form since this is the only time that it will appear, but this link action needs a reference to the search results panel to toggle the visibility back to true. As I see it, here are my options: 1) Have all panels be anonymous subclasses so they can all reference each other. 2) Have the other panel passed in as constructor argument for the other panel. 3) Have the main application page passed into the constructor the controlling panel. Any thoughts on the options? BTW, wow- i am doing some amazing stuff with wicket and I am excited! Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
example of opening ModalWindow with submit button ?
I would like to open a modelwindow, but not with a link since I do not want any form data to be lost. Does anyone have an example or pointer? I did manage to open a modalwindow using an ajaxsubmit button, but the content of my dialog gets written to my page and the dialog is empty! Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
lucene document property resolve with datatable?
Hi, I am trying to display a lucene document as a row in the datatable. Here is how I am defining my column: PropertyColumn col = new PropertyColumn(new Model(Name), get('NAME'), get('NAME')); The get('NAME') is a call to the document.get(String fieldName) method on the lucene document. I get the following error message: WicketMessage: No get method defined for class: class org.apache.lucene.document.Document expression: get('NAME') Is there a way to get the property resolver to work with the lucene document, or should I give up and write a wrapper for the lucene document? Thank you! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
modify domain object but stay on the same page?
I have been searching, but all the examples that I come across use a standalone page for editing an object. For example, clicking this link will take the user to a PersonEdit page. add(new Link(editPerson) { public void onClick() { setResponsePage(new PersonEdit(person, peopleList)); } }); I also have an edit link, but instead of going to another page, I just want a form that I have already have on the page to be updated to the selected person. Should I just still call setResponsePage using my current page's constructor, or is there a way that I can update the form on my page to be bound to a new person? Right now, in my onClick handler, while I can retrieve the new person, I can get the form model to reflect the new person. Day 2 with wicket! Phillip - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
wicket-datetime DateField generates 2 textfields problem
This is my first full day with wicket, so please bear with me. I am trying to use the DateField to manage a java.util.Date. My problem is that the datafield outputs an extra textfield in my form. The picker does work and does set the date value for the 2nd textarea, but there is still the extra (first) textfield that does not serve a purpose. I am using wicket 1.3.5 and wicket-datetime 1.3.5 I have included java snippet/template snippet and the what wicket generated. Thanks, hope for good things to come. DateField startDateField = new DateField(dateRange.startDate2); form.add(startDateField); tr tdwicket:message key=startDate[start date]/wicket:message/ tdtd input type=text wicket:id=dateRange.startDate2/ /td /tr tr tdwicket:message key=startDate[start date]/wicket:message/ tdtd input type=text wicket:id=dateRange.startDate2 name=dateRange.startDate2wicket:panel span style=white-space: nowrap; input value= type=text wicket:id=date size=8 name=dateRange.startDate2:date id=date21/ span class=yui-skin-samnbsp;span style=display:none;position:absolute;z-index: 9; id=date21Dp/ spanimg style=cursor: pointer; border: none; id=date21Icon src=resources/org.apache.wicket.extensions.yui.calendar.DatePicker/ icon1.gif alt=//span /span /wicket:panel/input /td /tr - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Open popup on form submit?
Hi, Is it possible to do a form submit and display a popup? I want it to be on form submit so that the form data is saved since I need to reload it when the popup is closed. Just having a anchor that generates the popup causes users to lose data entry. Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: NoSuchMethodException / PropertyResolver
Martijn Dashorst wrote: You have to provide the types for the fields, or else Wicket won't be able to discover what type to use (apparently it resolves to boolean for the name), or provide default values with the correct type in your valuemap. i.e. either: add(new TextField(firstName, new PropertyModel(map, firstName), String.class)); or map.put(firstName, ); No joy, I tried both suggestions (see code below) and still get the both a NoSuchMethodException and a NoSuchFieldException for each field (see stack trace below). Of course this doesn't actually stop anything from working, as far as I can tell, so it's not a big deal to me. But it seems like something still isn't quite right. BEGIN JAVA CODE *** public UserRegistrationForm(final String componentName) { super(componentName); // Attach textfield components that edit properties map model add(new TextField(firstName, new PropertyModel(properties, firstName), String.class)); add(new TextField(lastName, new PropertyModel(properties, lastName), String.class)); add( new TextField( loginName, new PropertyModel(properties, loginName), String.class)); add(new TextField(emailAddress, new PropertyModel(properties, emailAddress), String.class)); add(new PasswordTextField(password, new PropertyModel(properties, password))); add(new PasswordTextField(confirmPassword, new PropertyModel(properties, confirmPassword))); properties.add(firstName, ); properties.add(lastName, ); properties.add(loginName, ); properties.add(emailAddress, ); properties.add(password, ); properties.add(confirmPassword, ); } END JAVA CODE ** === BEGIN LOG / STACK-TRACE = 2007-09-25 19:51:27,390 DEBUG [wicket.util.lang.PropertyResolver] Cannot find getter class wicket.util.value.ValueMap.emailAddress java.lang.NoSuchMethodException: wicket.util.value.ValueMap.isEmailAddress() at java.lang.Class.getMethod(Class.java:1605) at wicket.util.lang.PropertyResolver.findGetter(PropertyResolver.java:387) at wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:233) at wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:200) at wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:88) at wicket.model.AbstractPropertyModel.onGetObject(AbstractPropertyModel.java:132) at wicket.model.AbstractDetachableModel.getObject(AbstractDetachableModel.java:104) at wicket.Component.getModelObject(Component.java:990) at wicket.Component.getModelObjectAsString(Component.java:1005) at wicket.markup.html.form.FormComponent.getModelValue(FormComponent.java:975) at wicket.markup.html.form.FormComponent.getValue(FormComponent.java:583) at wicket.markup.html.form.TextField.onComponentTag(TextField.java:102) at wicket.Component.renderComponent(Component.java:1688) at wicket.MarkupContainer.onRender(MarkupContainer.java:927) at wicket.Component.render(Component.java:1533) at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334) at wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982) at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917) at wicket.markup.html.form.Form.onComponentTagBody(Form.java:773) at wicket.Component.renderComponent(Component.java:1719) at wicket.MarkupContainer.onRender(MarkupContainer.java:927) at wicket.markup.html.form.Form.onRender(Form.java:844) at wicket.Component.render(Component.java:1533) at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334) at wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982) at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917) at wicket.Component.renderComponent(Component.java:1719) at wicket.MarkupContainer.onRender(MarkupContainer.java:927) at wicket.Component.render(Component.java:1533) at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334) at wicket.MarkupContainer.renderAll(MarkupContainer.java:944) at wicket.Page.onRender(Page.java:864) at wicket.Component.render(Component.java:1533) at wicket.Page.renderPage(Page.java:413) at wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:226) at
NoSuchMethodException / PropertyResolver
Hi guys, I'm seeing a weird problem with Wicket. I *think* it's the same problem discussed here http://www.nabble.com/Tracking-down-an-elusive-error-during-migration-to-1.3-t4381647.html, but won't swear to it. Basically Wicket is logging a NoSuchMethodException when rendering my page. This is using Wicket 1.2.4, running on JDK 1.6, JBoss 4.0.5, on Windows 2000 Server. The java code for the page in question looks like this: *** BEGIN JAVA CODE *** package org.openqabal.web.registration; import org.openqabal.auth.encoder.QPasswordEncoder; import org.openqabal.core.lib.domain.QGenericUserAccount; import org.openqabal.core.lib.domain.impl.UserAccountImpl; import org.openqabal.core.lib.service.QHybridUserService; import wicket.PageParameters; import wicket.examples.WicketExampleHeader; import wicket.markup.html.WebPage; import wicket.markup.html.form.Form; import wicket.markup.html.form.PasswordTextField; import wicket.markup.html.form.TextField; import wicket.markup.html.panel.FeedbackPanel; import wicket.model.PropertyModel; import wicket.spring.injection.annot.SpringBean; import wicket.util.string.Strings; import wicket.util.value.ValueMap; public final class UserRegistration1 extends WebPage { @SpringBean(name=hybridUserService) private QHybridUserService userService; @SpringBean(name=passwordEncoderBean) private QPasswordEncoder passwordEncoder; // note: TODO UserAccountFactory here... public UserRegistration1() { this( null ); } public UserRegistration1( final PageParameters parameters ) { final String packageName = getClass().getPackage().getName(); add(new WicketExampleHeader(mainNavigation, Strings.afterLast(packageName, '.'), this)); // Create feedback panel and add to page final FeedbackPanel feedback = new FeedbackPanel(feedback); add(feedback); add(new UserRegistrationForm(userForm)); } public final class UserRegistrationForm extends Form { // El-cheapo model for form private final ValueMap properties = new ValueMap(); public UserRegistrationForm(final String componentName) { super(componentName); // Attach textfield components that edit properties map model add(new TextField(firstName, new PropertyModel(properties, firstName))); add(new TextField(lastName, new PropertyModel(properties, lastName))); add( new TextField( loginName, new PropertyModel(properties, loginName))); add(new TextField(emailAddress, new PropertyModel(properties, emailAddress))); add(new PasswordTextField(password, new PropertyModel(properties, password))); add(new PasswordTextField(confirmPassword, new PropertyModel(properties, confirmPassword))); } public final void onSubmit() { System.out.println( onSubmit() ); String firstName = properties.getString(firstName); String lastName = properties.getString(lastName); String loginName = properties.getString( loginName ); String emailAddress = properties.getString(emailAddress); String password = properties.getString(password); String confirmPassword = properties.getString(confirmPassword); // create and persist user object using the details we // received... QGenericUserAccount userAccount = new UserAccountImpl(); userAccount.setLoginName( loginName ); userAccount.setPassword( passwordEncoder.encode(password)); userService.createAllAccounts(userAccount); } } } *** END JAVA CODE *** and here is the relevant stuff from the log. FWIW, I get this for every one of the above properties, but am only posting this log snippet since the others are all the same. *** BEGIN LOG / STACKTRACE *** 2007-09-24 21:55:13,890 DEBUG [wicket.Page] Rendered [MarkupContainer [Component id = lastName, page = org.openqabal.web.registration.UserRegistration1, path = 0:userForm:lastName.TextField, isVisible = true, isVersioned = false]] 2007-09-24 21:55:13,890 DEBUG [wicket.Component] End render