Re: [Wicketstuff jQuery] not compiling?
Hi Martin Theres still some trouble with sourceforge svn. But it should be somewhat okay, you just cant count on what youve just comitted will be compiled within the normal 60s timeframe, but this has been the case all the time.. Martin Grigorov wrote: I've updated and build locally all projects that extends wicketstuff-parent when I changed the dependency and everything was fine. But ... the 1.3.x projects (https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicket-1.3.x) still depends on wicketstuff-parent:2-nojavadoc... Ok, I will update the version of wicketstuff-parent in trunk. After that a new snapshot of it should be build and all 1.4-SNAPSHOT (trunk) project should be ok again. Last time when I checked WicketStuff's TeamCity it didn't work - the synchronization from SF.net had problems. Is this fixed now ? Martin On Tue, 2008-10-28 at 20:52 +0100, Nino Saturnino Martinez Vazquez Wael wrote: As I mentioned I saw it in the parent pom.. Here: https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-jquery/pom.xml Unless! I have an old outdated version of the pom.. That could be.. Nope, seems to be an old version on our maven repo: http://wicketstuff.org/maven/repository/org/wicketstuff/wicketstuff-parent/2-nojavadoc/wicketstuff-parent-2-nojavadoc.pom So we either need to refresh that one, or even better make a new version so it will not break with otherstuff using it? Martin Grigorov wrote: I've changed it. Since r4284 wicketstuff-parent/pom.xml has this: properties java.src.version1.5/java.src.version wicket.version1.4-m3/wicket.version slf4j.version1.5.2/slf4j.version runtime.logtarget/velocity.log/runtime.log /properties Where did you see 1.3.1 ? Martin On Tue, 2008-10-28 at 14:42 +0100, Nino Saturnino Martinez Vazquez Wael wrote: Hi Guys The JQuery stuff project arent compiling, seems to be dependant on Wicket 1.4 and using generics. But the pom uses this parent: groupIdorg.wicketstuff/groupId artifactIdwicketstuff-parent/artifactId version2-nojavadoc/version Which includes wicket 1.3.1... Whats up? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JFreeChart component
Ahh yeah, me and my memory.. I thought that this were related, but it's not as it's jasperreports: https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicket-contrib-jasperreports But thanks for posting. jwray wrote: I looked around wicket stuff and didn't see anything related to JFreeChart. If you think it is suitable for inclusion in wicket-stuff, or elsewhere, then by all means upload it. It's only four classes so I don't think it is worth creating a new project for, and I don't know where it would fit right not. Jonny -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket and URLs
Hello S D, This might interest you: http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html Note there are still some limitations. Your milage may vary. Regards, Erik. S D wrote: Hi, I was browsing through examples, it looks very impressive but there's a thing that bothers me somewhat. The Basic Label example uses the following URL: http://wicketstuff.org/wicket13/compref/;jsessionid=F8C6R0F2601C96D1Y3CAD8B69E8779D4?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage The problem with that is that we'd like to have an appearance of a technology neutral site (or at least not to be blatant about it) but Jsessionid and especially wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage destroy that impression completely. I understand it's possible to remove Jsessionid from URL but what about Wicket's contribution to the URL? We'd like to keep our URLs as clean and readable as possible. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket and URLs
while this might work for your usecase this will pretty much break things. the version number is in the url for a reason. 1) it completely kills the backbutton for that page. since the url remains the same the browser wont record your actions in the history. based on what you are trying to do this may or may not be a bad thing. 2) even if you manage to get the back button working this will completely kill applications that use any kind of panel replacement because you no longer have the version information in the url. you have a page with panel A, you click a link and it is swapped with panel B. go back, click a link on A and you are hosed because wicket will look for the component you clicked on panel B instead of A. in all the applications ive written there was at least a moderate amount of panel replacement going on. one of the applications i worked on had the majority of its navigation consist of panel replacement. so i dont think this is a good idea. -igor On Tue, Oct 28, 2008 at 11:42 PM, Erik van Oosten [EMAIL PROTECTED] wrote: Hello S D, This might interest you: http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html Note there are still some limitations. Your milage may vary. Regards, Erik. S D wrote: Hi, I was browsing through examples, it looks very impressive but there's a thing that bothers me somewhat. The Basic Label example uses the following URL: http://wicketstuff.org/wicket13/compref/;jsessionid=F8C6R0F2601C96D1Y3CAD8B69E8779D4?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage The problem with that is that we'd like to have an appearance of a technology neutral site (or at least not to be blatant about it) but Jsessionid and especially wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage destroy that impression completely. I understand it's possible to remove Jsessionid from URL but what about Wicket's contribution to the URL? We'd like to keep our URLs as clean and readable as possible. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p20222077.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket and URLs
Thanks for clarifying limitation no 2, I had not though of this. Indeed in my usecase this is not a problem. 'Limitation' no 1 is quite intentional. If you don't mind, I've also added this comment to the article. Regards, Erik. Igor Vaynberg wrote: while this might work for your usecase this will pretty much break things. the version number is in the url for a reason. 1) it completely kills the backbutton for that page. since the url remains the same the browser wont record your actions in the history. based on what you are trying to do this may or may not be a bad thing. 2) even if you manage to get the back button working this will completely kill applications that use any kind of panel replacement because you no longer have the version information in the url. you have a page with panel A, you click a link and it is swapped with panel B. go back, click a link on A and you are hosed because wicket will look for the component you clicked on panel B instead of A. in all the applications ive written there was at least a moderate amount of panel replacement going on. one of the applications i worked on had the majority of its navigation consist of panel replacement. so i dont think this is a good idea. -igor -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using wicket
I cannot comment on the stabiliy, but for the javadoc you'll need to download the source and generate the javadoc (use maven for the quickest) as I don;t beleive its online anywhere On Tue, Oct 28, 2008 at 5:53 PM, miro [EMAIL PROTECTED] wrote: I am new to wicket and no guru to help me answer questions , I am starting a new project , is it ok to work with wicket 1.4 , i mean is it a stable release ,of should I use wicket 1.3 ? Please help me , also please point me to java docs of wicket 1.4 if 1.4 is all teste3d and ready for use -- View this message in context: http://www.nabble.com/using-wicket-tp20211179p20211179.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataTable cell link
Hi, Thanks for help but the problem with your solution is that it doesnt work in IE (when I have multiple columns with such links only links in first column 'fills' entire cells) in Firefox that works. Jeremy Thomerson-5 wrote: If that's your problem, I'd suggest using CSS, something like: TD A { display: block; } This is much better because the anchor will fill the box (fixing your problem), and you are more compatible (if JS is off, etc). -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 28, 2008 at 2:42 PM, dlipski [EMAIL PROTECTED] wrote: Exaclty, problem is with 'consuming' td element by Item object. The problem is that if you have wide column but short text in it some users have problem with hitting the text (which is a link) .The idea is to make whole td element 'clickable'(or linkable). The solution would be if table could have any component as row or cell element not only Item object. But I know that this is a big change in DataTable class (or one of its child component class) . jwcarman wrote: On Tue, Oct 28, 2008 at 3:05 PM, dlipski [EMAIL PROTECTED] wrote: All this solutions are correct but the problem is not in attaching some custom Javascript to td element (which can be done in multiple ways) but in making td element work as a link. Right, the td element is already consumed by the Item object, so you can't attach your link to it. What exactly should I do to achive this ? What components should I add at server side at what JavaScript should I render at markup ? If I have to copy-paste bunch of Link class code it looks like some design/implementation problem of DataTable (or one of components it has). What is your requirement exactly? Is there going to be any text (or image) in your cell? If so, why can't it be a link? Its really supprising that such common issue is such problematic. I hope there is some simple and intuitive solution(if I find one I'll post it here) Thanks for your help Regards Daniel Michael O'Cleirigh wrote: Hi Daniel, If you subclass DefaultDataTable there is a protected method call newCellItem(...) that you can use to attach the onclick class onto the td. like: class MyDataTable extends DefaultDataTable { /* (non-Javadoc) * @see org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable#newCellItem(java.lang.String, int, org.apache.wicket.model.IModel) */ @Override protected Item newCellItem(String id, int index, IModel model) { Item cell = super.newCellItem(id, index, model); cell.add(new AttributeAppender(onclick, new Model (someJavascriptCall();)); return cell; } } Alternately you can use a custom column implementation like the FragrementColumn and add the onclick when the cell is created like: class MyOnClickColumn extends AbstractColumn { ... public void populateItem(Item cellItem, String componentId, IModel rowModel) { Label cell = new Label(componentId, new PropertyModel(rowModel, property)) cell.add (new AttributeAppender(onclick, new Model (someJavascriptCall();)); cellItem.add(cell); } } I think the second version would attach the onclick to the label within the td/td of a cell. Regards, Mike I dont know wicketopia project (and any of its classes like FragmentColumn) so I can misunderstand your idea but as far as I am able to read that code It looks like you are adding a link to the table cell, not making a cell itself a link. If I understand your code it is familar to: tdlt;agt;textlt;/agt;/td but Im wondering how to achive: td on click=xyztext/td where xyz is code generated by Wicket (like in Link component class) If I misundestood you could you give me some more details hot to make cell itself a link ? (not adding a link to the cell) ? Regards Daniel jwcarman wrote: Here's an example where I put a remove link in a DefaultDataTable cell: https://wicketopia.svn.sourceforge.net/svnroot/wicketopia/trunk/example/src/main/java/org/wicketopia/example/web/page/HomePage.java On Tue, Oct 28, 2008 at 6:33 AM, dlipski [EMAIL PROTECTED] wrote: Hi I have one short question: How to make entire cell in a DataTable a link ? I've read that Link component can be attached not only to lt;agt; tags but also to any other html elements (like tr and td) but I dont know how to use it with DataTable API. Regards Daniel -- View this message in context: http://www.nabble.com/DataTable-cell-link-tp20204702p20204702.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL
Re: Migration to 1.4 - generic headache
Hi Igor, igor.vaynberg wrote: yes it sucks. i agree. personally i prefer code written against wicket 1.3. even in 1.3 i hardly had to cast anything and even with those casts i do not remember getting any class cast exceptions. It is nice to know that somebody thinks similar to me :) The generics in Wicket looks nice on examples. But in bigger application (we have aprox. 500k loc) it is a mess. Especially when we use lots of forms, models, adapters and so on. We must write more code than in 1.3 and we do not get any reward for it ;) I'm thinking now whether cancel migration and stay with wicket 1.3 or add this all voids and questions marks (thanks Stefan!) and get used to it. How long do you want to support (bug fixing, adding small improvements to 1.3) and when do you plan do release 1.5 :) Thanks in advance for your advices. Artur -- View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20222475.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataTable cell link
Because I havent found better solution then adding 'onclick' handler to cellItem I have to do it your way. I looked at urlFor methods in Component class and didnt found the one with Component attribute. How should I generate url for Link component, AjaxLink or AjaxFallbackLink ? Do I have to add this components to the page and set its visiblity to false ? I understand 'general concept' of this solution but dont know how to implement this in specific scenarion (ie. linking to Link, AjaxLink, AjaxFallbackLink). Using diffrent repeater could be a option but DataTable (or AjaxFallbackDefaultDataTable) provides a lot of functionality (sorting, paging, fallback links etc) so it would be a waste of time to implement its from scratch just because its hard to make a table cell (or row) a link. It must be a way to achive this... if not it serious limitation of DataTable component. Regards Daniel Jeremy Thomerson-5 wrote: Depending on what you are linking TO, it can be very simple. You can call urlFor(YourBookmarkablePage.class, pageParamsOrNullIfNone). So, you could do: cellItem.add(new SimpleAttributeModifier(onclick, location.href = ' + urlFor(YourBookmarkablePage.class, pageParamsOrNullIfNone) + ')); Of course, that JS could be better for triple click problems, etc. Really, you may just consider using another Repeater rather than DataTable. DataTable is for a very specific purpose, and it is often easier to roll your own than make DT fit your purpose. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 28, 2008 at 2:05 PM, dlipski [EMAIL PROTECTED] wrote: All this solutions are correct but the problem is not in attaching some custom Javascript to td element (which can be done in multiple ways) but in making td element work as a link. What exactly should I do to achive this ? What components should I add at server side at what JavaScript should I render at markup ? If I have to copy-paste bunch of Link class code it looks like some design/implementation problem of DataTable (or one of components it has). Its really supprising that such common issue is such problematic. I hope there is some simple and intuitive solution(if I find one I'll post it here) Thanks for your help Regards Daniel Michael O'Cleirigh wrote: Hi Daniel, If you subclass DefaultDataTable there is a protected method call newCellItem(...) that you can use to attach the onclick class onto the td. like: class MyDataTable extends DefaultDataTable { /* (non-Javadoc) * @see org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable#newCellItem(java.lang.String, int, org.apache.wicket.model.IModel) */ @Override protected Item newCellItem(String id, int index, IModel model) { Item cell = super.newCellItem(id, index, model); cell.add(new AttributeAppender(onclick, new Model (someJavascriptCall();)); return cell; } } Alternately you can use a custom column implementation like the FragrementColumn and add the onclick when the cell is created like: class MyOnClickColumn extends AbstractColumn { ... public void populateItem(Item cellItem, String componentId, IModel rowModel) { Label cell = new Label(componentId, new PropertyModel(rowModel, property)) cell.add (new AttributeAppender(onclick, new Model (someJavascriptCall();)); cellItem.add(cell); } } I think the second version would attach the onclick to the label within the td/td of a cell. Regards, Mike I dont know wicketopia project (and any of its classes like FragmentColumn) so I can misunderstand your idea but as far as I am able to read that code It looks like you are adding a link to the table cell, not making a cell itself a link. If I understand your code it is familar to: tdlt;agt;textlt;/agt;/td but Im wondering how to achive: td on click=xyztext/td where xyz is code generated by Wicket (like in Link component class) If I misundestood you could you give me some more details hot to make cell itself a link ? (not adding a link to the cell) ? Regards Daniel jwcarman wrote: Here's an example where I put a remove link in a DefaultDataTable cell: https://wicketopia.svn.sourceforge.net/svnroot/wicketopia/trunk/example/src/main/java/org/wicketopia/example/web/page/HomePage.java On Tue, Oct 28, 2008 at 6:33 AM, dlipski [EMAIL PROTECTED] wrote: Hi I have one short question: How to make entire cell in a DataTable a link ? I've read that Link component can be attached not only to lt;agt; tags but also to any other html elements (like tr and td) but I dont know how to use it with DataTable API. Regards Daniel -- View this message in context: http://www.nabble.com/DataTable-cell-link-tp20204702p20204702.html Sent from the Wicket - User
Re: Migration to 1.4 - generic headache
Hi Igor, yes it sucks. i agree. personally i prefer code written against wicket 1.3. even in 1.3 i hardly had to cast anything and even with those casts i do not remember getting any class cast exceptions. hehe - just as I was saying months ago. *g* anyways, we will see how it goes. until 1.4 i think the generics will stay the way they are unless we hear a ton of users complaining. If you need someone to complain you may always call on me. :D --- Jan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Disabling 'back'/'next' web browser button usage in application
Hi. I have application which consists of questions to user provided in some order. Each question is reachable on the same address, let's say http://myApp/Question. Application engine knows which question to show from database record. Each question page has 'Previous Question' and 'Next Question' buttons which increase/decrease questionNumber in database and redirects to http://myApp/Question (which loads question looking for its number in database). My problem is: How disable 'back' and 'next' button in web browser so user can go to previous/next question only by using 'Previous Question' / 'Next Question' button? Is there a way to remove whole page from session? So user when clicks back/next will see custom communicate your session expired or you clicked 'back' or 'next' button on your web browser while doing a test'. Or maybe I could achieve such functionality in other way? Thank you in advance for help Regards -- Tomasz Dziurko - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
Yeah, I must say im looking forward to getting Wicket-1327 a reality too.. Wayne Pope wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using wicket
You could download it from Maven repos as any other artefact: http://repo1.maven.org/maven2/org/apache/wicket/wicket/1.4-m3/wicket-1.4-m3-javadoc.jar Since 1.4 is actually 1.3 + generics (and very few other changes) you could start with 1.4 and downgrade to 1.3 any time if you are concerned that you're using a milestone. On Wed, 2008-10-29 at 08:38 +0100, Wayne Pope wrote: I cannot comment on the stabiliy, but for the javadoc you'll need to download the source and generate the javadoc (use maven for the quickest) as I don;t beleive its online anywhere On Tue, Oct 28, 2008 at 5:53 PM, miro [EMAIL PROTECTED] wrote: I am new to wicket and no guru to help me answer questions , I am starting a new project , is it ok to work with wicket 1.4 , i mean is it a stable release ,of should I use wicket 1.3 ? Please help me , also please point me to java docs of wicket 1.4 if 1.4 is all teste3d and ready for use -- View this message in context: http://www.nabble.com/using-wicket-tp20211179p20211179.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Compatibility of objectautocomplete
Hi, does the objectautocomplete libs require wicket 1.4 or is it possible to use it with 1.3.x? Is it compatible with the AutoCompleteTextField of wicket extensions? Can I use a AutoCompleteTextField of wicket extensions and an ObjectAutoCompleteField in one form? Thanks in advance, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Session timeout page
How do I change the session timeout page? I want my application to display the actual home page on session timout instead of the default Return to homepage-link page. //Swanthe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session timeout page
Hi See here for all kinds of different error pages you can easily adjust: http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html Matt Swanthe Lindgren wrote: How do I change the session timeout page? I want my application to display the actual home page on session timout instead of the default Return to homepage-link page. //Swanthe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- [EMAIL PROTECTED] +41 44 268 83 98 Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich http://www.ergon.ch __ e r g o nsmart people - smart software smime.p7s Description: S/MIME Cryptographic Signature
Re: Compatibility of objectautocomplete
Hi Kai Im not sure if the authors are around.. But the one Objectautocomplet in trunk of stuff are not backwards compatible, that goes for every contrib which depends on wicket 1.4. But there should be a branch with the old version I think, Igor did that a while back the 1.3 branch I mean.. As for having AutoCompletetextfield along with objectautocompletefield, theres nothing intentionally done for them not to live together but the JS could be clashing(I dont even know if they use the same libs) you'll just have to try and see.. Kai Mütz wrote: Hi, does the objectautocomplete libs require wicket 1.4 or is it possible to use it with 1.3.x? Is it compatible with the AutoCompleteTextField of wicket extensions? Can I use a AutoCompleteTextField of wicket extensions and an ObjectAutoCompleteField in one form? Thanks in advance, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p20222077.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forcing property models to update
Hmm, this requires a bit low level Java understanding (Wicket doesn't have anything to do with it. The underlying mechanism is the same as doing this: public void foo2bar(String a) { a = bar; } String b = foo; System.out.println(b is now: + b); foo2bar(b); System.out.println(b is now: + b); What do you expect here? [1] Now consider this: public class Foo2Bar { private String text; public Foo2Bar(String t) { this.text = t; } public void setText(String t) { this.text = t; } public toString() { return text; } } String b = foo; Foo2Bar f2b = new Foo2Bar(b); System.out.println(f2b is now: + f2b); b = bar; System.out.println(f2b is now: + f2b); What do you expect now? [2] Java copies references to objects. When you modify the original reference to point to another object, the copy doesn't get notified of this change. THis is what is happening in your property models: you give it a reference to a person, which is copied (the reference). Next you modify the reference, but don't provide a way to notify the property model that it should point to another person. So to fix the second example: we need to notify our f2b instance that the reference has changed, by calling setText Martijn [1] foo and foo [2] f2b is now: foo and f2b is now: foo On Tue, Oct 28, 2008 at 10:35 PM, walnutmon [EMAIL PROTECTED] wrote: I did as you said, and have the unit tests, and read the wiki on chaining models... something still isn't clicking though. BTW, I have Wicket in action and it is fantastic, perhaps there is still something elduing me though... I still can't wrap my head around why that property model doesn't update in the first case you show me. If the property model is calling that object, and doing a get description each time it's called it's own getObject() method, why doesn't changing the reference externally work? If you simply point me to a page number and tell me to read until I understand, I would be greatful! Thanks again! Justin Martijn Dashorst wrote: No defensive copying happening. Just your plain old references updating. Read the models page on the wiki about chaining models. Put this in a unit test case: State s = new State(); s.setDescription(I haven't read Wicket in Action but hear it helps solve these questions); PropertyModel pm = new PropertyModel(s, description); assertEquals(I haven't read Wicket in Action but hear it helps solve these questions, pm.getObject()); s = new State(); s.setDescription(I'll buy Wicket in Action, just because I now get why my property model doesn't know this new state yet.); assertEquals(I'll buy Wicket in Action, just because I now get why my property model doesn't know this new state yet., pm.getObject()); This is basically what you are doing in your panel. but if you did: State s = new State(Foo); Model m = new Model(); m.setObject(s); PropertyModel pm = new PropertyModel(m, description); assertEquals(Foo, pm.getObject()); and now for the coup de grace: s = new State(Bar); m.setObject(s); assertEquals(Bar, pm.getObject()); Martijn On Fri, Oct 24, 2008 at 3:57 PM, walnutmon [EMAIL PROTECTED] wrote: I have two panels, a view panel where you can look for news and an edit panel. The edit panel has a reference to a news object and all of it's form elements have property models that use that object. When I pass a news object into the panel on creation all of the form elements fill as expected. However, if I set that object through a setter in the panel class, the elements do not update. My theory (which may be wrong) is that the property model makes a defensive copy and therefore is not linked to the object in the class. If this is true, can I resend the object to the property model? If that's not true, any insight as to what I may be doing wrong? -- View this message in context: http://www.nabble.com/Forcing-property-models-to-update-tp20150693p20150693.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.4 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Forcing-property-models-to-update-tp20150693p20216529.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Become a Wicket expert, learn from the best:
Re: CompoundModel based on proxies
Hi Maarten interesting idea thanks. I think the major issue is the null pointer checking. for your: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } do you wrap this around you (hibernate/other) pojo's or are this additional fields? On Wed, Oct 29, 2008 at 10:42 AM, Maarten Bosteels [EMAIL PROTECTED]wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p20222077.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,
Re: CompoundModel based on proxies
Hi Johan, we're now maigrating to 1.4 M3 - do you have any idea roughly when the release proper of 1.4 would be? thanks Wayne On Wed, Oct 29, 2008 at 10:34 AM, Johan Compagner [EMAIL PROTECTED]wrote: wicket 1.5 first 1.4 has to be released On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p20222077.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Compatibility of objectautocomplete
Nino Saturnino Martinez Vazquez Wael wrote: Hi Kai Im not sure if the authors are around.. But the one Objectautocomplet in trunk of stuff are not backwards compatible, that goes for every contrib which depends on wicket 1.4. But there should be a branch with the old version I think, Igor did that a while back the 1.3 branch I mean.. I can not find a 1.3 of objectautocomplete branch at https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicke t-1.3.x/ Anywhere else? As for having AutoCompletetextfield along with objectautocompletefield, theres nothing intentionally done for them not to live together but the JS could be clashing(I dont even know if they use the same libs) you'll just have to try and see.. I will try it if I find a 1.3 branch. Thanks, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
hi, One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); exactly, that is *the* problem otherwise we could have new AlternativeCompoundPropertyModel(customer.getAddress().getCity()); with this class decomposing the object chain into an el-style expression: customer.address.city which will be the wicket:id ... *but*, this can easily lose synchronization with the markup. another web framework called warp-widgets uses compile-time checking of expressions in html files with mvel. perhaps this points us in the right direction... we were also thinking of something like a compile time annotation (with logic) such as java's @SuppressWarnings , but not sure if it'll work though. any thoughts on this? francisco Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p20222077.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Disabling 'back'/'next' web browser button usage in application
Hi Tomasz, Recently I integrated a JavaScript library with Wicket that could help you with this particular application. Take a look at the code and examples: https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-jquery/src/main/java/org/wicketstuff/jquery/ajaxbackbutton https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-jquery-examples/src/main/java/org/wicketstuff/jquery/ajaxbackbutton The code is quite new and the example page is the only test for it, so it could have some bugs ... Try it and let me know whether it is in any help for you. Martin On Wed, 2008-10-29 at 09:52 +0100, Tomasz Dziurko wrote: Hi. I have application which consists of questions to user provided in some order. Each question is reachable on the same address, let's say http://myApp/Question. Application engine knows which question to show from database record. Each question page has 'Previous Question' and 'Next Question' buttons which increase/decrease questionNumber in database and redirects to http://myApp/Question (which loads question looking for its number in database). My problem is: How disable 'back' and 'next' button in web browser so user can go to previous/next question only by using 'Previous Question' / 'Next Question' button? Is there a way to remove whole page from session? So user when clicks back/next will see custom communicate your session expired or you clicked 'back' or 'next' button on your web browser while doing a test'. Or maybe I could achieve such functionality in other way? Thank you in advance for help Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Compatibility of objectautocomplete
Hi Kai No it seems Objectautocomplete were added after the branching.. So seems you are a bit out of luck, however backporting should not be too hard.. Kai Mütz wrote: Nino Saturnino Martinez Vazquez Wael wrote: Hi Kai Im not sure if the authors are around.. But the one Objectautocomplet in trunk of stuff are not backwards compatible, that goes for every contrib which depends on wicket 1.4. But there should be a branch with the old version I think, Igor did that a while back the 1.3 branch I mean.. I can not find a 1.3 of objectautocomplete branch at https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicke t-1.3.x/ Anywhere else? As for having AutoCompletetextfield along with objectautocompletefield, theres nothing intentionally done for them not to live together but the JS could be clashing(I dont even know if they use the same libs) you'll just have to try and see.. I will try it if I find a 1.3 branch. Thanks, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
On Wed, Oct 29, 2008 at 10:54 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi Maarten interesting idea thanks. I think the major issue is the null pointer checking. for your: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } do you wrap this around you (hibernate/other) pojo's or are this additional fields? This would be my domain class, so no extra pojo's needed. We don't use hibernate for now, but I would like to find out if I can create a hibernate UserType that can deal with these PropertyString properties. Did you know that bean-properties has its own ORM implementation: https://bean-properties.dev.java.net/orm.html ? I haven't tried it out yet though. About the null checking, I will see if I can avoid having nested null values in my proof-of-concept project. Regards, Maarten On Wed, Oct 29, 2008 at 10:42 AM, Maarten Bosteels [EMAIL PROTECTED]wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is
Re: Session timeout page
Is this session expiration or page expiration ? I know it is a bit misleading but Wicket throws PageExpiredException when it doesn't find a particular version of the requested page in the page store. There could be different reasons why the page is not found but in my experience the most often case is that a field of some component is not serializable and this prevents the storing of the page. On Wed, 2008-10-29 at 10:21 +0100, Swanthe Lindgren wrote: How do I change the session timeout page? I want my application to display the actual home page on session timout instead of the default Return to homepage-link page. //Swanthe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
hi maarten About the null checking, I will see if I can avoid having nested null values in my proof-of-concept project. thing is the object chain is going to be resolved before it gets passed in - there's nothing you can do about it inside your class :( an eventual null pointer exception would be thrown before your constructor is called. francisco On Wed, Oct 29, 2008 at 10:42 AM, Maarten Bosteels [EMAIL PROTECTED]wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p20222077.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:
Re: using wicket
hmm, it depends. if you upgrade to 1.4 and parameterize models and components, it could be really tough to go back to 1.3. depending of course on the size of your app. francisco On Wed, Oct 29, 2008 at 9:50 AM, Martin Grigorov [EMAIL PROTECTED] wrote: You could download it from Maven repos as any other artefact: http://repo1.maven.org/maven2/org/apache/wicket/wicket/1.4-m3/wicket-1.4-m3-javadoc.jar Since 1.4 is actually 1.3 + generics (and very few other changes) you could start with 1.4 and downgrade to 1.3 any time if you are concerned that you're using a milestone. On Wed, 2008-10-29 at 08:38 +0100, Wayne Pope wrote: I cannot comment on the stabiliy, but for the javadoc you'll need to download the source and generate the javadoc (use maven for the quickest) as I don;t beleive its online anywhere On Tue, Oct 28, 2008 at 5:53 PM, miro [EMAIL PROTECTED] wrote: I am new to wicket and no guru to help me answer questions , I am starting a new project , is it ok to work with wicket 1.4 , i mean is it a stable release ,of should I use wicket 1.3 ? Please help me , also please point me to java docs of wicket 1.4 if 1.4 is all teste3d and ready for use -- View this message in context: http://www.nabble.com/using-wicket-tp20211179p20211179.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
On Wed, Oct 29, 2008 at 11:47 AM, francisco treacy [EMAIL PROTECTED] wrote: hi maarten About the null checking, I will see if I can avoid having nested null values in my proof-of-concept project. thing is the object chain is going to be resolved before it gets passed in - there's nothing you can do about it inside your class :( an eventual null pointer exception would be thrown before your constructor is called. Yes, of course. What I mean is that I would implement my class like this: public class Customer { public final PropertyAddress address = new PropertyImplAddress(); } so evaluating customer.address.get().city will never throw a NPE. When I really need to distingish between customers with or without an address, I could add isNull()/setNull() to Address (or maybe even to the Property interface itself). Maarten francisco On Wed, Oct 29, 2008 at 10:42 AM, Maarten Bosteels [EMAIL PROTECTED]wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a
RE: Session timeout page
Swanthe Lindgren mailto:[EMAIL PROTECTED] wrote: How do I change the session timeout page? I want my application to display the actual home page on session timout instead of the default Return to homepage-link page. Try getApplicationSettings().setPageExpiredErrorPage(HomePage.class); in the init() method of your application. Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Compatibility of objectautocomplete
Hi, does the objectautocomplete libs require wicket 1.4 or is it possible to use it with 1.3.x? Is it compatible with the AutoCompleteTextField of wicket extensions? Can I use a AutoCompleteTextField of wicket extensions and an ObjectAutoCompleteField in one form? Thanks in advance, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
afiar the proxy based model is null safe. Martijn On Wed, Oct 29, 2008 at 11:47 AM, francisco treacy [EMAIL PROTECTED] wrote: hi maarten About the null checking, I will see if I can avoid having nested null values in my proof-of-concept project. thing is the object chain is going to be resolved before it gets passed in - there's nothing you can do about it inside your class :( an eventual null pointer exception would be thrown before your constructor is called. francisco On Wed, Oct 29, 2008 at 10:42 AM, Maarten Bosteels [EMAIL PROTECTED]wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p20222077.html Sent from the Wicket - User mailing list archive at Nabble.com.
Re: Disabling 'back'/'next' web browser button usage in application
I think a better solution is to make the browser's back/forward buttons have the same effect as clicking on the 'Previous Question'/'Next Question' buttons. If you put effort into making that work instead of putting your effort into trying to disable the browser's back/forward buttons, then you will have a better application in the end -- one that the user's will appreciate more. On Wed, Oct 29, 2008 at 6:12 AM, Martin Grigorov [EMAIL PROTECTED]wrote: Hi Tomasz, Recently I integrated a JavaScript library with Wicket that could help you with this particular application. Take a look at the code and examples: https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-jquery/src/main/java/org/wicketstuff/jquery/ajaxbackbutton https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-jquery-examples/src/main/java/org/wicketstuff/jquery/ajaxbackbutton The code is quite new and the example page is the only test for it, so it could have some bugs ... Try it and let me know whether it is in any help for you. Martin On Wed, 2008-10-29 at 09:52 +0100, Tomasz Dziurko wrote: Hi. I have application which consists of questions to user provided in some order. Each question is reachable on the same address, let's say http://myApp/Question. Application engine knows which question to show from database record. Each question page has 'Previous Question' and 'Next Question' buttons which increase/decrease questionNumber in database and redirects to http://myApp/Question (which loads question looking for its number in database). My problem is: How disable 'back' and 'next' button in web browser so user can go to previous/next question only by using 'Previous Question' / 'Next Question' button? Is there a way to remove whole page from session? So user when clicks back/next will see custom communicate your session expired or you clicked 'back' or 'next' button on your web browser while doing a test'. Or maybe I could achieve such functionality in other way? Thank you in advance for help Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Compatibility of objectautocomplete
or you can go with this solution: http://cwiki.apache.org/WICKET/autocomplete-using-a-wicket-model.html -Original Message- From: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2008 6:15 AM To: users@wicket.apache.org Subject: Re: Compatibility of objectautocomplete Hi Kai No it seems Objectautocomplete were added after the branching.. So seems you are a bit out of luck, however backporting should not be too hard.. Kai Mütz wrote: Nino Saturnino Martinez Vazquez Wael wrote: Hi Kai Im not sure if the authors are around.. But the one Objectautocomplet in trunk of stuff are not backwards compatible, that goes for every contrib which depends on wicket 1.4. But there should be a branch with the old version I think, Igor did that a while back the 1.3 branch I mean.. I can not find a 1.3 of objectautocomplete branch at https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches /wicke t-1.3.x/ Anywhere else? As for having AutoCompletetextfield along with objectautocompletefield, theres nothing intentionally done for them not to live together but the JS could be clashing(I dont even know if they use the same libs) you'll just have to try and see.. I will try it if I find a 1.3 branch. Thanks, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
On Wed, Oct 29, 2008 at 12:03 PM, Martijn Dashorst [EMAIL PROTECTED] wrote: afiar the proxy based model is null safe. Hello Martijn, But IIUC it's not refactor-friendly (and no navigation and code completion), right ? I really hope they add first-class properties (that is, not string-based) in java 7 ... city = new TextFieldString (customer#address#city); Maarten On Wed, Oct 29, 2008 at 11:47 AM, francisco treacy [EMAIL PROTECTED] wrote: hi maarten About the null checking, I will see if I can avoid having nested null values in my proof-of-concept project. thing is the object chain is going to be resolved before it gets passed in - there's nothing you can do about it inside your class :( an eventual null pointer exception would be thrown before your constructor is called. francisco On Wed, Oct 29, 2008 at 10:42 AM, Maarten Bosteels [EMAIL PROTECTED]wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other
Re: CompoundModel based on proxies
On Wed, Oct 29, 2008 at 12:02 PM, Maarten Bosteels [EMAIL PROTECTED]wrote: On Wed, Oct 29, 2008 at 11:47 AM, francisco treacy [EMAIL PROTECTED] wrote: hi maarten About the null checking, I will see if I can avoid having nested null values in my proof-of-concept project. thing is the object chain is going to be resolved before it gets passed in - there's nothing you can do about it inside your class :( an eventual null pointer exception would be thrown before your constructor is called. Yes, of course. What I mean is that I would implement my class like this: public class Customer { public final PropertyAddress address = new PropertyImplAddress() { @Override public void set(Address value) { if (value == null) { throw new NullPointerException(address should not be null); } super.set(object); } }; so evaluating customer.address.get().city will never throw a NPE. When I really need to distingish between customers with or without an address, I could add isNull()/setNull() to Address (or maybe even to the Property interface itself). Maarten francisco On Wed, Oct 29, 2008 at 10:42 AM, Maarten Bosteels [EMAIL PROTECTED]wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting
Re: DataTable cell link
My colegue point out that for Ajax requests AjaxEventBehavior can be used, and it works fine. so now I need only solution for normal (non Ajax) requests. dlipski wrote: Because I havent found better solution then adding 'onclick' handler to cellItem I have to do it your way. I looked at urlFor methods in Component class and didnt found the one with Component attribute. How should I generate url for Link component, AjaxLink or AjaxFallbackLink ? Do I have to add this components to the page and set its visiblity to false ? I understand 'general concept' of this solution but dont know how to implement this in specific scenarion (ie. linking to Link, AjaxLink, AjaxFallbackLink). Using diffrent repeater could be a option but DataTable (or AjaxFallbackDefaultDataTable) provides a lot of functionality (sorting, paging, fallback links etc) so it would be a waste of time to implement its from scratch just because its hard to make a table cell (or row) a link. It must be a way to achive this... if not it serious limitation of DataTable component. Regards Daniel Jeremy Thomerson-5 wrote: Depending on what you are linking TO, it can be very simple. You can call urlFor(YourBookmarkablePage.class, pageParamsOrNullIfNone). So, you could do: cellItem.add(new SimpleAttributeModifier(onclick, location.href = ' + urlFor(YourBookmarkablePage.class, pageParamsOrNullIfNone) + ')); Of course, that JS could be better for triple click problems, etc. Really, you may just consider using another Repeater rather than DataTable. DataTable is for a very specific purpose, and it is often easier to roll your own than make DT fit your purpose. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 28, 2008 at 2:05 PM, dlipski [EMAIL PROTECTED] wrote: All this solutions are correct but the problem is not in attaching some custom Javascript to td element (which can be done in multiple ways) but in making td element work as a link. What exactly should I do to achive this ? What components should I add at server side at what JavaScript should I render at markup ? If I have to copy-paste bunch of Link class code it looks like some design/implementation problem of DataTable (or one of components it has). Its really supprising that such common issue is such problematic. I hope there is some simple and intuitive solution(if I find one I'll post it here) Thanks for your help Regards Daniel Michael O'Cleirigh wrote: Hi Daniel, If you subclass DefaultDataTable there is a protected method call newCellItem(...) that you can use to attach the onclick class onto the td. like: class MyDataTable extends DefaultDataTable { /* (non-Javadoc) * @see org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable#newCellItem(java.lang.String, int, org.apache.wicket.model.IModel) */ @Override protected Item newCellItem(String id, int index, IModel model) { Item cell = super.newCellItem(id, index, model); cell.add(new AttributeAppender(onclick, new Model (someJavascriptCall();)); return cell; } } Alternately you can use a custom column implementation like the FragrementColumn and add the onclick when the cell is created like: class MyOnClickColumn extends AbstractColumn { ... public void populateItem(Item cellItem, String componentId, IModel rowModel) { Label cell = new Label(componentId, new PropertyModel(rowModel, property)) cell.add (new AttributeAppender(onclick, new Model (someJavascriptCall();)); cellItem.add(cell); } } I think the second version would attach the onclick to the label within the td/td of a cell. Regards, Mike I dont know wicketopia project (and any of its classes like FragmentColumn) so I can misunderstand your idea but as far as I am able to read that code It looks like you are adding a link to the table cell, not making a cell itself a link. If I understand your code it is familar to: tdlt;agt;textlt;/agt;/td but Im wondering how to achive: td on click=xyztext/td where xyz is code generated by Wicket (like in Link component class) If I misundestood you could you give me some more details hot to make cell itself a link ? (not adding a link to the cell) ? Regards Daniel jwcarman wrote: Here's an example where I put a remove link in a DefaultDataTable cell: https://wicketopia.svn.sourceforge.net/svnroot/wicketopia/trunk/example/src/main/java/org/wicketopia/example/web/page/HomePage.java On Tue, Oct 28, 2008 at 6:33 AM, dlipski [EMAIL PROTECTED] wrote: Hi I have one short question: How to make entire cell in a DataTable a link ? I've read that Link component can be attached not only to lt;agt; tags but also to any other html elements (like tr and td) but I dont
Re: Disabling 'back'/'next' web browser button usage in application
And any hint how to do this? :) I thought about two possible ways to solve my problem: 1. on clicking Next/Prev Question button remove current page from PageMap (although no idea how to do this yet ;) ) and then redirect further, so when user use back button he will see session-expired-like page 2. on clicking Next/Prev Question button invalidate Question and answers model so (not sure, but think it works this way) when user backs models will be loaded again. What do you think? Regards -- Tomasz Dziurko - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
it is refactor friendly and you also have code completion (it works with generics) johan On Wed, Oct 29, 2008 at 12:12 PM, Maarten Bosteels [EMAIL PROTECTED]wrote: On Wed, Oct 29, 2008 at 12:03 PM, Martijn Dashorst [EMAIL PROTECTED] wrote: afiar the proxy based model is null safe. Hello Martijn, But IIUC it's not refactor-friendly (and no navigation and code completion), right ? I really hope they add first-class properties (that is, not string-based) in java 7 ... city = new TextFieldString (customer#address#city); Maarten On Wed, Oct 29, 2008 at 11:47 AM, francisco treacy [EMAIL PROTECTED] wrote: hi maarten About the null checking, I will see if I can avoid having nested null values in my proof-of-concept project. thing is the object chain is going to be resolved before it gets passed in - there's nothing you can do about it inside your class :( an eventual null pointer exception would be thrown before your constructor is called. francisco On Wed, Oct 29, 2008 at 10:42 AM, Maarten Bosteels [EMAIL PROTECTED]wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like
Re: CompoundModel based on proxies
You shouldn't muddy up your domain with view-specific logic (the IModel interface). On Wed, Oct 29, 2008 at 5:42 AM, Maarten Bosteels [EMAIL PROTECTED] wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p20222077.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: inserting javascript from java to html file
or you can use: https://svn.apache.org/repos/asf/wicket/trunk/wicket-velocity/ in which case you could have a separate js/vm file that can inject the values for you: myscript.vm script language=JavaScript function removeBlur(checked) { if(checked) { document.getElementById('${loginButtonId}').disabled = false; } else { document.getElementById('${loginButtonId}').disabled = true; } } /script MyPage.java final MapString, String vars = new HashMapString, String(1); vars.put(loginButtonId, login_button); // should get the login_button id from component.getMarkupId() instead return new VelocityHeaderContributor().add(new VelocityJavascriptContributor(MyPage.class, path/to/myscript.vm, Model.valueOf(vars), nameOfScript)); -Original Message- From: eyalbenamram [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2008 2:45 PM To: users@wicket.apache.org Subject: Re: inserting javascript from java to html file OK. What if I want all the JS to be inline (no .js file to be made)? I saw that wicket created a .js file... igor.vaynberg wrote: response.renderOnLoadJavascript() takes just the javascript - like the javadoc says. no need for you to output the script tags. -igor On Tue, Oct 28, 2008 at 11:33 AM, eyalbenamram [EMAIL PROTECTED] wrote: public void renderHead(IHeaderResponse response) { StringBuffer config = new StringBuffer(); config.append(script language=\JavaScript\\n); config.append(function removeBlur(checked) {\n); config.append(if(checked) {\n); config.append(document.getElementById('login_button').disabled = false;\n); config.append(} else {\n); config.append(document.getElementById('login_button').disabled = true;\n); config.append(} }\n); config.append(/script\n); response.renderOnLoadJavascript(config.toString()); igor.vaynberg wrote: what is your code look like? -igor On Tue, Oct 28, 2008 at 11:28 AM, eyalbenamram [EMAIL PROTECTED] wrote: Hi again, I used IHeaderContributer, and the javascript code is now garbled and not working. Here is what I got: script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/w icket-event.js/script script type=text/javascript !--/*--![CDATA[/*!--*/ Wicket.Event.add(window, load, function() { script language=JavaScript function removeBlur(checked) { if(checked) { document.getElementById('login_button').disabled = false; } else { document.getElementById('login_button').disabled = true; } } /script ;}); /*--]]*//script igor.vaynberg wrote: use iheadercontributor, that should work much better also make sure your page has body tag. -igor On Tue, Oct 28, 2008 at 10:57 AM, eyalbenamram [EMAIL PROTECTED] wrote: Hi I am inserting javascript code like this: StringBuffer config = new StringBuffer(); config.append(script language=\JavaScript\\n); config.append(function onLoad() { getValue(); setTimeout(\onRefresh();\,+ns.getAutoRefreshSecs()*1000+); }\n); config.append(function onRefresh(){\n); config.append(document.getElementById('hiddenVar').value = document.getElementById('textString').value;\n); config.append(window.location.reload(); }\n); config.append(function getValue() {\n); config.append(document.getElementById('textString').value = document.getElementById('hiddenVar').value; }\n); config.append(/script\n); /*open to activate JS*/ add(new StringHeaderContributor(config.toString())); and receive an error in log file: http-6789-2 ERROR html.WebPage - ^ http-6789-2 ERROR html.WebPage - You probably forgot to add a body or header tag to your markup since no Header Container was found but components where found which want to write to the head section. script language=JavaScript function removeBlur(checked) { if(checked) { document.getElementById('login_button').disabled = false; } else { document.getElementById('login_button').disabled = true; } } /script although my html file contains a head tag, and the javascript code actually appears in the rendered page (when I look at the source of the page). any idea? Thanks,Eyal. -- View this message in context: http://www.nabble.com/inserting-javascript-from-java-to-html-file -tp20212650p20212650.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Compatibility of objectautocomplete
Hoover, William mailto:[EMAIL PROTECTED] wrote: or you can go with this solution: http://cwiki.apache.org/WICKET/autocomplete-using-a-wicket-model.html Hi William, I have tried it but not successfully. I can select a choice from the choicelist. But if I want to save it I get a java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(Proper tyResolver.java:1093) at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(Pro pertyResolver.java:583) at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java: 137) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyMode l.java:164) at org.apache.wicket.Component.setModelObject(Component.java:2889) This is because the model object seems to be a String. Do I have to use a special IModel for CHOICE? Where is the findChoice methode invoked? Or do I have to invoke it within a behavior? Regards, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Compatibility of objectautocomplete
The CHOICE is your domain model object (there was an error in the WIKI). You should be able to use any object in your domain. Can you post your code example? -Original Message- From: Kai Mütz [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2008 8:57 AM To: users@wicket.apache.org Subject: RE: Compatibility of objectautocomplete Hoover, William mailto:[EMAIL PROTECTED] wrote: or you can go with this solution: http://cwiki.apache.org/WICKET/autocomplete-using-a-wicket-model.html Hi William, I have tried it but not successfully. I can select a choice from the choicelist. But if I want to save it I get a java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(Proper tyResolver.java:1093) at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(Pro pertyResolver.java:583) at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java: 137) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyMode l.java:164) at org.apache.wicket.Component.setModelObject(Component.java:2889) This is because the model object seems to be a String. Do I have to use a special IModel for CHOICE? Where is the findChoice methode invoked? Or do I have to invoke it within a behavior? Regards, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirect to a page on a new browser window
To make this work in Firefox with window.open, it seems I need Sjax (synchronous) to call window.open just inside the onclick handler. Is it possible in Wicket, in any way? Adriano Adriano dos Santos Fernandes escreveu: In a non-Wicket application, I had a page for report parameters editing and an execute button. Parameter validation was is Javascript, and I want my report opening on a new browser window. I done it with a form target=_blank tag. Now with Wicket, I succeeded done the same thing but I have problem with the browser preventing the (bad, in its opinion) popup from opening. My form has a feedbackpanel, so I believe I can't use the same technique. I have created an AjaxButton on it, and on its onSubmit I call target.appendJavascript(window.open(...)). Do you see a way to do it without the browser interfere in the new window opening? Thanks, Adriano - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
i agree - that's why i think it would be difficult to avoid an eventual NPE in something like customer.getAddress().getCity().getBlabla() in that case On Wed, Oct 29, 2008 at 1:09 PM, James Carman [EMAIL PROTECTED] wrote: You shouldn't muddy up your domain with view-specific logic (the IModel interface). On Wed, Oct 29, 2008 at 5:42 AM, Maarten Bosteels [EMAIL PROTECTED] wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p20222077.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For
RE: Compatibility of objectautocomplete
// optional, but probably needed final AjaxFormComponentUpdatingBehavior afcub = new AjaxFormComponentUpdatingBehavior(onchange) { protected final void onUpdate(final AjaxRequestTarget target) { // TODO : do something } }; // optional final AbstractAutoCompleteRenderer autoCompleteRenderer = new AbstractAutoCompleteRenderer() { protected final String getTextValue(final Object object) { // TODO : get the text value representation of our domain model object } protected final void renderChoice(final Object object, final Response response, final String criteria) { response.write(getTextValue(object)); } }; // required final AbstractAutoCompleteTextFieldMyDomainModelObject autoCompleteField = new AbstractAutoCompleteTextFieldMyDomainModelObject(id, autoCompleteRenderer) { protected final ListMyDomainModelObject getChoiceList(final String searchTextInput) { // TODO : return your choice list } protected final String getChoiceValue(final MyDomainModelObject choice) throws Throwable { // TODO : get the value that will be displayed for the choice in the autocomplete list } }; autoCompleteField.add(afcub); -Original Message- From: Hoover, William [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2008 9:03 AM To: users@wicket.apache.org; [EMAIL PROTECTED] Subject: RE: Compatibility of objectautocomplete The CHOICE is your domain model object (there was an error in the WIKI). You should be able to use any object in your domain. Can you post your code example? -Original Message- From: Kai Mütz [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2008 8:57 AM To: users@wicket.apache.org Subject: RE: Compatibility of objectautocomplete Hoover, William mailto:[EMAIL PROTECTED] wrote: or you can go with this solution: http://cwiki.apache.org/WICKET/autocomplete-using-a-wicket-model.html Hi William, I have tried it but not successfully. I can select a choice from the choicelist. But if I want to save it I get a java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(Proper tyResolver.java:1093) at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(Pro pertyResolver.java:583) at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java: 137) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyMode l.java:164) at org.apache.wicket.Component.setModelObject(Component.java:2889) This is because the model object seems to be a String. Do I have to use a special IModel for CHOICE? Where is the findChoice methode invoked? Or do I have to invoke it within a behavior? Regards, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
It can be done, but the expression languages that I've used don't do it out of the box, so that would be an issue with using the proxy approach. You'd have to roll your own On Wed, Oct 29, 2008 at 9:14 AM, francisco treacy [EMAIL PROTECTED] wrote: i agree - that's why i think it would be difficult to avoid an eventual NPE in something like customer.getAddress().getCity().getBlabla() in that case On Wed, Oct 29, 2008 at 1:09 PM, James Carman [EMAIL PROTECTED] wrote: You shouldn't muddy up your domain with view-specific logic (the IModel interface). On Wed, Oct 29, 2008 at 5:42 AM, Maarten Bosteels [EMAIL PROTECTED] wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p20222077.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CompoundModel based on proxies
On Wed, Oct 29, 2008 at 1:09 PM, James Carman [EMAIL PROTECTED]wrote: You shouldn't muddy up your domain with view-specific logic (the IModel interface). In my example I just used IModelT instead of PropertyT because everybody knows IModel. Have a look at https://bean-properties.dev.java.net/ It's certainly *not* view-specific logic. It's a very simple idea, and way more elegant than ugly setters and getters. But I will have a look at the proxy approach as well. regards Maarten On Wed, Oct 29, 2008 at 5:42 AM, Maarten Bosteels [EMAIL PROTECTED] wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p20222077.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Re: CompoundModel based on proxies
On Wed, Oct 29, 2008 at 2:24 PM, James Carman [EMAIL PROTECTED]wrote: The IModel interface, if you're talking about the one from Wicket, is a view-specific interface (it comes with a view layer library). James, Have you actually read what I wrote ? Maarten On Wed, Oct 29, 2008 at 9:20 AM, Maarten Bosteels [EMAIL PROTECTED] wrote: On Wed, Oct 29, 2008 at 1:09 PM, James Carman [EMAIL PROTECTED]wrote: You shouldn't muddy up your domain with view-specific logic (the IModel interface). In my example I just used IModelT instead of PropertyT because everybody knows IModel. Have a look at https://bean-properties.dev.java.net/ It's certainly *not* view-specific logic. It's a very simple idea, and way more elegant than ugly setters and getters. But I will have a look at the proxy approach as well. regards Maarten On Wed, Oct 29, 2008 at 5:42 AM, Maarten Bosteels [EMAIL PROTECTED] wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is
Re: CompoundModel based on proxies
Sorry, but I am on many mailing lists as part of my open source involvement. I apologize if I breezed over some of what you wrote. I see now where you said you could use the Property API from that other project, which is what I would suggest as opposed to IModel from the Wicket library if you're going to use it in your domain. I have a bad habit of half-reading these emails just so I can keep up with the volume of traffic from all of the lists. :) On Wed, Oct 29, 2008 at 9:29 AM, Maarten Bosteels [EMAIL PROTECTED] wrote: On Wed, Oct 29, 2008 at 2:24 PM, James Carman [EMAIL PROTECTED]wrote: The IModel interface, if you're talking about the one from Wicket, is a view-specific interface (it comes with a view layer library). James, Have you actually read what I wrote ? Maarten On Wed, Oct 29, 2008 at 9:20 AM, Maarten Bosteels [EMAIL PROTECTED] wrote: On Wed, Oct 29, 2008 at 1:09 PM, James Carman [EMAIL PROTECTED]wrote: You shouldn't muddy up your domain with view-specific logic (the IModel interface). In my example I just used IModelT instead of PropertyT because everybody knows IModel. Have a look at https://bean-properties.dev.java.net/ It's certainly *not* view-specific logic. It's a very simple idea, and way more elegant than ugly setters and getters. But I will have a look at the proxy approach as well. regards Maarten On Wed, Oct 29, 2008 at 5:42 AM, Maarten Bosteels [EMAIL PROTECTED] wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your
Re: CompoundModel based on proxies
The IModel interface, if you're talking about the one from Wicket, is a view-specific interface (it comes with a view layer library). On Wed, Oct 29, 2008 at 9:20 AM, Maarten Bosteels [EMAIL PROTECTED] wrote: On Wed, Oct 29, 2008 at 1:09 PM, James Carman [EMAIL PROTECTED]wrote: You shouldn't muddy up your domain with view-specific logic (the IModel interface). In my example I just used IModelT instead of PropertyT because everybody knows IModel. Have a look at https://bean-properties.dev.java.net/ It's certainly *not* view-specific logic. It's a very simple idea, and way more elegant than ugly setters and getters. But I will have a look at the proxy approach as well. regards Maarten On Wed, Oct 29, 2008 at 5:42 AM, Maarten Bosteels [EMAIL PROTECTED] wrote: On Wed, Oct 29, 2008 at 8:35 AM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, Francisco and I here where discussing whether we could figure a way of having some form of static/compile time checking on our (Compound)PropertyModels, as I'm a bit concerned long term about some nasty runtime bugs that might slip through the testing coverage. Francisco found this thread - I'm wondering what the status is? I had a look at: https://issues.apache.org/jira/browse/WICKET-1327 and there doesn't look like any activity since Feb. Anyone been using this or come up with a different solution? Ideally I think it would be just great if we had an eclipse plugin that could just check for this (a bit like checkstyle or something) but a runtime solution as proposed above seems really smart as well. However I'd rather keep is 100% java (ie not cglib) if possible. Hello, If you want something 100% java you could copde your domain models like this: public class Customer implements Serializable { public final IModelString firstName = new ModelString(); public final IModelString lastName = new ModelString(); } and use it like this: form.add(new TextFieldString(firstName, customer.firstName)); form.add(new TextFieldString(lastName, customer.lastName)); = no need to generate ugly getters/setters for all your properties = pure java = refactoring-safe = navigation + code-completion from IDE = you can still override setObject() and/or setObject() when needed In this example I have used wicket's IModel and Model but you could also use PropertyString from https://bean-properties.dev.java.net/ which has a lot of other benefits (a pity that the project is stalled a bit). Note that I haven't used this extensively but I sure do want to test it out in the near future.. One problem I see with this approach is when you need null-checking for nested properties: eg: new TextFieldString(city, customer.address.getObject().city ); Let me know what you think about it. Maarten Thanks for any update if anyone knows anything! Wayne Johan Compagner wrote: no i really dont like that then everywhere there code they need to do that, that is not an option. and they have to program themselfs agains the proxy api. I dont want that developers also have the learn/do that This is something commons-proxy needs to do On Sat, Mar 8, 2008 at 3:29 PM, James Carman [EMAIL PROTECTED] wrote: Couldn't you also do: ProxyFactory pf = ...; new SharedPropertyModelCustomer(pf, customer); So, the client tells you what proxy factory implementation to use. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: I see the JIRA, I'll go ahead and start the discussion on the dev list. On 3/8/08, James Carman [EMAIL PROTECTED] wrote: On 3/8/08, Johan Compagner [EMAIL PROTECTED] wrote: for wicket this is a feature it really should have now it defeats the purpose i have to make a decission in wicket which factory i use Then i can just as well directly compile against cglib. I cant make the api that way that the developer has to give that factory to use. That would be completely horrible, You could always implement your own brand of discovery for your project (perhaps by using the service discovery feature built into the jdk). I like the idea of splitting it (and doing it the slf4j way rather than the JCL way). I have actually suggested that we start an exploratory branch of JCL to make it work more like slf4j (we've been talking about this since 2005). Anyway, if you file a JIRA issue, I'll make sure we have a discussion with the other devs. For your immediate purposes, commons-discovery is available also. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context:
Re: Disabling 'back'/'next' web browser button usage in application
it is too bad that there are no deployed examples of wicketstuff-jquery project to see it in action. What I've done is exactly this. With HistoryAjaxBehavior you could listen for clicks on back/forward button. On Wed, 2008-10-29 at 07:10 -0400, Richard Allen wrote: I think a better solution is to make the browser's back/forward buttons have the same effect as clicking on the 'Previous Question'/'Next Question' buttons. If you put effort into making that work instead of putting your effort into trying to disable the browser's back/forward buttons, then you will have a better application in the end -- one that the user's will appreciate more. On Wed, Oct 29, 2008 at 6:12 AM, Martin Grigorov [EMAIL PROTECTED]wrote: Hi Tomasz, Recently I integrated a JavaScript library with Wicket that could help you with this particular application. Take a look at the code and examples: https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-jquery/src/main/java/org/wicketstuff/jquery/ajaxbackbutton https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-jquery-examples/src/main/java/org/wicketstuff/jquery/ajaxbackbutton The code is quite new and the example page is the only test for it, so it could have some bugs ... Try it and let me know whether it is in any help for you. Martin On Wed, 2008-10-29 at 09:52 +0100, Tomasz Dziurko wrote: Hi. I have application which consists of questions to user provided in some order. Each question is reachable on the same address, let's say http://myApp/Question. Application engine knows which question to show from database record. Each question page has 'Previous Question' and 'Next Question' buttons which increase/decrease questionNumber in database and redirects to http://myApp/Question (which loads question looking for its number in database). My problem is: How disable 'back' and 'next' button in web browser so user can go to previous/next question only by using 'Previous Question' / 'Next Question' button? Is there a way to remove whole page from session? So user when clicks back/next will see custom communicate your session expired or you clicked 'back' or 'next' button on your web browser while doing a test'. Or maybe I could achieve such functionality in other way? Thank you in advance for help Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JFreeChart component
I wrote a simple resource-based implementation: http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/common/resource/ChartImageResource.java and an example of using it: http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/story10/resource/StudentPerRankChart.java On Tue, Oct 28, 2008 at 10:48 PM, jwray [EMAIL PROTECTED] wrote: I looked around wicket stuff and didn't see anything related to JFreeChart. If you think it is suitable for inclusion in wicket-stuff, or elsewhere, then by all means upload it. It's only four classes so I don't think it is worth creating a new project for, and I don't know where it would fit right not. Jonny -- View this message in context: http://www.nabble.com/JFreeChart-component-tp20200322p20220047.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Upload exceeds maxsize error comes AFTER upload has finished
I am extending the upload component and have a problem with the maximum file size detection. The mechanism seems to be working fine except for that it has an user unfriendliness to it: An exception is thrown, an error message is set and the onError event called, but the message only arrives AFTER the upload has finished. Our maximum file size is 100 MB, so if I get a user that is uploading a file of 200 MB he or she will have to wait until the upload is finished before the maximum size exceeded error appears. This is hardly user friendly and I cannot trust users reading and understanding the disclaimer next to the upload button. Does anyone already have a solution to this problem? How do I close the input stream and output back the error? I can imagine that this would solve the problem. Another solution I can think of is trying to get the error back via Ajax, but that is hardly an elegant solution. Then I could cancel the upload by redirecting the uploading iframe. Kind regards, Lobo PS I have tried this with the Jetty test server and have seen the problem on virtually all browsers. -- View this message in context: http://www.nabble.com/Upload-exceeds-maxsize-error-comes-AFTER-upload-has-finished-tp20228506p20228506.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: few (not only) AutoCompleteTextField questions
On Tue, 28 Oct 2008, dlipski wrote: Textfields do recive onchange event, even AutocompleteTextField has modified version off onchange event handler. Whats more new AjaxFormComponentUpdatingBehavior(onchange){..}; works well in this scenario but OnChangeAjaxBehavior not. I looked at OnChangeAjaxBehavior implemenation and this is a subclass of AjaxFormComponentUpdatingBehavior class with super(onchange); call in its constructor. This class only provides its own implementation of onComponentRendered method so there should be a problem. When I looked at OnChangeAjaxBehavior class contract description in JavaDoc (A behavior that updates the hosting FormComponent via ajax when value of the component is changed. This behavior uses best available method to track changes on different types of form components.) there is no mention that it shouldnt be used with some components so I think its bug either in OnChangeAjaxBehavior class or AutocompleteTextField class. OnChangeAjaxBehavior overwrites the onchange JavaScript event handler of the DOM element it's attached to. It makes onchange of a text field work so that whenever you change the contents of the text field with keyboard or mouse (cut / paste), the event gets fired, and also disables the browser autocompletion (because it doesn't send any event that could be caught). I don't have it very clear how it works on other type of components, I've only found it useful on text fields. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LazyInit error with LDM in a panel
Hi, I've got the above problem which I have boiled down to the following basic example. MyPage references PanelA and PanelB which it swaps about depending on the current state - both are created when the page is created but PanelA is added to MyPage as the default display panel. PanelB contains the following label... add(new Label(testLabel, new PropertyModel(myLDM, someCollection))); myLDM is a LoadableDetachableModel which wraps a hibernate entity which, in turn, has a 'someCollection' property. On loading MyPage (first request), everything is fine (MyPage creates PanelA and PanelB and displays PanelA). However on moving to PanelB (second request) I get a LazyInitializationException saying that someCollection couldn't be loaded. I've already found a fix to this problem I delay the creation of the panels until they are actually being used (i.e. on the call to Panel.replaceWith()). However, I just can't really get my head around why this fails in the first place. Basically why is the LDM not calling load() on the second request? Also, as the late-construction of the panels seems to work... is this what people would recommend when swapping panels in and out of a page? Any help much appreciated, Neil. -- View this message in context: http://www.nabble.com/LazyInit-error-with-LDM-in-a-panel-tp20228580p20228580.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Feedback Panel on Modal Window With Field Validation does not work
Sorry I meant can we add a page to a modal window 张伟-4 wrote: try page not panel 2008/10/29 sureshram [EMAIL PROTECTED] Hello, I am trying to add auto validation in the modal window but I don't see any error messages. I added a feedback panel on a modal window which has a required text field. When I try to submit, the modal window does not do -- View this message in context: http://www.nabble.com/Feedback-Panel-on-Modal-Window-With-Field-Validation-does-not-work-tp20216419p20228860.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket and URLs
of course i dont mind. -igor On Wed, Oct 29, 2008 at 12:39 AM, Erik van Oosten [EMAIL PROTECTED] wrote: Thanks for clarifying limitation no 2, I had not though of this. Indeed in my usecase this is not a problem. 'Limitation' no 1 is quite intentional. If you don't mind, I've also added this comment to the article. Regards, Erik. Igor Vaynberg wrote: while this might work for your usecase this will pretty much break things. the version number is in the url for a reason. 1) it completely kills the backbutton for that page. since the url remains the same the browser wont record your actions in the history. based on what you are trying to do this may or may not be a bad thing. 2) even if you manage to get the back button working this will completely kill applications that use any kind of panel replacement because you no longer have the version information in the url. you have a page with panel A, you click a link and it is swapped with panel B. go back, click a link on A and you are hosed because wicket will look for the component you clicked on panel B instead of A. in all the applications ive written there was at least a moderate amount of panel replacement going on. one of the applications i worked on had the majority of its navigation consist of panel replacement. so i dont think this is a good idea. -igor -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page Markup Inheritance Problem...
I would like to confirm to folks here that you can use a page that has a wicket:child element in it directly. You do not have to subclass it! I found that to be quite weird, but it was very helpful in our situation! On Thu, Oct 23, 2008 at 10:42 PM, Richard Paul [EMAIL PROTECTED] wrote: From the testing that I have done so far. Yes. This has been such an extra ordinary find for me. It is what I call a HOWZAT!!! wicket moment !! This is such a powerful feature. Hopefully someone can give us the official description of this concept. -Richard Paul Independent Contractor Chicago Area. On Thu, Oct 23, 2008 at 8:29 PM, James Carman [EMAIL PROTECTED] wrote: What if SuperPage is a page that is concrete? Can it display itself without having the wicket:child elements plugged in? On Thu, Oct 23, 2008 at 4:56 PM, Richard Paul [EMAIL PROTECTED] wrote: I ran into a similar situation last night. Not sure if this is what your looking for. BasePage - My Site Layout SuperPage - My Page Layout (e.g. a header area for what I am working with) SubPage - Actions ( e.g. forms for adding stuff etc.) When first navigating to SuperPage I only want to show links that the user needs to click on to access the different SubPages. In this case I used a wicket:child in my SuperPage. I can still navigate to SuperPage even if I am calling the class SuperPage directly. Then each link in SuperPage called my SubPage class, with only the extra component added by the SubPage. Hope this helps. But as Igor said you have to make SuperPage have the wicket:child in its markup. -Richard On Thu, Oct 23, 2008 at 3:37 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: just like in object inheritance your superpage would have to provide a way to plug this extra component in... -igor On Thu, Oct 23, 2008 at 1:30 PM, James Carman [EMAIL PROTECTED] wrote: Suppose I have this page hierarchy: BasePage - SuperPage - SubPage. In BasePage.html, I've got wicket:child and in SuperPage.html I've got wicket:extend. Now, in SubPage.html, I can't just override the markup of SuperPage.html by using a wicket:extend. Suppose I wanted to just add in an extra component in SubPage.html and then override the markup for SuperPage with the markup for SubPage, but still allowing myself to extend from BasePage. I can't do that! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Changing WicketRuntimeException output
I would like to make it so that whenever Wicket throws a WicketRuntimeException, it also prints out getSession().getUser(). I'm not especially clear on the flow for RuntimeExceptions, so any suggestions on where I would add the code to do this will be greatly appreciated. Dane Laverty Information Technology 503-365-4687 [EMAIL PROTECTED]
Re: Migration to 1.4 - generic headache
On Wed, Oct 29, 2008 at 1:13 AM, Artur W. [EMAIL PROTECTED] wrote: Hi Igor, igor.vaynberg wrote: yes it sucks. i agree. personally i prefer code written against wicket 1.3. even in 1.3 i hardly had to cast anything and even with those casts i do not remember getting any class cast exceptions. It is nice to know that somebody thinks similar to me :) The generics in Wicket looks nice on examples. But in bigger application (we have aprox. 500k loc) it is a mess. Especially when we use lots of forms, models, adapters and so on. We must write more code than in 1.3 and we do not get any reward for it ;) i think there is a lot of reward for using generics even how they are now, but there are a lot of times when it does suck. I'm thinking now whether cancel migration and stay with wicket 1.3 or add this all voids and questions marks (thanks Stefan!) and get used to it. that is up to you. How long do you want to support (bug fixing, adding small improvements to 1.3) we no longer add new improvements to 1.3. it is purely in maintenance mode. once 1.4.2 is out we will probably end support for 1.3 altogether. we do not have the resources to maintain two branches. and when do you plan do release 1.5 :) not for a while. i would say a first milestone in about 5 months, maybe the thing with the generics and how they are in 1.4 is that they are half way to how i envision them in 1.5. so migration wise it will be easier to go from 1.4-1.5 then from 1.3-1.5 because at least you have your models generified and your component constructors expect the right model types. -igor Thanks in advance for your advices. Artur -- View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20222475.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Migration to 1.4 - generic headache
you are against generics completely. but they are going to happen. the way they are now is not perfect, in 1.5 we will try to move them to a better place, but like it or not they are here to stay. -igor On Wed, Oct 29, 2008 at 1:28 AM, Jan Kriesten [EMAIL PROTECTED] wrote: Hi Igor, yes it sucks. i agree. personally i prefer code written against wicket 1.3. even in 1.3 i hardly had to cast anything and even with those casts i do not remember getting any class cast exceptions. hehe - just as I was saying months ago. *g* anyways, we will see how it goes. until 1.4 i think the generics will stay the way they are unless we hear a ton of users complaining. If you need someone to complain you may always call on me. :D --- Jan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Compatibility of objectautocomplete
look in the project pom -igor On Wed, Oct 29, 2008 at 2:14 AM, Kai Mütz [EMAIL PROTECTED] wrote: Hi, does the objectautocomplete libs require wicket 1.4 or is it possible to use it with 1.3.x? Is it compatible with the AutoCompleteTextField of wicket extensions? Can I use a AutoCompleteTextField of wicket extensions and an ObjectAutoCompleteField in one form? Thanks in advance, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing WicketRuntimeException output
Should be possible to catch WicketRuntimeException with a servlet filter ... On Wed, Oct 29, 2008 at 4:27 PM, Dane Laverty [EMAIL PROTECTED]wrote: I would like to make it so that whenever Wicket throws a WicketRuntimeException, it also prints out getSession().getUser(). I'm not especially clear on the flow for RuntimeExceptions, so any suggestions on where I would add the code to do this will be greatly appreciated. Dane Laverty Information Technology 503-365-4687 [EMAIL PROTECTED]
Re: Changing WicketRuntimeException output
Create your own RequestCycle and in the onRuntimeException(Page page, RuntimeException e) do this. Ryan Gravener http://ryangravener.com/flex | http://twitter.com/ryangravener On Wed, Oct 29, 2008 at 11:27 AM, Dane Laverty [EMAIL PROTECTED]wrote: I would like to make it so that whenever Wicket throws a WicketRuntimeException, it also prints out getSession().getUser(). I'm not especially clear on the flow for RuntimeExceptions, so any suggestions on where I would add the code to do this will be greatly appreciated. Dane Laverty Information Technology 503-365-4687 [EMAIL PROTECTED]
Re: DataTable cell link
abstract class clickableitem extends item implements ilinklistener { protected oncomponenttag(tag) { super tag.put(onclick,window.location='+urlfor(ilinklistenerinterface.interface)+';); } } thats about all it takes -igor On Wed, Oct 29, 2008 at 4:20 AM, dlipski [EMAIL PROTECTED] wrote: My colegue point out that for Ajax requests AjaxEventBehavior can be used, and it works fine. so now I need only solution for normal (non Ajax) requests. dlipski wrote: Because I havent found better solution then adding 'onclick' handler to cellItem I have to do it your way. I looked at urlFor methods in Component class and didnt found the one with Component attribute. How should I generate url for Link component, AjaxLink or AjaxFallbackLink ? Do I have to add this components to the page and set its visiblity to false ? I understand 'general concept' of this solution but dont know how to implement this in specific scenarion (ie. linking to Link, AjaxLink, AjaxFallbackLink). Using diffrent repeater could be a option but DataTable (or AjaxFallbackDefaultDataTable) provides a lot of functionality (sorting, paging, fallback links etc) so it would be a waste of time to implement its from scratch just because its hard to make a table cell (or row) a link. It must be a way to achive this... if not it serious limitation of DataTable component. Regards Daniel Jeremy Thomerson-5 wrote: Depending on what you are linking TO, it can be very simple. You can call urlFor(YourBookmarkablePage.class, pageParamsOrNullIfNone). So, you could do: cellItem.add(new SimpleAttributeModifier(onclick, location.href = ' + urlFor(YourBookmarkablePage.class, pageParamsOrNullIfNone) + ')); Of course, that JS could be better for triple click problems, etc. Really, you may just consider using another Repeater rather than DataTable. DataTable is for a very specific purpose, and it is often easier to roll your own than make DT fit your purpose. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 28, 2008 at 2:05 PM, dlipski [EMAIL PROTECTED] wrote: All this solutions are correct but the problem is not in attaching some custom Javascript to td element (which can be done in multiple ways) but in making td element work as a link. What exactly should I do to achive this ? What components should I add at server side at what JavaScript should I render at markup ? If I have to copy-paste bunch of Link class code it looks like some design/implementation problem of DataTable (or one of components it has). Its really supprising that such common issue is such problematic. I hope there is some simple and intuitive solution(if I find one I'll post it here) Thanks for your help Regards Daniel Michael O'Cleirigh wrote: Hi Daniel, If you subclass DefaultDataTable there is a protected method call newCellItem(...) that you can use to attach the onclick class onto the td. like: class MyDataTable extends DefaultDataTable { /* (non-Javadoc) * @see org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable#newCellItem(java.lang.String, int, org.apache.wicket.model.IModel) */ @Override protected Item newCellItem(String id, int index, IModel model) { Item cell = super.newCellItem(id, index, model); cell.add(new AttributeAppender(onclick, new Model (someJavascriptCall();)); return cell; } } Alternately you can use a custom column implementation like the FragrementColumn and add the onclick when the cell is created like: class MyOnClickColumn extends AbstractColumn { ... public void populateItem(Item cellItem, String componentId, IModel rowModel) { Label cell = new Label(componentId, new PropertyModel(rowModel, property)) cell.add (new AttributeAppender(onclick, new Model (someJavascriptCall();)); cellItem.add(cell); } } I think the second version would attach the onclick to the label within the td/td of a cell. Regards, Mike I dont know wicketopia project (and any of its classes like FragmentColumn) so I can misunderstand your idea but as far as I am able to read that code It looks like you are adding a link to the table cell, not making a cell itself a link. If I understand your code it is familar to: tdlt;agt;textlt;/agt;/td but Im wondering how to achive: td on click=xyztext/td where xyz is code generated by Wicket (like in Link component class) If I misundestood you could you give me some more details hot to make cell itself a link ? (not adding a link to the cell) ? Regards Daniel jwcarman wrote: Here's an example where I put a remove link in a DefaultDataTable cell: https://wicketopia.svn.sourceforge.net/svnroot/wicketopia/trunk/example/src/main/java/org/wicketopia/example/web/page/HomePage.java On Tue,
Re: inserting javascript from java to html file
what you pasted looks ok, but its incomplete. go ahead and create a quickstart and a jira issue and i will take a look. -igor On Wed, Oct 29, 2008 at 2:07 AM, eyalbenamram [EMAIL PROTECTED] wrote: OK. I used the IHeader contributor and the problem still exist! The error: http-6789-2 ERROR html.WebPage - ^ http-6789-2 ERROR html.WebPage - You probably forgot to add a body or header tag to your markup since no Header Container was found but components where found which want to write to the head section. script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script script type=text/javascript !--/*--![CDATA[/*!--*/ Wicket.Event.add(window, load, function() { function removeBlur(checked) { if(checked) { document.getElementById('login_button').disabled = false; } else { document.getElementById('login_button').disabled = true; } } ;}); /*--]]*//script http-6789-2 ERROR html.WebPage - ^ The html: ?xml version=1.0 encoding=UTF-8? !DOCTYPE html PUBLIC -//WAPFORUM//DTD XHTML Mobile 1.0//EN http://www.wapforum.org/DTD/xhtml-mobile10.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en xmlns:wicket=http://wicket.apache.org/; wicket:id=htmlTag dir=ltr head title wicket:id=titletitle/title style type=text/css body {background-color: #FF; font-family:verdana;} a {margin:0px 3px 0px 3px;} .link{ font-weight: bold; white-space: nowrap; margin-left: 5px; } .center{ text-align: center;} .header {background:#FF; border-bottom: rgb(51,102,204) solid 3px; width:100%; line-height: 150%; text-align: center; } .footer{background:rgb(204,236,255); border-top: blue solid 3px; text-align: center; /* position:fixed; */ /* bottom:0px; */ width:100%; line-height: 125%; } .form { line-height: 150%; margin-bottom: 5px; } #submitButton { width: 100px; } /style /head body wicket:id=body onload=JavaScript:removeBlur(false); The java: public void renderHead(IHeaderResponse response) { StringBuffer config = new StringBuffer(); config.append(function removeBlur(checked) {\n); config.append(if(checked) {\n); config.append(document.getElementById('login_button').disabled = false;\n); config.append(} else {\n); config.append(document.getElementById('login_button').disabled = true;\n); config.append(} }\n); response.renderOnLoadJavascript(config.toString()); } What am I doing wrong??? igor.vaynberg wrote: huh? it did not create the fileyour javascript will be inlined! you are using the onloadjavascript which needs support for the onload event, which is why the wicket-event.js is included before your javascript. all this is apparent just by looking at the output code, you can see your code being inlined... -igor On Tue, Oct 28, 2008 at 11:45 AM, eyalbenamram [EMAIL PROTECTED] wrote: OK. What if I want all the JS to be inline (no .js file to be made)? I saw that wicket created a .js file... igor.vaynberg wrote: response.renderOnLoadJavascript() takes just the javascript - like the javadoc says. no need for you to output the script tags. -igor On Tue, Oct 28, 2008 at 11:33 AM, eyalbenamram [EMAIL PROTECTED] wrote: public void renderHead(IHeaderResponse response) { StringBuffer config = new StringBuffer(); config.append(script language=\JavaScript\\n); config.append(function removeBlur(checked) {\n); config.append(if(checked) {\n); config.append(document.getElementById('login_button').disabled = false;\n); config.append(} else {\n); config.append(document.getElementById('login_button').disabled = true;\n); config.append(} }\n); config.append(/script\n); response.renderOnLoadJavascript(config.toString()); igor.vaynberg wrote: what is your code look like? -igor On Tue, Oct 28, 2008 at 11:28 AM, eyalbenamram [EMAIL PROTECTED] wrote: Hi again, I used IHeaderContributer, and the javascript code is now garbled and not working. Here is what I got: script type=text/javascript
Re: Migration to 1.4 - generic headache
the fact remains that there are components that are sometimes used with a model and sometimes without one. as it is we only generify components that we *think* are most likely to be used with a model, this is why we spent many an hour backing out generics from Component. it is too bad that java does not have a way to default to a type if one is not specified, but that is java's limitation. -igor On Wed, Oct 29, 2008 at 8:46 AM, Jan Kriesten [EMAIL PROTECTED] wrote: Hi Igor, you are against generics completely. but they are going to happen. the way they are now is not perfect, in 1.5 we will try to move them to a better place, but like it or not they are here to stay. huh - hell, no, I'm not against generics at all. Where do you get that from? I'm against generics on Components which are not FormComponents (or ListViews)! I'm using Wicket together with Scala and other than with Java, I can't just drop the generics attributes (and live with the warnings). And the Void is really a hell of a generic... Generics on Models are what is needed and if your vision to decouple models from the component and use introspection/reflection to support them comes true I'd be quite happy (and could use Scala's mixin-feature to have my model functionality on the components). Best regards, --- Jan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Migration to 1.4 - generic headache
Hi Igor, you are against generics completely. but they are going to happen. the way they are now is not perfect, in 1.5 we will try to move them to a better place, but like it or not they are here to stay. huh - hell, no, I'm not against generics at all. Where do you get that from? I'm against generics on Components which are not FormComponents (or ListViews)! I'm using Wicket together with Scala and other than with Java, I can't just drop the generics attributes (and live with the warnings). And the Void is really a hell of a generic... Generics on Models are what is needed and if your vision to decouple models from the component and use introspection/reflection to support them comes true I'd be quite happy (and could use Scala's mixin-feature to have my model functionality on the components). Best regards, --- Jan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirect to a page on a new browser window
you will need to reshuffle your code so that it opens the window and all processing happens inside that window rather then in the ajax behavior. that way you can just add window.open piece to the onclick of whatever and pass all the necessary attributes on the url. -igor On Wed, Oct 29, 2008 at 6:09 AM, Adriano dos Santos Fernandes [EMAIL PROTECTED] wrote: To make this work in Firefox with window.open, it seems I need Sjax (synchronous) to call window.open just inside the onclick handler. Is it possible in Wicket, in any way? Adriano Adriano dos Santos Fernandes escreveu: In a non-Wicket application, I had a page for report parameters editing and an execute button. Parameter validation was is Javascript, and I want my report opening on a new browser window. I done it with a form target=_blank tag. Now with Wicket, I succeeded done the same thing but I have problem with the browser preventing the (bad, in its opinion) popup from opening. My form has a feedbackpanel, so I believe I can't use the same technique. I have created an AjaxButton on it, and on its onSubmit I call target.appendJavascript(window.open(...)). Do you see a way to do it without the browser interfere in the new window opening? Thanks, Adriano - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Migration to 1.4 - generic headache
its not just compound we have 2 special cases for this: IComponentAssignedModel and IComponentInheritedModel which will be both pretty tricky to do if the users must make a field for the model them selfs. but we will see. johan On Tue, Oct 28, 2008 at 5:22 PM, Igor Vaynberg [EMAIL PROTECTED]wrote: yes it sucks. i agree. personally i prefer code written against wicket 1.3. even in 1.3 i hardly had to cast anything and even with those casts i do not remember getting any class cast exceptions. i do think imodelt makes a ton of sense, but the types on components are pretty bad. in 1.5 i have an idea to fix it, but i am not sure it is going to work without giving up compound property model. the idea is to remove the default model from component completely and have user keep the model as a field. in ondetach() we can then detach any fields that are imodel via reflection. this will neatly solve all generics problems but it has limitations. anyways, we will see how it goes. until 1.4 i think the generics will stay the way they are unless we hear a ton of users complaining. -igor On Tue, Oct 28, 2008 at 4:23 AM, Artur W. [EMAIL PROTECTED] wrote: Hi Guys, In the weekend I tried to migrate our application to wicket 1.4. I was very happy to use generics with wicket but now I frustrated. I love Wicket and I know it is nobody fault (it java fault! :)) but the generics sucks. Our application is quite big, more than one thousand classes and after adding generics the code looks awful and it is unreadable. I could live with that but especially frustrating are more than 4.000 warnings that I have now. Most of them I cannot fix. For example the warnings apply to the components that don't have models but I have to add them a type. What type? Any? Example: add(new Link(link) { //warning here @Override public void onClick() { //do something here } }); I have a warning here because I didn't set a type of Link. But it doesn't have any model. I know I can add @SuppressWarnings(unchecked) but I don't want to do that in more than 4000 places in my code. If I do than I will loose all the warnign event that I would to have or could save me in the future. So a question is there any way to workaround about this warnings problem? I don't want to stay with wicket 1.3 because I realize that it will be abandon in a year or something. Thanks in advance, Artur -- View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JFreeChart component
James, slow down (and read the thread) :) The guy actually asked for a place to commit some integration stuff.. Unless you want him to put it in your svn? :) James Carman wrote: I wrote a simple resource-based implementation: http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/common/resource/ChartImageResource.java and an example of using it: http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/story10/resource/StudentPerRankChart.java On Tue, Oct 28, 2008 at 10:48 PM, jwray [EMAIL PROTECTED] wrote: I looked around wicket stuff and didn't see anything related to JFreeChart. If you think it is suitable for inclusion in wicket-stuff, or elsewhere, then by all means upload it. It's only four classes so I don't think it is worth creating a new project for, and I don't know where it would fit right not. Jonny -- View this message in context: http://www.nabble.com/JFreeChart-component-tp20200322p20220047.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JFreeChart component
I wasn't giving a place to put stuff. I was just offering up an alternative solution to the problem. I don't let anyone put stuff in my SVN! :) On Wed, Oct 29, 2008 at 12:07 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: James, slow down (and read the thread) :) The guy actually asked for a place to commit some integration stuff.. Unless you want him to put it in your svn? :) James Carman wrote: I wrote a simple resource-based implementation: http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/common/resource/ChartImageResource.java and an example of using it: http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/story10/resource/StudentPerRankChart.java On Tue, Oct 28, 2008 at 10:48 PM, jwray [EMAIL PROTECTED] wrote: I looked around wicket stuff and didn't see anything related to JFreeChart. If you think it is suitable for inclusion in wicket-stuff, or elsewhere, then by all means upload it. It's only four classes so I don't think it is worth creating a new project for, and I don't know where it would fit right not. Jonny -- View this message in context: http://www.nabble.com/JFreeChart-component-tp20200322p20220047.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataTable cell link
That was the solution I was looking for. I havent know that it is possible to do thinks that way ! I supose that I have to override newCellItem and newRowItem method in DataTable class and return ClickableItem instead of Item. Good to know that it is possible to do this in standard Wicket way without 'magic code'. Although it works and all classes follows their contracts in my opinion it would be more coherent and obvious if DataTable could work with any somponent as cell/row but its only my notice... igor.vaynberg wrote: abstract class clickableitem extends item implements ilinklistener { protected oncomponenttag(tag) { super tag.put(onclick,window.location='+urlfor(ilinklistenerinterface.interface)+';); } } thats about all it takes -igor On Wed, Oct 29, 2008 at 4:20 AM, dlipski [EMAIL PROTECTED] wrote: My colegue point out that for Ajax requests AjaxEventBehavior can be used, and it works fine. so now I need only solution for normal (non Ajax) requests. dlipski wrote: Because I havent found better solution then adding 'onclick' handler to cellItem I have to do it your way. I looked at urlFor methods in Component class and didnt found the one with Component attribute. How should I generate url for Link component, AjaxLink or AjaxFallbackLink ? Do I have to add this components to the page and set its visiblity to false ? I understand 'general concept' of this solution but dont know how to implement this in specific scenarion (ie. linking to Link, AjaxLink, AjaxFallbackLink). Using diffrent repeater could be a option but DataTable (or AjaxFallbackDefaultDataTable) provides a lot of functionality (sorting, paging, fallback links etc) so it would be a waste of time to implement its from scratch just because its hard to make a table cell (or row) a link. It must be a way to achive this... if not it serious limitation of DataTable component. Regards Daniel Jeremy Thomerson-5 wrote: Depending on what you are linking TO, it can be very simple. You can call urlFor(YourBookmarkablePage.class, pageParamsOrNullIfNone). So, you could do: cellItem.add(new SimpleAttributeModifier(onclick, location.href = ' + urlFor(YourBookmarkablePage.class, pageParamsOrNullIfNone) + ')); Of course, that JS could be better for triple click problems, etc. Really, you may just consider using another Repeater rather than DataTable. DataTable is for a very specific purpose, and it is often easier to roll your own than make DT fit your purpose. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 28, 2008 at 2:05 PM, dlipski [EMAIL PROTECTED] wrote: All this solutions are correct but the problem is not in attaching some custom Javascript to td element (which can be done in multiple ways) but in making td element work as a link. What exactly should I do to achive this ? What components should I add at server side at what JavaScript should I render at markup ? If I have to copy-paste bunch of Link class code it looks like some design/implementation problem of DataTable (or one of components it has). Its really supprising that such common issue is such problematic. I hope there is some simple and intuitive solution(if I find one I'll post it here) Thanks for your help Regards Daniel Michael O'Cleirigh wrote: Hi Daniel, If you subclass DefaultDataTable there is a protected method call newCellItem(...) that you can use to attach the onclick class onto the td. like: class MyDataTable extends DefaultDataTable { /* (non-Javadoc) * @see org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable#newCellItem(java.lang.String, int, org.apache.wicket.model.IModel) */ @Override protected Item newCellItem(String id, int index, IModel model) { Item cell = super.newCellItem(id, index, model); cell.add(new AttributeAppender(onclick, new Model (someJavascriptCall();)); return cell; } } Alternately you can use a custom column implementation like the FragrementColumn and add the onclick when the cell is created like: class MyOnClickColumn extends AbstractColumn { ... public void populateItem(Item cellItem, String componentId, IModel rowModel) { Label cell = new Label(componentId, new PropertyModel(rowModel, property)) cell.add (new AttributeAppender(onclick, new Model (someJavascriptCall();)); cellItem.add(cell); } } I think the second version would attach the onclick to the label within the td/td of a cell. Regards, Mike I dont know wicketopia project (and any of its classes like FragmentColumn) so I can misunderstand your idea but as far as I am able to read that code It looks like you are adding a link to the table cell, not making a cell itself a link. If I understand your code it is familar to:
Re: Migration to 1.4 - generic headache
yes, the inherited will have to most likely go away - but that is there only for the CPM. the icomponentassignedmodel is already broken if a component has more then one model because you have to manually call wrap() on those anyways...lately ive been writing a lot of components that take more then one model so i noticed this :) -igor On Wed, Oct 29, 2008 at 8:59 AM, Johan Compagner [EMAIL PROTECTED] wrote: its not just compound we have 2 special cases for this: IComponentAssignedModel and IComponentInheritedModel which will be both pretty tricky to do if the users must make a field for the model them selfs. but we will see. johan On Tue, Oct 28, 2008 at 5:22 PM, Igor Vaynberg [EMAIL PROTECTED]wrote: yes it sucks. i agree. personally i prefer code written against wicket 1.3. even in 1.3 i hardly had to cast anything and even with those casts i do not remember getting any class cast exceptions. i do think imodelt makes a ton of sense, but the types on components are pretty bad. in 1.5 i have an idea to fix it, but i am not sure it is going to work without giving up compound property model. the idea is to remove the default model from component completely and have user keep the model as a field. in ondetach() we can then detach any fields that are imodel via reflection. this will neatly solve all generics problems but it has limitations. anyways, we will see how it goes. until 1.4 i think the generics will stay the way they are unless we hear a ton of users complaining. -igor On Tue, Oct 28, 2008 at 4:23 AM, Artur W. [EMAIL PROTECTED] wrote: Hi Guys, In the weekend I tried to migrate our application to wicket 1.4. I was very happy to use generics with wicket but now I frustrated. I love Wicket and I know it is nobody fault (it java fault! :)) but the generics sucks. Our application is quite big, more than one thousand classes and after adding generics the code looks awful and it is unreadable. I could live with that but especially frustrating are more than 4.000 warnings that I have now. Most of them I cannot fix. For example the warnings apply to the components that don't have models but I have to add them a type. What type? Any? Example: add(new Link(link) { //warning here @Override public void onClick() { //do something here } }); I have a warning here because I didn't set a type of Link. But it doesn't have any model. I know I can add @SuppressWarnings(unchecked) but I don't want to do that in more than 4000 places in my code. If I do than I will loose all the warnign event that I would to have or could save me in the future. So a question is there any way to workaround about this warnings problem? I don't want to stay with wicket 1.3 because I realize that it will be abandon in a year or something. Thanks in advance, Artur -- View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upload exceeds maxsize error comes AFTER upload has finished
this is how posts work. we do not get control until the browser has processed the entire request. at least afaik. if you want to fix it you will have to write a custom servlet that processes uploads, and not use the standard POST mechanism. -igor On Wed, Oct 29, 2008 at 7:40 AM, lodewijkdans [EMAIL PROTECTED] wrote: I am extending the upload component and have a problem with the maximum file size detection. The mechanism seems to be working fine except for that it has an user unfriendliness to it: An exception is thrown, an error message is set and the onError event called, but the message only arrives AFTER the upload has finished. Our maximum file size is 100 MB, so if I get a user that is uploading a file of 200 MB he or she will have to wait until the upload is finished before the maximum size exceeded error appears. This is hardly user friendly and I cannot trust users reading and understanding the disclaimer next to the upload button. Does anyone already have a solution to this problem? How do I close the input stream and output back the error? I can imagine that this would solve the problem. Another solution I can think of is trying to get the error back via Ajax, but that is hardly an elegant solution. Then I could cancel the upload by redirecting the uploading iframe. Kind regards, Lobo PS I have tried this with the Jetty test server and have seen the problem on virtually all browsers. -- View this message in context: http://www.nabble.com/Upload-exceeds-maxsize-error-comes-AFTER-upload-has-finished-tp20228506p20228506.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Migration to 1.4 - generic headache
just dont write those! On Wed, Oct 29, 2008 at 5:18 PM, Igor Vaynberg [EMAIL PROTECTED]wrote: yes, the inherited will have to most likely go away - but that is there only for the CPM. the icomponentassignedmodel is already broken if a component has more then one model because you have to manually call wrap() on those anyways...lately ive been writing a lot of components that take more then one model so i noticed this :) -igor On Wed, Oct 29, 2008 at 8:59 AM, Johan Compagner [EMAIL PROTECTED] wrote: its not just compound we have 2 special cases for this: IComponentAssignedModel and IComponentInheritedModel which will be both pretty tricky to do if the users must make a field for the model them selfs. but we will see. johan On Tue, Oct 28, 2008 at 5:22 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: yes it sucks. i agree. personally i prefer code written against wicket 1.3. even in 1.3 i hardly had to cast anything and even with those casts i do not remember getting any class cast exceptions. i do think imodelt makes a ton of sense, but the types on components are pretty bad. in 1.5 i have an idea to fix it, but i am not sure it is going to work without giving up compound property model. the idea is to remove the default model from component completely and have user keep the model as a field. in ondetach() we can then detach any fields that are imodel via reflection. this will neatly solve all generics problems but it has limitations. anyways, we will see how it goes. until 1.4 i think the generics will stay the way they are unless we hear a ton of users complaining. -igor On Tue, Oct 28, 2008 at 4:23 AM, Artur W. [EMAIL PROTECTED] wrote: Hi Guys, In the weekend I tried to migrate our application to wicket 1.4. I was very happy to use generics with wicket but now I frustrated. I love Wicket and I know it is nobody fault (it java fault! :)) but the generics sucks. Our application is quite big, more than one thousand classes and after adding generics the code looks awful and it is unreadable. I could live with that but especially frustrating are more than 4.000 warnings that I have now. Most of them I cannot fix. For example the warnings apply to the components that don't have models but I have to add them a type. What type? Any? Example: add(new Link(link) { //warning here @Override public void onClick() { //do something here } }); I have a warning here because I didn't set a type of Link. But it doesn't have any model. I know I can add @SuppressWarnings(unchecked) but I don't want to do that in more than 4000 places in my code. If I do than I will loose all the warnign event that I would to have or could save me in the future. So a question is there any way to workaround about this warnings problem? I don't want to stay with wicket 1.3 because I realize that it will be abandon in a year or something. Thanks in advance, Artur -- View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AutoCompleteTextField type mismatch in line 227
jira, patch, etc... the mailing list is not a good place to report bugs. -igor On Wed, Oct 29, 2008 at 7:40 AM, Shailesh Verma [EMAIL PROTECTED] wrote: I am using wicket-extensions v 1.3.5 and see the javascript Type Mismatch error on Line 287 of wicket-autocomplete.js. This error comes on IE6.0 only. Firefox works ok. Shailesh Gerolf Seitz wrote: it's fixed in the upcoming 1.3.4 and the already release 1.4-M1 Gerolf On Thu, May 8, 2008 at 10:20 PM, taygolf [EMAIL PROTECTED] wrote: Yes I am just starting to try and get the autocompletetextfield working on my app and I am using wicket 1.3. as well and it is doing the same thing. It is throwing a js type mismatch error. Works fine in firefox but not in IE. Did you figure out the problem? T Niels Bo wrote: Hi I just swithed from 1.3.2 to 1.3.3 and that resultet in a javascript error type mismatch in line 227, wich is this line in wicket-autocomplete.js: menu.style.zIndex=index==auto?index:Number(index)+1; Only in IE (6.0) - firefox works fine. Does anyone else see this problem? Niels -- View this message in context: http://www.nabble.com/AutoCompleteTextField-%22type-mismatch%22-in-line-227-tp16560166p17135623.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/AutoCompleteTextField-%22type-mismatch%22-in-line-227-tp16560166p20228515.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Migration to 1.4 - generic headache
Those are definitely sticking points. I guess we'll just have to evaluate what is better for the framework. These two features are definitely convenient. On Wed, Oct 29, 2008 at 11:59 AM, Johan Compagner [EMAIL PROTECTED] wrote: its not just compound we have 2 special cases for this: IComponentAssignedModel and IComponentInheritedModel which will be both pretty tricky to do if the users must make a field for the model them selfs. but we will see. johan On Tue, Oct 28, 2008 at 5:22 PM, Igor Vaynberg [EMAIL PROTECTED]wrote: yes it sucks. i agree. personally i prefer code written against wicket 1.3. even in 1.3 i hardly had to cast anything and even with those casts i do not remember getting any class cast exceptions. i do think imodelt makes a ton of sense, but the types on components are pretty bad. in 1.5 i have an idea to fix it, but i am not sure it is going to work without giving up compound property model. the idea is to remove the default model from component completely and have user keep the model as a field. in ondetach() we can then detach any fields that are imodel via reflection. this will neatly solve all generics problems but it has limitations. anyways, we will see how it goes. until 1.4 i think the generics will stay the way they are unless we hear a ton of users complaining. -igor On Tue, Oct 28, 2008 at 4:23 AM, Artur W. [EMAIL PROTECTED] wrote: Hi Guys, In the weekend I tried to migrate our application to wicket 1.4. I was very happy to use generics with wicket but now I frustrated. I love Wicket and I know it is nobody fault (it java fault! :)) but the generics sucks. Our application is quite big, more than one thousand classes and after adding generics the code looks awful and it is unreadable. I could live with that but especially frustrating are more than 4.000 warnings that I have now. Most of them I cannot fix. For example the warnings apply to the components that don't have models but I have to add them a type. What type? Any? Example: add(new Link(link) { //warning here @Override public void onClick() { //do something here } }); I have a warning here because I didn't set a type of Link. But it doesn't have any model. I know I can add @SuppressWarnings(unchecked) but I don't want to do that in more than 4000 places in my code. If I do than I will loose all the warnign event that I would to have or could save me in the future. So a question is there any way to workaround about this warnings problem? I don't want to stay with wicket 1.3 because I realize that it will be abandon in a year or something. Thanks in advance, Artur -- View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LazyInit error with LDM in a panel
Its probably not fool-proof, but it has worked fine up till now public class MyLDMT extends MyDomainModelIF extends LoadableDetachableModel{ private MyServiceIFT modelLoaderService; private Long id; /** * Constructor. * * @param object the model to make 'detachable' * @param modelLoaderService used to load the model */ public MyLDM(T object, MyServiceIFT modelLoaderService){ super(object); this.modelLoaderService = modelLoaderService; this.id = object.getId(); } public MyLDM(Long id){ super(); this.id = id; } @Override protected T load() { return modelLoaderService.load(id); } public void setId(Long id) { this.id = id; } @Override @SuppressWarnings(unchecked) public T getObject(){ return (T)super.getObject(); } } igor.vaynberg wrote: what is your ldm implementation look like? and yes, delayed construction is always the way to go. -igor On Wed, Oct 29, 2008 at 7:44 AM, Neil McT [EMAIL PROTECTED] wrote: -- View this message in context: http://www.nabble.com/LazyInit-error-with-LDM-in-a-panel-tp20228580p20231137.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LazyInit error with LDM in a panel
that looks fine. is the myservice serializable? do you see any serialization errors in the log. if load() is not called then detach() is not called, that means you are removing the model or the component that contains it after getobject() has been called but before detach() was and you are somehow holding onto this instance and giving it to the next panel... -igor On Wed, Oct 29, 2008 at 9:45 AM, Neil McT [EMAIL PROTECTED] wrote: Its probably not fool-proof, but it has worked fine up till now public class MyLDMT extends MyDomainModelIF extends LoadableDetachableModel{ private MyServiceIFT modelLoaderService; private Long id; /** * Constructor. * * @param object the model to make 'detachable' * @param modelLoaderService used to load the model */ public MyLDM(T object, MyServiceIFT modelLoaderService){ super(object); this.modelLoaderService = modelLoaderService; this.id = object.getId(); } public MyLDM(Long id){ super(); this.id = id; } @Override protected T load() { return modelLoaderService.load(id); } public void setId(Long id) { this.id = id; } @Override @SuppressWarnings(unchecked) public T getObject(){ return (T)super.getObject(); } } igor.vaynberg wrote: what is your ldm implementation look like? and yes, delayed construction is always the way to go. -igor On Wed, Oct 29, 2008 at 7:44 AM, Neil McT [EMAIL PROTECTED] wrote: -- View this message in context: http://www.nabble.com/LazyInit-error-with-LDM-in-a-panel-tp20228580p20231137.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Compatibility of objectautocomplete
Maybe I have found another solution using the standard AutoCompleteTextField and a custom converter by overwriting getConverter(): public IConverter getConverter(final Class type) { return new MyAutoCompleteConverter(); } private class MyAutoCompleteConverter implements IConverter { public MyDomainModelObject convertToObject(final String value, final Locale locale) { if (Strings.isEmpty(value)) { return null; } MyDomainModelObject myModelObject = findChoice(value); if (myModelObject == null) { try { myModelObject = (MyDomainModelObject) MyAutoCompleteTextField.this.getType().newInstance(); myModelObject.setValue(value); } catch (Exception e) { return null; } } return myModelObject; } private MyDomainModelObject findChoice(final String value) { MyDomainModelObject myChoice = null; if (value != null) { for (MyDomainModelObject choice : choices) { if (choice.getValue() != null choice.getValue().equals(value)) { myChoice = choice; break; } } } return myChoice; } } I do not need any special AjaxFormComponentUpdatingBehavior because the findChoice() method is invoked from convertToObject(). I haven't tested it enough but it seems to work. Cheers, Kai Hoover, William mailto:[EMAIL PROTECTED] wrote: // optional, but probably needed final AjaxFormComponentUpdatingBehavior afcub = new AjaxFormComponentUpdatingBehavior(onchange) { protected final void onUpdate(final AjaxRequestTarget target) { // TODO : do something } }; // optional final AbstractAutoCompleteRenderer autoCompleteRenderer = new AbstractAutoCompleteRenderer() { protected final String getTextValue(final Object object) { // TODO : get the text value representation of our domain model object } protected final void renderChoice(final Object object, final Response response, final String criteria) { response.write(getTextValue(object)); } }; // required final AbstractAutoCompleteTextFieldMyDomainModelObject autoCompleteField = new AbstractAutoCompleteTextFieldMyDomainModelObject(id, autoCompleteRenderer) { protected final ListMyDomainModelObject getChoiceList(final String searchTextInput) { // TODO : return your choice list } protected final String getChoiceValue(final MyDomainModelObject choice) throws Throwable { // TODO : get the value that will be displayed for the choice in the autocomplete list } }; autoCompleteField.add(afcub); -Original Message- From: Hoover, William [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2008 9:03 AM To: users@wicket.apache.org; [EMAIL PROTECTED] Subject: RE: Compatibility of objectautocomplete The CHOICE is your domain model object (there was an error in the WIKI). You should be able to use any object in your domain. Can you post your code example? -Original Message- From: Kai Mütz [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2008 8:57 AM To: users@wicket.apache.org Subject: RE: Compatibility of objectautocomplete Hoover, William mailto:[EMAIL PROTECTED] wrote: or you can go with this solution: http://cwiki.apache.org/WICKET/autocomplete-using-a-wicket-model.html Hi William, I have tried it but not successfully. I can select a choice from the choicelist. But if I want to save it I get a java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(Proper tyResolver.java:1093) at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(Pro pertyResolver.java:583) at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java: 137) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyMode l.java:164) at org.apache.wicket.Component.setModelObject(Component.java:2889) This is because the model object seems to be a String. Do I have to use a special IModel for CHOICE? Where is the findChoice methode invoked? Or do I have to invoke it within a behavior? Regards, Kai
Re: Feedback Panel on Modal Window With Field Validation does not work
I tried with a modal window and page, still no luck, I do see validation happening in the server but I don't see that response coming back to the client 12:20:12,263 DEBUG [ComponentStringResourceLoader] Found resource from: org/apache/wicket/Application.properties; key: R equired 12:20:12,263 DEBUG [FeedbackMessages] Adding feedback message [FeedbackMessage message = Field 'text' is required., re porter = text, level = ERROR] The Ajax Debug Window shows the following response, I don't see any error message sent back to the window. ?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response Note the Submit button on the modal window is a ajaxfallback button, is this causing any problems? Any clue? sureshramakrishnaiah wrote: Sorry I meant can we add a page to a modal window 张伟-4 wrote: try page not panel 2008/10/29 sureshram [EMAIL PROTECTED] Hello, I am trying to add auto validation in the modal window but I don't see any error messages. I added a feedback panel on a modal window which has a required text field. When I try to submit, the modal window does not do - Suresh Ramakrishnaiah Lead Software Engineer -- View this message in context: http://www.nabble.com/Feedback-Panel-on-Modal-Window-With-Field-Validation-does-not-work-tp20216419p20231857.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Feedback Panel on Modal Window With Field Validation does not work
Ok found the solution myself, The problem was In the AjaxFallBackButton I had not overriden the onError() method, here's the solution added, onError(AjaxTarget target, Form form) { target.addComponent(feedbackPanel); } sureshramakrishnaiah wrote: I tried with a modal window and page, still no luck, I do see validation happening in the server but I don't see that response coming back to the client 12:20:12,263 DEBUG [ComponentStringResourceLoader] Found resource from: org/apache/wicket/Application.properties; key: R equired 12:20:12,263 DEBUG [FeedbackMessages] Adding feedback message [FeedbackMessage message = Field 'text' is required., re porter = text, level = ERROR] The Ajax Debug Window shows the following response, I don't see any error message sent back to the window. ?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response Note the Submit button on the modal window is a ajaxfallback button, is this causing any problems? Any clue? sureshramakrishnaiah wrote: Sorry I meant can we add a page to a modal window 张伟-4 wrote: try page not panel 2008/10/29 sureshram [EMAIL PROTECTED] Hello, I am trying to add auto validation in the modal window but I don't see any error messages. I added a feedback panel on a modal window which has a required text field. When I try to submit, the modal window does not do - Suresh Ramakrishnaiah Lead Software Engineer -- View this message in context: http://www.nabble.com/Feedback-Panel-on-Modal-Window-With-Field-Validation-does-not-work-tp20216419p20232299.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JFreeChart component
Theres no problem.. The guy just implemented a clickable chart, and wanted to share.. James Carman wrote: I wasn't giving a place to put stuff. I was just offering up an alternative solution to the problem. I don't let anyone put stuff in my SVN! :) On Wed, Oct 29, 2008 at 12:07 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: James, slow down (and read the thread) :) The guy actually asked for a place to commit some integration stuff.. Unless you want him to put it in your svn? :) James Carman wrote: I wrote a simple resource-based implementation: http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/common/resource/ChartImageResource.java and an example of using it: http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/story10/resource/StudentPerRankChart.java On Tue, Oct 28, 2008 at 10:48 PM, jwray [EMAIL PROTECTED] wrote: I looked around wicket stuff and didn't see anything related to JFreeChart. If you think it is suitable for inclusion in wicket-stuff, or elsewhere, then by all means upload it. It's only four classes so I don't think it is worth creating a new project for, and I don't know where it would fit right not. Jonny -- View this message in context: http://www.nabble.com/JFreeChart-component-tp20200322p20220047.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Migration to 1.4 - generic headache
Yeah I for one would defiantly hate for compound model to go away..:( But I guess one could come along away with propertymodel and when we get the proxybase model aproach in it could be okay. [1] https://issues.apache.org/jira/browse/WICKET-1327 James Carman wrote: Those are definitely sticking points. I guess we'll just have to evaluate what is better for the framework. These two features are definitely convenient. On Wed, Oct 29, 2008 at 11:59 AM, Johan Compagner [EMAIL PROTECTED] wrote: its not just compound we have 2 special cases for this: IComponentAssignedModel and IComponentInheritedModel which will be both pretty tricky to do if the users must make a field for the model them selfs. but we will see. johan On Tue, Oct 28, 2008 at 5:22 PM, Igor Vaynberg [EMAIL PROTECTED]wrote: yes it sucks. i agree. personally i prefer code written against wicket 1.3. even in 1.3 i hardly had to cast anything and even with those casts i do not remember getting any class cast exceptions. i do think imodelt makes a ton of sense, but the types on components are pretty bad. in 1.5 i have an idea to fix it, but i am not sure it is going to work without giving up compound property model. the idea is to remove the default model from component completely and have user keep the model as a field. in ondetach() we can then detach any fields that are imodel via reflection. this will neatly solve all generics problems but it has limitations. anyways, we will see how it goes. until 1.4 i think the generics will stay the way they are unless we hear a ton of users complaining. -igor On Tue, Oct 28, 2008 at 4:23 AM, Artur W. [EMAIL PROTECTED] wrote: Hi Guys, In the weekend I tried to migrate our application to wicket 1.4. I was very happy to use generics with wicket but now I frustrated. I love Wicket and I know it is nobody fault (it java fault! :)) but the generics sucks. Our application is quite big, more than one thousand classes and after adding generics the code looks awful and it is unreadable. I could live with that but especially frustrating are more than 4.000 warnings that I have now. Most of them I cannot fix. For example the warnings apply to the components that don't have models but I have to add them a type. What type? Any? Example: add(new Link(link) { //warning here @Override public void onClick() { //do something here } }); I have a warning here because I didn't set a type of Link. But it doesn't have any model. I know I can add @SuppressWarnings(unchecked) but I don't want to do that in more than 4000 places in my code. If I do than I will loose all the warnign event that I would to have or could save me in the future. So a question is there any way to workaround about this warnings problem? I don't want to stay with wicket 1.3 because I realize that it will be abandon in a year or something. Thanks in advance, Artur -- View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page Markup Inheritance Problem...
I dont find it a bit wierd.. It just means that you've prepped the class for inheritance (by telling wicket that markup should be inserted where wicket:child are), so that if someone comes along latter and extends your component they are allowed todo so:) I actually think this is a very nice feature.. James Carman wrote: I would like to confirm to folks here that you can use a page that has a wicket:child element in it directly. You do not have to subclass it! I found that to be quite weird, but it was very helpful in our situation! On Thu, Oct 23, 2008 at 10:42 PM, Richard Paul [EMAIL PROTECTED] wrote: From the testing that I have done so far. Yes. This has been such an extra ordinary find for me. It is what I call a HOWZAT!!! wicket moment !! This is such a powerful feature. Hopefully someone can give us the official description of this concept. -Richard Paul Independent Contractor Chicago Area. On Thu, Oct 23, 2008 at 8:29 PM, James Carman [EMAIL PROTECTED] wrote: What if SuperPage is a page that is concrete? Can it display itself without having the wicket:child elements plugged in? On Thu, Oct 23, 2008 at 4:56 PM, Richard Paul [EMAIL PROTECTED] wrote: I ran into a similar situation last night. Not sure if this is what your looking for. BasePage - My Site Layout SuperPage - My Page Layout (e.g. a header area for what I am working with) SubPage - Actions ( e.g. forms for adding stuff etc.) When first navigating to SuperPage I only want to show links that the user needs to click on to access the different SubPages. In this case I used a wicket:child in my SuperPage. I can still navigate to SuperPage even if I am calling the class SuperPage directly. Then each link in SuperPage called my SubPage class, with only the extra component added by the SubPage. Hope this helps. But as Igor said you have to make SuperPage have the wicket:child in its markup. -Richard On Thu, Oct 23, 2008 at 3:37 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: just like in object inheritance your superpage would have to provide a way to plug this extra component in... -igor On Thu, Oct 23, 2008 at 1:30 PM, James Carman [EMAIL PROTECTED] wrote: Suppose I have this page hierarchy: BasePage - SuperPage - SubPage. In BasePage.html, I've got wicket:child and in SuperPage.html I've got wicket:extend. Now, in SubPage.html, I can't just override the markup of SuperPage.html by using a wicket:extend. Suppose I wanted to just add in an extra component in SubPage.html and then override the markup for SuperPage with the markup for SubPage, but still allowing myself to extend from BasePage. I can't do that! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page Markup Inheritance Problem...
In my mind, I think of wicket:child like an abstract method in an abstract superclass. That's why I find it a bit weird. On Wed, Oct 29, 2008 at 3:31 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: I dont find it a bit wierd.. It just means that you've prepped the class for inheritance (by telling wicket that markup should be inserted where wicket:child are), so that if someone comes along latter and extends your component they are allowed todo so:) I actually think this is a very nice feature.. James Carman wrote: I would like to confirm to folks here that you can use a page that has a wicket:child element in it directly. You do not have to subclass it! I found that to be quite weird, but it was very helpful in our situation! On Thu, Oct 23, 2008 at 10:42 PM, Richard Paul [EMAIL PROTECTED] wrote: From the testing that I have done so far. Yes. This has been such an extra ordinary find for me. It is what I call a HOWZAT!!! wicket moment !! This is such a powerful feature. Hopefully someone can give us the official description of this concept. -Richard Paul Independent Contractor Chicago Area. On Thu, Oct 23, 2008 at 8:29 PM, James Carman [EMAIL PROTECTED] wrote: What if SuperPage is a page that is concrete? Can it display itself without having the wicket:child elements plugged in? On Thu, Oct 23, 2008 at 4:56 PM, Richard Paul [EMAIL PROTECTED] wrote: I ran into a similar situation last night. Not sure if this is what your looking for. BasePage - My Site Layout SuperPage - My Page Layout (e.g. a header area for what I am working with) SubPage - Actions ( e.g. forms for adding stuff etc.) When first navigating to SuperPage I only want to show links that the user needs to click on to access the different SubPages. In this case I used a wicket:child in my SuperPage. I can still navigate to SuperPage even if I am calling the class SuperPage directly. Then each link in SuperPage called my SubPage class, with only the extra component added by the SubPage. Hope this helps. But as Igor said you have to make SuperPage have the wicket:child in its markup. -Richard On Thu, Oct 23, 2008 at 3:37 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: just like in object inheritance your superpage would have to provide a way to plug this extra component in... -igor On Thu, Oct 23, 2008 at 1:30 PM, James Carman [EMAIL PROTECTED] wrote: Suppose I have this page hierarchy: BasePage - SuperPage - SubPage. In BasePage.html, I've got wicket:child and in SuperPage.html I've got wicket:extend. Now, in SubPage.html, I can't just override the markup of SuperPage.html by using a wicket:extend. Suppose I wanted to just add in an extra component in SubPage.html and then override the markup for SuperPage with the markup for SubPage, but still allowing myself to extend from BasePage. I can't do that! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
IE7 ignores AjaxButton onSubmit when I use the keyboard enter key
I have a ModalWindow containing a class extending Panel. On the Panel I have a class extending Form. The Form contains a custom AjaxButton which overrides protected void onSubmit(AjaxRequestTarget target, Form? form). When I click this button it retrieves text from a PasswordField and validates it. It displays an error message on my Panel's FeedbackPanel in the event of en error; otherwise it closes the ModalWindow and refreshes the calling page. This works flawlessly when I use the mouse button to click my AjaxButton. It also works in FireFox3 when I use the enter button. But in IE7 when I use the enter button instead of the mouse, it gives me a 404 error in my browser and the modal window disappears without running the onSubmit function. Any suggestions on how to make this work for IE7? I would like to use a ModalWindow if at all possible instead of popping up another page. Here is my HTML: html xmlns:wicket=http://wicket.sourceforge.net/; lang=EN-US wicket:panel form wicket:id=form action= table width=75% cellpadding=5 cellspacing=0 border=0 align=center tr td colspan=2 div class=formFeedback wicket:id=feedback/div Password: input type=password wicket:id=password name=Password/input /td /tr tr td align=center input type=submit wicket:id=okButton value=Delete/ /td td # Cancel /td /tr /table /form /wicket:panel /html - Here is my AjaxButton which I add to my Form object. add(new AjaxButton(okButton, this) { @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { if(form.get(password) != null (PasswordTextField)form.get(password) != null) { String userEnteredPassword = ((PasswordTextField)form.get(password)).getInput(); if(userEnteredPassword != null !userEnteredPassword.equals() validPassword(userEnteredPassword)) { //Delete successful; closing window window.close(target); return; } } error(Invalid password); } - Thanks. -- View this message in context: http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20234862.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IE7 ignores AjaxButton onSubmit when I use the keyboard enter key
FYI, I did try some of the suggestions in here but to no avail: http://www.nabble.com/Form-Enter-Key-Problem-td14408121.html Also I have investigated using some custom JavaScript manipulate IE, but I would like to avoid a messy solution like that if possible. -- View this message in context: http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20234941.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Back-button Page instance cloning issue
Greetings, I have spent a couple days trying to fix this issue, any help would be appreciated: Action sequence: 1. User of my application loads a wicket/html form page 2. User clicks a link and goes to another page 3. User clicks the browser's BACK button 4. User edits form's content and clicks submit By debugging and breaking in the onSubmit handler of the form, I notice that all the variables I used to originally construct the form page have been replaced with cloned instances! This is a problem because the object that was edited no longer refers to original object (which is held at the application level), and therefore the changes do not get seen, since the responding page uses the original object. Is there a way to disable this component cloning behavior, or should I code in a way that I only ever rely on id values and never the actual object instance? :sleep: Thanks in advance! -Sean -- View this message in context: http://www.nabble.com/Back-button-Page-instance-cloning-issue-tp20235001p20235001.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IE7 ignores AjaxButton onSubmit when I use the keyboard enter key
easiest thing is to simply disable the enter key on the textfield by override onkeydown -igor On Wed, Oct 29, 2008 at 1:04 PM, mallet [EMAIL PROTECTED] wrote: I have a ModalWindow containing a class extending Panel. On the Panel I have a class extending Form. The Form contains a custom AjaxButton which overrides protected void onSubmit(AjaxRequestTarget target, Form? form). When I click this button it retrieves text from a PasswordField and validates it. It displays an error message on my Panel's FeedbackPanel in the event of en error; otherwise it closes the ModalWindow and refreshes the calling page. This works flawlessly when I use the mouse button to click my AjaxButton. It also works in FireFox3 when I use the enter button. But in IE7 when I use the enter button instead of the mouse, it gives me a 404 error in my browser and the modal window disappears without running the onSubmit function. Any suggestions on how to make this work for IE7? I would like to use a ModalWindow if at all possible instead of popping up another page. Here is my HTML: html xmlns:wicket=http://wicket.sourceforge.net/; lang=EN-US wicket:panel form wicket:id=form action= table width=75% cellpadding=5 cellspacing=0 border=0 align=center tr td colspan=2 div class=formFeedback wicket:id=feedback/div Password: input type=password wicket:id=password name=Password/input /td /tr tr td align=center input type=submit wicket:id=okButton value=Delete/ /td td # Cancel /td /tr /table /form /wicket:panel /html - Here is my AjaxButton which I add to my Form object. add(new AjaxButton(okButton, this) { @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { if(form.get(password) != null (PasswordTextField)form.get(password) != null) { String userEnteredPassword = ((PasswordTextField)form.get(password)).getInput(); if(userEnteredPassword != null !userEnteredPassword.equals() validPassword(userEnteredPassword)) { //Delete successful; closing window window.close(target); return; } } error(Invalid password); } - Thanks. -- View this message in context: http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20234862.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Back-button Page instance cloning issue
wicket can clone your model objects for versioning or serialize the entire page to disk. it is not a good idea to hold direct references to object's whose lifecycle is independent of wicket components, for that you should use loadabledetachablemodel or something like it. -igor On Wed, Oct 29, 2008 at 1:12 PM, Sean W [EMAIL PROTECTED] wrote: Greetings, I have spent a couple days trying to fix this issue, any help would be appreciated: Action sequence: 1. User of my application loads a wicket/html form page 2. User clicks a link and goes to another page 3. User clicks the browser's BACK button 4. User edits form's content and clicks submit By debugging and breaking in the onSubmit handler of the form, I notice that all the variables I used to originally construct the form page have been replaced with cloned instances! This is a problem because the object that was edited no longer refers to original object (which is held at the application level), and therefore the changes do not get seen, since the responding page uses the original object. Is there a way to disable this component cloning behavior, or should I code in a way that I only ever rely on id values and never the actual object instance? :sleep: Thanks in advance! -Sean -- View this message in context: http://www.nabble.com/Back-button-Page-instance-cloning-issue-tp20235001p20235001.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page Markup Inheritance Problem...
Ahh, and in my mind It just goes hand in hand with classes which are not final:) I guess different mindsets.. So my idea is that if you can extend something you place in wicket:child. and if not you leave it out. James Carman wrote: In my mind, I think of wicket:child like an abstract method in an abstract superclass. That's why I find it a bit weird. On Wed, Oct 29, 2008 at 3:31 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: I dont find it a bit wierd.. It just means that you've prepped the class for inheritance (by telling wicket that markup should be inserted where wicket:child are), so that if someone comes along latter and extends your component they are allowed todo so:) I actually think this is a very nice feature.. James Carman wrote: I would like to confirm to folks here that you can use a page that has a wicket:child element in it directly. You do not have to subclass it! I found that to be quite weird, but it was very helpful in our situation! On Thu, Oct 23, 2008 at 10:42 PM, Richard Paul [EMAIL PROTECTED] wrote: From the testing that I have done so far. Yes. This has been such an extra ordinary find for me. It is what I call a HOWZAT!!! wicket moment !! This is such a powerful feature. Hopefully someone can give us the official description of this concept. -Richard Paul Independent Contractor Chicago Area. On Thu, Oct 23, 2008 at 8:29 PM, James Carman [EMAIL PROTECTED] wrote: What if SuperPage is a page that is concrete? Can it display itself without having the wicket:child elements plugged in? On Thu, Oct 23, 2008 at 4:56 PM, Richard Paul [EMAIL PROTECTED] wrote: I ran into a similar situation last night. Not sure if this is what your looking for. BasePage - My Site Layout SuperPage - My Page Layout (e.g. a header area for what I am working with) SubPage - Actions ( e.g. forms for adding stuff etc.) When first navigating to SuperPage I only want to show links that the user needs to click on to access the different SubPages. In this case I used a wicket:child in my SuperPage. I can still navigate to SuperPage even if I am calling the class SuperPage directly. Then each link in SuperPage called my SubPage class, with only the extra component added by the SubPage. Hope this helps. But as Igor said you have to make SuperPage have the wicket:child in its markup. -Richard On Thu, Oct 23, 2008 at 3:37 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: just like in object inheritance your superpage would have to provide a way to plug this extra component in... -igor On Thu, Oct 23, 2008 at 1:30 PM, James Carman [EMAIL PROTECTED] wrote: Suppose I have this page hierarchy: BasePage - SuperPage - SubPage. In BasePage.html, I've got wicket:child and in SuperPage.html I've got wicket:extend. Now, in SubPage.html, I can't just override the markup of SuperPage.html by using a wicket:extend. Suppose I wanted to just add in an extra component in SubPage.html and then override the markup for SuperPage with the markup for SubPage, but still allowing myself to extend from BasePage. I can't do that! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Back-button Page instance cloning issue
Ah, I get It. I thought we could count on direct object references to the application level for at least the duration of the user session, but now i see it's not a good idea, especially if you want proper back-button functionality serialization. LoadableDetachableModel sounds good, thanks. igor.vaynberg wrote: wicket can clone your model objects for versioning or serialize the entire page to disk. it is not a good idea to hold direct references to object's whose lifecycle is independent of wicket components, for that you should use loadabledetachablemodel or something like it. -igor On Wed, Oct 29, 2008 at 1:12 PM, Sean W [EMAIL PROTECTED] wrote: Greetings, I have spent a couple days trying to fix this issue, any help would be appreciated: Action sequence: 1. User of my application loads a wicket/html form page 2. User clicks a link and goes to another page 3. User clicks the browser's BACK button 4. User edits form's content and clicks submit By debugging and breaking in the onSubmit handler of the form, I notice that all the variables I used to originally construct the form page have been replaced with cloned instances! This is a problem because the object that was edited no longer refers to original object (which is held at the application level), and therefore the changes do not get seen, since the responding page uses the original object. Is there a way to disable this component cloning behavior, or should I code in a way that I only ever rely on id values and never the actual object instance? :sleep: Thanks in advance! -Sean -- View this message in context: http://www.nabble.com/Back-button-Page-instance-cloning-issue-tp20235001p20235001.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Back-button-Page-instance-cloning-issue-tp20235001p20235720.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JFreeChart component
Err, sort of confused about the last few messages. I submitted the component as I thought it would be useful for other people, and from the emails I've got I guess it was. When I had the need to implement a clickable chart a few weeks ago I looked around for an existing solution, and found none. There were one or two mentions of dynamic image generation using JFreeChart and, as the other code posted shows, it's relatively easy to do (eg. from the wicket wiki http://cwiki.apache.org/WICKET/jfreechart-and-wicket-example.html). What I didn't find, and took me a little time to figure out the best way to do, was generation of an image map from the chart thus allowing the chart to by clickable and integrated with a wicket AjaxLink, and associated callbacks. That's what this component provides, and I hope people find it useful. Jonny -- View this message in context: http://www.nabble.com/JFreeChart-component-tp20200322p20236096.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Saving panel state
I have some reused panels that have a custom built CollapsiblePanelHeader component in them. I would like to save the boolean value of whether it is collapsed or not within the Session object. I had it working for a while by using a Map in the Session with the panel's classname as the key and the boolean value as the value. This works mostly until you have a panel that is reused in another page. Then it will share it's state with the other panel of the same class. I tried to use the getPath() method but since I am constructing my CollapsiblePanelHeader in the constructor of the Panel, the parent of the Panel component is null therefore I am only getting back the id of the Panel which still causes many collisions(mainly because I have a BasePage that has a div wicket:id=bodyPanel/ that gets replaced by other subclasses). Does anyone have any ideas of how to uniquely identify reused Panel components? If not, is there a way that I can get the full path of the Panel by calling getPath() from within its constructor? Any help is greatly appreciated. Josh -- View this message in context: http://www.nabble.com/Saving-panel-state-tp20236203p20236203.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IE7 ignores AjaxButton onSubmit when I use the keyboard enter key
Igor, Thanks for your reply. Here's what I did: PasswordTextField passwordTextField = new PasswordTextField(password, new ModelString()); passwordTextField.add(new AjaxFormComponentUpdatingBehavior(onkeydown) { @Override public void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(onkeydown, if (wicketKeyCode(event) == 13) { return false;}; ); } }); However, the problem I have now is that the enter key no longer submits the form through my AjaxButton's onSubmit function. It simply disables the enter key from doing anything. This is better than before, but the users of this want to use the enter key to submit the form rather than the mouse click. I wonder if there is any way I can have it propagate the enter key to call the same function as when I press the AjaxButton with my mouse? igor.vaynberg wrote: easiest thing is to simply disable the enter key on the textfield by override onkeydown -igor On Wed, Oct 29, 2008 at 1:04 PM, mallet [EMAIL PROTECTED] wrote: I have a ModalWindow containing a class extending Panel. On the Panel I have a class extending Form. The Form contains a custom AjaxButton which overrides protected void onSubmit(AjaxRequestTarget target, Form? form). When I click this button it retrieves text from a PasswordField and validates it. It displays an error message on my Panel's FeedbackPanel in the event of en error; otherwise it closes the ModalWindow and refreshes the calling page. This works flawlessly when I use the mouse button to click my AjaxButton. It also works in FireFox3 when I use the enter button. But in IE7 when I use the enter button instead of the mouse, it gives me a 404 error in my browser and the modal window disappears without running the onSubmit function. Any suggestions on how to make this work for IE7? I would like to use a ModalWindow if at all possible instead of popping up another page. Here is my HTML: html xmlns:wicket=http://wicket.sourceforge.net/; lang=EN-US wicket:panel form wicket:id=form action= table width=75% cellpadding=5 cellspacing=0 border=0 align=center tr td colspan=2 div class=formFeedback wicket:id=feedback/div Password: input type=password wicket:id=password name=Password/input /td /tr tr td align=center input type=submit wicket:id=okButton value=Delete/ /td td # Cancel /td /tr /table /form /wicket:panel /html - Here is my AjaxButton which I add to my Form object. add(new AjaxButton(okButton, this) { @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { if(form.get(password) != null (PasswordTextField)form.get(password) != null) { String userEnteredPassword = ((PasswordTextField)form.get(password)).getInput(); if(userEnteredPassword != null !userEnteredPassword.equals() validPassword(userEnteredPassword)) { //Delete successful; closing window window.close(target); return; } } error(Invalid password); } - Thanks. -- View this message in context: http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20234862.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/IE7-ignores-AjaxButton-onSubmit-when-I-use-the-keyboard-enter-key-tp20234862p20236367.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]