Re: Cache oddity ... maybe
I have briefly looked at ur codes. Have u checked if your code has not executed the refresh / reload routine? Some methods are not executed in AJAX. Sorry I can't tell u what methods offhand. If you placed your code in those methods then ur new items will not be loaded but it will when u do a page refresh. This has happened to me before. -- View this message in context: http://www.nabble.com/Cache-oddity-...-maybe-tp22889814p22983675.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: GWT vs. Wicket?
I really like the idea behind GWT. And striving for a statically typed 'true' OO programming model is what GWT and Wicket have in common. I haven't build anything with GWT, so my opinions in this respect are what I infer from how I think GWT works. I expect GWT to scale more easily if you plan well for it. Meaning that you probably don't want to end up with a very crowded pages that's very chatty with the server.. in that case Wicket might actually be more efficient (probably a surprise for many) because often times it'll do everything in one request (locality). A few other things I like about Wicket when compared with GWT: - It's just the Java code you work with, nothing complicating like an extra compile step (in GWT's case to JavaScript) or even byte code engineering like many other frameworks do. This makes Wicket easier to debug - though admitted Wicket doesn't have the easiest to follow bowels around due to the magic we have to do to give users a stateful programing experience. - Wicket is very flexible. I've read comments a while back of someone saying Wicket doesn't very well support integrating with other libraries... well, that's just bullocks. Some things will be harder than other things, but you can pretty much take the framework apart at any level and replace with your own ideas, including tags that dynamically create components and stuff. - Wicket is completely dynamic. I've worked on several projects now where we had panels contributed by e.g. domain objects. Maybe not something that appeals to people who take separation of layers ultra serious, but I think it is awesome. I currently use this for functionality that is about surveys. Surveys have questions, and these questions can be anything... free text, multiple choice, but potentially location or color. Questions can contribute their own panels for editing and viewing. So we can decide at some point to e.g. develop a location question, that displays a map, and we could jar the question with the UI with it, plug it in, and no-one ever had to touch other parts of the UI. I love that kind of flexiblity, and it's hard to find frameworks that support stuff like that (though I expect that you can achieve something like this with GWT, I don't expect it to be as straightforward as with Wicket). - It's safe by default. I don't mean hacker-safe, but rather that you never by default communicate sensitive info like IDs (or as with GWT whole objects) with clients. My experience with using other frameworks than Wicket is that we always spent quite a bit of time making sure users couldn't do things they weren't supposed to do (like deleting an object they have no right for), whereas with Wicket based projects the amount of time doing this is zero. I do expect a few things to be nicer with GWT though. Mainly, no worries about scaling (Wicket *is* scalable, but beyond a few servers you'll have to do work for it, while with GWT it's mainly a question of scaling your services and avoid too much chatty-ness), and no worries about detaching models! And these two advantages can be large enough for someone to prefer GWT. I can easily make this email 3 times longer with my perceived pros and cons, but these are the things that spontaneously came up. :-) Eelco On Wed, Apr 8, 2009 at 6:11 AM, Casper Bang cas...@jbr.dk wrote: I was just wondering about the Wicket community's opinion of GWT. It seems to share many of the positive characteristics as Wicket (focus on code, not markup) with the major difference/benefit as I see, that is does not maintain any state on the server. Also, with GWT you seem to get more readily available components (i.e. http://extjs.com/explorer/). The bennefit of Wicket as I can see, is that applications potentially degrade nicer and the programming model hides the Ajax RPC better. Any thoughts? /Casper - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Can client cache pages effectively?
Still sounds like you're jumping through hoops to force this HTML caching to fit - possibly opening up security vulnerabilities by exposing a user's role in the URL - which should only be in the session. I maintain that you'd be better off caching the data - that's the expensive part anyway. But it's your app and that's my two cents. :) -- Jeremy Thomerson http://www.wickettraining.com On Thu, Apr 9, 2009 at 11:29 AM, Jim Pinkham pinkh...@gmail.com wrote: A quick follow up in case anyone else was curious about how this is going: I ended up using ehcache page cache filter for a simple page that just displays 'current' items (calendar view of events) based on a db query. No forms (state) on this page so it works pretty well. In my DAO that does updates, I clear the cache. Very simple, works great. (Only catch I ran into is that my menus change when I have a session and I'm logged in as super-user, so I have to make sure I don't let that version of the page be cached - I do that by adding 'super' page parameter so URL is different and filter is set to only cache the 'normal' version. So, that still leaves me with my main catalog page, which is primarily a similar list of items, but it also has some active content (in particular, a search form). So my bright idea (tm) (i.e. I'd love to hear critiques before I get too far along with it) is the following: Make a new page for just the data grid, with page parameters including the search string and last-modified date (and super-user login because I get some edit links and such with that). Mount it and ehcache it, and override setHeader so it becomes client cache-able. Then, my outer catalog page with the search form on it just uses an IFrame to display the grid data (easy to keep track of last-modified globally). Same clear method in DAO dumps the cache whenever a change is made. Also, I'd want to make a robot no-follow thing to avoid google trap on that page. Could this actually be a legitimate use of otherwise dodgy IFRAME ? Sound like a good plan? Thanks, -- Jim. On Fri, Mar 27, 2009 at 1:56 PM, Jim Pinkham pinkh...@gmail.com wrote: Jeremy, Thanks for your thoughtful reply - Scenario is exactly right. I played around with page headers to make the whole page cacheable, but ran into several problems - I have a search form, and there's an 'admin' login that enables edit links. So it's really a stateful page, but I want to speed up the most common state. The bulk of the content is from an AjaxFallbackDefaultDataTable with sortable columns. I re-sorted a column with the Ajax Debug window open to measure it's data size - about 225000 chars. My database search takes 64ms. Overall client repaint time is about 2 sec with browser on localhost. I haven't found the right hook to measure total wicket response time yet, but it appears pretty quick - so that's why I thougth it made sense to focus on client caching. Before I give up entirely on this idea, I'm wondering if it might make sense to make the grid a public Resource, which I'm hoping the browser would treat like an image. I can afford a separate db query to just get my max(lastModified), which might let me save the time to generate HTML, which looks as though it could be my bottleneck. If this way is too hard, I'll give up, but it sounds do-able - what do you think? Thanks, -- Jim. On Thu, Mar 26, 2009 at 6:30 PM, Jeremy Thomerson jer...@wickettraining.com wrote: How is this going to help you? Scenario as I understand it: 1. User requests homepage - pulls from site - with your etag in it 2. User requests homepage again - calls site - your server does all of the loading of data - then you calculate / set etag 3. Browser now knows that it is the same as before and does not have to pull the HTML down The user saves what is likely a very short time in the overall scheme of things - downloading the HTML. The user still has to sit through the process of you loading the data from the search / DB / etc. and generating HTML Your server saves no load - but a little bandwidth. I'd look at caching before it even gets to your server. Otherwise your user will likely not see much benefit unless you are sending multiple MB of data back. Sounds like premature optimization to me. -- Jeremy Thomerson http://www.wickettraining.com On Thu, Mar 26, 2009 at 5:26 PM, Jim Pinkham pinkh...@gmail.com wrote: Thanks Jerry; I think that applies only to static pages. My next idea is to try overridding WebPage.setHeaders and just set the response.setHeader(Cache-Control, max-age=3600, must-revalidate); response.setHeader(ETag, 1); // I'll use a checksum on the data coming back from my search (Even better would be a checksum on the rendered page data - any idea how to do that?) Initial test (above) seems promising...
Re: Package all CSS and JS
Hi, how about doing this with some kind of precompilation step? You could manipulate the code with maven or ant befor packing the war having an task combining all js and css in one. Just an idea... Cheers Bjoern Tietjens Am 10.04.2009 um 05:31 schrieb Brill Pappin br...@pappin.ca: Funny, I was thinking that same thing... in one quick app i was writing, I had ~20 header links! I kept thinking that can't be good :) although I have not done so yet, I think there must be a way to modify or create a resource loader that would generate a buffered version of css (for isntance) and change the request page to just load it. Let us know if you tackle that one... I'd love to see the code. - Brill Pappin On 9-Apr-09, at 10:57 AM, Eduardo Nunes wrote: I think that I didn't explain it right. What I want is that wicket concatenate all included javascripts into one file. Something like wicket:link link.. javascript1.js / link.. javascript2.js / link.. javascript3.js / /wicket:link Generate just one resource with javacript1.js, javacript2.js and javacript3.js concatenated. The reason for that is to reduce the number of requests. I have a project that includes almost 10 javascripts files and around 7 css files, it would be faster if the browser has to download just 2 files, one for all javascript and another one for css. I can do it with a servlet or something like this, but I want a solution that works inside wicket, that i don't have to change my source code. Probably wicket has a piece of source code responsible for the wicket:head tag, If I could intercept it and get all included javascripts, remove them from the generated html and include my own resource with all javascripts concatenated, I would be happy hehehe Please ask me if you don't understand, I have to improve my english :( Thanks, Eduardo S. Nunes On Thu, Apr 9, 2009 at 11:42 AM, Craig Tataryn crai...@tataryn.net wrote: On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes esnu...@gmail.com wrote: Hi, Is there a way to tell wicket to package all referenced javascripts together, the same for the css? If there isn't this solution yet, can anyone tell me where should I look for to implement it? You can put your resources, like css and javascript, directly in your packages either under src/main/java or src/main/resources and include them through header inclusions using a ResourceReference Craig. Thanks, Eduardo S. Nunes --- -- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Craig Tataryn site: http://www.basementcoders.com/ podcast:http://feeds.feedburner.com/TheBasementCoders irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin im: craiger...@hotmail.com, skype: craig.tataryn - 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: Package all CSS and JS
I think that this response by Igor to another thread was supposed to be on this one. Either way, it fits this one. it is much simpler and more efficient to set proper caching headers. concatenating resources often does not work because different components on different pages contribute different resources, so there are a lot of variations of these huge files you may end up with and would have to stream to the user over and over. yes, it would only be one request per page, but it would be a huge one over and over as opposed to being able to cache a lot of small resources and never request them again. -igor -- Jeremy Thomerson http://www.wickettraining.com On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes esnu...@gmail.com wrote: Hi, Is there a way to tell wicket to package all referenced javascripts together, the same for the css? If there isn't this solution yet, can anyone tell me where should I look for to implement it? Thanks, Eduardo S. Nunes - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Package all CSS and JS
The problem with merging css is that the backgrounds will not work anymore (in case the images are referenced relatively). But there is a solution for this, check web resource optimizer ( http://code.google.com/p/wro4j/ wro4j ). It performs url rewriting. Also, resources can be located anywhere (classpath, disk, relative or absolute url, etc.). Alex Bjoern Tietjens wrote: Hi, how about doing this with some kind of precompilation step? You could manipulate the code with maven or ant befor packing the war having an task combining all js and css in one. Just an idea... Cheers Bjoern Tietjens Am 10.04.2009 um 05:31 schrieb Brill Pappin br...@pappin.ca: Funny, I was thinking that same thing... in one quick app i was writing, I had ~20 header links! I kept thinking that can't be good :) although I have not done so yet, I think there must be a way to modify or create a resource loader that would generate a buffered version of css (for isntance) and change the request page to just load it. Let us know if you tackle that one... I'd love to see the code. - Brill Pappin On 9-Apr-09, at 10:57 AM, Eduardo Nunes wrote: I think that I didn't explain it right. What I want is that wicket concatenate all included javascripts into one file. Something like wicket:link link.. javascript1.js / link.. javascript2.js / link.. javascript3.js / /wicket:link Generate just one resource with javacript1.js, javacript2.js and javacript3.js concatenated. The reason for that is to reduce the number of requests. I have a project that includes almost 10 javascripts files and around 7 css files, it would be faster if the browser has to download just 2 files, one for all javascript and another one for css. I can do it with a servlet or something like this, but I want a solution that works inside wicket, that i don't have to change my source code. Probably wicket has a piece of source code responsible for the wicket:head tag, If I could intercept it and get all included javascripts, remove them from the generated html and include my own resource with all javascripts concatenated, I would be happy hehehe Please ask me if you don't understand, I have to improve my english :( Thanks, Eduardo S. Nunes On Thu, Apr 9, 2009 at 11:42 AM, Craig Tataryn crai...@tataryn.net wrote: On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes esnu...@gmail.com wrote: Hi, Is there a way to tell wicket to package all referenced javascripts together, the same for the css? If there isn't this solution yet, can anyone tell me where should I look for to implement it? You can put your resources, like css and javascript, directly in your packages either under src/main/java or src/main/resources and include them through header inclusions using a ResourceReference Craig. Thanks, Eduardo S. Nunes --- -- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Craig Tataryn site: http://www.basementcoders.com/ podcast:http://feeds.feedburner.com/TheBasementCoders irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin im: craiger...@hotmail.com, skype: craig.tataryn - 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/Package-all-CSS-and-JS-tp22971703p22984088.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: BUG: Wrong behavior when calling super(parameters)
Did you create a jira issue for this? On Fri, Apr 10, 2009 at 00:18, Eduardo Nunes esnu...@gmail.com wrote: Hi guys, Yesterday I sent a mail to this list about a possible bug with webpage + panel + form. I made a sample application that reproduce the bug. Please, run this application mvn compile jetty:start and on the main screen click more than one time in the Login button. Each time that you click on the Login button wicket add more parameters to the URL. After around 12 clicks you got no answer, just a blank screen. I will try to attach the sample application in this message, if it wont work, please tell me what should I do to share this sample application. PS: take a look in the comment in file BasePage.java Thanks, Eduardo S. Nunes - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: GWT vs. Wicket?
Casper, for the case when you can not enforce your users to have javascript, it's more worthwhile to compare Wicket to Tapestry5. I'm evaluating the latter right now. On Wed, Apr 8, 2009 at 4:11 PM, Casper Bang cas...@jbr.dk wrote: I was just wondering about the Wicket community's opinion of GWT. It seems to share many of the positive characteristics as Wicket (focus on code, not markup) with the major difference/benefit as I see, that is does not maintain any state on the server. Also, with GWT you seem to get more readily available components (i.e. http://extjs.com/explorer/). The bennefit of Wicket as I can see, is that applications potentially degrade nicer and the programming model hides the Ajax RPC better. Any thoughts? /Casper - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Just showing rating results
It shouldn't be too hard to write one. It would just be a component that shows an image then. The html would be something like this: html body wicket:panel img wicket:id=rating/ /wicket:panel /body /html And the java file would be something like this: public class RatingPanel extends Panel { public RatingPanel (final String id) { super(id); String imageName; // get rating int rating = ...; imageName = rating+rating+.png; add(new Image(rating, imageName)); } } Mind you, I didn't test this or anything and it could be done a whole lot prettier. Regards, Linda Altuğ B. Altıntaş wrote: Hi; How can i just show rating results of my ratings in the page. I know RatingPanel component but i need just to show rating in stars (ex : as an image), i don't want Ajax or clickable component. When you visit youtube homepage, you see the stars about ratings but they are not clickable, just image, i want that feature. Do you know any components in wicket that statfiy this feature. Thanks. No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.287 / Virus Database: 270.11.51/2052 - Release Date: 04/10/09 06:39:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Just showing rating results
Yes; it worked ! Thanks. 10 Nisan 2009 Cuma 13:52 tarihinde Martin Makundi martin.maku...@koodaripalvelut.com yazdı: You could use RatingPanel as it does have the feature isEnabled() = !hasVoted.getObject(); This means that a 'voted' element cannot be clicked. ** Martin 2009/4/10 Altuğ B. Altıntaş alt...@gmail.com: Hi; How can i just show rating results of my ratings in the page. I know RatingPanel component but i need just to show rating in stars (ex : as an image), i don't want Ajax or clickable component. When you visit youtube homepage, you see the stars about ratings but they are not clickable, just image, i want that feature. Do you know any components in wicket that statfiy this feature. Thanks. -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Altuğ.
RE: How to manipulate an AjaxRequest
Hi Martin, we have an solution, thanks for your help. Sort like your proposal. But an command that has to be executed. This command will force to do the data manipulation before any markup changes. So markup changes won't be done if data manipulation gives exception. See example under: public void execute(AjaxRequestTarget target) { try{ executeAction(target); -- Do data manipulation here onActionSuccess(target); } catch(Exception e) { onActionFailure(target); } } Regards, Frank -Original Message- From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] Sent: Thursday, April 09, 2009 4:48 PM To: users@wicket.apache.org Subject: Re: How to manipulate an AjaxRequest It could work, but that's not what I want, because also after the exception is thrown components could be added to the target. In that case I've to check on every add to target if an exception has occurred. I prefer to do this on one place. Maybe your exception handling could deal with this? Would you like to show your code in order for us to have a closer view on your particular situation? ** Martin -Original Message- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org The information contained in this communication is confidential, intended solely for the use of the individual or entity to whom it is addressed and may be legally privileged and protected by professional secrecy. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. This email does not constitute any commitment from Cordys Holding BV or any of its subsidiaries except when expressly agreed in a written agreement between the intended recipient and Cordys Holding BV or its subsidiaries. Cordys is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. Cordys does not guarantee that the integrity of this communication has been maintained nor that the communication is free of viruses, interceptions or interference. If you are not the intended recipient of this communication please return the communication to the sender and delete and destroy all copies. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Just showing rating results
Or, you could use jquery rating plugin, take a look here: http://www.fyneworks.com/jquery/star-rating/ http://www.fyneworks.com/jquery/star-rating/ Alex. Altuğ B. Altıntaş wrote: Hi; How can i just show rating results of my ratings in the page. I know RatingPanel component but i need just to show rating in stars (ex : as an image), i don't want Ajax or clickable component. When you visit youtube homepage, you see the stars about ratings but they are not clickable, just image, i want that feature. Do you know any components in wicket that statfiy this feature. Thanks. -- Altuğ. -- View this message in context: http://www.nabble.com/Just-showing-rating-results-tp22986194p22987283.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: BUG: Wrong behavior when calling super(parameters)
No, not yet On Fri, Apr 10, 2009 at 4:45 AM, Johan Compagner jcompag...@gmail.com wrote: Did you create a jira issue for this? On Fri, Apr 10, 2009 at 00:18, Eduardo Nunes esnu...@gmail.com wrote: Hi guys, Yesterday I sent a mail to this list about a possible bug with webpage + panel + form. I made a sample application that reproduce the bug. Please, run this application mvn compile jetty:start and on the main screen click more than one time in the Login button. Each time that you click on the Login button wicket add more parameters to the URL. After around 12 clicks you got no answer, just a blank screen. I will try to attach the sample application in this message, if it wont work, please tell me what should I do to share this sample application. PS: take a look in the comment in file BasePage.java Thanks, Eduardo S. Nunes - 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: Adding a confirmation popup
What's the generated JS? Have you debugged with Firebug, etc, to see what's happening in the JS? Are you attaching that link to a regular anchor tag in the HTML? If you're putting it on a span, Wicket will generate an onclick to make it a link - which may iinterfere with your onclick JS. -- Jeremy Thomerson http://www.wickettraining.com On Fri, Apr 10, 2009 at 3:38 AM, Linda van der Pal lvd...@heritageagenturen.nl wrote: In the book Wicket in Action I found this example: public class MyPage extends WebPage { public MyPage() { Link link = new Link(link) { @Override protected void onClick() { System.out.println(Link clicked); } }; add(link); link.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');); } } I tried to copy this behavior in my own code, but for some reason, it does show the popup, but then doesn't go on to actually going through with the action (deleting an item) after confirmation. So here's my code: private Link? createDeleteButton(final ListItemBookListData item) { Link? deleteButton = new DeleteLink(delete, item.getModel()); deleteButton.add(new Image(deleteIcon, new ResourceReference(BookListPanel.class, ../icons/list-remove.png))); deleteButton.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');)); return deleteButton; } // This is an inner class in the same class as the method above @AuthorizeAction(action = Action.ENABLE, roles = { OWNER }) private class DeleteLink extends LinkBookListData { private static final long serialVersionUID = 1L; public DeleteLink(final String id, final IModelBookListData model) { super(id, model); } @Override public void onClick() { // delete the book try { BookSaver bs = new BookSaver(); BookListData deletedbook = (BookListData) getModelObject(); bs.deleteBook(deletedbook.getIsbn()); booklistmodel.getObject().remove(deletedbook); } catch (SQLException se) { error(SQLERROR_GET+ '\n' + se.getMessage()); } catch (IOException ie) { error(IOERROR+ '\n' + ie.getMessage()); } } } Any clue what I might be doing wrong? Regards, Linda - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Adding a confirmation popup
I've put it on a button, might that be why it doesn't work? Generated line of source code: button type=submit wicket:id=delete class=greenButton onclick=return confirm('Are you sure?');img wicket:id=deleteIcon src=resources/nl.lunaris.bookdb.webui.pages.BookListPanel/null/icons/list-remove.png//button Jeremy Thomerson wrote: What's the generated JS? Have you debugged with Firebug, etc, to see what's happening in the JS? Are you attaching that link to a regular anchor tag in the HTML? If you're putting it on a span, Wicket will generate an onclick to make it a link - which may iinterfere with your onclick JS. -- Jeremy Thomerson http://www.wickettraining.com On Fri, Apr 10, 2009 at 3:38 AM, Linda van der Pal lvd...@heritageagenturen.nl wrote: In the book Wicket in Action I found this example: public class MyPage extends WebPage { public MyPage() { Link link = new Link(link) { @Override protected void onClick() { System.out.println(Link clicked); } }; add(link); link.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');); } } I tried to copy this behavior in my own code, but for some reason, it does show the popup, but then doesn't go on to actually going through with the action (deleting an item) after confirmation. So here's my code: private Link? createDeleteButton(final ListItemBookListData item) { Link? deleteButton = new DeleteLink(delete, item.getModel()); deleteButton.add(new Image(deleteIcon, new ResourceReference(BookListPanel.class, ../icons/list-remove.png))); deleteButton.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');)); return deleteButton; } // This is an inner class in the same class as the method above @AuthorizeAction(action = Action.ENABLE, roles = { OWNER }) private class DeleteLink extends LinkBookListData { private static final long serialVersionUID = 1L; public DeleteLink(final String id, final IModelBookListData model) { super(id, model); } @Override public void onClick() { // delete the book try { BookSaver bs = new BookSaver(); BookListData deletedbook = (BookListData) getModelObject(); bs.deleteBook(deletedbook.getIsbn()); booklistmodel.getObject().remove(deletedbook); } catch (SQLException se) { error(SQLERROR_GET+ '\n' + se.getMessage()); } catch (IOException ie) { error(IOERROR+ '\n' + ie.getMessage()); } } } Any clue what I might be doing wrong? Regards, Linda - 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.287 / Virus Database: 270.11.51/2052 - Release Date: 04/10/09 06:39:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Adding a confirmation popup
I think it should be input type=submit instead of button, or you should add form submit javascript code into the onclick handler.. Linda van der Pal wrote: I've put it on a button, might that be why it doesn't work? Generated line of source code: button type=submit wicket:id=delete class=greenButton onclick=return confirm('Are you sure?');img wicket:id=deleteIcon src=resources/nl.lunaris.bookdb.webui.pages.BookListPanel/null/icons/list-remove.png//button Jeremy Thomerson wrote: What's the generated JS? Have you debugged with Firebug, etc, to see what's happening in the JS? Are you attaching that link to a regular anchor tag in the HTML? If you're putting it on a span, Wicket will generate an onclick to make it a link - which may iinterfere with your onclick JS. -- Jeremy Thomerson http://www.wickettraining.com On Fri, Apr 10, 2009 at 3:38 AM, Linda van der Pal lvd...@heritageagenturen.nl wrote: In the book Wicket in Action I found this example: public class MyPage extends WebPage { public MyPage() { Link link = new Link(link) { @Override protected void onClick() { System.out.println(Link clicked); } }; add(link); link.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');); } } I tried to copy this behavior in my own code, but for some reason, it does show the popup, but then doesn't go on to actually going through with the action (deleting an item) after confirmation. So here's my code: private Link? createDeleteButton(final ListItemBookListData item) { Link? deleteButton = new DeleteLink(delete, item.getModel()); deleteButton.add(new Image(deleteIcon, new ResourceReference(BookListPanel.class, ../icons/list-remove.png))); deleteButton.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');)); return deleteButton; } // This is an inner class in the same class as the method above @AuthorizeAction(action = Action.ENABLE, roles = { OWNER }) private class DeleteLink extends LinkBookListData { private static final long serialVersionUID = 1L; public DeleteLink(final String id, final IModelBookListData model) { super(id, model); } @Override public void onClick() { // delete the book try { BookSaver bs = new BookSaver(); BookListData deletedbook = (BookListData) getModelObject(); bs.deleteBook(deletedbook.getIsbn()); booklistmodel.getObject().remove(deletedbook); } catch (SQLException se) { error(SQLERROR_GET+ '\n' + se.getMessage()); } catch (IOException ie) { error(IOERROR+ '\n' + ie.getMessage()); } } } Any clue what I might be doing wrong? Regards, Linda - 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.287 / Virus Database: 270.11.51/2052 - Release Date: 04/10/09 06:39:00 - 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: Adding a confirmation popup
Thanks to you both, now at least I know what to experiment with. Regards, Linda Serkan Camurcuoglu wrote: I think it should be input type=submit instead of button, or you should add form submit javascript code into the onclick handler.. Linda van der Pal wrote: I've put it on a button, might that be why it doesn't work? Generated line of source code: button type=submit wicket:id=delete class=greenButton onclick=return confirm('Are you sure?');img wicket:id=deleteIcon src=resources/nl.lunaris.bookdb.webui.pages.BookListPanel/null/icons/list-remove.png//button Jeremy Thomerson wrote: What's the generated JS? Have you debugged with Firebug, etc, to see what's happening in the JS? Are you attaching that link to a regular anchor tag in the HTML? If you're putting it on a span, Wicket will generate an onclick to make it a link - which may iinterfere with your onclick JS. -- Jeremy Thomerson http://www.wickettraining.com On Fri, Apr 10, 2009 at 3:38 AM, Linda van der Pal lvd...@heritageagenturen.nl wrote: In the book Wicket in Action I found this example: public class MyPage extends WebPage { public MyPage() { Link link = new Link(link) { @Override protected void onClick() { System.out.println(Link clicked); } }; add(link); link.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');); } } I tried to copy this behavior in my own code, but for some reason, it does show the popup, but then doesn't go on to actually going through with the action (deleting an item) after confirmation. So here's my code: private Link? createDeleteButton(final ListItemBookListData item) { Link? deleteButton = new DeleteLink(delete, item.getModel()); deleteButton.add(new Image(deleteIcon, new ResourceReference(BookListPanel.class, ../icons/list-remove.png))); deleteButton.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');)); return deleteButton; } // This is an inner class in the same class as the method above @AuthorizeAction(action = Action.ENABLE, roles = { OWNER }) private class DeleteLink extends LinkBookListData { private static final long serialVersionUID = 1L; public DeleteLink(final String id, final IModelBookListData model) { super(id, model); } @Override public void onClick() { // delete the book try { BookSaver bs = new BookSaver(); BookListData deletedbook = (BookListData) getModelObject(); bs.deleteBook(deletedbook.getIsbn()); booklistmodel.getObject().remove(deletedbook); } catch (SQLException se) { error(SQLERROR_GET+ '\n' + se.getMessage()); } catch (IOException ie) { error(IOERROR+ '\n' + ie.getMessage()); } } } Any clue what I might be doing wrong? Regards, Linda - 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.287 / Virus Database: 270.11.51/2052 - Release Date: 04/10/09 06:39:00 - 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 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.287 / Virus Database: 270.11.51/2052 - Release Date: 04/10/09 06:39:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: BUG: Wrong behavior when calling super(parameters)
please do else it will be lost here on the mailing list On Fri, Apr 10, 2009 at 15:16, Eduardo Nunes esnu...@gmail.com wrote: No, not yet On Fri, Apr 10, 2009 at 4:45 AM, Johan Compagner jcompag...@gmail.com wrote: Did you create a jira issue for this? On Fri, Apr 10, 2009 at 00:18, Eduardo Nunes esnu...@gmail.com wrote: Hi guys, Yesterday I sent a mail to this list about a possible bug with webpage + panel + form. I made a sample application that reproduce the bug. Please, run this application mvn compile jetty:start and on the main screen click more than one time in the Login button. Each time that you click on the Login button wicket add more parameters to the URL. After around 12 clicks you got no answer, just a blank screen. I will try to attach the sample application in this message, if it wont work, please tell me what should I do to share this sample application. PS: take a look in the comment in file BasePage.java Thanks, Eduardo S. Nunes - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket in Action vs the other main books
Hello Wicketers, I am in the throes of a decision to buy the Wicket in Action book. There are a couple of other books but the little time I have lurked on this ML I have noticed the Wicket-in-Action authors are fielding some of the issues on this list. The reason I need to hit Wicket as hard as I can is I have already dismissed 3 other MVC frameworks that I have evaluated over the past two weeks. I have also evaluated 3 end-to-end MVC frameworks based on Wicket. End-to-end means: (HTML UI)(Java POJO middleware)(Hibernate|iBatis)(MySQL). I have dismissed all of the so-called end-to-end MVC frameworks except: databinder.net. The databinder.net framework is a great piece of software based entirely on Wicket and Hibernate. The only caveat is databinder.net appears to no longer enjoy a community type support. And, in fact, databinder.net does not seem to be supported in any way including the original author. So, betting the farm on databinder.net is problematic and this brings us to the question of: does the Wicket in Action book (or any Wicket book) discuss the coupling together of Wicket and something like Hibernate or iBatis to a restructured database for the purposes of rewriting an existing web app. The current web app run-time for the company I am working for was written using a code-generator. The name of the code-generator referenced in the previous sentence is not known. The original programmer that authored the original run-time web app has flown-the-coop. Rants and Raves welcomed. Please advise, David. There are 10 kinds of people in this world: those who understand binary and those who don’t (Valid only for 2's complement). - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
open view session filter position in web.xml
I am using open view session filter , i was assuming that a session gets created whenever a request is made and closed when response is rendered , to check that i added log statements to see when session gets created and closed, but surprisinging its gets called several times , i have this filter after wicket servlet in web.xml, what should be order of this in web.xml - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket in Action vs the other main books
David, Wicket in Action describe how to integrate with Spring and Hibernate. Databinder.net is LGPL, you can choose and copy code you like. Updating selected code to recent wicket version should be fairly easy. Regards, Erik. David Brown schreef: Hello Wicketers, I am in the throes of a decision to buy the Wicket in Action book. There are a couple of other books but the little time I have lurked on this ML I have noticed the Wicket-in-Action authors are fielding some of the issues on this list. The reason I need to hit Wicket as hard as I can is I have already dismissed 3 other MVC frameworks that I have evaluated over the past two weeks. I have also evaluated 3 end-to-end MVC frameworks based on Wicket. End-to-end means: (HTML UI)(Java POJO middleware)(Hibernate|iBatis)(MySQL). I have dismissed all of the so-called end-to-end MVC frameworks except: databinder.net. The databinder.net framework is a great piece of software based entirely on Wicket and Hibernate. The only caveat is databinder.net appears to no longer enjoy a community type support. And, in fact, databinder.net does not seem to be supported in any way including the original author. So, betting the farm on databinder.net is problematic and this brings us to the question of: does the Wicket in Action book (or any Wicket book) discuss the coupling together of Wicket and something like Hibernate or iBatis to a restructured database for the purposes of rewriting an existing web app. The current web app run-time for the company I am working for was written using a code-generator. The name of the code-generator referenced in the previous sentence is not known. The original programmer that authored the original run-time web app has flown-the-coop. Rants and Raves welcomed. Please advise, David. -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
URL rewriting
We are evaluating wicket to rewrite our consumer UI. There is one requirement in which I would like to get advice on. We have a requirement in which the wildcard url gets dispatched to a controller that renders a page. The url pattern is in the form of /company/**-details.html. We have a single controller that receives the above url and figures out the company name and displays the page accordingly or throws a http 404 error if the company is not found. e.g /company/ABC-details.html, /company/TOTO-details.html etc Can this be done in wicket? Any advice or hints would be appreciated! Dinp - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket in Action vs the other main books
You probably shouldn't base your evaluation of a book on how good any specific topic is explained there, unless this specific topic is one and the only thing you are interested in. You will most probably still have to spend some time researching whatever you're insterested in on the web. Still, Wicket in Action is afaik the most recent piece, and certainly comes from the most experienced in Wicket authors, which is good regardless of what solutions you're going to use for your business layer. On Fri, Apr 10, 2009 at 6:42 PM, David Brown dbr...@sexingtechnologies.com wrote: Hello Wicketers, I am in the throes of a decision to buy the Wicket in Action book. There are a couple of other books but the little time I have lurked on this ML I have noticed the Wicket-in-Action authors are fielding some of the issues on this list. The reason I need to hit Wicket as hard as I can is I have already dismissed 3 other MVC frameworks that I have evaluated over the past two weeks. I have also evaluated 3 end-to-end MVC frameworks based on Wicket. End-to-end means: (HTML UI)(Java POJO middleware)(Hibernate|iBatis)(MySQL). I have dismissed all of the so-called end-to-end MVC frameworks except: databinder.net. The databinder.net framework is a great piece of software based entirely on Wicket and Hibernate. The only caveat is databinder.net appears to no longer enjoy a community type support. And, in fact, databinder.net does not seem to be supported in any way including the original author. So, betting the farm on databinder.net is problematic and this brings us to the question of: does the Wicket in Action book (or any Wicket book) discuss the coupling together of Wicket and something like Hibernate or iBatis to a restructured database for the purposes of rewriting an existing web app. The current web app run-time for the company I am working for was written using a code-generator. The name of the code-generator referenced in the previous sentence is not known. The original programmer that authored the original run-time web app has flown-the-coop. Rants and Raves welcomed. Please advise, David. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- sp - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: URL rewriting
I am not sure but maybe one simple way is to mountBookmarkablePage(/company, CompanyHandler.class); and then perform uour stuff in CompanyHandler, look at the request url etc. ** Martin 2009/4/10 DV huc...@yahoo.com: We are evaluating wicket to rewrite our consumer UI. There is one requirement in which I would like to get advice on. We have a requirement in which the wildcard url gets dispatched to a controller that renders a page. The url pattern is in the form of /company/**-details.html. We have a single controller that receives the above url and figures out the company name and displays the page accordingly or throws a http 404 error if the company is not found. e.g /company/ABC-details.html, /company/TOTO-details.html etc Can this be done in wicket? Any advice or hints would be appreciated! Dinp - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket:Interface TabbedPanel and INewBrowserWindowListener
that parameter is only added when wicket thinks you opened a new browser window or tab. it has nothing to do with tabbed panel. have you done that? this code is based on window.name attribute so if you have some js that changes the value it may confuse wicket. -igor On Fri, Apr 10, 2009 at 8:38 AM, Daniele Dellafiore ilde...@gmail.com wrote: Hi everyone, I have this situation: a TabbedPanel with 2 panels each containing a form. Each panel have aa checkbox that trigger the enable/disable status of each component of the form. So I enter the panel, click the enable checkbox and then I can edit and save and press a discard button. The discard button execute a: setResponsePage(getPage().getClass(), getPage().getPageParameters()); becouse I need to reload the same entity I was editing and tipically I have a single parameters that is the ID of the entity. The effect is that the page is still in the initial situation, with editing disabled and every modification, of course, has not been saved. This works in the first Tab of the TabbedPanel. In the second, what happens is that fields values are reset but they do not go back to disabled status. The reason I think is that instead of just the entity ID I also found this pageParameter: wicket:interface = wicket-7:0:7:INewBrowserWindowListener:: I am pretty sure that is related to the TabbedPanel but cannot understand how. If I remove that parameter, the behavior is what expected: page is restarted and I am back to the first tab with fields disabled. Two question: 1. when and why that parameter is added? I would like to read more about wicket:interface and friends, can you point me to some doc? 2. What if I would like to reload the page on the same tab I was before? You think is better to call a setSelectedTab before the setResponsePage or to pass a pageParameter with the number of the selected tab? Or what else? Thanks. -- Daniele Dellafiore http://blog.ildella.net/ - 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: URL rewriting
You have to mount your page via MixedParamUrlCodingStrategy: mount(new MixedParamUrlCodingStrategy(/company, CompanyPage.class, new String[] {companyName}); and in CompanyPage(PageParameters parameters) constructor do something like this: String nameInUrl = parameters.getString(); String company = nameInUrl.substring(0, ...); On Fri, Apr 10, 2009 at 5:11 PM, DV huc...@yahoo.com wrote: We are evaluating wicket to rewrite our consumer UI. There is one requirement in which I would like to get advice on. We have a requirement in which the wildcard url gets dispatched to a controller that renders a page. The url pattern is in the form of /company/**-details.html. We have a single controller that receives the above url and figures out the company name and displays the page accordingly or throws a http 404 error if the company is not found. e.g /company/ABC-details.html, /company/TOTO-details.html etc Can this be done in wicket? Any advice or hints would be appreciated! Dinp
Re: URL rewriting
Thanks for the responses. 3 decent responses within an hour or two. I'm impressed. The reputation about this group is definitely a plus in my evaluation. --- On Fri, 4/10/09, David Brown dbr...@sexingtechnologies.com wrote: From: David Brown dbr...@sexingtechnologies.com Subject: Re: URL rewriting To: users@wicket.apache.org, huc...@yahoo.com Date: Friday, April 10, 2009, 10:17 AM Hello, one thing you could do is to not worry with Wicket doing this but instead allow a proxy to do this for you such as Squid with the very good Squid URL rewriting engine. I think even Apache has some very good URL rewriting configurations. Just an idea, David. There are 10 kinds of people in this world: those who understand binary and those who don’t (Valid only for 2's complement). - Original Message - From: DV huc...@yahoo.com To: users@wicket.apache.org Sent: Friday, April 10, 2009 10:11:24 AM GMT -06:00 US/Canada Central Subject: URL rewriting We are evaluating wicket to rewrite our consumer UI. There is one requirement in which I would like to get advice on. We have a requirement in which the wildcard url gets dispatched to a controller that renders a page. The url pattern is in the form of /company/**-details.html. We have a single controller that receives the above url and figures out the company name and displays the page accordingly or throws a http 404 error if the company is not found. e.g /company/ABC-details.html, /company/TOTO-details.html etc Can this be done in wicket? Any advice or hints would be appreciated! Dinp - 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: Component Model question
Are you trying to handle state on client side? While that is possible, it is not the purpose of Wicket. Would you consider managing he state on server side? ** Martin 2009/4/10 Craig Tataryn crai...@tataryn.net: I have a component I'm designing where it displays a list of items to the user, so the setup for the component on the page might look like this: add(new MultiTextInputCollectionString(tags, new ArrayListString() { { add(apple); add(banana); } })); The widget will render two sets of hidden inputs, one for the original/additional items (name=tags) which were entered and one for deleted items (name=removed_tags). For instance: input type=hidden name=tags value=apple/ input type=hidden name=tags value=peach/ input type=hidden name=tags value=grape/ input type=hidden name=removed_tags value=banana/ The above would result from me keeping apple and adding peach, grape, and removing banana. I'm a bit stuck on how I should get my component to put these values back into it's model? Obviously in behind the scenes I'm going to have to do some stuff in the MultiTextInput ctor to have the incoming Collection added to a composite model that contains both the original/added items and the removed items. I'm just not sure where I broker the form submittal so that I have a chance to move the tags and removed_tags into the proper place in the model for my component. When the user calls getModelObject() on my component they'll get an object back where they can query model.getItems() and model.getRemovedItems(). As always, any help greatly appreciated! Craig. -- Craig Tataryn site: http://www.basementcoders.com/ podcast:http://feeds.feedburner.com/TheBasementCoders irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin twitter: craiger - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component Model question
On 10-Apr-09, at 12:58 PM, Martin Makundi wrote: Are you trying to handle state on client side? While that is possible, it is not the purpose of Wicket. Would you consider managing he state on server side? It's an existing javascript widget I wrote so I was looking for a quick port to Wicket. However there is no reason there couldn't be two versions, the Ajax version could redraw everything serverside upon addition/deletion of items. So if it's possible for me to (easily) map those two sets of hidden inputs to my model upon form submit I'd really like to know how. Thanks, Craig. ** Martin 2009/4/10 Craig Tataryn crai...@tataryn.net: I have a component I'm designing where it displays a list of items to the user, so the setup for the component on the page might look like this: add(new MultiTextInputCollectionString(tags, new ArrayListString() { { add(apple); add(banana); } })); The widget will render two sets of hidden inputs, one for the original/additional items (name=tags) which were entered and one for deleted items (name=removed_tags). For instance: input type=hidden name=tags value=apple/ input type=hidden name=tags value=peach/ input type=hidden name=tags value=grape/ input type=hidden name=removed_tags value=banana/ The above would result from me keeping apple and adding peach, grape, and removing banana. I'm a bit stuck on how I should get my component to put these values back into it's model? Obviously in behind the scenes I'm going to have to do some stuff in the MultiTextInput ctor to have the incoming Collection added to a composite model that contains both the original/added items and the removed items. I'm just not sure where I broker the form submittal so that I have a chance to move the tags and removed_tags into the proper place in the model for my component. When the user calls getModelObject() on my component they'll get an object back where they can query model.getItems() and model.getRemovedItems(). As always, any help greatly appreciated! Craig. -- Craig Tataryn site: http://www.basementcoders.com/ podcast:http://feeds.feedburner.com/TheBasementCoders irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin twitter: craiger - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: open view session filter position in web.xml
Your filter-mapping for the OSIV filter has to come before the one for wicket. On Fri, Apr 10, 2009 at 10:37 AM, tubin gen fachh...@gmail.com wrote: I am using open view session filter , i was assuming that a session gets created whenever a request is made and closed when response is rendered , to check that i added log statements to see when session gets created and closed, but surprisinging its gets called several times , i have this filter after wicket servlet in web.xml, what should be order of this in web.xml - 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: open view session filter position in web.xml
On 10-Apr-09, at 1:44 PM, James Carman wrote: Your filter-mapping for the OSIV filter has to come before the one for wicket. On Fri, Apr 10, 2009 at 10:37 AM, tubin gen fachh...@gmail.com wrote: I am using open view session filter , i was assuming that a session gets created whenever a request is made and closed when response is rendered , to check that i added log statements to see when session gets created and closed, but surprisinging its gets called several times , i have this filter after wicket servlet in web.xml, what should be order of this in web.xml Search for OpenSessionInView here: http://www.mysticcoders.com/blog/2009/03/09/5-days-of-wicket-day-1/ James is right, OSIV must come before wicket's or BOOM. - 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
image path for my java script
I need image path in my java script , I want collapsable behavior for my component , to which i add either plus or minus , when user click on the imaghe my java script get the image with component and checks the src to find if it is plus or minus , and finally changes the image to the oppsite here is my java script [code] $(document).ready(function(){ $(p.collapsible_text).click( function () { var $img= $(this).children(img); var $div= $(this).next(div); var $label=$(this).children(label); var imgSrc=$img.attr(src); if($img.attr(src) == resources/gov.hhs.acf.web.pages.common.collapsable.AbstractCollapsablePanel/plus.png){ $div.slideDown(fast); $label.html(Close); $img.attr(src,resources/gov.hhs.acf.web.pages.common.collapsable.AbstractCollapsablePanel/minus.png); return; } if($img.attr(src) == resources/gov.hhs.acf.web.pages.common.collapsable.AbstractCollapsablePanel/minus.png){ $div.slideUp(fast); $label.html(Open); $img.attr(src,resources/gov.hhs.acf.web.pages.common.collapsable.AbstractCollapsablePanel/plus.png) } } ); }); [code] now the problem is I hardcoded the image path in java script but the image path changes becasue this sciprt gets added by my collapsable panel and any page from any directory might use this panel so the image path is different to different pages so need suggestions on how to hard code image path in this java script - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket And Double Form Submission
Hi, I was just wondering how you guys implement double posting (double form Submission) measures for wicket. I was able to implement client side protection and was wondering if there any way to do it via server side also Is there one like struts token approach that I can use? What is the best way to do this? Thanks Carlo
Re: Wicket And Double Form Submission
Wicket uses redirect by default to avoid double submission.. ** Martin 2009/4/10 Carlo Camerino carlo.camer...@gmail.com: Hi, I was just wondering how you guys implement double posting (double form Submission) measures for wicket. I was able to implement client side protection and was wondering if there any way to do it via server side also Is there one like struts token approach that I can use? What is the best way to do this? Thanks Carlo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component Model question
So if it's possible for me to (easily) map those two sets of hidden inputs to my model upon form submit I'd really like to know how. What specifically is the difficult part? ** Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket And Double Form Submission
Does it work even if i use IndicatingAjaxButton and not the SubmitLink? On Sat, Apr 11, 2009 at 3:10 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Wicket uses redirect by default to avoid double submission.. ** Martin 2009/4/10 Carlo Camerino carlo.camer...@gmail.com: Hi, I was just wondering how you guys implement double posting (double form Submission) measures for wicket. I was able to implement client side protection and was wondering if there any way to do it via server side also Is there one like struts token approach that I can use? What is the best way to do this? Thanks Carlo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket And Double Form Submission
Does it work even if i use IndicatingAjaxButton and not the SubmitLink? The wicket requestCycle redirects by default, you can put a brekpoint at public final void setRedirect(final boolean redirect) { this.redirect = redirect; } and you'll see. Ofcourse the http traffic is more efficient if you avoid double submission on client side and just 'gracefully' (more or less, depending on your service) fail on server side on double submit. ** Martin On Sat, Apr 11, 2009 at 3:10 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Wicket uses redirect by default to avoid double submission.. ** Martin 2009/4/10 Carlo Camerino carlo.camer...@gmail.com: Hi, I was just wondering how you guys implement double posting (double form Submission) measures for wicket. I was able to implement client side protection and was wondering if there any way to do it via server side also Is there one like struts token approach that I can use? What is the best way to do this? Thanks Carlo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket And Double Form Submission
ya i tested it on indicatingajaxbutton. seems that when you don't enable javascripts, you don't go to the event handler for your button. Instead the page is reloaded again so if i'm able to catch it on the client side with javascript turned on, it wouldn't anymore be a problem. hopefully :P On Sat, Apr 11, 2009 at 3:16 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Does it work even if i use IndicatingAjaxButton and not the SubmitLink? The wicket requestCycle redirects by default, you can put a brekpoint at public final void setRedirect(final boolean redirect) { this.redirect = redirect; } and you'll see. Ofcourse the http traffic is more efficient if you avoid double submission on client side and just 'gracefully' (more or less, depending on your service) fail on server side on double submit. ** Martin On Sat, Apr 11, 2009 at 3:10 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Wicket uses redirect by default to avoid double submission.. ** Martin 2009/4/10 Carlo Camerino carlo.camer...@gmail.com: Hi, I was just wondering how you guys implement double posting (double form Submission) measures for wicket. I was able to implement client side protection and was wondering if there any way to do it via server side also Is there one like struts token approach that I can use? What is the best way to do this? Thanks Carlo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket in Action vs the other main books
Hello Erik, thanks for the speedy and informative reply. I just acquired the Tong PDF and I will cruise by BN and pick-up the WIA book. The databinder.net may be LGPL but I do not see any source-code repo: SVN, HG, etc. so it is too risky for me to rely strictly on the jars that came with the demo examples. Thanks again, David. There are 10 kinds of people in this world: those who understand binary and those who don’t (Valid only for 2's complement). - Original Message - From: Erik van Oosten e.vanoos...@grons.nl To: users@wicket.apache.org Sent: Friday, April 10, 2009 9:54:35 AM GMT -06:00 US/Canada Central Subject: Re: Wicket in Action vs the other main books David, Wicket in Action describe how to integrate with Spring and Hibernate. Databinder.net is LGPL, you can choose and copy code you like. Updating selected code to recent wicket version should be fairly easy. Regards, Erik. David Brown schreef: Hello Wicketers, I am in the throes of a decision to buy the Wicket in Action book. There are a couple of other books but the little time I have lurked on this ML I have noticed the Wicket-in-Action authors are fielding some of the issues on this list. The reason I need to hit Wicket as hard as I can is I have already dismissed 3 other MVC frameworks that I have evaluated over the past two weeks. I have also evaluated 3 end-to-end MVC frameworks based on Wicket. End-to-end means: (HTML UI)(Java POJO middleware)(Hibernate|iBatis)(MySQL). I have dismissed all of the so-called end-to-end MVC frameworks except: databinder.net. The databinder.net framework is a great piece of software based entirely on Wicket and Hibernate. The only caveat is databinder.net appears to no longer enjoy a community type support. And, in fact, databinder.net does not seem to be supported in any way including the original author. So, betting the farm on databinder.net is problematic and this brings us to the question of: does the Wicket in Action book (or any Wicket book) discuss the coupling together of Wicket and something like Hibernate or iBatis to a restructured database for the purposes of rewriting an existing web app. The current web app run-time for the company I am working for was written using a code-generator. The name of the code-generator referenced in the previous sentence is not known. The original programmer that authored the original run-time web app has flown-the-coop. Rants and Raves welcomed. Please advise, David. -- Erik van Oosten http://day-to-day-stuff.blogspot.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: image path for my java script
the easiest way to deal with images is to always use css, that way images are always loaded relative to css and you dont have a problem. instead of an img tag add a div class=plus and have div.plus { background: url('plus.gif'); width:20px;height:20px; } other then that you can always build a url using urlfor() methods on component and request cycle and pas those as parameters to your script. -igor On Fri, Apr 10, 2009 at 11:59 AM, tubin gen fachh...@gmail.com wrote: I need image path in my java script , I want collapsable behavior for my component , to which i add either plus or minus , when user click on the imaghe my java script get the image with component and checks the src to find if it is plus or minus , and finally changes the image to the oppsite here is my java script [code] $(document).ready(function(){ $(p.collapsible_text).click( function () { var $img= $(this).children(img); var $div= $(this).next(div); var $label=$(this).children(label); var imgSrc=$img.attr(src); if($img.attr(src) == resources/gov.hhs.acf.web.pages.common.collapsable.AbstractCollapsablePanel/plus.png){ $div.slideDown(fast); $label.html(Close); $img.attr(src,resources/gov.hhs.acf.web.pages.common.collapsable.AbstractCollapsablePanel/minus.png); return; } if($img.attr(src) == resources/gov.hhs.acf.web.pages.common.collapsable.AbstractCollapsablePanel/minus.png){ $div.slideUp(fast); $label.html(Open); $img.attr(src,resources/gov.hhs.acf.web.pages.common.collapsable.AbstractCollapsablePanel/plus.png) } } ); }); [code] now the problem is I hardcoded the image path in java script but the image path changes becasue this sciprt gets added by my collapsable panel and any page from any directory might use this panel so the image path is different to different pages so need suggestions on how to hard code image path in this java script - 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: Component Model question
look at textfield. all you have to do is to write out the input tags with a name you obtain from formcomponent.getname() - to guarantee uniqueness, then override convertinput() and pull those values out of the request into a collection and call setconvertedinput(collection). formcomponent will take care of everything else such as validation and updating the model. thats all there is to it. -igor On Fri, Apr 10, 2009 at 10:49 AM, Craig Tataryn crai...@tataryn.net wrote: I have a component I'm designing where it displays a list of items to the user, so the setup for the component on the page might look like this: add(new MultiTextInputCollectionString(tags, new ArrayListString() { { add(apple); add(banana); } })); The widget will render two sets of hidden inputs, one for the original/additional items (name=tags) which were entered and one for deleted items (name=removed_tags). For instance: input type=hidden name=tags value=apple/ input type=hidden name=tags value=peach/ input type=hidden name=tags value=grape/ input type=hidden name=removed_tags value=banana/ The above would result from me keeping apple and adding peach, grape, and removing banana. I'm a bit stuck on how I should get my component to put these values back into it's model? Obviously in behind the scenes I'm going to have to do some stuff in the MultiTextInput ctor to have the incoming Collection added to a composite model that contains both the original/added items and the removed items. I'm just not sure where I broker the form submittal so that I have a chance to move the tags and removed_tags into the proper place in the model for my component. When the user calls getModelObject() on my component they'll get an object back where they can query model.getItems() and model.getRemovedItems(). As always, any help greatly appreciated! Craig. -- Craig Tataryn site: http://www.basementcoders.com/ podcast:http://feeds.feedburner.com/TheBasementCoders irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin twitter: craiger - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket in Action vs the other main books
google databinder.net svn which will lead you to the faq page http://databinder.net/site/show/faq which will lead you to git://databinder.net/git/databinder -igor On Fri, Apr 10, 2009 at 12:31 PM, David Brown dbr...@sexingtechnologies.com wrote: Hello Erik, thanks for the speedy and informative reply. I just acquired the Tong PDF and I will cruise by BN and pick-up the WIA book. The databinder.net may be LGPL but I do not see any source-code repo: SVN, HG, etc. so it is too risky for me to rely strictly on the jars that came with the demo examples. Thanks again, David. There are 10 kinds of people in this world: those who understand binary and those who don’t (Valid only for 2's complement). - Original Message - From: Erik van Oosten e.vanoos...@grons.nl To: users@wicket.apache.org Sent: Friday, April 10, 2009 9:54:35 AM GMT -06:00 US/Canada Central Subject: Re: Wicket in Action vs the other main books David, Wicket in Action describe how to integrate with Spring and Hibernate. Databinder.net is LGPL, you can choose and copy code you like. Updating selected code to recent wicket version should be fairly easy. Regards, Erik. David Brown schreef: Hello Wicketers, I am in the throes of a decision to buy the Wicket in Action book. There are a couple of other books but the little time I have lurked on this ML I have noticed the Wicket-in-Action authors are fielding some of the issues on this list. The reason I need to hit Wicket as hard as I can is I have already dismissed 3 other MVC frameworks that I have evaluated over the past two weeks. I have also evaluated 3 end-to-end MVC frameworks based on Wicket. End-to-end means: (HTML UI)(Java POJO middleware)(Hibernate|iBatis)(MySQL). I have dismissed all of the so-called end-to-end MVC frameworks except: databinder.net. The databinder.net framework is a great piece of software based entirely on Wicket and Hibernate. The only caveat is databinder.net appears to no longer enjoy a community type support. And, in fact, databinder.net does not seem to be supported in any way including the original author. So, betting the farm on databinder.net is problematic and this brings us to the question of: does the Wicket in Action book (or any Wicket book) discuss the coupling together of Wicket and something like Hibernate or iBatis to a restructured database for the purposes of rewriting an existing web app. The current web app run-time for the company I am working for was written using a code-generator. The name of the code-generator referenced in the previous sentence is not known. The original programmer that authored the original run-time web app has flown-the-coop. Rants and Raves welcomed. Please advise, David. -- Erik van Oosten http://day-to-day-stuff.blogspot.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket in Action vs the other main books
Hello Igor, thanks again for the reply. I can't see the git forest for all the svn,hg,cvs trees. I will git-up-to-speed with git (no pun intended) and fetch the sofware. Again, thanks very much as this changes the complexion of the direction I will be taking to development the web app for my current gig. I may even be able to keep my job! Regards, ;-) David. There are 10 kinds of people in this world: those who understand binary and those who don’t (Valid only for 2's complement). - Original Message - From: Igor Vaynberg igor.vaynb...@gmail.com To: users@wicket.apache.org Sent: Friday, April 10, 2009 3:12:32 PM GMT -06:00 US/Canada Central Subject: Re: Wicket in Action vs the other main books google databinder.net svn which will lead you to the faq page http://databinder.net/site/show/faq which will lead you to git://databinder.net/git/databinder -igor On Fri, Apr 10, 2009 at 12:31 PM, David Brown dbr...@sexingtechnologies.com wrote: Hello Erik, thanks for the speedy and informative reply. I just acquired the Tong PDF and I will cruise by BN and pick-up the WIA book. The databinder.net may be LGPL but I do not see any source-code repo: SVN, HG, etc. so it is too risky for me to rely strictly on the jars that came with the demo examples. Thanks again, David. There are 10 kinds of people in this world: those who understand binary and those who don’t (Valid only for 2's complement). - Original Message - From: Erik van Oosten e.vanoos...@grons.nl To: users@wicket.apache.org Sent: Friday, April 10, 2009 9:54:35 AM GMT -06:00 US/Canada Central Subject: Re: Wicket in Action vs the other main books David, Wicket in Action describe how to integrate with Spring and Hibernate. Databinder.net is LGPL, you can choose and copy code you like. Updating selected code to recent wicket version should be fairly easy. Regards, Erik. David Brown schreef: Hello Wicketers, I am in the throes of a decision to buy the Wicket in Action book. There are a couple of other books but the little time I have lurked on this ML I have noticed the Wicket-in-Action authors are fielding some of the issues on this list. The reason I need to hit Wicket as hard as I can is I have already dismissed 3 other MVC frameworks that I have evaluated over the past two weeks. I have also evaluated 3 end-to-end MVC frameworks based on Wicket. End-to-end means: (HTML UI)(Java POJO middleware)(Hibernate|iBatis)(MySQL). I have dismissed all of the so-called end-to-end MVC frameworks except: databinder.net. The databinder.net framework is a great piece of software based entirely on Wicket and Hibernate. The only caveat is databinder.net appears to no longer enjoy a community type support. And, in fact, databinder.net does not seem to be supported in any way including the original author. So, betting the farm on databinder.net is problematic and this brings us to the question of: does the Wicket in Action book (or any Wicket book) discuss the coupling together of Wicket and something like Hibernate or iBatis to a restructured database for the purposes of rewriting an existing web app. The current web app run-time for the company I am working for was written using a code-generator. The name of the code-generator referenced in the previous sentence is not known. The original programmer that authored the original run-time web app has flown-the-coop. Rants and Raves welcomed. Please advise, David. -- Erik van Oosten http://day-to-day-stuff.blogspot.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 - 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: Package all CSS and JS
You could likely do that fairly easily, but how do you know which ones are need by which page? For instance page A may not need all the CSS that page B does. - Brill Pappin On 10-Apr-09, at 2:49 AM, Bjoern Tietjens wrote: Hi, how about doing this with some kind of precompilation step? You could manipulate the code with maven or ant befor packing the war having an task combining all js and css in one. Just an idea... Cheers Bjoern Tietjens Am 10.04.2009 um 05:31 schrieb Brill Pappin br...@pappin.ca: Funny, I was thinking that same thing... in one quick app i was writing, I had ~20 header links! I kept thinking that can't be good :) although I have not done so yet, I think there must be a way to modify or create a resource loader that would generate a buffered version of css (for isntance) and change the request page to just load it. Let us know if you tackle that one... I'd love to see the code. - Brill Pappin On 9-Apr-09, at 10:57 AM, Eduardo Nunes wrote: I think that I didn't explain it right. What I want is that wicket concatenate all included javascripts into one file. Something like wicket:link link.. javascript1.js / link.. javascript2.js / link.. javascript3.js / /wicket:link Generate just one resource with javacript1.js, javacript2.js and javacript3.js concatenated. The reason for that is to reduce the number of requests. I have a project that includes almost 10 javascripts files and around 7 css files, it would be faster if the browser has to download just 2 files, one for all javascript and another one for css. I can do it with a servlet or something like this, but I want a solution that works inside wicket, that i don't have to change my source code. Probably wicket has a piece of source code responsible for the wicket:head tag, If I could intercept it and get all included javascripts, remove them from the generated html and include my own resource with all javascripts concatenated, I would be happy hehehe Please ask me if you don't understand, I have to improve my english :( Thanks, Eduardo S. Nunes On Thu, Apr 9, 2009 at 11:42 AM, Craig Tataryn crai...@tataryn.net wrote: On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes esnu...@gmail.com wrote: Hi, Is there a way to tell wicket to package all referenced javascripts together, the same for the css? If there isn't this solution yet, can anyone tell me where should I look for to implement it? You can put your resources, like css and javascript, directly in your packages either under src/main/java or src/main/resources and include them through header inclusions using a ResourceReference Craig. Thanks, Eduardo S. Nunes - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Craig Tataryn site: http://www.basementcoders.com/ podcast:http://feeds.feedburner.com/TheBasementCoders irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin im: craiger...@hotmail.com, skype: craig.tataryn - 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 smime.p7s Description: S/MIME cryptographic signature
Re: Package all CSS and JS
Yah, he's right about the caching... so maybe not work it... however the solution someone posted was a ... hmm... Just in Time Resource kind of idea. which would still optimize for whatever page you were on (instead of bundling it all up into one giant file). - Brill Pappin On 10-Apr-09, at 2:55 AM, Jeremy Thomerson wrote: I think that this response by Igor to another thread was supposed to be on this one. Either way, it fits this one. it is much simpler and more efficient to set proper caching headers. concatenating resources often does not work because different components on different pages contribute different resources, so there are a lot of variations of these huge files you may end up with and would have to stream to the user over and over. yes, it would only be one request per page, but it would be a huge one over and over as opposed to being able to cache a lot of small resources and never request them again. -igor -- Jeremy Thomerson http://www.wickettraining.com On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes esnu...@gmail.com wrote: Hi, Is there a way to tell wicket to package all referenced javascripts together, the same for the css? If there isn't this solution yet, can anyone tell me where should I look for to implement it? Thanks, Eduardo S. Nunes - 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: Package all CSS and JS
Ahh... forgot about that... It will only work for CSS files that are in the same directory if you want to find other resources like images. Can it be done without doubt but its starting o get more complex than is likely worth the trouble since as Igor pointed out, the browser caches them anyway. - Brill Pappin On 10-Apr-09, at 3:06 AM, Alex Objelean wrote: The problem with merging css is that the backgrounds will not work anymore (in case the images are referenced relatively). But there is a solution for this, check web resource optimizer ( http://code.google.com/p/wro4j/ wro4j ). It performs url rewriting. Also, resources can be located anywhere (classpath, disk, relative or absolute url, etc.). Alex Bjoern Tietjens wrote: Hi, how about doing this with some kind of precompilation step? You could manipulate the code with maven or ant befor packing the war having an task combining all js and css in one. Just an idea... Cheers Bjoern Tietjens Am 10.04.2009 um 05:31 schrieb Brill Pappin br...@pappin.ca: Funny, I was thinking that same thing... in one quick app i was writing, I had ~20 header links! I kept thinking that can't be good :) although I have not done so yet, I think there must be a way to modify or create a resource loader that would generate a buffered version of css (for isntance) and change the request page to just load it. Let us know if you tackle that one... I'd love to see the code. - Brill Pappin On 9-Apr-09, at 10:57 AM, Eduardo Nunes wrote: I think that I didn't explain it right. What I want is that wicket concatenate all included javascripts into one file. Something like wicket:link link.. javascript1.js / link.. javascript2.js / link.. javascript3.js / /wicket:link Generate just one resource with javacript1.js, javacript2.js and javacript3.js concatenated. The reason for that is to reduce the number of requests. I have a project that includes almost 10 javascripts files and around 7 css files, it would be faster if the browser has to download just 2 files, one for all javascript and another one for css. I can do it with a servlet or something like this, but I want a solution that works inside wicket, that i don't have to change my source code. Probably wicket has a piece of source code responsible for the wicket:head tag, If I could intercept it and get all included javascripts, remove them from the generated html and include my own resource with all javascripts concatenated, I would be happy hehehe Please ask me if you don't understand, I have to improve my english :( Thanks, Eduardo S. Nunes On Thu, Apr 9, 2009 at 11:42 AM, Craig Tataryn crai...@tataryn.net wrote: On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes esnu...@gmail.com wrote: Hi, Is there a way to tell wicket to package all referenced javascripts together, the same for the css? If there isn't this solution yet, can anyone tell me where should I look for to implement it? You can put your resources, like css and javascript, directly in your packages either under src/main/java or src/main/resources and include them through header inclusions using a ResourceReference Craig. Thanks, Eduardo S. Nunes --- -- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Craig Tataryn site: http://www.basementcoders.com/ podcast:http://feeds.feedburner.com/TheBasementCoders irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin im: craiger...@hotmail.com, skype: craig.tataryn - 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/Package-all-CSS-and-JS-tp22971703p22984088.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 smime.p7s Description: S/MIME cryptographic signature
Re: Package all CSS and JS
my point is that the just in time thing will not work suppose on page A you use jquery and ext on page B you use jquery and yui using this just-in-time composition you will get two resources: jquery+ext and jquery+yui - so you are trading 3 hits for two hits, but transferring jquery twice. even worse, consider on page B you have a dynamic header contributor that sometimes adds mootools. so now you have jquery+ext, jquery+yui, jquery+yui+mootools, in the case of the latter you did not actually save a request to the server because you still have the jquery+yui+mootools combo, but because you are doing this caching the last request which was supposed to be just for mootols now also has to carry jquery+yui. wicket is very dynamic, which makes these kinds of page-oriented caching strategies difficult. in order to work correctly everything should be oriented around a component, not a page. -igor On Fri, Apr 10, 2009 at 1:44 PM, Brill Pappin br...@pappin.ca wrote: Yah, he's right about the caching... so maybe not work it... however the solution someone posted was a ... hmm... Just in Time Resource kind of idea. which would still optimize for whatever page you were on (instead of bundling it all up into one giant file). - Brill Pappin On 10-Apr-09, at 2:55 AM, Jeremy Thomerson wrote: I think that this response by Igor to another thread was supposed to be on this one. Either way, it fits this one. it is much simpler and more efficient to set proper caching headers. concatenating resources often does not work because different components on different pages contribute different resources, so there are a lot of variations of these huge files you may end up with and would have to stream to the user over and over. yes, it would only be one request per page, but it would be a huge one over and over as opposed to being able to cache a lot of small resources and never request them again. -igor -- Jeremy Thomerson http://www.wickettraining.com On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes esnu...@gmail.com wrote: Hi, Is there a way to tell wicket to package all referenced javascripts together, the same for the css? If there isn't this solution yet, can anyone tell me where should I look for to implement it? Thanks, Eduardo S. Nunes - 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: Montable PDF creating page
Thanks Igor! Works fine! -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Donnerstag, 9. April 2009 18:09 An: users@wicket.apache.org Betreff: Re: Montable PDF creating page why would you want a mounted page to create pdfs? servlets are so much better at that. that said you can do getrequestcycle().setrequesttarget(new sometargetthatstreamspdfs()); throw new restartresponseexception(); -igor On Thu, Apr 9, 2009 at 12:39 AM, Stefan Lindner lind...@visionet.de wrote: I need some trick to turn the response into a PDF stream. E. g. I have a Bookmarkable Page PdfPAge public class PdfPage extends WebPage { public PdfPage (final PageParameters parameters) { // Respond with PDF content. } } Application.init() { mountBookmarkablePage(/PdfGenerator, PdfPage.class); Is it possible to let a WebPage create a pdfOutput? If I try to do the following Response r = getResponse(); if (r instanceof WebResponse) { WebResponse wr = (WebResponse)r; wr.reset(); OutputStream os = wr.getOutputStream(); try { os.write(/*PDFcontent*/); } catch (Exception e) { e.printStackTrace(); } } } I can see the Exception java.lang.IllegalStateException: getOutputStream() has already been called for this response The reason for this is: I did not find something like BookmarkableResource in wicket. It is no problem to have a DynaicResourceLink in a page but the displayes content is not bookmarkable. Any Ideas? - 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: debugging a Wicket application running under Jetty-6.1 in Eclipse
It is working now. I am debugging in Eclipse. Thanks a lot -Original Message- From: jcgarciam [mailto:jcgarc...@gmail.com] Sent: Thursday, April 09, 2009 6:06 PM To: users@wicket.apache.org Subject: Re: debugging a Wicket application running under Jetty-6.1 in Eclipse I'll suggest to do it in the Wicket Way, you will have much more benefits. If you made your project from the QuickStart, you will notice a 'Start' class under your 'test' source. that what it does is just start an embedded jetty pointing to your webapp directory and mounting your application under / context. so just right click on it and click Debug as - Java Application and you're done. Even if you are working on a multi-module maven project this will work, just make sure your module are installed on your local repository, issuing 'mvn install' on the root project. If you have question regarding the 'Start.java' class just let us know. mchenini wrote: Hi, This is about debugging a Wicket application running under Jetty-6.1 in Eclipse. I followed the steps shown at: http://docs.codehaus.org/display/JETTY/Debugging+with+the+Maven+Jetty+Pl ugin+inside+Eclipse But I am getting this exception: java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher Exception in thread main Any help? The steps I followed are: Step 1 Go to the Run/External Tools/External Tools ... menu item on the Run menu bar. Select Program and click the New button. On the Main tab, fill in the Location: as the full path to your mvn executable. C:\java\DEVTOOLS\MAIN\maven2\bin For the Working Directory: select the workspace that matches your webapp. For Arguments: add jetty:run. Move to the Environment tab and click the New button to add a new variable named MAVEN_OPTS with the value: -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y If you supply suspend=n instead of suspend=y you can start immediately without running the debugger and launch the debugger at anytime you really wish to debug. Step 2 Then, pull up the Run/Debug/Debug ... menu item and select Remote Java Application and click the New button. Fill in the dialog by selecting your webapp project for the Project: field, and ensure you are using the same port number as you specified in the address= property above. Now all you need to do is to Run/External Tools and select the name of the maven tool setup you created in step 1 to start the plugin and then Run/Debug and select the name of the debug setup you setup in step2. Thanks, Mohamed This email/fax message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution of this email/fax is prohibited. If you are not the intended recipient, please destroy all paper and electronic copies of the original message. -- View this message in context: http://www.nabble.com/debugging-a-Wicket-application-running-under-Jetty -6.1-in-Eclipse-tp22979929p22980041.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 This email/fax message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution of this email/fax is prohibited. If you are not the intended recipient, please destroy all paper and electronic copies of the original message. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component Model question
On 10-Apr-09, at 3:10 PM, Igor Vaynberg wrote: look at textfield. all you have to do is to write out the input tags with a name you obtain from formcomponent.getname() - to guarantee uniqueness, then override convertinput() and pull those values out of the request into a collection and call setconvertedinput(collection). formcomponent will take care of everything else such as validation and updating the model. thats all there is to it. Thanks Igor, in my version I had overridden updateModel like so to get it working: public void updateModel() { String[] added = this.getInputAsArray(); String[] removed = getRequest().getParameters(removed_ + getInputName()); MultiTextInputModel model = (MultiTextInputModel) this.getModel(); model.setItems(added == null ? EMPTY_STRING_COL : Arrays.asList(added)); model.setRemovedItems(removed == null ? EMPTY_STRING_COL : Arrays.asList(removed)); } I'm assuming that convertInput fires before update model, so I should override that method as you suggest to handle different types but maintain my updateModel as well to shovel things into the right places in the model? Craig. -igor On Fri, Apr 10, 2009 at 10:49 AM, Craig Tataryn crai...@tataryn.net wrote: I have a component I'm designing where it displays a list of items to the user, so the setup for the component on the page might look like this: add(new MultiTextInputCollectionString(tags, new ArrayListString() { { add(apple); add(banana); } })); The widget will render two sets of hidden inputs, one for the original/additional items (name=tags) which were entered and one for deleted items (name=removed_tags). For instance: input type=hidden name=tags value=apple/ input type=hidden name=tags value=peach/ input type=hidden name=tags value=grape/ input type=hidden name=removed_tags value=banana/ The above would result from me keeping apple and adding peach, grape, and removing banana. I'm a bit stuck on how I should get my component to put these values back into it's model? Obviously in behind the scenes I'm going to have to do some stuff in the MultiTextInput ctor to have the incoming Collection added to a composite model that contains both the original/added items and the removed items. I'm just not sure where I broker the form submittal so that I have a chance to move the tags and removed_tags into the proper place in the model for my component. When the user calls getModelObject() on my component they'll get an object back where they can query model.getItems() and model.getRemovedItems(). As always, any help greatly appreciated! Craig. -- Craig Tataryn site: http://www.basementcoders.com/ podcast:http://feeds.feedburner.com/TheBasementCoders irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin twitter: craiger - 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: Component Model question
no, all you have to do is override convertinput and inside call setconvertedinput(yourcollection); the default implementation of updatemodel() already does getmodel().setobject(getconvertedinput()); -igor On Fri, Apr 10, 2009 at 3:29 PM, Craig Tataryn crai...@tataryn.net wrote: On 10-Apr-09, at 3:10 PM, Igor Vaynberg wrote: look at textfield. all you have to do is to write out the input tags with a name you obtain from formcomponent.getname() - to guarantee uniqueness, then override convertinput() and pull those values out of the request into a collection and call setconvertedinput(collection). formcomponent will take care of everything else such as validation and updating the model. thats all there is to it. Thanks Igor, in my version I had overridden updateModel like so to get it working: public void updateModel() { String[] added = this.getInputAsArray(); String[] removed = getRequest().getParameters(removed_ + getInputName()); MultiTextInputModel model = (MultiTextInputModel) this.getModel(); model.setItems(added == null ? EMPTY_STRING_COL : Arrays.asList(added)); model.setRemovedItems(removed == null ? EMPTY_STRING_COL : Arrays.asList(removed)); } I'm assuming that convertInput fires before update model, so I should override that method as you suggest to handle different types but maintain my updateModel as well to shovel things into the right places in the model? Craig. -igor On Fri, Apr 10, 2009 at 10:49 AM, Craig Tataryn crai...@tataryn.net wrote: I have a component I'm designing where it displays a list of items to the user, so the setup for the component on the page might look like this: add(new MultiTextInputCollectionString(tags, new ArrayListString() { { add(apple); add(banana); } })); The widget will render two sets of hidden inputs, one for the original/additional items (name=tags) which were entered and one for deleted items (name=removed_tags). For instance: input type=hidden name=tags value=apple/ input type=hidden name=tags value=peach/ input type=hidden name=tags value=grape/ input type=hidden name=removed_tags value=banana/ The above would result from me keeping apple and adding peach, grape, and removing banana. I'm a bit stuck on how I should get my component to put these values back into it's model? Obviously in behind the scenes I'm going to have to do some stuff in the MultiTextInput ctor to have the incoming Collection added to a composite model that contains both the original/added items and the removed items. I'm just not sure where I broker the form submittal so that I have a chance to move the tags and removed_tags into the proper place in the model for my component. When the user calls getModelObject() on my component they'll get an object back where they can query model.getItems() and model.getRemovedItems(). As always, any help greatly appreciated! Craig. -- Craig Tataryn site: http://www.basementcoders.com/ podcast:http://feeds.feedburner.com/TheBasementCoders irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin twitter: craiger - 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