Re: Validate, Navigate Wizards
Hi, sometimes the world is easy! Thanks for your support. Thinking in Wicket means, to think easier :-D For other readers, to get the right required validation message at the feebackPanel an entry has to written into the Wizard's property file. e.g. group.Required=My message on the feebackpanel... So, the thread could be closed :clap: Matthias Keller wrote: Hi If you only want to require that a radio button is selected, then myRadioGroup.setRequired(true) already does that job. No need to implement a custom form validator then. BTW: RequiredTextField is nothing other than a TextField which calls setRequired(true) in the constructor.. It's only here for convenience since it is used very often. so, .setRequired(true) is your friend as long as you only want to check if a radio button has been selected. Matt jackkilian wrote: Hi, my intention is to check if special mandatory fields are filled. What I found in the examples is the RequiredTextField... within the Wicket lib. I use a RadioBtnGroup with RadioBtn's, the user has to select one! Thats all what I validate. But no matter, with your hint I can solve that problem. Maybe I implement an own RadioBtnGroup-Komponent who can check this in general, like the RequiredTextField... :-) regards - jk Matthias Keller wrote: Hi Just one note - I just had another look at our FormValidator class - you might wonder why you won't find the method error (FormComponent fc, String resourceKey) provided in my example. The reason is, we wrapped this to provide a direct access to localized error messages in our custom FormValidator: /** * Reports an error against the validatable using the given literal resource key. This means, no * class prefix is prepended to the resource key. * * @param fc form component against which the error is reported * @param resourceKey The resource key to use */ @Override public void error (FormComponent fc, String resourceKey) { fc.error(fc.getLocalizer().getString(resourceKey, fc)); } Just calling error (Serializable message) inside your form validator implementation will of course report the error against the FormValidator and not the failing component. So make sure you callmyTextFieldThatFailed.error(...) instead of error(...) The Wizard will later test, if all contained components were successful and only advance if none of them had its FormComponent.error() method invoked. Good luck Matt jackkilian wrote: Hi Matthias, thanks! I used error(), but the wizard didn't stop. I will check it, maybe I use a ref-Object to call error(). regards - jk Matthias Keller wrote: wolfgang.sch...@dachser.com wrote: Hi, when I validate the data of a WizardStep after pressing Next, I navigate within the validate method to the WizardStep.previous() step in the false case. Works fine! But calling the method WizardStep.previous() works not for the first Wizard step. That's ok, there is no previous one. But how can I do it right? Hi Not sure why you even want to call next or previous at all manually? I'm using 1.3.5 so that may make a difference but we're just adding validators to the WizardStep which takes care of everything. We never have to manually call previous() or next() ? We're just doing: add(new FormValidator() { public FormComponent[] getDependentFormComponents() { return new FormComponent[] { radioGroup, checkbox }; } public void validate (Form form) { if (isSelected(radioGroup, radio1)) { if (isChecked(checkbox)) { error(checkbox, our.error); } } } }); Note that FormValidator is our implementation of AbstractFormValidator which is just there to provide some helper methods like the isSelected() and isChecked() plus some optimizations. Now when the error() is called, the wizard won't go to the next step. Matt -- matthias.kel...@ergon.ch +41 44 268 83 98 Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich http://www.ergon.ch __ e r g o nsmart people - smart software Ergon ist im Final für den Fairnesspreis 2009 - Online-Abstimmung bis 6. Mai 2009 unter www.fairnesspreis.ch -- matthias.kel...@ergon.ch +41 44 268 83 98 Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich http://www.ergon.ch __ e r g o nsmart people - smart software Ergon ist im Final für den Fairnesspreis 2009 - Online-Abstimmung bis 6. Mai 2009 unter www.fairnesspreis.ch -- matthias.kel...@ergon.ch +41 44 268 83 98 Ergon
Like to override normal page mapping but setResponsePage(...) is final
Chaps, We have a requirement to customize certain pages depending on the installation. My approach is to subclass the pages needing customization and put the difference in the subclass. Then a bit of installation specific config overrides the normal destination page and returns a different one. This seems an OK approach (other approaches happily received) but requires that I be able to intercept calls to the original page with calls to the subclassed version. I was going to implement a subclass of RequestCycle to lookup the requested page and use the subclass if my configuration specifies one. That way there is no change needed in the rest of the application when we decide to use a modified page. new WebRequestCycle(this, (WebRequest)request, (WebResponse)response){ public C extends Page void setResponsePage(final ClassC pageClass, final PageParameters pageParameters, final String pageMapName) { // finds configured alternative or returns same pageClass if nothing // configured for this page. ClassC altClass = getPageFactory().getPage(pageClass); super.setResponsePage( altClass, pageParameters, pageMapName); } }; Unfortunately, setResponsePage(...) is final so I cant. This makes me think I am approaching this wrong as whenever I find I am blocked doing something in Wicket it's usually because I am going the wrong way. I'm using 1.4RC2. Can anyone offer an alternative for me please. Cheers - Steve - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Automatically adding a parameter to every link?
the most authorative might be the javadoc in the code: http://fisheye6.atlassian.com/browse/wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/IPageSettings.java?r=768578#l53 mf Am 05.05.2009 um 00:25 schrieb Eyal Golan: In short, what does it mean exactly Multi Window Support ? Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary On Mon, May 4, 2009 at 1:06 PM, Martin Funk mafulaf...@googlemail.comwrote: maybe automatic multi window support might help you this can be turned on like this in the init method of your Application. /** * @see org.apache.wicket.protocol.http.WebApplication#init() */ @Override protected void init() { super.init(); getPageSettings().setAutomaticMultiWindowSupport(true); } mf Am 03.05.2009 um 15:00 schrieb Matthew Welch: The data in the application that I'm working on is divided in any number of different contexts. The pages displayed for each context are the same but the data shown on those pages will be different depending on the specific context. A logged in user might might have multiple pages (browser windows) open at one time from any one of these contexts, otherwise I would store the context in their session. As it stands I need to pass the context around from page to page as a parameter. Is there an easy way to have this parameter automatically appended to all links on page as they are rendered or generated? I suppose I could build my own set of Link components that look for the existing context of a page and append that to themselves, and use those links instead of the built in ones. Any other options? -Matt - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Putting HTML files in src/main/webapp
On 05/05/2009, at 1:28 AM, Alan Garfield wrote: The hack I have with maven at the moment properly constructs the war by copying all the .html files into the classes folder for Wicket to find... What 'hack' do you need for Maven to include the HTML in the classes directory? Presumably, since most other Wicket developers have their HTML alongside their classes, they need this hack as well right? It's just standard maven building: Add this to your POM to add everything except the Java source, as is. It's even in the Maven quickstart: build resources resource filteringfalse/filtering directory${basedir}/src/java/directory includes include**/include /includes excludes exclude**/*.java/exclude /excludes /resource /resources /build Nonetheless, the first result from a search for wicket html location (Safari even autofilled the last word for me) I found this: http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html Steve smime.p7s Description: S/MIME cryptographic signature
yui slider component does not work
Hello, I have downloaded the yui-examples-1.4-20090427.160726-141.war file. The sliders cannot be moved with the mouse and rather behave static. Moreover, the javascript error yahoo.widget.slider is null is reported. It seems that some js files are missing. Is there a workaround/update? Best regards, Christoph
Why the ModalWindow isn't getting closed?
Hey, I have a ModalWindow with an Ajaxified form. Upon a successful submitting, a data table in the original panel that caused the modalwindow to be appeared is getting updated. The problem is the close button of the ModalWindow is not working, I mean the window isn't getting shut down. editContactModal.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() { @Override public boolean onCloseButtonClicked(AjaxRequestTarget target) { return true; } }); Any idea what is going wrong? Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Putting HTML files in src/main/webapp
Separates the code from the templates so the designers don't have to checkout the whole project, also keeps all the content in one directory. Even though they are dynamic template files for wicket there is a certain amount of static stuff that would be nice to be in one place. If you simply want to separate the file types, you can separate the *.html files into the src/main/resources directory. That separates the Java code from the HTML templates, it gives you a completely separate directory tree for the *.html files and it keeps all the html content in one directory. In addition, it is standard Maven practice to separate non-Java files into the src/main/resources directory. All standard Maven builds should work just fine. Additionally, under Netbeans it seems to me to be rather daft that there is a folder is called Web Pages in the project view but all it contains is image/binary files and the WEB-INF directory. Just a little background, by definition, Wicket defines a non-traditional web application structure. It intentionally avoids the use of the web page directory structure you are likely used to. It turns out that to do what you are asking, you are actually fighting both Wicket and Maven. Traditional HTML and JSP pages can be visited directly - but not so with Wicket html files. They are read in from the classpath and much more tightly bound to an actual Java class. Trying to fit your Wicket app into a traditional structure can be done ... but it is not standard Wicket practice and you're going to end up with custom configuration that you'll have to manage. But the actual HTML files end up in the Source Packages or worse Other Sources folder. I understand the reasons for putting them in the source packages directories but it's not an ideal solution to my mind and my team. That is fair. If you're simply after your aforementioned points, try dropping the *.html files into src/main/resources. -Luther
IE7 and file upload inside a wizard
Hi. Im having some problems with IE 7 and the UploadProgressBar in a Wizard. It seems to have some limits in my special case. Inside my WizardStep constuctor I have this code: public class MyWizardStep(SomeValues){ super(SomeValues); setOutputMarkupId(true); FormString uploadForm = new FormString(uploadForm); uploadForm.setMultiPart(true); add(uploadForm); FileUploadField fileUploadField = new FileUploadField(filefield, new ModelFileUpload()); uploadForm.add(mFileUploadField); uploadForm.add(new UploadProgressBar(progress, uploadForm)); SubmitLink uploadlink = new SubmitLink(uploadButton) { @Override public void onSubmit() { System.out.println(onSubmit runs); } }; uploadForm.add(uploadlink); } And the markup... form wicket:id=uploadForm div div class=floatclass wicket:message key=payablefile.filefile/wicket:message /div div class=floatclass input wicket:id=filefield type=file/ /div div class=floatclass div class=mybutton onmouseout=this.className='submitbutton' onmouseover=this.className='submitbutton_hover' wicket:id=uploadButtonUpload/div /div div class=clearfloat/ /div div div div wicket:id=progressajax upload progressbar/div /div div class=clearfloat/ /div /form Works fine i firefox but it does not work in IE 7. I get a javascript error (object property or method is not supported) and the submit wont run. I have noticed 1. If I remove the UploadProgressBar it starts to work. 2. I can also change the upload button to and input type=submit and keep the UploadProgressBar and then it will work. 3. If I add above code to a ordenary page(not nested form as in the wizard) it will also work. It seems the wicket file upload example(as in http://www.wicketstuff.org/wicket13/upload/single) wont work inside a wizard for IE 7. Does anyone have any comment on this. Have I missed something? Jens Alenius - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
XmlPullParser error checking attributes
I've got the following exception: Caused by: java.text.ParseException: Same attribute found twice: url at org.apache.wicket.markup.parser.XmlPullParser.parseTagText(XmlPullParser.java:636) when the markup contains an object tag with a JSON encoded into param tag: object id=player_api height=100% width=100% type=application/x-shockwave-flash data=ref/app/js/swf/flowplayer-3.1.0.swf?0.8721899861018372 param value=true name=allowFullScreen/ param value=config={playerId:player,clip:{url: http://blip.tv/file/get/KimAronson-TwentySeconds73213.flv },playlist:[{url: http://blip.tv/file/get/KimAronson-TwentySeconds73213.flv}]}; name=flashvars/ /object Is it a normal behaviour? Thanks! Alex
Re: Putting HTML files in src/main/webapp
On Tue, 2009-05-05 at 03:03 -0500, Luther Baker wrote: Separates the code from the templates so the designers don't have to checkout the whole project, also keeps all the content in one directory. Even though they are dynamic template files for wicket there is a certain amount of static stuff that would be nice to be in one place. If you simply want to separate the file types, you can separate the *.html files into the src/main/resources directory. That separates the Java code from the HTML templates, it gives you a completely separate directory tree for the *.html files and it keeps all the html content in one directory. In addition, it is standard Maven practice to separate non-Java files into the src/main/resources directory. All standard Maven builds should work just fine. Thanks that's pretty much where I've ended up. Additionally, under Netbeans it seems to me to be rather daft that there is a folder is called Web Pages in the project view but all it contains is image/binary files and the WEB-INF directory. Just a little background, by definition, Wicket defines a non-traditional web application structure. It intentionally avoids the use of the web page directory structure you are likely used to. It turns out that to do what you are asking, you are actually fighting both Wicket and Maven. Traditional HTML and JSP pages can be visited directly - but not so with Wicket html files. They are read in from the classpath and much more tightly bound to an actual Java class. Trying to fit your Wicket app into a traditional structure can be done ... but it is not standard Wicket practice and you're going to end up with custom configuration that you'll have to manage. Thanks for the explanation, that makes sense to me now. You should probably add something like this to the wiki as I couldn't find a really good reason and the examples where a little light. But the actual HTML files end up in the Source Packages or worse Other Sources folder. I understand the reasons for putting them in the source packages directories but it's not an ideal solution to my mind and my team. That is fair. If you're simply after your aforementioned points, try dropping the *.html files into src/main/resources. Thanks, it does seem a little silly to me as far as Netbeans is concerned (also the million directories that might be needed to handle com.foo.bar.web.pages.panels etc), but less than it did after your explanation. It'll be fine with the files being in Other Sources/resources. Many thanks Luther! Alan. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Wicket SWFObject
check this http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html El lun, 04-05-2009 a las 22:54 -0700, Douglas Ferguson escribió: I just figured out that the deal is that SWFObject doesn't like to be set visible false on page load then visible true via Ajax. Any thoughts on how to get around this? D/ -Original Message- From: Douglas Ferguson [mailto:doug...@douglasferguson.us] Sent: Tuesday, May 05, 2009 12:20 AM To: users@wicket.apache.org Subject: Wicket SWFObject Has anybody successfully got SWFObject to work on a wicket page? Douglas - 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
Try adding a selectoption in you 'backingbean'. The Dropdown choice want to 'bind' it self to the same type of property in the model as in the List that you fill it with. If you use the generics on the dropdown it will be much clearer. Jens Alenius Juha Palomäki wrote: I think the exception org.apache.wicket.WicketRuntimeException: No get method defined for class: class java.lang.String expression: id means that Wicket is looking for the getId() method from String, not from your own SelectOption. Br, Juha On Tue, May 5, 2009 at 4:48 AM, 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 -- View this message in context: http://www.nabble.com/DropDownChoice-with-ChoiceRender-problem-tp23374394p23385127.html Sent from the Wicket - User 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: Why the ModalWindow isn't getting closed?
Seems like you are using the wrong approach to this, did you see the examples on how it's working? 2009/5/5 HHB hubaghd...@yahoo.ca: Hey, I have a ModalWindow with an Ajaxified form. Upon a successful submitting, a data table in the original panel that caused the modalwindow to be appeared is getting updated. The problem is the close button of the ModalWindow is not working, I mean the window isn't getting shut down. editContactModal.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() { @Override public boolean onCloseButtonClicked(AjaxRequestTarget target) { return true; } }); Any idea what is going wrong? 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: 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
Re: css and dreamweaver problem
Make a custom resource locator? http://www.mkyong.com/wicket/how-do-change-the-html-file-location-wicket/ 2009/5/3 Anantha Kumaran ananthakuma...@gmail.com: hi I am using netbeans and dreamweaver to develop my wicket app The problem is dreamweaver expects the stylesheets and the html in the same folder . But in wicket app the stylesheets will be in web folder and the html files will be in pakage along with the java file Is there anyway to fix this by change any setting in dreamweaver.. currently i am keeping a copy of all files in the web folder in the package for preview.But it is annoying as i have to copy the file to web folder everytime when i change something using dreamweaver.. Thanks Anantha Kumaran - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Tomcat Publishing and Hot-Swapping with Wicket (solved)
I like these kind of monologs, I often do them myself also known as parrot talks :) We both need to remember not to do them too often, if too often then we end up in a room with soft walls :) regards Nino 2009/5/4 Kaspar Fischer fisch...@inf.ethz.ch: I intended to post the following questions but found the answer myself, finally. I post it anyway in the hope that it helps others. Kaspar Fischer almost posted the following: My app takes quite some time to start up, so I don't want changes to my Wicket HTML or Wicket Java files to cause Tomcat to completely reload the web app. Is it (at all) possible that only the changed Wicket HTML/Java/.properties file get reloaded and the rest (Spring beans, etc.) stays? Yes. It is working for HTML, Java, and .properties files under Eclipse with WTP and Tomcat. I am a little confused about the terms used in this context. Here's how I see; please correct me if I am wrong. - Hotswapping means replacing a given class implementation with another one. - Publishing (as seen in the server configuration panel in Eclipse when clicking on a Tomcat server in the Servers view) means shutting a webapp down and restarting it, hithout actually shutting Tomcat down. I can't answer myself on this. But I guess it's more or less fine ;-) There is also an option Update context paths in the Tomcat Server configuration panel (under Publishing). Is it related? It is checked in my set up but I don't know whether it is related. Finally, *how* can I get Tomcat/Eclipse/Wicket to only reload Wicket HTML/Java/.properties files that changed? In particular, I am unsure whether I have to: - Debug instead of Run the server (i.e., click Debug in the Eclipse Servers view)? With Debug it works. - Should the server have Automatically publish when resources change selected (in the server's configuration panel in Eclipse)? I have this checkbox checked. - What Tomcat Context configuration must I use? I currently have something like: Context docBase=myproject path=/myproject reloadable=true source=org.eclipse.jst.j2ee.server:myproject/ This works for me. - In the server's configuration panel, in tab Modules, should I check Auto reloading enabled? No. Otherwise Tomcat reloads the *whole* webapp. I know that Wicket must be running in development mode. I think so, too ;-) Many thanks for any pointers and sharing your settings! Kaspar, you're welcome. Kaspar - 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: Putting HTML files in src/main/webapp
Ok, if you really want to do this and you don't want to use src/main/resources, have you checked out: http://wicketstuff.org/wicket13/customresourceloading/ That has some code examples on how to load html templates from the document root. That might help you. On Mon, May 4, 2009 at 9:31 PM, Alan Garfield a...@fromorbit.com wrote: On Mon, 2009-05-04 at 21:07 -0400, James Carman wrote: What's the justification of having them in src/main/webapp again? Separates the code from the templates so the designers don't have to checkout the whole project, also keeps all the content in one directory. Even though they are dynamic template files for wicket there is a certain amount of static stuff that would be nice to be in one place. Additionally, under Netbeans it seems to me to be rather daft that there is a folder is called Web Pages in the project view but all it contains is image/binary files and the WEB-INF directory. But the actual HTML files end up in the Source Packages or worse Other Sources folder. I understand the reasons for putting them in the source packages directories but it's not an ideal solution to my mind and my team. Looking at the debug from org.apache.wicket.util.resource it looks like Wicket already looks for all and sundry anyway. How do I make it look in the webroot? Thanks, Alan. - 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: Putting HTML files in src/main/webapp
Alan, The fragment of XML from the pom that I posted IS in the Wicket Quickstart generated via mvn archetype:generate. It's also in the pom when you use the helper code available here: http://wicket.apache.org/quickstart.html Hence why it's not a hack, it's standard Maven stuff. You don't need the maven war plugin to generate the default war either. However, since you are doing it in a non standard way then you'll need the maven war plugin to assemble your war in the way you want. You said this: Thanks for that, but that's not really my issue. How do I make Wicket find the .html files in the root of the war? So I gave you a link to do that. Since your HTML files will now be in a non standard location (ie not next to the classes) you will need to configure your app to look in the location you desire, and that information is available in the wiki link I posted: http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html All of this information is readily available; first search item for the configuration, quickstart for pom. Steve On 5 May 2009, at 10:11, Alan Garfield wrote: On Tue, 2009-05-05 at 08:32 +0100, Steve Swinsburg wrote: On 05/05/2009, at 1:28 AM, Alan Garfield wrote: The hack I have with maven at the moment properly constructs the war by copying all the .html files into the classes folder for Wicket to find... What 'hack' do you need for Maven to include the HTML in the classes directory? Presumably, since most other Wicket developers have their HTML alongside their classes, they need this hack as well right? It's just standard maven building: I didn't want to start a religious argument. I don't want to ruffle anyone's feathers. I didn't mean hack as a bad thing, I meant that I added a resource directive to Maven (ala below) to include the HTML from the webapp directory and it helpfully copied it twice as part of the war plugin. Without this change to the default wicket-quickstart POM Wicket still wouldn't find them. That was all I meant, hack was probably the wrong word and I apologies if I upset anyone. At the same time, why attack me when all I asked was a simple question I couldn't find the answer to elsewhere. Add this to your POM to add everything except the Java source, as is. It's even in the Maven quickstart: build resources resource filteringfalse/filtering directory${basedir}/src/java/directory includes include**/include /includes excludes exclude**/*.java/exclude /excludes /resource /resources /build Nonetheless, the first result from a search for wicket html location (Safari even autofilled the last word for me) I found this: http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html Thanks Steve for the added condescending tone there, but above isn't shown in the wiki you just posted (I also looked at that before posting, I even attempted to use the non-maven partitioning method but without much documentation on the PathStripperLocator and a working example I got lost). I posted here as a last resort to my question and wasn't looking to be verbally beaten up because I asked a question that might be outside the norm. Thanks anyway, Alan. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org smime.p7s Description: S/MIME cryptographic signature
Re: Putting HTML files in src/main/webapp
On Tue, 2009-05-05 at 07:23 -0400, James Carman wrote: Ok, if you really want to do this and you don't want to use src/main/resources, have you checked out: http://wicketstuff.org/wicket13/customresourceloading/ That has some code examples on how to load html templates from the document root. That might help you. Thanks for that. I only just found that by chance in Google a few minutes ago. Although upon my response from Luther I think I'll stick with the files being in the resources directory. It's the least amount of change (eg. none) and it suits my purposes fully. Many thanks again, Alan. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Putting HTML files in src/main/webapp
To make Luther's point more explicit: Wicket allows you to bundle everything a Wicket component needs (Java code, HTML, CSS, images, etc.) into a single JAR and drop that JAR into the WEB-INF/lib directory of any WAR, thereby making the JAR essentially self-contained and reusable. The benefit this provides is the ability to truly componentize (or modularize) your web application. You can break a large project up into modules that become separate JAR Maven projects. Or you can break out reusable components into separate JAR Maven projects that get reused in different web applications. You can't take advantage of that if you put the resources in the root of WAR. -Richard On Tue, May 5, 2009 at 4:03 AM, Luther Baker lutherba...@gmail.com wrote: Separates the code from the templates so the designers don't have to checkout the whole project, also keeps all the content in one directory. Even though they are dynamic template files for wicket there is a certain amount of static stuff that would be nice to be in one place. If you simply want to separate the file types, you can separate the *.html files into the src/main/resources directory. That separates the Java code from the HTML templates, it gives you a completely separate directory tree for the *.html files and it keeps all the html content in one directory. In addition, it is standard Maven practice to separate non-Java files into the src/main/resources directory. All standard Maven builds should work just fine. Additionally, under Netbeans it seems to me to be rather daft that there is a folder is called Web Pages in the project view but all it contains is image/binary files and the WEB-INF directory. Just a little background, by definition, Wicket defines a non-traditional web application structure. It intentionally avoids the use of the web page directory structure you are likely used to. It turns out that to do what you are asking, you are actually fighting both Wicket and Maven. Traditional HTML and JSP pages can be visited directly - but not so with Wicket html files. They are read in from the classpath and much more tightly bound to an actual Java class. Trying to fit your Wicket app into a traditional structure can be done ... but it is not standard Wicket practice and you're going to end up with custom configuration that you'll have to manage. But the actual HTML files end up in the Source Packages or worse Other Sources folder. I understand the reasons for putting them in the source packages directories but it's not an ideal solution to my mind and my team. That is fair. If you're simply after your aforementioned points, try dropping the *.html files into src/main/resources. -Luther
Re: Putting HTML files in src/main/webapp
On Tue, 2009-05-05 at 12:33 +0100, Steve Swinsburg wrote: Alan, The fragment of XML from the pom that I posted IS in the Wicket Quickstart generated via mvn archetype:generate. It's also in the pom when you use the helper code available here: http://wicket.apache.org/quickstart.html Hence why it's not a hack, it's standard Maven stuff. You don't need the maven war plugin to generate the default war either. Indeed, but if you read my original post fully I wasn't asking about the resources folder or the standard way, I was wanting them in the webapp folder which with the default quickstart wicket pom doesn't work. And I quote myself Thanks for that, but that's not really my issue. How do I make Wicket find the .html files in the __root of the war__? The hack I have with maven at the moment properly constructs the war by copying all the .html files into the classes folder for Wicket to find, but maven also helpfully copies them into __the war's root__ as well creating duplicates in the war. As you can see my hack comment wasn't talking about a standard structure hence my use of the word. My changed directory structure was the hack. You read hack and completely missed my question for something else. However, since you are doing it in a non standard way then you'll need the maven war plugin to assemble your war in the way you want. Indeed! Which was the reason for my original question. The war-plugin helpfully copies the contents of the webapp directory into the war, BUT if you also declare the resources as per the XML fragment to point at the webapp dir, then maven will copy the html files twice. Once into the classes directory structure as needed by Wicket and once into the webroot of the war as per the defaults of the war-plugin. That was my question, how do I stop maven (further the war-plugin) or how do you change the way Wicket loads the HTML so that I don't end up with two copies of the same files in the war. I may not have structure my question properly because I'm not fully versed with maven or wicket so you must excuse my inexperience. You said this: Thanks for that, but that's not really my issue. How do I make Wicket find the .html files in the root of the war? So I gave you a link to do that. Since your HTML files will now be in a non standard location (ie not next to the classes) you will need to configure your app to look in the location you desire, and that information is available in the wiki link I posted: http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html Again, I even posted that exact same link you quoted in the email you responded to! All of this information is readily available; first search item for the configuration, quickstart for pom. Well I must be not looking right, because it wasn't really apparent to me. I'm going to go with Luther's suggestion and use the default resources folder to make what I need to happen happen. That way there is no messing about with modifications to Wicket and no clumsy fiddling with maven to move files into and out of weird directory structures. Thanks anyway, Alan. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Putting HTML files in src/main/webapp
On Tue, 2009-05-05 at 08:26 -0400, Richard Allen wrote: To make Luther's point more explicit: Wicket allows you to bundle everything a Wicket component needs (Java code, HTML, CSS, images, etc.) into a single JAR and drop that JAR into the WEB-INF/lib directory of any WAR, thereby making the JAR essentially self-contained and reusable. The benefit this provides is the ability to truly componentize (or modularize) your web application. You can break a large project up into modules that become separate JAR Maven projects. Or you can break out reusable components into separate JAR Maven projects that get reused in different web applications. You can't take advantage of that if you put the resources in the root of WAR. Thanks Richard, that really needs to be in the wiki somewhere. It's clear and makes the advantages obvious. Previous to my question it all appeared to be just for the sake of ease, but now it's rather apparent why it is the way it is. I've read many sites/tutorials/mailing list archives and the Wicket in Action book but it never was really explained that well. Some even have their own differing confusing opinions and variations. But then again maybe I just wasn't looking right. Regards, Alan. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to append JavaScript to a link?
Hey, The last cell in a data table is a link (that is contained in a form) that will delete the row. How to append JavaScript code that will display a confirmation dialog? Thanks for help and time. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Putting HTML files in src/main/webapp
Ok glad you got it sorted. For reference, you can adjust the excludes/includes in the build section of the POM to exclude the HTML files from being added. Then use the maven-war-plugin to take control of what goes where. cheers, Steve On 5 May 2009, at 13:52, Alan Garfield wrote: On Tue, 2009-05-05 at 12:33 +0100, Steve Swinsburg wrote: Alan, The fragment of XML from the pom that I posted IS in the Wicket Quickstart generated via mvn archetype:generate. It's also in the pom when you use the helper code available here: http://wicket.apache.org/quickstart.html Hence why it's not a hack, it's standard Maven stuff. You don't need the maven war plugin to generate the default war either. Indeed, but if you read my original post fully I wasn't asking about the resources folder or the standard way, I was wanting them in the webapp folder which with the default quickstart wicket pom doesn't work. And I quote myself Thanks for that, but that's not really my issue. How do I make Wicket find the .html files in the __root of the war__? The hack I have with maven at the moment properly constructs the war by copying all the .html files into the classes folder for Wicket to find, but maven also helpfully copies them into __the war's root__ as well creating duplicates in the war. As you can see my hack comment wasn't talking about a standard structure hence my use of the word. My changed directory structure was the hack. You read hack and completely missed my question for something else. However, since you are doing it in a non standard way then you'll need the maven war plugin to assemble your war in the way you want. Indeed! Which was the reason for my original question. The war-plugin helpfully copies the contents of the webapp directory into the war, BUT if you also declare the resources as per the XML fragment to point at the webapp dir, then maven will copy the html files twice. Once into the classes directory structure as needed by Wicket and once into the webroot of the war as per the defaults of the war-plugin. That was my question, how do I stop maven (further the war-plugin) or how do you change the way Wicket loads the HTML so that I don't end up with two copies of the same files in the war. I may not have structure my question properly because I'm not fully versed with maven or wicket so you must excuse my inexperience. You said this: Thanks for that, but that's not really my issue. How do I make Wicket find the .html files in the root of the war? So I gave you a link to do that. Since your HTML files will now be in a non standard location (ie not next to the classes) you will need to configure your app to look in the location you desire, and that information is available in the wiki link I posted: http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html Again, I even posted that exact same link you quoted in the email you responded to! All of this information is readily available; first search item for the configuration, quickstart for pom. Well I must be not looking right, because it wasn't really apparent to me. I'm going to go with Luther's suggestion and use the default resources folder to make what I need to happen happen. That way there is no messing about with modifications to Wicket and no clumsy fiddling with maven to move files into and out of weird directory structures. Thanks anyway, Alan. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org smime.p7s Description: S/MIME cryptographic signature
Re: How to append JavaScript to a link?
I would not use javascript direct. Use wickets Ajax components instead. I would use a AjaxLink and a wicket Modal Window. The modal window would then contain the message and Ok and Cancel button. Jens HHB wrote: Hey, The last cell in a data table is a link (that is contained in a form) that will delete the row. How to append JavaScript code that will display a confirmation dialog? Thanks for help and time. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/How-to-append-JavaScript-to-a-link--tp23387242p23387452.html Sent from the Wicket - User 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: How to append JavaScript to a link?
deleteButton.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');)); HHB wrote: Hey, The last cell in a data table is a link (that is contained in a form) that will delete the row. How to append JavaScript code that will display a confirmation dialog? Thanks for help and time. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.325 / Virus Database: 270.12.18/2096 - Release Date: 05/04/09 17:51:00 - 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
Re: Tomcat Publishing and Hot-Swapping with Wicket (solved)
I often talk to myself - sometimes it's the most intelligent conversation I can find (really? so do I!) On Tue, May 5, 2009 at 7:23 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: I like these kind of monologs, I often do them myself also known as parrot talks :) We both need to remember not to do them too often, if too often then we end up in a room with soft walls :) regards Nino 2009/5/4 Kaspar Fischer fisch...@inf.ethz.ch: I intended to post the following questions but found the answer myself, finally. I post it anyway in the hope that it helps others. Kaspar Fischer almost posted the following: My app takes quite some time to start up, so I don't want changes to my Wicket HTML or Wicket Java files to cause Tomcat to completely reload the web app. Is it (at all) possible that only the changed Wicket HTML/Java/.properties file get reloaded and the rest (Spring beans, etc.) stays? Yes. It is working for HTML, Java, and .properties files under Eclipse with WTP and Tomcat. I am a little confused about the terms used in this context. Here's how I see; please correct me if I am wrong. - Hotswapping means replacing a given class implementation with another one. - Publishing (as seen in the server configuration panel in Eclipse when clicking on a Tomcat server in the Servers view) means shutting a webapp down and restarting it, hithout actually shutting Tomcat down. I can't answer myself on this. But I guess it's more or less fine ;-) There is also an option Update context paths in the Tomcat Server configuration panel (under Publishing). Is it related? It is checked in my set up but I don't know whether it is related. Finally, *how* can I get Tomcat/Eclipse/Wicket to only reload Wicket HTML/Java/.properties files that changed? In particular, I am unsure whether I have to: - Debug instead of Run the server (i.e., click Debug in the Eclipse Servers view)? With Debug it works. - Should the server have Automatically publish when resources change selected (in the server's configuration panel in Eclipse)? I have this checkbox checked. - What Tomcat Context configuration must I use? I currently have something like: Context docBase=myproject path=/myproject reloadable=true source=org.eclipse.jst.j2ee.server:myproject/ This works for me. - In the server's configuration panel, in tab Modules, should I check Auto reloading enabled? No. Otherwise Tomcat reloads the *whole* webapp. I know that Wicket must be running in development mode. I think so, too ;-) Many thanks for any pointers and sharing your settings! Kaspar, you're welcome. Kaspar - 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
encoding in html from
I'm using the wicket distribution for java 1.4 on a OC4J 10.1.3.3, When using a form, I'm having some encoding problems similar to the ones in the link below http://markmail.org/search/?q=wicket+encoding#query:wicket%20encoding+page:1+mid:ebuxlgb2vvu7x6oo+state:results Problem is, that for me changing to UTF-8 doesn't seem to help (nor any other encoding) ... Any ideas ?
Re: DropDownChoice with ChoiceRender problem
Why dont you let handicapaccess be of the type SelectOption. It will contain the getId and getName. So you can get the Y or Yes if you want to. You could ever rename selectoption to HandicapAccessBean to make it clearer. I have created a dropdownchoice that maps to an UUID in the Model instead of the DropDownChoice generic type and I can say I like it. Lets say that your working on a wizard. On the last confirm page you dont want to show Y as the selected handicappaccess. You want to show 'Yes'. That is easiest done by letting the model have the SelectOption as a member! Jens rhodebump 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? 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 -- View this message in context: http://www.nabble.com/DropDownChoice-with-ChoiceRender-problem-tp23374394p23389037.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail:
Re: Like to override normal page mapping but setResponsePage(...) is final
setResponsePage(MyApplicaton.getCustomizedPageXClass(), .., ..) -igor On Tue, May 5, 2009 at 12:15 AM, Steve Flasby st...@flasby.org wrote: Chaps, We have a requirement to customize certain pages depending on the installation. My approach is to subclass the pages needing customization and put the difference in the subclass. Then a bit of installation specific config overrides the normal destination page and returns a different one. This seems an OK approach (other approaches happily received) but requires that I be able to intercept calls to the original page with calls to the subclassed version. I was going to implement a subclass of RequestCycle to lookup the requested page and use the subclass if my configuration specifies one. That way there is no change needed in the rest of the application when we decide to use a modified page. new WebRequestCycle(this, (WebRequest)request, (WebResponse)response){ public C extends Page void setResponsePage(final ClassC pageClass, final PageParameters pageParameters, final String pageMapName) { // finds configured alternative or returns same pageClass if nothing // configured for this page. ClassC altClass = getPageFactory().getPage(pageClass); super.setResponsePage( altClass, pageParameters, pageMapName); } }; Unfortunately, setResponsePage(...) is final so I cant. This makes me think I am approaching this wrong as whenever I find I am blocked doing something in Wicket it's usually because I am going the wrong way. I'm using 1.4RC2. Can anyone offer an alternative for me please. Cheers - Steve - 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: XmlPullParser error checking attributes
that isnt really valid html... param value=config={playerId you should either have value in single quotes and use double quotes inside, or the other way around, or escape the double quotes inside. -igor On Tue, May 5, 2009 at 2:00 AM, Objelean Alex alex.objel...@gmail.com wrote: I've got the following exception: Caused by: java.text.ParseException: Same attribute found twice: url at org.apache.wicket.markup.parser.XmlPullParser.parseTagText(XmlPullParser.java:636) when the markup contains an object tag with a JSON encoded into param tag: object id=player_api height=100% width=100% type=application/x-shockwave-flash data=ref/app/js/swf/flowplayer-3.1.0.swf?0.8721899861018372 param value=true name=allowFullScreen/ param value=config={playerId:player,clip:{url: http://blip.tv/file/get/KimAronson-TwentySeconds73213.flv },playlist:[{url: http://blip.tv/file/get/KimAronson-TwentySeconds73213.flv}]}; name=flashvars/ /object Is it a normal behaviour? Thanks! Alex - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: CheckBoxMultipleChoice in two columns
use checkgroup and check components. -igor On Tue, May 5, 2009 at 3:00 AM, Serkan Camurcuoglu serkan.camurcuo...@telenity.com wrote: Hi all, I want to display the choices in a CheckBoxMultipleChoice component in two columns, like in a GridView. Currently the CheckBoxMultipleChoice generates an input element (checkbox), a label element for the checkbox and a br/ element (I'm using wicket 1.3.4). I want it to generate the choices in a table with two columns. If there are an odd number of choices, I want the last cell to be empty. Is there an easy way how I can achieve this? Best regards, SerkanC - 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: TreeTable and column issues
JulianS wrote: I ran into similar problems, and decided to take a different approach. See http://javathoughts.capesugarbird.com/2009/03/jquery-tree-table-for-wicket.html. Julian Thank you so much. It worked really great! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Automatically adding a parameter to every link?
thanks Martin. Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary On Tue, May 5, 2009 at 10:28 AM, Martin Funk mafulaf...@googlemail.comwrote: the most authorative might be the javadoc in the code: http://fisheye6.atlassian.com/browse/wicket/trunk/wicket/src/main/java/org/apache/wicket/settings/IPageSettings.java?r=768578#l53 mf Am 05.05.2009 um 00:25 schrieb Eyal Golan: In short, what does it mean exactly Multi Window Support ? Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary On Mon, May 4, 2009 at 1:06 PM, Martin Funk mafulaf...@googlemail.com wrote: maybe automatic multi window support might help you this can be turned on like this in the init method of your Application. /** * @see org.apache.wicket.protocol.http.WebApplication#init() */ @Override protected void init() { super.init(); getPageSettings().setAutomaticMultiWindowSupport(true); } mf Am 03.05.2009 um 15:00 schrieb Matthew Welch: The data in the application that I'm working on is divided in any number of different contexts. The pages displayed for each context are the same but the data shown on those pages will be different depending on the specific context. A logged in user might might have multiple pages (browser windows) open at one time from any one of these contexts, otherwise I would store the context in their session. As it stands I need to pass the context around from page to page as a parameter. Is there an easy way to have this parameter automatically appended to all links on page as they are rendered or generated? I suppose I could build my own set of Link components that look for the existing context of a page and append that to themselves, and use those links instead of the built in ones. Any other options? -Matt - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
DateTextField design issue
Hello, We use Wicket 1.3.5 and I found something annoying with the DateTextField. In the constructor of that class, the converter is created internally. If I want to use my own converter, I need to inherit DateTextField, add a converter as a member, and return it in the getConverter method. Why not have a protected method (that can be overridden) that returns the converter: Instead of: public DateTextField(String id, IModel model, String datePattern) { super(id, model, Date.class); this.datePattern = datePattern; *this.converter = new DateConverter() { private static final long serialVersionUID = 1L; /** * @see org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale) */ public DateFormat getDateFormat(Locale locale) { return new SimpleDateFormat(DateTextField.this.datePattern); } };* } Do something like: public DateTextField(String id, IModel model, String datePattern) { super(id, model, Date.class); this.datePattern = datePattern; *this.converter = newDateConverter();* } and protected newDateConverter() { return new DateConverter() { private static final long serialVersionUID = 1L; /** * @see org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale) */ public DateFormat getDateFormat(Locale locale) { return new SimpleDateFormat(DateTextField.this.datePattern); } }; } BTW, I know that we can also use the newConverterLocator() in our application. Do you think I should open a JIRA issue with 'wish' for that? Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary
Re: CheckBoxMultipleChoice in two columns
but I think checkgroup is for single selection only, am I wrong? Igor Vaynberg wrote: use checkgroup and check components. -igor On Tue, May 5, 2009 at 3:00 AM, Serkan Camurcuoglu serkan.camurcuo...@telenity.com wrote: Hi all, I want to display the choices in a CheckBoxMultipleChoice component in two columns, like in a GridView. Currently the CheckBoxMultipleChoice generates an input element (checkbox), a label element for the checkbox and a br/ element (I'm using wicket 1.3.4). I want it to generate the choices in a table with two columns. If there are an odd number of choices, I want the last cell to be empty. Is there an easy way how I can achieve this? Best regards, SerkanC - 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
On Tue, May 5, 2009 at 10:50 AM, jensiator jens.alen...@megasol.se wrote: Why dont you let handicapaccess be of the type SelectOption. It will contain the getId and getName. So you can get the Y or Yes if you want to. That would be muddying up your domain model to get the view to work. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
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
Re: confirm leave page when a page contains unsaved data
http://www.jroller.com/karthikg/entry/modelling_client_side_form_modifications http://www.jroller.com/karthikg/entry/modelling_client_side_form_modifications might be what you're looking for. It works well, but it works best when the behaviour is attached to the onbeforeunload event, which you can only do once. Consistently triggering the behaviour when using AJAX form submits can be tricky too. -- View this message in context: http://www.nabble.com/confirm-leave-page-when-a-page-contains-unsaved-data-tp23312432p23391789.html Sent from the Wicket - User 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
Example for FormComponentPanel/best-practice for reusable form-components
Hello, I want to use FormComponentPanels in forms to deal with more complex model-objects. I think it should be possible to chain the Model of every FormComponentPanel to the Model of the Form. So every FormComponent has automatically the right data in its Model when it changes. But somehow I am experiencing problems doing that. Is there any example using the FormComponentPanel-class? Do you have any (other) best-practices creating reusable FormComponents? Any help would be appreciated! :-) Best regards, Marc - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: CheckBoxMultipleChoice in two columns
you are wrong. -igor On Tue, May 5, 2009 at 9:52 AM, Serkan Camurcuoglu serkan.camurcuo...@telenity.com wrote: but I think checkgroup is for single selection only, am I wrong? Igor Vaynberg wrote: use checkgroup and check components. -igor On Tue, May 5, 2009 at 3:00 AM, Serkan Camurcuoglu serkan.camurcuo...@telenity.com wrote: Hi all, I want to display the choices in a CheckBoxMultipleChoice component in two columns, like in a GridView. Currently the CheckBoxMultipleChoice generates an input element (checkbox), a label element for the checkbox and a br/ element (I'm using wicket 1.3.4). I want it to generate the choices in a table with two columns. If there are an odd number of choices, I want the last cell to be empty. Is there an easy way how I can achieve this? Best regards, SerkanC - 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
Re: Example for FormComponentPanel/best-practice for reusable form-components
show us your code. -igor On Tue, May 5, 2009 at 10:04 AM, Marc Hauptmann hauptm...@ecmlabs.de wrote: Hello, I want to use FormComponentPanels in forms to deal with more complex model-objects. I think it should be possible to chain the Model of every FormComponentPanel to the Model of the Form. So every FormComponent has automatically the right data in its Model when it changes. But somehow I am experiencing problems doing that. Is there any example using the FormComponentPanel-class? Do you have any (other) best-practices creating reusable FormComponents? Any help would be appreciated! :-) Best regards, Marc - 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: CheckBoxMultipleChoice in two columns
sorry, I should have tried it before asking.. thanks a lot.. Igor Vaynberg wrote: you are wrong. -igor On Tue, May 5, 2009 at 9:52 AM, Serkan Camurcuoglu serkan.camurcuo...@telenity.com wrote: but I think checkgroup is for single selection only, am I wrong? Igor Vaynberg wrote: use checkgroup and check components. -igor On Tue, May 5, 2009 at 3:00 AM, Serkan Camurcuoglu serkan.camurcuo...@telenity.com wrote: Hi all, I want to display the choices in a CheckBoxMultipleChoice component in two columns, like in a GridView. Currently the CheckBoxMultipleChoice generates an input element (checkbox), a label element for the checkbox and a br/ element (I'm using wicket 1.3.4). I want it to generate the choices in a table with two columns. If there are an odd number of choices, I want the last cell to be empty. Is there an easy way how I can achieve this? Best regards, SerkanC - 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
Re: remember me at login page feature
Hello all. Previous answers did not helped me much. Though thanks authors for their replies. I am going to provide more detailed question: My App extends AuthenticatedWebApplication { And I want to implement auto-login/remember me feature. More precisely - when user submits to browser URL for some Wicket page (and user is not yet logged in) he should be able to see this page without seeing SignInPage (if he set at previous session remember me check box at SignInPage). I can't understand how can I achive that with the AuthenticatedWebApplication. How can I handle redirecting user to the SignInPage at org.apache.wicket.authentication;AuthenticatedWebApplication final method: onUnauthorizedInstantiation: ... public final void onUnauthorizedInstantiation(final Component component) { // If there is a sign in page class declared, and the unauthorized // component is a page, but it's not the sign in page if (component instanceof Page) { if (!AuthenticatedWebSession.get().isSignedIn()) { // Redirect to intercept page to let the user sign in throw new RestartResponseAtInterceptPageException(getSignInPageClass()); } else { onUnauthorizedPage((Page)component); } } else { // The component was not a page, so throw an exception throw new UnauthorizedInstantiationException(component.getClass()); } } ... As it is final I can't override the line: ... throw new RestartResponseAtInterceptPageException(getSignInPageClass()); ... to make setting SignInPage optional, depending on the cookie, and if cookie is given from remember me checkbox - than to authenticate user just by login retrieved from the cookie. And do not show SignInPage and do not do any redirectToInterceptPage. Thanks in advance! P.S. I think Wicket as a project requires more detailed and features-wide reference documentation. Khlystov Alexandr пишет: Good day. Can anyone, please, give an example, or direct wicket API description about remember me at login page feature. Thanks in advance. -- Khlystov Alexandr - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: remember me at login page feature
All you need to do is evaluate the cookie here: if (!AuthenticatedWebSession.get().isSignedIn()) Meaning that this should return TRUE if cookie is found. ** Martin 2009/5/5 Khlystov Alexandr a...@ovservice.org: Hello all. Previous answers did not helped me much. Though thanks authors for their replies. I am going to provide more detailed question: My App extends AuthenticatedWebApplication { And I want to implement auto-login/remember me feature. More precisely - when user submits to browser URL for some Wicket page (and user is not yet logged in) he should be able to see this page without seeing SignInPage (if he set at previous session remember me check box at SignInPage). I can't understand how can I achive that with the AuthenticatedWebApplication. How can I handle redirecting user to the SignInPage at org.apache.wicket.authentication;AuthenticatedWebApplication final method: onUnauthorizedInstantiation: ... public final void onUnauthorizedInstantiation(final Component component) { // If there is a sign in page class declared, and the unauthorized // component is a page, but it's not the sign in page if (component instanceof Page) { if (!AuthenticatedWebSession.get().isSignedIn()) { // Redirect to intercept page to let the user sign in throw new RestartResponseAtInterceptPageException(getSignInPageClass()); } else { onUnauthorizedPage((Page)component); } } else { // The component was not a page, so throw an exception throw new UnauthorizedInstantiationException(component.getClass()); } } ... As it is final I can't override the line: ... throw new RestartResponseAtInterceptPageException(getSignInPageClass()); ... to make setting SignInPage optional, depending on the cookie, and if cookie is given from remember me checkbox - than to authenticate user just by login retrieved from the cookie. And do not show SignInPage and do not do any redirectToInterceptPage. Thanks in advance! P.S. I think Wicket as a project requires more detailed and features-wide reference documentation. Khlystov Alexandr пишет: Good day. Can anyone, please, give an example, or direct wicket API description about remember me at login page feature. Thanks in advance. -- Khlystov Alexandr - 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: Example for FormComponentPanel/best-practice for reusable form-components
igor.vaynberg wrote: show us your code. Ok, I have a class 'Person' with an'Address-Property. My Form-object has a simple Model wrapping a Person-object. The constructor creating the Panel with the form contains these lines: form = new FormPerson(form, new ModelPerson()); personFormComponent = new PersonFormComponentStudent(personFormComponent, form.getModel()); addressFormComponent = new AddressFormComponentAddress(addressFormComponent, new PropertyModelAddress(this.form.getModel(), address)); form.add(personFormComponent); form.add(addressFormComponent); After creation of this Panel I call form.setModelObject(...). So the model ist not empty. The PersonFormComponent works well as it only sets some String-Properties of the Person-Object. But I have trouble with the AddressFormComponent which looks like this: public class AddressFormComponentT extends Address extends FormComponentPanelT { protected TextFieldString cityField, postcodeField, streetField; protected IModelT model; public AddressFormComponent(String id, IModelT model) { super(id, model); // Model this.model = model; // Straße streetField = new TextFieldString(streetField, new PropertyModelString(model, street)); streetField.setRequired(true); streetField.add(StringValidator.lengthBetween(0, 100)); // PLZ postcodeField = new TextFieldString(postcodeField, new ModelString()); postcodeField.setRequired(true); // Stadt cityField = new TextFieldString(cityField, new ModelString()); cityField.setRequired(true); cityField.add(StringValidator.lengthBetween(0, 50)); this.add(streetField); this.add(postcodeField); this.add(cityField); } } After submitting the whole form (with an AjaxButton) the Address-Property of my Person-Object ist null. Perhaps I did not use the Models correctly ...? -- View this message in context: http://www.nabble.com/Example-for-FormComponentPanel-best-practice-for-reusable-form-components-tp23391811p23393211.html Sent from the Wicket - User 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: Example for FormComponentPanel/best-practice for reusable form-components
a) you are not chaining the postcode and city models, so those values will never make it into anything b) so person.address is null? are you sure the person object you are giving to the form has a non-null address bean? if so i would set a modification breakpoint on the field and see where it is being set to null. -igor On Tue, May 5, 2009 at 11:22 AM, FlyingMustang hauptm...@ecmlabs.de wrote: igor.vaynberg wrote: show us your code. Ok, I have a class 'Person' with an'Address-Property. My Form-object has a simple Model wrapping a Person-object. The constructor creating the Panel with the form contains these lines: form = new FormPerson(form, new ModelPerson()); personFormComponent = new PersonFormComponentStudent(personFormComponent, form.getModel()); addressFormComponent = new AddressFormComponentAddress(addressFormComponent, new PropertyModelAddress(this.form.getModel(), address)); form.add(personFormComponent); form.add(addressFormComponent); After creation of this Panel I call form.setModelObject(...). So the model ist not empty. The PersonFormComponent works well as it only sets some String-Properties of the Person-Object. But I have trouble with the AddressFormComponent which looks like this: public class AddressFormComponentT extends Address extends FormComponentPanelT { protected TextFieldString cityField, postcodeField, streetField; protected IModelT model; public AddressFormComponent(String id, IModelT model) { super(id, model); // Model this.model = model; // Straße streetField = new TextFieldString(streetField, new PropertyModelString(model, street)); streetField.setRequired(true); streetField.add(StringValidator.lengthBetween(0, 100)); // PLZ postcodeField = new TextFieldString(postcodeField, new ModelString()); postcodeField.setRequired(true); // Stadt cityField = new TextFieldString(cityField, new ModelString()); cityField.setRequired(true); cityField.add(StringValidator.lengthBetween(0, 50)); this.add(streetField); this.add(postcodeField); this.add(cityField); } } After submitting the whole form (with an AjaxButton) the Address-Property of my Person-Object ist null. Perhaps I did not use the Models correctly ...? -- View this message in context: http://www.nabble.com/Example-for-FormComponentPanel-best-practice-for-reusable-form-components-tp23391811p23393211.html Sent from the Wicket - User 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: AjaxTabbedPanel, AjaxLazyLoadPanel and back button
I solved this problem turning off the browser's cache for this page. So I added the following override method and now it works just fine: @Override protected void configureResponse() { super.configureResponse(); final WebResponse response = getWebRequestCycle().getWebResponse(); response.setHeader(Cache-Control, no-cache, max-age=0, must-revalidate, no-store); } Please let me know if there is another (better) solution. Rodrigo On Tue, Apr 28, 2009 at 7:14 PM, Rodrigo De Castro rodr...@sacaluta.comwrote: Hey, I've been using AjaxTabbedPanel successfully, but ran into the following problem today: 1. Load page that has multiple tabs 2. Click on the second tab 3. Click on link on the tab panel that takes me to another page 4. Press back button It fails with the following error: WicketMessage: component tabpanel:mytabpanel:panel:general_workflow_panel:graph_container not found on page The container (graph_container) is an AjaxLazyLoadPanel. If I don't load it lazyly, it works fine. Is this a known bug? Or maybe I am not using AjaxLazyLoadPanel properly? Let me know if you need more information. AjaxLazyLoadPanel code: graphContainer = new AjaxLazyLoadPanel(graph_container) { @Override public Component getLazyLoadComponent(String markupId) { return new ChartPanel(markupId, new ChartModel()); } }; This is where the panel is inserted: div style=float: left; wicket:id=graph_container/div And panel (ChartPanel) html: wicket:panel div style=float: left; width: 650px; margin-top: 10px; wicket:id=graph_container img wicket:id=workflow_trend/img /div /wicket:panel Thanks, Rodrigo
Re: Example for FormComponentPanel/best-practice for reusable form-components
AddressFormComponent should extend Panel, not FormComponentPanel. FormComponentPanel is used for special cases where you have several FormComponents that work together to edit a model value, such as a date editor that has dropdowns for month and day. On a FormComponentPanel, you have to implement convertValue() to gather the input from your subcomponents, synthesize them into a single value, and call setConvertedValue(). Since you never call setConvertedValue(), your panel pushes null back into your address model. jk On Tue, May 05, 2009 at 11:22:44AM -0700, FlyingMustang wrote: igor.vaynberg wrote: show us your code. Ok, I have a class 'Person' with an'Address-Property. My Form-object has a simple Model wrapping a Person-object. The constructor creating the Panel with the form contains these lines: form = new FormPerson(form, new ModelPerson()); personFormComponent = new PersonFormComponentStudent(personFormComponent, form.getModel()); addressFormComponent = new AddressFormComponentAddress(addressFormComponent, new PropertyModelAddress(this.form.getModel(), address)); form.add(personFormComponent); form.add(addressFormComponent); After creation of this Panel I call form.setModelObject(...). So the model ist not empty. The PersonFormComponent works well as it only sets some String-Properties of the Person-Object. But I have trouble with the AddressFormComponent which looks like this: public class AddressFormComponentT extends Address extends FormComponentPanelT { protected TextFieldString cityField, postcodeField, streetField; protected IModelT model; public AddressFormComponent(String id, IModelT model) { super(id, model); // Model this.model = model; // Straße streetField = new TextFieldString(streetField, new PropertyModelString(model, street)); streetField.setRequired(true); streetField.add(StringValidator.lengthBetween(0, 100)); // PLZ postcodeField = new TextFieldString(postcodeField, new ModelString()); postcodeField.setRequired(true); // Stadt cityField = new TextFieldString(cityField, new ModelString()); cityField.setRequired(true); cityField.add(StringValidator.lengthBetween(0, 50)); this.add(streetField); this.add(postcodeField); this.add(cityField); } } After submitting the whole form (with an AjaxButton) the Address-Property of my Person-Object ist null. Perhaps I did not use the Models correctly ...? -- View this message in context: http://www.nabble.com/Example-for-FormComponentPanel-best-practice-for-reusable-form-components-tp23391811p23393211.html Sent from the Wicket - User 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
Access http headers?
I have a page that is built on a 3rd. party Flash movie, which reads a very ugly, remote XML file. It doesn't work correctly unless the URL I point to in the embed tag is absolute. This makes testing it locally a complete PITA. I'd like to put something in the page that tests the URL and redirects if it matches certain criteria - how can I access the HTTP headers to do this? Is there a better way? Thanks!
Re: Access http headers?
((webrequest)requestcycle.get().getrequest).gethttpservletrequest() -igor On Tue, May 5, 2009 at 12:54 PM, VGJ zambi...@gmail.com wrote: I have a page that is built on a 3rd. party Flash movie, which reads a very ugly, remote XML file. It doesn't work correctly unless the URL I point to in the embed tag is absolute. This makes testing it locally a complete PITA. I'd like to put something in the page that tests the URL and redirects if it matches certain criteria - how can I access the HTTP headers to do this? Is there a better way? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
unsubcribe
unsubscribe - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Example for FormComponentPanel/best-practice for reusable form-components
John Krasnay wrote: AddressFormComponent should extend Panel, not FormComponentPanel. Thank you for yout help! Now AddressFormComponent extends from Panel and fixed the wrong chainigs. I also asserted that the address is NOT null right before I submit the form in my test-case. But after submission I still get the following Exception: org.apache.wicket.WicketRuntimeException: Attempted to set property value on a null object. Property expression: street Value: Straße at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:125) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:169) at org.apache.wicket.Component.setDefaultModelObject(Component.java:3021) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1141) at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:223) at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:488) at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:467) at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:467) at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrder(FormComponent.java:439) at org.apache.wicket.markup.html.form.Form.internalUpdateFormComponentModels(Form.java:1970) at org.apache.wicket.markup.html.form.Form.updateFormComponentModels(Form.java:1938) at org.apache.wicket.markup.html.form.Form.process(Form.java:960) at org.apache.wicket.markup.html.form.Form.process(Form.java:908) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:876) -- View this message in context: http://www.nabble.com/Example-for-FormComponentPanel-best-practice-for-reusable-form-components-tp23391811p23395642.html Sent from the Wicket - User 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: Example for FormComponentPanel/best-practice for reusable form-components
create a quickstart and attach it to a jira issue -igor On Tue, May 5, 2009 at 1:47 PM, FlyingMustang hauptm...@ecmlabs.de wrote: John Krasnay wrote: AddressFormComponent should extend Panel, not FormComponentPanel. Thank you for yout help! Now AddressFormComponent extends from Panel and fixed the wrong chainigs. I also asserted that the address is NOT null right before I submit the form in my test-case. But after submission I still get the following Exception: org.apache.wicket.WicketRuntimeException: Attempted to set property value on a null object. Property expression: street Value: Straße at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:125) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:169) at org.apache.wicket.Component.setDefaultModelObject(Component.java:3021) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1141) at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:223) at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:488) at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:467) at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:467) at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrder(FormComponent.java:439) at org.apache.wicket.markup.html.form.Form.internalUpdateFormComponentModels(Form.java:1970) at org.apache.wicket.markup.html.form.Form.updateFormComponentModels(Form.java:1938) at org.apache.wicket.markup.html.form.Form.process(Form.java:960) at org.apache.wicket.markup.html.form.Form.process(Form.java:908) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:876) -- View this message in context: http://www.nabble.com/Example-for-FormComponentPanel-best-practice-for-reusable-form-components-tp23391811p23395642.html Sent from the Wicket - User 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: unsubcribe
Oh, the shame. My only excuse is that the drugs for a sickness were stronger than expected, and I shouldn't have been typing then (or now, likely.) My apologies nonetheless. -Clint On Tue, May 5, 2009 at 3:08 PM, Clint Popetz cpop...@gmail.com wrote: unsubscribe - 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: IE7 and file upload inside a wizard
I believe the docs say that fileupload won't work in an ajax environment. Wizards are ajax-based, right? On May 5, 2009 4:35 AM, Jens Alenius jens.alen...@megasol.se wrote: Hi. Im having some problems with IE 7 and the UploadProgressBar in a Wizard. It seems to have some limits in my special case. Inside my WizardStep constuctor I have this code: public class MyWizardStep(SomeValues){ super(SomeValues); setOutputMarkupId(true); FormString uploadForm = new FormString(uploadForm); uploadForm.setMultiPart(true); add(uploadForm); FileUploadField fileUploadField = new FileUploadField(filefield, new ModelFileUpload()); uploadForm.add(mFileUploadField); uploadForm.add(new UploadProgressBar(progress, uploadForm)); SubmitLink uploadlink = new SubmitLink(uploadButton) { @Override public void onSubmit() { System.out.println(onSubmit runs); } }; uploadForm.add(uploadlink); } And the markup... form wicket:id=uploadForm div div class=floatclass wicket:message key=payablefile.filefile/wicket:message /div div class=floatclass input wicket:id=filefield type=file/ /div div class=floatclass div class=mybutton onmouseout=this.className='submitbutton' onmouseover=this.className='submitbutton_hover' wicket:id=uploadButtonUpload/div /div div class=clearfloat/ /div div div div wicket:id=progressajax upload progressbar/div /div div class=clearfloat/ /div /form Works fine i firefox but it does not work in IE 7. I get a javascript error (object property or method is not supported) and the submit wont run. I have noticed 1. If I remove the UploadProgressBar it starts to work. 2. I can also change the upload button to and input type=submit and keep the UploadProgressBar and then it will work. 3. If I add above code to a ordenary page(not nested form as in the wizard) it will also work. It seems the wicket file upload example(as in http://www.wicketstuff.org/wicket13/upload/single) wont work inside a wizard for IE 7. Does anyone have any comment on this. Have I missed something? Jens Alenius - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: remember me at login page feature
Thanks for reply, Martin. AuthenticatedWebSession#isSignedIn() is final too :). And according to design I think it is not the proper place to do the auto-login logic. http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/authentication/AuthenticatedWebSession.html#isSignedIn() All you need to do is evaluate the cookie here: if (!AuthenticatedWebSession.get().isSignedIn()) Meaning that this should return TRUE if cookie is found. ** Martin 2009/5/5 Khlystov Alexandr a...@ovservice.org: Hello all. Previous answers did not helped me much. Though thanks authors for their replies. I am going to provide more detailed question: My App extends AuthenticatedWebApplication { And I want to implement auto-login/remember me feature. More precisely - when user submits to browser URL for some Wicket page (and user is not yet logged in) he should be able to see this page without seeing SignInPage (if he set at previous session remember me check box at SignInPage). I can't understand how can I achive that with the AuthenticatedWebApplication. How can I handle redirecting user to the SignInPage at org.apache.wicket.authentication;AuthenticatedWebApplication final method: onUnauthorizedInstantiation: ... public final void onUnauthorizedInstantiation(final Component component) { // If there is a sign in page class declared, and the unauthorized // component is a page, but it's not the sign in page if (component instanceof Page) { if (!AuthenticatedWebSession.get().isSignedIn()) { // Redirect to intercept page to let the user sign in throw new RestartResponseAtInterceptPageException(getSignInPageClass()); } else { onUnauthorizedPage((Page)component); } } else { // The component was not a page, so throw an exception throw new UnauthorizedInstantiationException(component.getClass()); } } ... As it is final I can't override the line: ... throw new RestartResponseAtInterceptPageException(getSignInPageClass()); ... to make setting SignInPage optional, depending on the cookie, and if cookie is given from remember me checkbox - than to authenticate user just by login retrieved from the cookie. And do not show SignInPage and do not do any redirectToInterceptPage. Thanks in advance! P.S. I think Wicket as a project requires more detailed and features-wide reference documentation. Khlystov Alexandr пишет: Good day. Can anyone, please, give an example, or direct wicket API description about remember me at login page feature. Thanks in advance. -- Khlystov Alexandr - 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 regards, Khlystov Alexandr. mailto: a...@ovservice.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: remember me at login page feature
Thanks for reply, Martin. AuthenticatedWebSession#isSignedIn() is final too :). And according to design I think it is not the proper place to do the auto-login logic. http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/authentication/AuthenticatedWebSession.html#isSignedIn() All you need to do is evaluate the cookie here: if (!AuthenticatedWebSession.get().isSignedIn()) Meaning that this should return TRUE if cookie is found. ** Martin 2009/5/5 Khlystov Alexandr a...@ovservice.org: Hello all. Previous answers did not helped me much. Though thanks authors for their replies. I am going to provide more detailed question: My App extends AuthenticatedWebApplication { And I want to implement auto-login/remember me feature. More precisely - when user submits to browser URL for some Wicket page (and user is not yet logged in) he should be able to see this page without seeing SignInPage (if he set at previous session remember me check box at SignInPage). I can't understand how can I achive that with the AuthenticatedWebApplication. How can I handle redirecting user to the SignInPage at org.apache.wicket.authentication;AuthenticatedWebApplication final method: onUnauthorizedInstantiation: ... public final void onUnauthorizedInstantiation(final Component component) { // If there is a sign in page class declared, and the unauthorized // component is a page, but it's not the sign in page if (component instanceof Page) { if (!AuthenticatedWebSession.get().isSignedIn()) { // Redirect to intercept page to let the user sign in throw new RestartResponseAtInterceptPageException(getSignInPageClass()); } else { onUnauthorizedPage((Page)component); } } else { // The component was not a page, so throw an exception throw new UnauthorizedInstantiationException(component.getClass()); } } ... As it is final I can't override the line: ... throw new RestartResponseAtInterceptPageException(getSignInPageClass()); ... to make setting SignInPage optional, depending on the cookie, and if cookie is given from remember me checkbox - than to authenticate user just by login retrieved from the cookie. And do not show SignInPage and do not do any redirectToInterceptPage. Thanks in advance! P.S. I think Wicket as a project requires more detailed and features-wide reference documentation. Khlystov Alexandr пишет: Good day. Can anyone, please, give an example, or direct wicket API description about remember me at login page feature. Thanks in advance. -- Khlystov Alexandr - 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 regards, Khlystov Alexandr. mailto: a...@ovservice.org
Re: remember me at login page feature
Well.. darn ... then do not call and check the cookie :) if (!AuthenticatedWebSession.get().isSignedIn() (!myOwnCookieCheck())) { :... } ** Martin 2009/5/6 Khlystov Alexandr a...@ovservice.org: Thanks for reply, Martin. AuthenticatedWebSession#isSignedIn() is final too :). And according to design I think it is not the proper place to do the auto-login logic. http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/authentication/AuthenticatedWebSession.html#isSignedIn() All you need to do is evaluate the cookie here: if (!AuthenticatedWebSession.get().isSignedIn()) Meaning that this should return TRUE if cookie is found. ** Martin 2009/5/5 Khlystov Alexandr a...@ovservice.org: Hello all. Previous answers did not helped me much. Though thanks authors for their replies. I am going to provide more detailed question: My App extends AuthenticatedWebApplication { And I want to implement auto-login/remember me feature. More precisely - when user submits to browser URL for some Wicket page (and user is not yet logged in) he should be able to see this page without seeing SignInPage (if he set at previous session remember me check box at SignInPage). I can't understand how can I achive that with the AuthenticatedWebApplication. How can I handle redirecting user to the SignInPage at org.apache.wicket.authentication;AuthenticatedWebApplication final method: onUnauthorizedInstantiation: ... public final void onUnauthorizedInstantiation(final Component component) { // If there is a sign in page class declared, and the unauthorized // component is a page, but it's not the sign in page if (component instanceof Page) { if (!AuthenticatedWebSession.get().isSignedIn()) { // Redirect to intercept page to let the user sign in throw new RestartResponseAtInterceptPageException(getSignInPageClass()); } else { onUnauthorizedPage((Page)component); } } else { // The component was not a page, so throw an exception throw new UnauthorizedInstantiationException(component.getClass()); } } ... As it is final I can't override the line: ... throw new RestartResponseAtInterceptPageException(getSignInPageClass()); ... to make setting SignInPage optional, depending on the cookie, and if cookie is given from remember me checkbox - than to authenticate user just by login retrieved from the cookie. And do not show SignInPage and do not do any redirectToInterceptPage. Thanks in advance! P.S. I think Wicket as a project requires more detailed and features-wide reference documentation. Khlystov Alexandr пишет: Good day. Can anyone, please, give an example, or direct wicket API description about remember me at login page feature. Thanks in advance. -- Khlystov Alexandr - 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 regards, Khlystov Alexandr. mailto: a...@ovservice.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org