Re: [Wicket-user] Setting up directories to make CSS available
You can include wicket:remove base href=file:///C:/Docs%20and%20Settings/you/your-project/src/webapp/ / /wicket:remove in your html head. 2007/3/14, Chris Colman [EMAIL PROTECTED]: I'm using wicket and trying to work out how to set up my directories so that while editing HTML markups my HTML editor has access to the same CSS files that will be used as run time. The HTML markups are in my project/src/com/sas/ui/wicket directory with my wicket component classes but being in the src directory these files are kind of in a different realm to the normal HTML resources of the web app. Any ideas on how to set up directories so that I can use the CSS in both my HTML editor and at run time? - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] IntelliJ IDEA Wicket Plugin
Nick, as far as I know the sources are attached in the jar. Dirk 2006/12/9, Nick Heudecker [EMAIL PROTECTED]: Hi, Does anyone know if the Wicket plugin for IDEA has been open-sourced? I'd like to make some updates to it. Thanks, Nick - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Changing class attribute of a HTML-tag
Show us some of your code. 2006/12/1, Ted Roeloffzen [EMAIL PROTECTED]: Hi all, An example is described here: http://cwiki.apache.org/WICKET/how-to-modify-an-attribute-on-a-html-tag.html http://cwiki.apache.org/WICKET/how-to-modify-an-attribute-on-a-html-tag.html+ If have taken a look at the example given above, but it still doesn't work. Wicket won't change the value of the class attribute. Ted - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Changing class attribute of a HTML-tag
And your html? 2006/12/1, Ted Roeloffzen [EMAIL PROTECTED]: list.add(new AttributeModifier(class, new Model() { public Object getObject(final Component component) { String cssClass; if(isHorizontal) { cssClass = menuItemsHorizontal; } else { cssClass = menuItemsVertical; } return cssClass; } })); This is almost exactly the same as the example i got from Erik. Ted - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Can I prevent wicket specific URL parameters
http://cwiki.apache.org/WICKET/obfuscating-urls.html Dirk 2006/12/1, Carfield Yim [EMAIL PROTECTED]: Is there way to not having parameters like ?wicket:interface=:4:: at the URL? - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Give me a Wicket MVC so simple example!
exaMple Very niCe 2006/11/27, Eelco Hillenius [EMAIL PROTECTED]: Must Violate Conventions On 11/26/06, la guo [EMAIL PROTECTED] wrote: RT. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] proof of concept app
Scott,do you really have to get access to the panel from the form? Or can your panel respond to a model change you do in the form?Dirk2006/10/15, Scott Swank [EMAIL PROTECTED]:One weekend later and I'm working on this again.Here's my situation: page- browse panel- cart panel- modal window- - edit item form (inside the modal window)I have an ajax submit button in the EditItemForm.I need to callpublic void onSubmit(AjaxRequestTarget target, Form f) { target.addComponent(theCartPanel);ModalWindow.close(target);}My problem is: how do I get access to the cart panel from within theform in the modal window?Here's what I've come up with, and everything feels a bit ugly:1. I can get the cart from the session and have the cart fetch thecart panel -- ugh, the cart (business object) shouldn't know about aUI widget.2.I can pass the cart panel in as my model object 3. I could put the cart panel in the session (or my own ThreadLocal)4. I could crawl my way back upfindParent(ProductPanel.class).visitChildren(IVisitorThatHandlesTargetAddComponent)Any suggestions would be entirely welcome. Thanks,ScottOn 10/9/06, Igor Vaynberg [EMAIL PROTECTED] wrote: the question is one of lifecycle. does your reportmodel need to live as long as the user's session? if not then you dont need to put it into session. a shopping cart usually spans the session - so it makes complete sense to put it there. -Igor On 10/9/06, Nino Wael [EMAIL PROTECTED] wrote: Why? Keeping the cart within constructors are kinda more POJO i think. What I am working on now, we have a reportmodel and almost all our pages has aconstructor that requires our reportmodel, so we dont need to be aware of session. I feel that the application becomes more simple that way, however we do not have a LOT of panels, we have some which uses abstractmodels that grabs their data from the reportmodel, when switching pages we pass the reportmodel through. This might be a different approach from what you need when building a store site, but it feels pretty a lot simpler than have something stored in session context. regards Nino-Original Message- From: [EMAIL PROTECTED] on behalf of Eelco Hillenius Sent: Mon 09-10-2006 20:14 To: wicket-user@lists.sourceforge.net Cc: Subject:Re: [Wicket-user] proof of concept app If you're main domain is a store, and a cart is information you want to keep throughout, it does make sense to put it in a session, so that you don't have to pass it around your pages and panels all the time. Eelco On 10/9/06, Nino Wael [EMAIL PROTECTED] wrote: Looks nice(just skimping the code through without running it though), however I can see that you have extended the session, do you really have a need to store the cart in session context? Why not just create it on PosPage? -regards Nino -Original Message- From: [EMAIL PROTECTED] on behalf of Scott Swank Sent: Mon 09-10-2006 18:30 To: wicket-user@lists.sourceforge.net Cc: Subject:[Wicket-user] proof of concept app I've been pushing to use Wicket as our new web UI framework.We currently have a custom template that resembles Velocity.The broad concensus is to go with JSF.While I'm convinced that JSF will work for us it always seems so cumbersome. I've convinced by boss to give Wicket a 2nd look, and so this weekend I threw together the attached.If anyone is inclined to give it a quick glance for best practices type considerations I'd certainly be appreciative. The only relevant files are the jetty config, web.xml the java/html. There are two apps that both sub-class an abstract app.The Concierge version is for retail sales while the C3 version is for our call center. The urls are below. Thank you, Scott -- Forwarded message -- From: Scott Swank [EMAIL PROTECTED]Date: Oct 8, 2006 10:41 PM Subject: concierge/c3 in wicket To: Scott Swank [EMAIL PROTECTED], Scott Swank [EMAIL PROTECTED] http://localhost:8081/concierge/app http://localhost:8081/concierge/c3 -- Scott Swank reformed mathematician Power is not a means, it is an end. One does not establish a dictatorship in order to safeguard a revolution; one makes the revolution in order to establish the dictatorship. The object of persecution is persecution. The object of torture is torture. The object of power is power.-- George Orwell, 1984 -- Scott Swank reformed mathematician Power is not a means, it is an end. One does not establish a dictatorship in order to safeguard a revolution; one makes the revolution in order to establish the dictatorship. The object of persecution is persecution. The object of torture is torture. The object of power is power.-- George Orwell, 1984 - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get
Re: [Wicket-user] links about wicket scalability...
Erik,did you search this link?http://www.virtuas.com/articles/webframework-sweetspots.html -Dirk2006/9/26, Erik Brakkee [EMAIL PROTECTED]: Hi all, A collegue of mine at a very big and slow organization is evaluating web frameworks, of which one is wicket. As expected, there is the remark that wicket is not scalable because of its use of session scope. I already gave the most important arguments, but it would be nice to have some good links for backing these arguments. In paticular, the link where (I think it was Eelco) mentioned that in a number of comparisons between web frameworks it was shown that wicket actually stores less in the session than other frameworks. This is a really strong argument, especially when backed up by real data. Nevertheless, I couldn't find this information anymore. Are there links to the applications (downloadable) proving this point? Cheers Erik -Take Surveys. Earn Cash. Influence the Future of ITJoin SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket requires my model to be serializable???
Maybe this helps:http://www.wicket-wiki.org.uk/wiki/index.php/FAQs#I_get_.27Internal_error_cloning_object.27_errors 2006/9/14, Christian Hvid [EMAIL PROTECTED]: Hi.I keep getting:WicketMessage: Internal error cloning object. Make sure all dependentobjects implement Serializable. Class: ..I am using wicket 1.2.2 - when I roll back to an earlier version of 1.2 (checked out from main trunk in february) - the problem is goneand everything works fine.What is going on?What is the right way to handle this?-- Chritsian- Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] VOTE: how should localized attributes work?
2 [x]2006/8/3, Eelco Hillenius [EMAIL PROTECTED]: For localized attributes - so that you don't have to attach attributemodifiers all over the place for that sole reason - we have twoalternative approaches in mind. For end-users this would either looklike: 1) input type=submit value=wicket:i18n:my_key/which is compact, or2) input type=submit value=Default Value wicket:message=value:my_key/ which works better if you want to keep your components preview-able.What do you prefer (vote open to anyone that want to join in)?1 []2 []Eelco(I have to think about what I like a bit more myself, but currently I lean towards 2 as I think it is cleaner and supports preview-ability)-Take Surveys. Earn Cash. Influence the Future of ITJoin SourceForge.net 's Techsay panel and you'll get the chance to share youropinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Options Transfer Component?
Andreas,check this one: http://www.wicket-library.com/wicket-examples/compref;jsessionid=1964CEEDBD5270FCDA54CFE3AFAE4CB7?wicket:bookmarkablePage=:wicket.examples.compref.PalettePageDirk2006/6/7, [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi,I'm new to Wicket and Ineed to create an Options Transfer Widget.It consists of two select boxes with optionsand arrow buttons to move the options from onebox into the other one. Example: http://www.mattkruse.com/_javascript_/optiontransfer/How can this be done in Wicket?I tried to use ListMultipleChoice, but this does not work because a ListMultipleChoice cannot grow, i.e. cope withnew options that have not been not in the choices list.When I insert a new option into a ListMultipleChoice at runtimevia _javascript_, there is appearantly no way to access this new option after submitting the form because Wicket does not find itin the choices.Is there any other way to build an Options Transfer than to buildthe Component from scratch? Thanks,Andreas--Andreas ReimerT-Systems GEI GmbHEAI SolutionsHausanschrift: Pascalstrasse 8, D-52076 AachenPostanschrift: Postfach 500155, D-52085 AachenTelefon: +49 (2408) 943-1375 Telefax: +49 (2408) 943-1722mailto: [EMAIL PROTECTED]___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Form partial updates, how?
2006/6/2, Johan Compagner [EMAIL PROTECTED]: there is just no way for wicket to do this automatically because it cannot see inside your brain. do fix this igor. It would make my life so much more easier.+1 johan Dirk
Re: [Wicket-user] Is there a shuttle(?) component?
52 minutes. Not that bad!Dirk2006/6/1, Igor Vaynberg [EMAIL PROTECTED]: fixed-IgorOn 5/31/06, cowwoc [EMAIL PROTECTED] wrote: There seems to be a bug in this example. I select the last entry, andkeep on clicking on the first button. Eventually, it moves the entryfrom the right side to the left, even though I am clicking on the arrow pointing from left to right. I am expecting the entry to remain on theright. Can anyone else reproduce this?GiliPhilip A. Chapman wrote: The palette component: http://www.wicket-library.com/wicket-examples/compref;jsessionid=1964CEEDBD5270FCDA54CFE3AFAE4CB7?wicket:bookmarkablePage=:wicket.examples.compref.PalettePage On Wed, 2006-05-31 at 23:32 -0300, Bruno Borges wrote: I don't know how to name it, but Shuttle was the name I've seen people using to specify this kind of component: | Item 1 || Item 3 | | Item 2 | | Item 4 | || || |||| Where: : move all right : move all selected right ... same, but to left side If there's nothing like this ready-to-use, can somebody shot an idea on how to implement? Some first steps would be nice... :) In the model, would be something like: - In the left select, a list of available categories - In the right select, a list of associated categories I think on something like this: ShuttleList s = new ShuttleList(shuttle, new ShuttleModel(availableItems, selectedItems) { public void populateItem(Item i) { ... } })); And then: List newSelectedItems ((ShuttleModel) s.getModel()).getSelectedItems(); Now, 'newSelectedItems' should have objects that came from 'availableItems' and shouldn't have objects removed from 'selectedItems'. []'s -- Bruno Borges Summa Technologies Inc. www.summa-tech.com http://www.summa-tech.com (11) 8565-7739 - (11) 3846-1622 -- Philip A. Chapman Desktop and Web Application Development: Java, .NET, PostgreSQL, MySQL, MSSQL Linux, Windows 2000, Windows XP
Re: [Wicket-user] local path
Hi Alex, try getApplication().getWicketServlet().getServletContext().getRealPath(); Dirk 2006/3/31, Alexander Lohse [EMAIL PROTECTED]: Hi,how do I determine the local path to my webapp?getApplication().getApplicationSettings().getContextPath(); gives me the web-path.In other words, from this jetty-config:Call name=addWebApplicationArg/quickstart/ArgArgsrc/webapp/Arg/Call where do I find the 2. argument?Regards,Alex---This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How do I replace ExceptionErrorPage ?
Ingram, try getApplicationSettings().setInternalErrorPage(); Call it in theinit method of your application class. Dirk 2006/3/22, Ingram Chen [EMAIL PROTECTED]: When runtime exception throw, wicket show ExceptionErrorPage.Can I custom this page ? I don't want end user to see internal stack trace.. -- Ingram ChenJava [EMAIL PROTECTED]Institue of BioMedical Sciences Academia Sinica Taiwan blog: http://www.javaworld.com.tw/roller/page/ingramchen
Re: [Wicket-user] How do I replace ExceptionErrorPage ?
Ingram, try getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE) in your init method. Dirk 2006/3/22, Ingram Chen [EMAIL PROTECTED]: I tried, and it works well in deployment mode. thanks a lot.But I think it's weird that it only works in deployment mode, how do I test this in development mode while developing ? On 3/22/06, Ingram Chen [EMAIL PROTECTED] wrote: Yeah.. I already tried IApplicationSettings.setIneternalErrorPage(), and still get old exception page. Sounds like I need to try deploy mode again.Thanks On 3/22/06, Johan Compagner [EMAIL PROTECTED] wrote: that doesn't really replace our exception page when in development mode.The best thing to do is implement/override RequestCycle.onRuntimeException() johan On 3/22/06, Igor Vaynberg [EMAIL PROTECTED] wrote: take a look at IApplicationSettings.setIneternalErrorPage() -Igor On 3/22/06, Ingram Chen [EMAIL PROTECTED] wrote: When runtime exception throw, wicket show ExceptionErrorPage. Can I custom this page ? I don't want end user to see internal stack trace.. -- Ingram ChenJava [EMAIL PROTECTED]Institue of BioMedical Sciences Academia Sinica Taiwan blog: http://www.javaworld.com.tw/roller/page/ingramchen -- Ingram ChenJava [EMAIL PROTECTED]Institue of BioMedical Sciences Academia Sinica Taiwanblog: http://www.javaworld.com.tw/roller/page/ingramchen -- Ingram ChenJava [EMAIL PROTECTED]Institue of BioMedical Sciences Academia Sinica Taiwanblog: http://www.javaworld.com.tw/roller/page/ingramchen
Re: [Wicket-user] Images, Flashs, Javascripts, CSSs and other resources
Why don't you include wicket:remove base href="" href="file:///C:/Docs%20and%20Settings/you/your-project/src/webapp/">file:///C:/Docs%20and%20Settings/you/your-project/src/webapp/ / /wicket:removein your html head. Dirk 2006/3/18, Thomas Singer [EMAIL PROTECTED]: Hi Bruno,I'm with you. Please take a look at issue 1448195 in the wicket tracker( http://sourceforge.net/tracker/index.php?func=detailaid=1448195group_id=119783atid=684978).--Best regards,Thomas SingerBruno Borges schrieb: In the case of static resources, the problem is that, as you show, if my web designer opens the Index.html he'll not see the images in his WYSIWYG editor. Thanks. From: Martijn Dashorst [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] To: wicket-user@lists.sourceforge.net mailto:wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Images, Flashs, _javascript_s, CSSs and other resources Reply-To: wicket-user@lists.sourceforge.net mailto:wicket-user@lists.sourceforge.net There are several possibilities here. Dynamic approach Needed in the following cases:- resource needs to be generated- resource comes from external, non-web system (database, etc) - resource must be filtered (component id's subsitution, etc)- resource must be packaged with your component Static approach Needed in the following cases:- absolute performance requirements - static resources served by webserver, not servlet- static files, no special requirement for dynamic content- ? In the dynamic approach the resources need either to be registered at load time (this will change I think), or generated on the fly as needed. Resourc= e source files should be available on the classpath, but need not be (provide your own resolver). In the static approach, you put the files in the webroot and thus have them available to link from your pages. com.foo.Index.html html head style src="" type=3Dtext/css/style script src=""> type=3Dtext/_javascript_/script /head body /body /html and directories: src/webapp/style/style.css src/webapp/prototype/prototype.js src/webapp/WEB-INF/web.xml src/main/java/com/foo/Index.html src/main/java/com/foo/Index.java Not complete, but a start. Martijn On 3/17/06, Bruno Borges [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I've seen some threads in the mailing-list archive, and for I understand, there's no common way to deal with resources like those in the subject. Could you guys please list what's the best approaches to deal with images= , so programmers and designers can work together without any problem? I wan= na see developers coding the html files, and designers specifying images in these pages, so the images can be displayed in the same way at developmen= t time (WYSIWYG HTML Editors) and at runtime. The same question for _javascript_ files (.js) and stylesheet files (.css). And after that, we could put all information together and submit to the Wiki. Thank you! -- Bruno Borges - SCJP 1.4 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]---This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Browser detector available?
Hi David, use ClientProperties. ClientProperties properties = ((WebClientInfo)getRequestCycle().getClientInfo()).getProperties(); See HelloBrowser in Wicket exampleDirk 2006/3/14, David Leangen [EMAIL PROTECTED]: Are there any browser detectors available in Wicket?IIRC, I remember one of the core devz mentioning this a while back... ---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] ListView: Rendering table row id attribute
Hi Michael, you need an AttributeModifier. Something like protected void populateItem(final ListItem listItem) { add(new Label(name,Scooby).new AttributeModifier(id, .., new Model(row + listItem.getIndex())); } Dirk 2006/3/13, Michael K [EMAIL PROTECTED]: Hi,I want to be able to render id=rowcount attribute when using ListView. I need it to code _javascript_ using getElementById(). Please find the examples below: Html code:---tabletr wicket:id = rowToRender id=row0 tdspan wicket:id=namename/span/td/tr tr wicket:id = rowToRender id=row1 tdspan wicket:id=namename/span/td/trtr wicket:id = rowToRender id=row2 tdspan wicket:id=namename/span/td/tr/tableJava code:---add(new ListView(rowToRender,someArrayList){ protected void populateItem(final ListItem listItem) { add(new Label(name,Scooby);}});Has anyone done this? Any help wo uld be greatly appreciated.BTW, I 'm using Wicket 1.1.1.Thanks in Advance.--Michael Yahoo! MailBring photos to life! New PhotoMail makes sharing a breeze.
Re: [Wicket-user] ListView: Rendering table row id attribute
Well, actually it is protected void populateItem(final ListItem listItem) {listItem.add(new AttributeModifier(id, .., new Model(row + listItem.getIndex() )); } Dirk 2006/3/13, Dirk Markert [EMAIL PROTECTED]: Hi Michael, you need an AttributeModifier. Something like protected void populateItem(final ListItem listItem) { add(new Label(name,Scooby).new AttributeModifier(id, .., new Model(row + listItem.getIndex())); } Dirk 2006/3/13, Michael K [EMAIL PROTECTED]: Hi,I want to be able to render id=rowcount attribute when using ListView. I need it to code _javascript_ using getElementById(). Please find the examples below: Html code:---tabletr wicket:id = rowToRender id=row0 tdspan wicket:id=namename/span/td/tr tr wicket:id = rowToRender id=row1 tdspan wicket:id=namename/span/td/trtr wicket:id = rowToRender id=row2 tdspan wicket:id=namename/span/td/tr/tableJava code:---add(new ListView(rowToRender,someArrayList){ protected void populateItem(final ListItem listItem) { add(new Label(name,Scooby);}});Has anyone done this? Any help wo uld be greatly appreciated.BTW, I 'm using Wicket 1.1.1.Thanks in Advance.--Michael Yahoo! MailBring photos to life! New PhotoMail makes sharing a breeze.
[Wicket-user] Multiple page instances possible?
I am using latest anon cvs head. I have a home page H with a popuplink opening page P. It is possible to have more than one page P. A linkon Pleads to P, itonly changes internalpage state.Thus we can havesequences like: H - P1 P1 - P1 +-- P2 P2 - P2 P1 and P2 have different internal states, because the page constructor takes the new internal state as an argument. The sequence H--P1, H--P2, P1--P1, P2-- shows the expired page. (In step 3 version 0 of P2 is removed from the wickets page map) How can I have multiple instances of page P? Dirk
Re: [Wicket-user] Multiple page instances possible?
I have one homepageH with one Link named actionLink: PopupSettings p = new PopupSettings(PageMap.forName(popup-page-map), PopupSettings.LOCATION_BAR ); p.setWidth(600).setHeight(600); actionLink.setPopupSettings(p); In my homepage I click two times on this link, giving me 2 browser windows P1 and P2. Dirk 2006/3/10, Martijn Dashorst [EMAIL PROTECTED]: Ah,you have 2 browsers pointing to the same session?Then you should use a different pagemap for each browser. MartijnOn 3/10/06, Dirk Markert [EMAIL PROTECTED] wrote: Johan, thank you for your answer. That's what I am doing right now. To be exact, I am calling: setResponsePage(new P(newState)); And then I am having two instances of P, page P1 and page P2, after the link is clicked two times. I am getting the error later with the described sequence. Dirk 2006/3/10, Johan Compagner [EMAIL PROTECTED]: Dirk, just create the pages with the new keyword of java so in a link or submit just do: setResponsePage(new P1(newState)) johan On 3/10/06, Dirk Markert [EMAIL PROTECTED] wrote: I am using latest anon cvs head. I have a home page H with a popuplink opening page P. It is possible to have more than one page P. A link on P leads to P, it only changes internal page state. Thus we can have sequences like: H - P1 P1 - P1 +-- P2 P2 - P2 P1 and P2 have different internal states, because the page constructor takes the new internal state as an argument. The sequence H--P1, H--P2, P1--P1, P2-- shows the expired page. (In step 3 version 0 of P2 is removed from the wickets page map) How can I have multiple instances of page P? Dirk --Nominate Wicket for the SourceForge.net's Choice awards!http://www.wilsonresearch.com/2006/ostgawards06/ostgawards4.php ---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642 ___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Multiple page instances possible?
I try to explain. Given the above code with homepage H und page class P. We have the following steps: 1.in my homepage I click on the action link giving me a new browser window for class instance P1 of class P 2.in my homepage I click again on the action link giving me a new browser window for class instance P2 of class P 3.in P1 I click on the link 4.in P2 I click on the link and then I getthe standard wicket page expired page As far as I can see, wicket is removingversion 0 of page P2 from the page map in step 3. when PageMap.access() is called. I hope I could make it clear. Dirk 2006/3/10, Johan Compagner [EMAIL PROTECTED]: then i need a complete example to see what really does happen or what exactly goes wrong.At what exact time you get and error and what exactly is that error? On 3/10/06, Dirk Markert [EMAIL PROTECTED] wrote: I am using cvs head. I do not close any window P1 or P2. My homepage constructor in full glory: public Home() { Link actionLink = new Link(start) { public void onClick() { setResponsePage(new P()); } }; PopupSettings p = new PopupSettings( PageMap.forName(popup-page-map), PopupSettings.LOCATION_BAR ); p.setWidth(600).setHeight(600); actionLink.setPopupSettings(p); add(actionLink); } My class P is basically something like: . Link link = new Link(link, new Model(..)) { public void onClick() { changeInternalState(getModelObject()); } .. Dirk 2006/3/10, Johan Compagner [EMAIL PROTECTED] : ahh which build are you using?Because i think this is the problem i fixed and i believe it didn't make it into 1.2b1The popup closing did remove to much.Don't know exactly if that is the case for you then i have to see more code. that link that you give those popupsettings to is that a link with an onClick() {setResponsePage(newPage)} ? Yes, see above. On 3/10/06, Dirk Markert [EMAIL PROTECTED] wrote: I have one homepageH with one Link named actionLink: PopupSettings p = new PopupSettings(PageMap.forName(popup-page-map), PopupSettings.LOCATION_BAR ); p.setWidth(600).setHeight(600); actionLink.setPopupSettings(p); In my homepage I click two times on this link, giving me 2 browser windows P1 and P2. Dirk 2006/3/10, Martijn Dashorst [EMAIL PROTECTED]: Ah,you have 2 browsers pointing to the same session? Then you should use a different pagemap for each browser. MartijnOn 3/10/06, Dirk Markert [EMAIL PROTECTED] wrote: Johan, thank you for your answer. That's what I am doing right now. To be exact, I am calling: setResponsePage(new P(newState)); And then I am having two instances of P, page P1 and page P2, after the link is clicked two times. I am getting the error later with the described sequence. Dirk 2006/3/10, Johan Compagner [EMAIL PROTECTED]: Dirk,just create the pages with the new keyword of java so in a link or submit just do: setResponsePage(new P1(newState)) johan On 3/10/06, Dirk Markert [EMAIL PROTECTED] wrote: I am using latest anon cvs head. I have a home page H with a popuplink opening page P. It is possible to have more than one page P. A link on P leads to P, it only changes internal page state. Thus we can have sequences like: H - P1 P1 - P1 +-- P2 P2 - P2 P1 and P2 have different internal states, because the page constructortakes the new internal state as an argument. The sequence H--P1, H--P2, P1--P1, P2-- shows the expired page. (In step 3 version 0 of P2 is removed from the wickets page map) How can I have multiple instances of page P? Dirk--Nominate Wicket for the SourceForge.net's Choice awards!http://www.wilsonresearch.com/2006/ostgawards06/ostgawards4.php ---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642 ___Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Multiple page instances possible?
Now that we have an explanation, what's the solution?2006/3/10, Johan Compagner [EMAIL PROTECTED]: ahh yesthats logical.Because you use the same pagemap.and a pagemap has a browser stackso if you open P1 on pagemap Xthen P2 on pagemap Xand you click again on P1 then we think you did a back button to P1 and then we remove P2 from the stack because if this was a browser it wasn't accessible anymore.johanOn 3/10/06, Dirk Markert [EMAIL PROTECTED] wrote: I try to explain. Given the above code with homepage H und page class P. We have the following steps: 1.in my homepage I click on the action link giving me a new browser window for class instance P1 of class P 2.in my homepage I click again on the action link giving me a new browser window for class instance P2 of class P 3.in P1 I click on the link 4.in P2 I click on the link and then I getthe standard wicket page expired page As far as I can see, wicket is removingversion 0 of page P2 from the page map in step 3. when PageMap.access() is called. I hope I could make it clear. Dirk 2006/3/10, Johan Compagner [EMAIL PROTECTED]: then i need a complete example to see what really does happen or what exactly goes wrong. At what exact time you get and error and what exactly is that error? On 3/10/06, Dirk Markert [EMAIL PROTECTED] wrote: I am using cvs head. I do not close any window P1 or P2. My homepage constructor in full glory: public Home() { Link actionLink = new Link(start) { public void onClick() { setResponsePage(new P()); } }; PopupSettings p = new PopupSettings( PageMap.forName(popup-page-map), PopupSettings.LOCATION_BAR ); p.setWidth(600).setHeight(600); actionLink.setPopupSettings(p); add(actionLink); } My class P is basically something like: . Link link = new Link(link, new Model(..)) { public void onClick() { changeInternalState(getModelObject()); } .. Dirk 2006/3/10, Johan Compagner [EMAIL PROTECTED] : ahh which build are you using?Because i think this is the problem i fixed and i believe it didn't make it into 1.2b1The popup closing did remove to much.Don't know exactly if that is the case for you then i have to see more code. that link that you give those popupsettings to is that a link with an onClick() {setResponsePage(newPage)} ? Yes, see above. On 3/10/06, Dirk Markert [EMAIL PROTECTED] wrote: I have one homepageH with one Link named actionLink: PopupSettings p = new PopupSettings(PageMap.forName(popup-page-map), PopupSettings.LOCATION_BAR ); p.setWidth(600).setHeight(600); actionLink.setPopupSettings(p); In my homepage I click two times on this link, giving me 2 browser windows P1 and P2. Dirk 2006/3/10, Martijn Dashorst [EMAIL PROTECTED]: Ah,you have 2 browsers pointing to the same session? Then you should use a different pagemap for each browser. MartijnOn 3/10/06, Dirk Markert [EMAIL PROTECTED] wrote: Johan, thank you for your answer. That's what I am doing right now. To be exact, I am calling: setResponsePage(new P(newState)); And then I am having two instances of P, page P1 and page P2, after the link is clicked two times. I am getting the error later with the described sequence. Dirk 2006/3/10, Johan Compagner [EMAIL PROTECTED]: Dirk,just create the pages with the new keyword of java so in a link or submit just do: setResponsePage(new P1(newState)) johan On 3/10/06, Dirk Markert [EMAIL PROTECTED] wrote: I am using latest anon cvs head. I have a home page H with a popuplink opening page P. It is possible to have more than one page P. A link on P leads to P, it only changes internal page state. Thus we can have sequences like: H - P1 P1 - P1 +-- P2 P2 - P2 P1 and P2 have different internal states, because the page constructortakes the new internal state as an argument. The sequence H--P1, H--P2, P1--P1, P2-- shows the expired page. (In step 3 version 0 of P2 is removed from the wickets page map) How can I have multiple instances of page P? Dirk--Nominate Wicket for the SourceForge.net's Choice awards!http://www.wilsonresearch.com/2006/ostgawards06/ostgawards4.php ---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642 ___Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] DropDownChoice howto change default text
Hi Nino, I think you need a ChoiceRenderer for your DropDownChoice. See javadoc there. Regards, Dirk 2006/3/8, Nino Wael [EMAIL PROTECTED]: Hi How do I change the default text ( "Choose One ", see picture below) of a dropdownchoice, do I need to implement a custom render? I' ve looked at the methods for dropdownchoice class but no one seems to do just that. -regards Nino
Re: [Wicket-user] java.lang.NoClassDefFoundError after deployment
Hi Thomas, I think your assumption is right. Youhave to run java headless or install xvfb. Dirk 2006/2/24, Thomas Küchenthal [EMAIL PROTECTED]: Dear all,I have developed a Wicket-Application (wicket 1.1)on my Windows XPmachine. In some Pages (Pages for editing data), I used the ImageButton.class and Image.class within the Form. Everything went fine.But now, after I deployed the application on the server, all Pages thathave editing functionality are causing the following NoClassDefFound Error.(I'm unsing Java 1.4.2 Tomcat 5.0.28, same as on the Windows machine)Could it be, that the getLocalGraphicsEnvironment method is causingthe error because there is no X-Server running on the machine? Thanks in advancethomasjava.lang.NoClassDefFoundError java.lang.Class.forName0(Native Method) java.lang.Class.forName(Class.java:141) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment (GraphicsEnvironment.java:62) java.awt.Font.initializeFont(Font.java:308) java.awt.Font.init(Font.java:344) wicket.markup.html.image.resource.DefaultButtonImageResource.init(DefaultButtonImageResource.java :55) wicket.markup.html.image.resource.DefaultButtonImageResourceFactory.newResource(DefaultButtonImageResourceFactory.java:46) wicket.markup.html.image.resource.LocalizedImageResource.newImage(LocalizedImageResource.java :368) wicket.markup.html.image.resource.LocalizedImageResource.setSrcAttribute(LocalizedImageResource.java:255) wicket.markup.html.form.ImageButton.onComponentTag(ImageButton.java:118) wicket.Component.renderComponent (Component.java:1866) wicket.markup.html.WebMarkupContainer.onRender(WebMarkupContainer.java:77) wicket.Component.render(Component.java:1163) wicket.MarkupContainer.renderNext(MarkupContainer.java :1136) wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:811) wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:753) wicket.Component.renderComponent(Component.java :1888) wicket.markup.html.WebMarkupContainer.onRender(WebMarkupContainer.java:77) wicket.markup.html.form.Form.onRender(Form.java:517) wicket.Component.render(Component.java:1163) wicket.markup.html.BodyOnLoadContainer.resolve (BodyOnLoadContainer.java:106) wicket.MarkupContainer.renderNext(MarkupContainer.java:1159) wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:811) wicket.MarkupContainer.onComponentTagBody (MarkupContainer.java:753) wicket.Component.renderComponent(Component.java:1888) wicket.markup.html.WebMarkupContainer.onRender(WebMarkupContainer.java:77) wicket.Component.render(Component.java :1163) wicket.MarkupContainer.autoAdd(MarkupContainer.java:170) wicket.markup.html.BodyOnLoadResolver.resolve(BodyOnLoadResolver.java:60) wicket.MarkupContainer.renderNext(MarkupContainer.java :1146) wicket.MarkupContainer.renderAll(MarkupContainer.java:779) wicket.Page.onRender(Page.java:788) wicket.Component.render(Component.java:1163) wicket.Page.doRender(Page.java:251) wicket.RequestCycle.respond(RequestCycle.java:948) wicket.RequestCycle.request(RequestCycle.java:411) wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:208) javax.servlet.http.HttpServlet.service (HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)---This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Loop iteration rendering only loop body
Given a loop (ListView, Loop or Repeater) such as: span wicket:id=loop a href="" wicket:id=itemimg wicket:id=image //a/span Is it possible to yield an html result as: span wicket:id=loop a href="" wicket:id=itemimg wicket:id=image src=""> a href="" wicket:id=itemimg wicket:id=image src="" //a /span I do not want to repeat the span tag around my loop. Only the body should be repeated. Dirk
Re: [Wicket-user] Loop iteration rendering only loop body
Thank you. I knew it is that easy. Dirk 2006/2/16, Martijn Dashorst [EMAIL PROTECTED]: set 'setRenderBodyOnly(true)' on your list item. That'll fix the span problemMartijn On 2/16/06, Dirk Markert [EMAIL PROTECTED] wrote: Given a loop (ListView, Loop or Repeater) such as: span wicket:id=loop a href="" wicket:id=itemimg wicket:id=image //a/span Is it possible to yield an html result as: span wicket:id=loop a href="" wicket:id=itemimg wicket:id=image src=""> a href="" wicket:id=itemimg wicket:id=image src="" //a /span I do not want to repeat the span tag around my loop. Only the body should be repeated. Dirk-- Living a wicket life...Martijn Dashorst - http://www.jroller.com/page/dashorstWicket 1.1.1 is out: http://wicket.sourceforge.net/wicket-1.1
Re: [Wicket-user] VOTE
2006/2/17, Eelco Hillenius [EMAIL PROTECTED]: 2. Do the constructor change in a seperate release (Wicket 1.3) andput Java 5 in the next (Wicket 2.0) +1 Dirk
Re: [Wicket-user] recommend HTML editor for Wicket user
2006/2/14, Martijn Dashorst [EMAIL PROTECTED]: Frank,There are several options. But by far the best one is use a plugin foryour IDE. NetBeans and IntelliJ IDEA both have very decent markup editors, with tag completion. Eclipse has a couple of plugins ofvarying quality. You might want to check out the WTP package.Eclipse has a built in browser, but I tend not to use that, as it getsin the way of editing the file. As I am rather fluent in HTML I usually know what the final result looks like.A very nice workflow is to start Wicket using Jetty launcher, anEclipse plugin, and run your application in development mode (in yourapplication constructor do: configure(development); This will instruct Wicket to scan for resource updates and will reloadyour markup as you change it and press the save button. If you run indebug mode, Eclipse will try to hot swap the code as you change it in your application. So you can update that behavior of the onclickmethod of your button and links!If you don't mind paying a minor fee, you could see if MyEclipse works for you.I don't have other preferences. For basic editing stuff on a windows box I use UltraEdit. Probably the best plain text editor around. If you are looking for a free editoruse PSPad. Martijn Dirk On 2/14/06, Frank Silbermann [EMAIL PROTECTED] wrote: I am not only new to Wicket; I am also new to web programming.I can read HTML, but I'm not fluent in writing it.Any suggestions for a free HTML editor that is appropriate for Wicket users? I presume it should be text-centric rather than a WYSIWYG editor, because we need to keep things clean, small and readable at the tag level.But it would probably be nice if there were a way to view the result at the touch of a button.Also, it should make it easy to produce correct XHTML, especially for someone who has trouble remembering the names of tags.--Living a wicket life...Martijn Dashorst - http://www.jroller.com/page/dashorstWicket 1.1.1 is out: http://wicket.sourceforge.net/wicket-1.1 ---This SF.net email is sponsored by: Splunk Inc. Do you grep through log filesfor problems?Stop!Download the new AJAX search engine that makessearching your log files as easy as surfing theweb.DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmdlnkkid3432bid#0486dat1642___ Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket goodie: Versioned form blog entry
Great, thank you. 2006/2/13, Martijn Dashorst [EMAIL PROTECTED]: Someone asked about how I did my optimistic locking form, so I took 15 minutes and wrote a short entry on my blog. http://www.jroller.com/page/dashorst?entry=wicket_goodie_hibernate_versioned_form Martijn-- Living a wicket life...Martijn Dashorst - http://www.jroller.com/page/dashorstWicket 1.1.1 is out: http://wicket.sourceforge.net/wicket-1.1
Re: [Wicket-user] Creating a PropertyModel using a non-IModel POJO
Martijn, where is the big advantage between public MyForm(String id, IModel personmodel) { super(id, personmodel); add(new TextField(name, new PropertyModel(personmodel, name)));} and public MyForm(String id, Person person) { super(id, person); add(new TextField(name, new PropertyModel(person, name)));} It can't see it. Dirk 2006/1/25, Martijn Dashorst [EMAIL PROTECTED]: Frank,I see your confusion (I think).The javadoc comment for the modelObject parameter says: 'The model object, which may or may not implement IModel'This means that you can use POJO's directly as a parameter, and,IModel objects that wrap an object.For instance, you can do this: new PropertyModel(new Person(), name);andnew PropertyModel(new Model(new Person()), name);Both property models will evaluate correctly to the name propert ofthe person object. The difference is, that the first property model uses a direct reference to the person object, and the second uses awrapped person object.The advantage of the latter is that you can use specialized modelsthat minimize HTTPSession usage, by retrieving the model object 'on-the-fly', and still use the property models to get to the values.The other big advantage is that you can use this in your forms:public MyForm(String id, IModel personmodel) { super(id, personmodel); add(new TextField(name, new PropertyModel(personmodel, name)));}This has the advantage that you don't need to know how to get at theperson object in your form component. It can come from everywhere. MartijnOn 1/25/06, Frank Silbermann [EMAIL PROTECTED] wrote: The JavaDoc for the PropertyModel constructor says that its parameters are an IModel and an OGNL string, but I noticed that the code accepts any java.lang.Object as the first parameter.I discovered this when trying to sort out my confusion when the linkomatic example created a PropertyModel using this (the page itself) instead of an IModel. At first I thought this looked like a hack, and asked myself:If you wanted to be able to accept either kind of object, why not use two constructors? Then I realized that java.lang.Object is the supertype of everything, and maybe Java doesn't let you create overloaded constructors where the only difference in parameter is type versus subtype.But if the convenience of passing a non-IModel POJO is so important, then why not mention it in the JavaDoc? Or is the capability of passing a non-IModel POJO to the constructor a deprecated capability, perhaps included to ease the conversion of programs from earlier versions of Wicket?(If that is the case, perhaps the linkomatic example should be updated.The Page object could easily have been wrapped before passing it to the PropertyModel constructor.)--Living a wicket life...Martijn Dashorst - http://www.jroller.com/page/dashorstWicket 1.1 is out: http://wicket.sourceforge.net/wicket-1.1--- This SF.net email is sponsored by: Splunk Inc. Do you grep through log filesfor problems?Stop!Download the new AJAX search engine that makessearching your log files as easy as surfing theweb.DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmdlnkkid3432bid#0486dat1642___ Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Creating a PropertyModel using a non-IModel POJO
Igor, thank you. I got it. Dirk 2006/1/26, Igor Vaynberg [EMAIL PROTECTED]: the flexibility is in the extra layer of the modelmaybe you want to use a detachable model for the person so that it is loaded from the database. this is where public MyForm(String id, IModel personmodel) would come in handy. pass in whatever kind of model you want, and the propertymodel will use it to retrieve the object. -Igor On 1/25/06, Dirk Markert [EMAIL PROTECTED] wrote: Martijn, where is the big advantage between public MyForm(String id, IModel personmodel) { super(id, personmodel); add(new TextField(name, new PropertyModel(personmodel, name)));} and public MyForm(String id, Person person) { super(id, person); add(new TextField(name, new PropertyModel(person, name)));} It can't see it. Dirk 2006/1/25, Martijn Dashorst [EMAIL PROTECTED]: Frank,I see your confusion (I think). The javadoc comment for the modelObject parameter says: 'The model object, which may or may not implement IModel'This means that you can use POJO's directly as a parameter, and,IModel objects that wrap an object.For instance, you can do this: new PropertyModel(new Person(), name);andnew PropertyModel(new Model(new Person()), name);Both property models will evaluate correctly to the name propert ofthe person object. The difference is, that the first property model uses a direct reference to the person object, and the second uses awrapped person object.The advantage of the latter is that you can use specialized modelsthat minimize HTTPSession usage, by retrieving the model object 'on-the-fly', and still use the property models to get to the values.The other big advantage is that you can use this in your forms:public MyForm(String id, IModel personmodel) { super(id, personmodel); add(new TextField(name, new PropertyModel(personmodel, name)));}This has the advantage that you don't need to know how to get at theperson object in your form component. It can come from everywhere. MartijnOn 1/25/06, Frank Silbermann [EMAIL PROTECTED] wrote: The JavaDoc for the PropertyModel constructor says that its parameters are an IModel and an OGNL string, but I noticed that the code accepts any java.lang.Object as the first parameter.I discovered this when trying to sort out my confusion when the linkomatic example created a PropertyModel using this (the page itself) instead of an IModel. At first I thought this looked like a hack, and asked myself:If you wanted to be able to accept either kind of object, why not use two constructors? Then I realized that java.lang.Object is the supertype of everything, and maybe Java doesn't let you create overloaded constructors where the only difference in parameter is type versus subtype.But if the convenience of passing a non-IModel POJO is so important, then why not mention it in the JavaDoc? Or is the capability of passing a non-IModel POJO to the constructor a deprecated capability, perhaps included to ease the conversion of programs from earlier versions of Wicket?(If that is the case, perhaps the linkomatic example should be updated.The Page object could easily have been wrapped before passing it to the PropertyModel constructor.)--Living a wicket life... Martijn Dashorst - http://www.jroller.com/page/dashorstWicket 1.1 is out: http://wicket.sourceforge.net/wicket-1.1 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log filesfor problems?Stop!Download the new AJAX search engine that makes searching your log files as easy as surfing theweb.DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmdlnkkid3432bid#0486dat1642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user