Re: Add/remove AbstractAjaxBehavior
Hi Martin, Ok. But what if I want to remove it and then add again later? In my case I have several behaviors that are relatively heavy to create and I switch them. Vitaly 2012/12/12 Martin Grigorov mgrigo...@apache.org Hi, It is expected behavior. An Ajax behavior can work with only one component because it cannot create callbackUrl for more than one. On Wed, Dec 12, 2012 at 4:06 PM, Vitaly Tsaplin vitaly.tsap...@gmail.com wrote: Hi, It looks like it is not possible to remove an instance of AbstractAjaxBehavior. The behavior keeps reference to a component it was attached to and doesn't override unbind so it doesn't clear this reference. On every subsequent attempt to attach it throws an exception saying that it cannot be attached to more then one component. Should I file a bug or it is expected behavior? Vitaly -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Add/remove AbstractAjaxBehavior
I filed an issue https://issues.apache.org/jira/browse/WICKET-4925 2012/12/12 Vitaly Tsaplin vitaly.tsap...@gmail.com Hi Martin, Ok. But what if I want to remove it and then add again later? In my case I have several behaviors that are relatively heavy to create and I switch them. Vitaly 2012/12/12 Martin Grigorov mgrigo...@apache.org Hi, It is expected behavior. An Ajax behavior can work with only one component because it cannot create callbackUrl for more than one. On Wed, Dec 12, 2012 at 4:06 PM, Vitaly Tsaplin vitaly.tsap...@gmail.com wrote: Hi, It looks like it is not possible to remove an instance of AbstractAjaxBehavior. The behavior keeps reference to a component it was attached to and doesn't override unbind so it doesn't clear this reference. On every subsequent attempt to attach it throws an exception saying that it cannot be attached to more then one component. Should I file a bug or it is expected behavior? Vitaly -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: CryptedUrlWebRequestCodingStrategy and bookmarkable pages
Hi Igor, you can tweak the crypter to ignore bookmarkable urls. Well, that's what the crypter is supposed to do by default, isn't it? Now it simply tries to encrypt everything that starts with ? safely ignoring only RESTful urls. VItaly 2011/4/14 Igor Vaynberg igor.vaynb...@gmail.com: urls are encrypted with session-relative randomly generated keys. so they are not bookmarkable. vitaly, you can tweak the crypter to ignore bookmarkable urls. -igor On Wed, Apr 13, 2011 at 2:59 AM, Martin Grigorov mgrigo...@apache.org wrote: I don't have time to debug it right now but as far as I know the crypting algorithm doesn't use the sessionid. Either try to debug and see what happens or create a ticket with a quickstart and wait until someone of us have time to look at it. On Wed, Apr 13, 2011 at 11:46 AM, Vitaly Tsaplin vitaly.tsap...@gmail.comwrote: when I try to copy this link and open it in another browser it says The page you requested has expired. Does it mean that the link is bookmarkable? ) But it works as it should with no crypting. Bug? I use 1.4.17. The strategy is set like this @Override protected IRequestCycleProcessor newRequestCycleProcessor() { return new WebRequestCycleProcessor() { @Override protected IRequestCodingStrategy newRequestCodingStrategy() { return new CryptedUrlWebRequestCodingStrategy(new WebRequestCodingStrategy()); } }; } 2011/4/13 Martin Grigorov mgrigo...@apache.org: well, this is what crypting does ... but I think the url is still bookmarkable, i.e. clicking on it always creates a new instance of ProductViewPage On Wed, Apr 13, 2011 at 9:37 AM, Vitaly Tsaplin vitaly.tsap...@gmail.comwrote: Hi Martin, Here is how it looks http://localhost:8080/mysite/?x=Dc11lSgdY6XfDJ4ubDucC6WRETrJP52-jOltr8KdvSmpmKOCpyMIMn-JtJePH3kpFspghl8jR-5be5cN-L0iMC8wWtD2AXFO with disabled strategy it becomes http://localhost:8080/mysite/?wicket:bookmarkablePage=:com.tsaplin.web.engine.components.commerce.ProductViewPageid=5 Vitaly 2011/4/13 Martin Grigorov mgrigo...@apache.org: On Tue, Apr 12, 2011 at 9:11 PM, Vitaly Tsaplin vitaly.tsap...@gmail.comwrote: Hi everyone, I am using CryptedUrlWebRequestCodingStrategy to encode urls. I also put an instance of BookmarkablePageLink on my page and the link that has been generated by this is NOT bookmarkable. What's wrong I am doing? Do I always have to mount my page as bookmarkable? How does this generated url look like ? Best regards, Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: CryptedUrlWebRequestCodingStrategy and bookmarkable pages
Hi Martin, Here is how it looks http://localhost:8080/mysite/?x=Dc11lSgdY6XfDJ4ubDucC6WRETrJP52-jOltr8KdvSmpmKOCpyMIMn-JtJePH3kpFspghl8jR-5be5cN-L0iMC8wWtD2AXFO with disabled strategy it becomes http://localhost:8080/mysite/?wicket:bookmarkablePage=:com.tsaplin.web.engine.components.commerce.ProductViewPageid=5 Vitaly 2011/4/13 Martin Grigorov mgrigo...@apache.org: On Tue, Apr 12, 2011 at 9:11 PM, Vitaly Tsaplin vitaly.tsap...@gmail.comwrote: Hi everyone, I am using CryptedUrlWebRequestCodingStrategy to encode urls. I also put an instance of BookmarkablePageLink on my page and the link that has been generated by this is NOT bookmarkable. What's wrong I am doing? Do I always have to mount my page as bookmarkable? How does this generated url look like ? Best regards, Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: CryptedUrlWebRequestCodingStrategy and bookmarkable pages
when I try to copy this link and open it in another browser it says The page you requested has expired. Does it mean that the link is bookmarkable? ) But it works as it should with no crypting. Bug? I use 1.4.17. The strategy is set like this @Override protected IRequestCycleProcessor newRequestCycleProcessor() { return new WebRequestCycleProcessor() { @Override protected IRequestCodingStrategy newRequestCodingStrategy() { return new CryptedUrlWebRequestCodingStrategy(new WebRequestCodingStrategy()); } }; } 2011/4/13 Martin Grigorov mgrigo...@apache.org: well, this is what crypting does ... but I think the url is still bookmarkable, i.e. clicking on it always creates a new instance of ProductViewPage On Wed, Apr 13, 2011 at 9:37 AM, Vitaly Tsaplin vitaly.tsap...@gmail.comwrote: Hi Martin, Here is how it looks http://localhost:8080/mysite/?x=Dc11lSgdY6XfDJ4ubDucC6WRETrJP52-jOltr8KdvSmpmKOCpyMIMn-JtJePH3kpFspghl8jR-5be5cN-L0iMC8wWtD2AXFO with disabled strategy it becomes http://localhost:8080/mysite/?wicket:bookmarkablePage=:com.tsaplin.web.engine.components.commerce.ProductViewPageid=5 Vitaly 2011/4/13 Martin Grigorov mgrigo...@apache.org: On Tue, Apr 12, 2011 at 9:11 PM, Vitaly Tsaplin vitaly.tsap...@gmail.comwrote: Hi everyone, I am using CryptedUrlWebRequestCodingStrategy to encode urls. I also put an instance of BookmarkablePageLink on my page and the link that has been generated by this is NOT bookmarkable. What's wrong I am doing? Do I always have to mount my page as bookmarkable? How does this generated url look like ? Best regards, Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
CryptedUrlWebRequestCodingStrategy and bookmarkable pages
Hi everyone, I am using CryptedUrlWebRequestCodingStrategy to encode urls. I also put an instance of BookmarkablePageLink on my page and the link that has been generated by this is NOT bookmarkable. What's wrong I am doing? Do I always have to mount my page as bookmarkable? Best regards, Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to get notified when a component is added to a hierarchy?
Hi everyone, I far as I could find out there is onRemove method which gets called once a component has been removed from its parent. But how about the opposite? How to get notified when a component is added to a hierarchy? (setParent is final) Best regards, Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to get notified when a component is added to a hierarchy?
Hi Igor, It seams to be checking the flag.. if (!getFlag(FLAG_INITIALIZED)) { setFlag(FLAG_INITIALIZED, true); setFlag(FLAG_INITIALIZE_SUPER_CALL_VERIFIED, false); onInitialize(); My code adds and removes components via ajax dynamically. So it wouldn't be reasonably safe technique if the component gets re-attached twice within a single request. Vitaly 2010/12/13 Igor Vaynberg igor.vaynb...@gmail.com: oninitialize() -igor On Mon, Dec 13, 2010 at 8:08 PM, Vitaly Tsaplin vitaly.tsap...@gmail.com wrote: Hi everyone, I far as I could find out there is onRemove method which gets called once a component has been removed from its parent. But how about the opposite? How to get notified when a component is added to a hierarchy? (setParent is final) Best regards, Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Determine if request are ajax?
AjaxUtils.isAjaxRequest () On Tue, Nov 23, 2010 at 2:13 PM, nino martinez wael nino.martinez.w...@gmail.com wrote: Hi I have a page which are ajax enabled, on first rendering (non ajax) it should render some css. On subsequent renderings(ajax) it should only render if new css has been added. So I need to figure out if the the current request are a full non ajax refresh or ajax, so how's that done? I thought that calling AjaxRequestTarget.get would give an indication or maybe the request or the requestcycle.. But havent found a way yet. regards Nino - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Determine if request are ajax?
Sorry, I was a part of my code :) RequestCycle.get ().getRequestTarget () instanceof AjaxRequestTarget On Tue, Nov 23, 2010 at 2:18 PM, Vitaly Tsaplin vitaly.tsap...@gmail.com wrote: AjaxUtils.isAjaxRequest () On Tue, Nov 23, 2010 at 2:13 PM, nino martinez wael nino.martinez.w...@gmail.com wrote: Hi I have a page which are ajax enabled, on first rendering (non ajax) it should render some css. On subsequent renderings(ajax) it should only render if new css has been added. So I need to figure out if the the current request are a full non ajax refresh or ajax, so how's that done? I thought that calling AjaxRequestTarget.get would give an indication or maybe the request or the requestcycle.. But havent found a way yet. regards Nino - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
The inconsistency in a localization of enums (DropDownChoice vs EnumLabel)
Hi everyone, It seems there is an inconsistency in the way DropDownChoice (when localizeDisplayValues returns true) and EnumLabel localize they values. DropDownChoice uses toString and EnumLabel - toString + enum class name which makes me either have to keys for the same value or override EnumLabel.resourceKey. Is is meant to be this way? Best regards, Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Free wicket from component hierarchy hell
In simple cases it makes no difference. It makes real difference with some complex widgets (for example search components) that must be reused on many pages and they should render differently on each page depending on how much space and what context they are in. I don't like duplicating code even if it is gui code. Sounds like the first appealing argument slowly comming out of surrounding fuzz =) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Free wicket from component hierarchy hell
I'm sorry to say, but the whole discussion makes little sense to me and these attempts to fix something that is not broken actually scares me a bit. +1 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Free wicket from component hierarchy hell
My only hope is that the solution you end up with will not make us running some sort of script against all the sorces we have. On Mon, Nov 8, 2010 at 7:30 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: I'm sorry to say, but the whole discussion makes little sense to me and these attempts to fix something that is not broken actually scares me a bit. +1 It's maybe not broken for you. For me it's like dabbling in a swamp (http://kuvablogi.com/nayta/prev/img1483294.jpg, http://www.lansi-savo.fi/Urheilu/9349269.jpg, http://www.suopotkupallo.fi/). But all really depends on your approach. Some people think dabbling in a swamp gives you a firm grip. I cosinder it the opposite: swamp has a firm grip on you. ** Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Is there any way to process a wicket ajax envelope sent in some non-wicket way like using jQuery or Prototype?
Hi guys, Is there any way to process a wicket ajax envelope sent in some non-wicket way like using jQuery or Prototype? It seem that I can somehow utilize loadedCallback () but i don't know how to call it right way. Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Is there any way to process a wicket ajax envelope sent in some non-wicket way like using jQuery or Prototype?
Solved. Currently I do it like the following: new Wicket.Ajax.Call ().loadedCallback (response). But it looks like a bit of hack. I would request to decouple the javascript method loadedCallback of the class Wicket.Ajax.Call that actually process a wicket ajax envelope. The use cases may be different. For instance one can use an alternative ajax facility like that jQuery or Prototype offer to have a fine-grained control under request headers. Or like in my case to be able to post data (for uploading files) using an iframe and then to update a page in a regular manner avoiding a second client-server round-trip which will involve a regular wicket ajax call. Should I create an issue for that? On Sat, Mar 14, 2009 at 7:34 PM, Vitaly Tsaplin vitaly.tsap...@gmail.com wrote: Hi guys, Is there any way to process a wicket ajax envelope sent in some non-wicket way like using jQuery or Prototype? It seem that I can somehow utilize loadedCallback () but i don't know how to call it right way. Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket meetup in Switzerland?
Hi there, I would propose to meet in Geneva!! ;) Vitaly On Fri, Feb 20, 2009 at 1:57 PM, jWeekend jweekend_for...@cabouge.com wrote: Thomas, This is partly because, strange as it may seem, not everyone that develops with Wicket uses this list. We have clients and students that have come over for jWeekend Wicket courses from Switzerland and for our http://jWeekend.com/dev/LWUGReg/ London Wicket Events - I have never seen them post here, although they really enjoy Wicket. If it looks like you'll be going ahead let me know if you like me to contact them about your idea. You are also more than welcome to visit us at our next London Wicket Event (which will be on April 1st, at Google - details to be confirmed) that has gone from strength to strength in nearly 2 years since jWeekend founded it with Al Maw, but we also experienced quiet moments, especially during the first 6 months. In fact, despite regularly getting up to 50 people registering these days, it's very rare that our guests will post here afterwards saying how much they enjoy our events so others will know and come along, even though they tell us they love our events and keep coming back and wish we arranged more of them! We also offer to help people with their commercial/work projects during our events, I think that helped us build some momentum in the early days. The moral of the story is don't give up - you need to start somewhere, even if there's just a handful of you. What you may also find difficult at the start is getting enough people to prepare and deliver presentations that your guests would be willing to travel for. At the start it was just Al and I giving presentations, with maybe one other speaker if we were lucky. It took me several months to get that ball rolling smoothly, and even now we try to arrange things with our presenters several months in advance and jWeekend help with their presentation preparation and occasionally, cover their travel/accommodation expenses. We give everyone Pizza too, and are almost always the last to leave the pub after the event! I think some of our hard-core regulars feel it's just a good night out, as we seem to attract a really good bunch of people - and, from my experience, that is representative of the Wicket community/users generally. Let me know if you think we can help with what you're starting up in Switzerland. Regards - Cemal http://jWeekend.com jWeekend Thomas Mäder-2 wrote: Whoa! The silence is deafening! Since I've had one answer in a week, I guess there is just no interest. Oh well... Thomas On Mon, Feb 16, 2009 at 12:04 PM, Thomas Mäder thomas.mae...@devotek-it.chwrote: Hi Folks, I would be willing to organize a Wicket meetup in Switzerland if there is enough interest. I propose a meeting somewhere in Zürich. The format I imagine is that participants could (don't have to) shortly (15-20min.) present their work with Wicket (demos are always nice). That would be followed by general mingling with drinks snacks. For the date, I would shoot for the week starting March 16, 17:30-20:30h. Would you be interested in participating in/hosting/sponsoring such a thing? Either reply here or to me privately, and if there is enough interest, I'll set up a thing on the wiki. Thomas -- Thomas Mäder Wicket Eclipse Consulting www.devotek-it.ch -- Wicket Eclipse Consulting www.devotek-it.ch thomasmaeder.blogspot.com -- View this message in context: http://www.nabble.com/Wicket-meetup-in-Switzerland--tp22035241p22120034.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
What is the best place to add AjaxRequestTarget.IListener?
Hi there, What is the best place to add AjaxRequestTarget.IListener? And what is a life time of this listener? When is it removed? Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxRequestTarget.prependJavascript () seems to not evaluate a javascript
Hi there, Actually I have a behavior which implemented like the following @Override public void onRendered (Component component) { String scr = null; if (isAjaxRequest ()) { AjaxRequestTarget t = (AjaxRequestTarget)RequestCycle.get ().getRequestTarget (); if ((scr = getStartupJavascript ()) != null) { t.appendJavascript (scr); // WORKS FINE } if ((scr = getCleanupJavascript ()) != null) { t.prependJavascript (scr); // IS DEFINITELY CALLED! I SENDS JUST 'ALERT (1);' } } } And I cannot find the script it is supposed to send to a browser in the wicket ajax console. Am I doing something wrong? Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Generated links for sending with emails
Hi there, The simplest example is a link for accessing a user profile. It's unique and once clicked should cause opening a user profile. Or what even more interesting is the links that are generated for performing some specific actions like for a voting when the user by clicking on the link can vote and he/she is authorized only for performing this action. Probably this subject was discussed already so just point me out if it is. Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Generated links for sending with emails
Thanks Martijn, You have changed a bit the direction I was thinking about it in. The rest is to apply all this in practice :) Vitaly On Fri, Dec 19, 2008 at 12:13 PM, Martijn Dashorst martijn.dasho...@gmail.com wrote: If you click a link in an email message, it opens up your browser as it tries to render the response from the url. It is nice if you can then continue working in the application. I suggest a page that says Thank you for your vote, it counts in a friendly message. Martijn On Fri, Dec 19, 2008 at 12:07 PM, Vitaly Tsaplin vitaly.tsap...@gmail.com wrote: Thank you, Martijn, for your response! Now it's more or less clear how to deal with links to profiles. But what about voting for instance. Should I use a plain servlet in parallel with the wicket stuff or wicket can provide me with something a bit higher? Because this kind of functionality wouldn't be attached to any page. It would be modifying a database only. Basically when you click on the link provided for a voting in the email you receive your voice will be counted somehow in a database without opening a page. I am a bit lost where to dig for. Vitaly On Fri, Dec 19, 2008 at 11:39 AM, Martijn Dashorst martijn.dasho...@gmail.com wrote: generate a user specific hash, based on some data (time, userid, etc) store it with the user in your database and put the hash in a page parameter. urlFor(Page.class, PageParameters) will generate the appropriate url for your email. Martijn On Fri, Dec 19, 2008 at 10:24 AM, Vitaly Tsaplin vitaly.tsap...@gmail.com wrote: Hi there, The simplest example is a link for accessing a user profile. It's unique and once clicked should cause opening a user profile. Or what even more interesting is the links that are generated for performing some specific actions like for a voting when the user by clicking on the link can vote and he/she is authorized only for performing this action. Probably this subject was discussed already so just point me out if it is. Vitaly - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Is there any way to mount an action
Hi there, Something like: mountAction (/logout, new Action () { public void perform () { doLogout (); } ); Is is somehow possible? Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is there any way to mount an action
I just called it action. I have never used any action based framework before wicket :) You can think about an action I mentioned as about a method that can be mounted. If you create a link as was proposed you have to create a Java object with onClick () implemented that is referencing to your markup. It's a bit tedious if the link is not unique. Having an anonymous pageless action instantiated at the mounting point you will just drop as many links as you need and you will have all this links in the markup only. On Mon, Dec 8, 2008 at 11:40 AM, Martijn Dashorst [EMAIL PROTECTED] wrote: Wicket is not an action framework. There won't be any mount action thingies if I can help it. Why not just create a LogoutLink extends Link which does this? Think components, not actions. Martijn On Mon, Dec 8, 2008 at 11:29 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi Martijn, Thank you for your help. I meant that defining logic at the mounting point sometimes is a better idea then to do it at the point where we instantiate an anonimous link for instance. Regarding your example we have to have a page class + associated markup which is not necessary especially because I would like to jump directly to a home page. It's a bit heavy for such a simple thing. Vitaly On Mon, Dec 8, 2008 at 10:51 AM, Martijn Dashorst [EMAIL PROTECTED] wrote: public class LogoutPage extends WebPage { public LogoutPage() { add(new Label(msg, You have been logged out.)); getSession().invalidate(); } } mountBookmarkablePage(/logout, LogoutPage.class); Martijn On Mon, Dec 8, 2008 at 10:28 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi there, Something like: mountAction (/logout, new Action () { public void perform () { doLogout (); } ); Is is somehow possible? Vitaly - 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] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is there any way to mount an action
Hi Martijn, Thank you for your help. I meant that defining logic at the mounting point sometimes is a better idea then to do it at the point where we instantiate an anonimous link for instance. Regarding your example we have to have a page class + associated markup which is not necessary especially because I would like to jump directly to a home page. It's a bit heavy for such a simple thing. Vitaly On Mon, Dec 8, 2008 at 10:51 AM, Martijn Dashorst [EMAIL PROTECTED] wrote: public class LogoutPage extends WebPage { public LogoutPage() { add(new Label(msg, You have been logged out.)); getSession().invalidate(); } } mountBookmarkablePage(/logout, LogoutPage.class); Martijn On Mon, Dec 8, 2008 at 10:28 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi there, Something like: mountAction (/logout, new Action () { public void perform () { doLogout (); } ); Is is somehow possible? Vitaly - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is there any way to mount an action
I have a base page. As I said it's perfectly ok if the link is unique. If not and it jumps to an existing page (so you don't have to create a new one + markup) all links that you drop on your pages have to have paired Java objects instantiated and added to the wicket hierarchy (+ wicket:id in the markup) at least which is repetitive and boring since it brings no added value. It's not just about a logout, it can be applied, for instance, to any other similar task. I am not complaining :) Usualy I do it in the method onClick but as I said it's kinda tedious. On Mon, Dec 8, 2008 at 11:58 AM, Martijn Dashorst [EMAIL PROTECTED] wrote: You already need the link in the markup and you need the action in the javacode. What are you complaining about? You don't use base pages? Martijn On Mon, Dec 8, 2008 at 11:55 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I just called it action. I have never used any action based framework before wicket :) You can think about an action I mentioned as about a method that can be mounted. If you create a link as was proposed you have to create a Java object with onClick () implemented that is referencing to your markup. It's a bit tedious if the link is not unique. Having an anonymous pageless action instantiated at the mounting point you will just drop as many links as you need and you will have all this links in the markup only. On Mon, Dec 8, 2008 at 11:40 AM, Martijn Dashorst [EMAIL PROTECTED] wrote: Wicket is not an action framework. There won't be any mount action thingies if I can help it. Why not just create a LogoutLink extends Link which does this? Think components, not actions. Martijn On Mon, Dec 8, 2008 at 11:29 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi Martijn, Thank you for your help. I meant that defining logic at the mounting point sometimes is a better idea then to do it at the point where we instantiate an anonimous link for instance. Regarding your example we have to have a page class + associated markup which is not necessary especially because I would like to jump directly to a home page. It's a bit heavy for such a simple thing. Vitaly On Mon, Dec 8, 2008 at 10:51 AM, Martijn Dashorst [EMAIL PROTECTED] wrote: public class LogoutPage extends WebPage { public LogoutPage() { add(new Label(msg, You have been logged out.)); getSession().invalidate(); } } mountBookmarkablePage(/logout, LogoutPage.class); Martijn On Mon, Dec 8, 2008 at 10:28 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi there, Something like: mountAction (/logout, new Action () { public void perform () { doLogout (); } ); Is is somehow possible? Vitaly - 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] - 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] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I'm adding a new item to a ListView via ajax - how to get reference to the new item?
Hi, The item is already on your page so just use its html id in the javascript script you use to highlight it. Vitaly On Sun, Aug 17, 2008 at 1:22 PM, Wayne Pope [EMAIL PROTECTED] wrote: Hi everyone, I have a ListView that displays a list of cars (say). I have a small form on the page whereby they can add a new car using a AjaxFallbackButton. I can enter a new car and it updates the ListView However I want to highlight the newly added item, and I just can't seemt to figure out how I can 'target' the item. I'd like to do something like protected void onSubmit(AjaxRequestTarget target, Form arg1) { // add new car... if (target!=null) { target.addComponent(carList); target.addCompoent(THENEWITEM.addJavascript(new Effect.Highlight(this).toJavascript())); } - the question is how do I get the target reference to the new item added? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I'm adding a new item to a ListView via ajax - how to get reference to the new item?
My solution was to generate html ids according to some well defined strategy like using a uniq product ids from a database plus a prefix. So you will be able to reconstruct the html ids at any time if you know an id of the object you have just been created. If I am right you use the target object that is supplied for you in the method onSubmit. On Sun, Aug 17, 2008 at 1:36 PM, Wayne Pope [EMAIL PROTECTED] wrote: Hi, But how do I get that target? As the items are being rendered using a ListView - the only time I can get access is during the populateItem - but thats a ListItem, I need a AjexRequestTarget to append the javascript? On Sun, Aug 17, 2008 at 1:28 PM, Vitaly Tsaplin [EMAIL PROTECTED]wrote: Hi, The item is already on your page so just use its html id in the javascript script you use to highlight it. Vitaly On Sun, Aug 17, 2008 at 1:22 PM, Wayne Pope [EMAIL PROTECTED] wrote: Hi everyone, I have a ListView that displays a list of cars (say). I have a small form on the page whereby they can add a new car using a AjaxFallbackButton. I can enter a new car and it updates the ListView However I want to highlight the newly added item, and I just can't seemt to figure out how I can 'target' the item. I'd like to do something like protected void onSubmit(AjaxRequestTarget target, Form arg1) { // add new car... if (target!=null) { target.addComponent(carList); target.addCompoent(THENEWITEM.addJavascript(new Effect.Highlight(this).toJavascript())); } - the question is how do I get the target reference to the new item added? - 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: Modal window - update main page on close
It depends how you create your modal window. If it contains a page (iframe) then passing a component belonging to a main page to a modal window is not a solution. At least it did not work for me. The work around was to either open a modal window as a panel and pass the component as a constructor argrument (it works fine) or to update your component in WindowClosedCallback as you do :) On Tue, Jul 29, 2008 at 8:24 PM, steviezz [EMAIL PROTECTED] wrote: Component I want to update is in a Panel contained in the main page. So, no access to this component from the cancel button on the ModalWindow. Should I be passing the Panel to the ModalWindow in the constructor so I can access its components? Steve damnitjim wrote: Have you tried adding target.addComponent() call in the CancelButton submit ? On Mon, Jul 28, 2008 at 4:19 PM, steve222 [EMAIL PROTECTED] wrote: Hi. Using Wicket 1.3.4. I have a main page with a panel. Page contains a form for editing a main record. Panel contains a DataView containing a list of related sub records. In the java code for the pabel, create a ModalWindow and pop this for adding more sub-records. Uses AJAX. Got this working OK similar to: Main page code: public MainRecordEdit(PageParameters p) { Integer id = p.getInt(mainRecord); // uses application scope Spring bean to get record from database final MyRecord myRecord = getRecordManager().findById(id); ... // stuff form main record CRUD on main page ... // add the panel for the sub records add(new MyListingPanel(myListingPanel, myRecord)); } Panel code for sub records: public MyListingPanel(String id, final MyRecord myRecord) { super(id); Collection mySubs = myRecord.getSubRecords(); DataView dataView = new DataView(dataView, new ListDataProvider(new ArrayList(mySubs))) { public void populateItem(final Item item) { final MySub ms = (MyRecord) item.getModelObject(); item.add(new Label(id, ms.getId())); ... } }; final WebMarkupContainer listContainer = new WebMarkupContainer(theContainer); listContainer.setOutputMarkupId(true); listContainer.add(dataView); ... payawayWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { public void onClose(AjaxRequestTarget target) { // not sure what to put here to refresh the list in dataview target.addComponent(listContainer); } }); final ModalWindow modalWindow = new ModalWindow(modalWindow); modalWindow.setOutputMarkupId(true); add(modalWindow); add(new AjaxLink(modalLink) { public void onClick(AjaxRequestTarget target) { modalWindowshow(target); } }); In the jave code for the Modal window - also a Panel - I do normal CRUD stuff via AJAX with feedback going into a FeedbackPanel on the modal window panel when I save (or hit validation errors). No problems here - my AJAX updates work OK. I close the popup panel using a button: private void addCancelButton(Form form, final ModalWindow window) { AjaxFallbackButton cancel = new AjaxFallbackButton(cancelbutton, form) { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { // not sure if I need to do anything here to make the new // sub record appear on main page when I close this window info(Cancel was pressed!); window.close(target); } }; cancel.setDefaultFormProcessing(false); form.add(cancel); } Window closes. Main page does not show new sub record in the DataView on the main Panel. Page refresh reloads the list OK. Thanks. -- View this message in context: http://www.nabble.com/Modal-window---update-main-page-on-close-tp18701883p18701883.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/Modal-window---update-main-page-on-close-tp18701883p18718430.html Sent from the Wicket - User mailing list archive at Nabble.com.
Re: DataView and No items label
Thank you Igor, It's a good idea! So this component would complete the set of three: DataView, PagingNavigator and NoItemLabel (or kind of). Vitaly On Sun, Jul 27, 2008 at 4:36 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: you can create such a label yourself easily. simply pass in the dataview into it and override isvisible() { return dataview.getitemcount()==0; } -igor On Sat, Jul 26, 2008 at 5:53 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi everyone, Can anyone suggest a way to add a messages like No items in case if no items can be presented by the DataView. Currently I am using a simple label hiding it if something presents. Is there any other way? Or someone could generalize it by baking it to a reusable component? Vitaly - 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: DataView and No items label
DataTable? You mean GridView or what...? I cannot find anything like this in the javadoc... Could you provide a link? On Sun, Jul 27, 2008 at 1:47 PM, Martijn Dashorst [EMAIL PROTECTED] wrote: In this case, why not take a closer look at datatable? Martijn On Sun, Jul 27, 2008 at 12:59 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Thank you Igor, It's a good idea! So this component would complete the set of three: DataView, PagingNavigator and NoItemLabel (or kind of). Vitaly On Sun, Jul 27, 2008 at 4:36 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: you can create such a label yourself easily. simply pass in the dataview into it and override isvisible() { return dataview.getitemcount()==0; } -igor On Sat, Jul 26, 2008 at 5:53 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi everyone, Can anyone suggest a way to add a messages like No items in case if no items can be presented by the DataView. Currently I am using a simple label hiding it if something presents. Is there any other way? Or someone could generalize it by baking it to a reusable component? Vitaly - 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] -- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataView and No items label
Thank you all guys, The DataTable is definitely worth to look at! Vitaly On Sun, Jul 27, 2008 at 3:35 PM, Martijn Dashorst [EMAIL PROTECTED] wrote: I actually meant datatable: http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/extensions/markup/html/repeater/data/table/DataTable.html Of which DefaultDataTable is a subclass providing several toolbars, amongst one of them the NoRecordsToolbar you linked. DefaultDataTable is a good example, but in my experience brings too much to the table as a default. Building it up yourself from DataTable is more beneficial. Martijn On Sun, Jul 27, 2008 at 2:02 PM, James Carman [EMAIL PROTECTED] wrote: Oops, pasted the wrong URL: http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/extensions/markup/html/repeater/data/table/DefaultDataTable.html On Sun, Jul 27, 2008 at 8:01 AM, James Carman [EMAIL PROTECTED] wrote: He means check out DefaultDataTable: http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/extensions/markup/html/repeater/data/table/NoRecordsToolbar.html Notice the part about NoRecordsToolbar. On Sun, Jul 27, 2008 at 7:53 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: DataTable? You mean GridView or what...? I cannot find anything like this in the javadoc... Could you provide a link? On Sun, Jul 27, 2008 at 1:47 PM, Martijn Dashorst [EMAIL PROTECTED] wrote: In this case, why not take a closer look at datatable? Martijn On Sun, Jul 27, 2008 at 12:59 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Thank you Igor, It's a good idea! So this component would complete the set of three: DataView, PagingNavigator and NoItemLabel (or kind of). Vitaly On Sun, Jul 27, 2008 at 4:36 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: you can create such a label yourself easily. simply pass in the dataview into it and override isvisible() { return dataview.getitemcount()==0; } -igor On Sat, Jul 26, 2008 at 5:53 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi everyone, Can anyone suggest a way to add a messages like No items in case if no items can be presented by the DataView. Currently I am using a simple label hiding it if something presents. Is there any other way? Or someone could generalize it by baking it to a reusable component? Vitaly - 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] -- 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] - 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] -- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DataView and No items label
Hi everyone, Can anyone suggest a way to add a messages like No items in case if no items can be presented by the DataView. Currently I am using a simple label hiding it if something presents. Is there any other way? Or someone could generalize it by baking it to a reusable component? Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Javascript error in wicket
Hi everyone, Firebug is complaining as follows: [Exception... Component is not available nsresult: 0x80040111 (NS_ERROR_NOT_AVAILABLE) location: JS frame :: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsSessionStore.js :: sss_saveState :: line 1753 data: no] [Break on this error] oState.session = { state: ((this._loadState == STATE_RUNNING) ? STATE_RUNNIN... Any ideas? Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Javascript error in wicket
This file exists. I can open it... On Wed, Apr 30, 2008 at 2:52 PM, Peter Ertl [EMAIL PROTECTED] wrote: that's not wicket but firefox... try reading the filename: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsSessionStore.js Am 30.04.2008 um 12:17 schrieb Vitaly Tsaplin: Hi everyone, Firebug is complaining as follows: [Exception... Component is not available nsresult: 0x80040111 (NS_ERROR_NOT_AVAILABLE) location: JS frame :: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsSessionStore.js :: sss_saveState :: line 1753 data: no] [Break on this error] oState.session = { state: ((this._loadState == STATE_RUNNING) ? STATE_RUNNIN... Any ideas? Vitaly - 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: what is the preferred way to include a javascript library to a wicket project?
-- create a jira issue for the datepicker please For the datepicker only? Shouldn't it be done on the component level and be a part of solid wicket API...? In fact I do not use the datapicker at all what I said was related to the problem that I faced writing my own components. Hi Uwe, Why it should be so complicated... Isn't it better and simpler to be able to just add dependencies by hands overriding the defaults. It's the only practice in the javascript world. Look at YUI or whatever... every component has the inctructions... which libs to include...which css files... and how to use it. Personally I think that java and javascript should be kept as completely independent worlds with a clear conceptual separation since wicket do not even pretend to do such a thing like GWT or Volta do (java - javascript translation). And so an interoperational aspect in wicket are very limited. The client side shouldn't be jailed by the server side anyhow. A javascript developer should always have a change to tweak the tricky nature of javascript. On Sun, Apr 27, 2008 at 11:21 AM, Uwe Schäfer [EMAIL PROTECTED] wrote: Vitaly Tsaplin schrieb: -- personally i like to be able to simply include the datepicker and not -- have to worry or research what javascript library it uses. i´ve talked this over with some guys personally, and maybe this was discussed before, but consider this: what if components could express contributions by a dependency descriptor (maybe new Dependency(KnownLibs.XY, 1, 2) for xy 1.2) and provide wicket with a javascript integration project, where some versions of XY and others will be packaged? the page could resolve this dependency and actually contribute the header. - first thing that comes to mind, is that if lib XY has init code, that really should run once, and once only, the page has a chance of including it only once, if two components request for it. - second, assuming that later version are always compatible with earlier [yes, i know :) ], the page could decide to resolve to a later version if two components use two different versions of the same lib up to here, the cost of mainting these third party libs is as high, as packaging them with a version descriptor. i really think, that would be doable. - third (now really dreaming) if some version shift is known to break compatibility, the page could ask an handler to resolve this situation or (if unhandled) throw an exception. this makes it possible to a) be aware of using two components that depend on different version of teh same lib and b) to get the PAGE in charge of handling this situation and decide, what to do, as the page is the one thing, the application coder has control over (whereas the components are not). this would of course mean, that the libs desriptor needs to declare that compatibility break and (and here comes the tricky part), those people adding it to the KnownLibs-project have to know about it. what do you think? cu uwe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
a hidden field named x is filled by the form action url... a bug?
Hi everyone, It seems that if you add a hidden field named x to your form the field is going to be filled by the form action url :) It should be easy to reproduce. Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: what is the preferred way to include a javascript library to a wicket project?
And what does this mean? What if 2 different extensions are contributing to a header 2 different versions of YUI or prototype? Is it possible in javascript? I think no. You will definitely have a conflict. One of this versions will take a precedence. Being able to include javascript libraries by hands you still have a change to choose a most compartible version or to solve the conflict on the script level somehow if you can (noConflict mode for jquery for instance). On Sat, Apr 26, 2008 at 10:28 PM, Maurice Marrink [EMAIL PROTECTED] wrote: But this still does not fully support different versions of the lib. So if one extension uses version 1.0 of javascript lib A and another uses version 2.0, chances are you have a problem. because both extensions call some api that might not be available or has changed in the other version. just my 2c, Maurice On Fri, Apr 25, 2008 at 6:24 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Vitaly Tsaplin wrote: Isn't it often better to explicitly declare the list of javascript libraries the component uses and let the user add this libraries to the web content folder manually on his/her preferred location? I like that you package your component to run off the fly, and then you can overide so that you yourself can put in javascript libs, just like the prototip from minis, although I havent done this myself this gives full flexibility. On Fri, Apr 25, 2008 at 4:51 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: If you just need the javascript library, I also use header contribution. You can also take a look at wicket input events or datepicker etc... If you have your js files locally(in your project) you can use the packagedRessource so it gets gziped.. http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-stuff-contrib-input-events Vitaly Tsaplin wrote: Hi everyone, There are many usecases when it could be necessary to write some javascript by hands directly in the html file. So I need to reference the library I use in a head section of my html file. But having a reusable component written in java which is depending on the same javascript library I use a header contribution to inject a reference to the library that I have somewhere in a java package. So what is the preferred way to include a javascript library to a wicket project? Vitaly - 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] - 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: what is the preferred way to include a javascript library to a wicket project?
I am not talking about a level of wicket perfection :) I really like the idea to contribute to the header scripts that are locally stored in the java package if those scripts are somehow proprietary for the component being imported. But I am a bit worried about the fact that such commonly used components like datepicker or whatever are contributing YUI or prototype or some another library. It can quickly turn into the problem once it's getting out of regular support. You will end up with the fact that your application is sensitive to the order in which your components are added to the page. It seems that you should somehow emphasize that fact and try to somehow enforce extension writers to not include such libraries to they extensions locally but just put all required libs to they zips but out of the jar file. It's probably should be accepted as a best practice. I am just trying to discuss it... I guess it's quite important since wicket is enforcing a component oriented design. On Sun, Apr 27, 2008 at 12:45 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: and so what do we do in this situation or how can we ever fix it as a framework? you can always come up with a scenario that breaks under some condition. nothing is perfect. if i code against jquery 1.2.1 and someone else codes against jquery 1.0, then the two components are incompatible just like the two versions of the library they use. there isnt much we can do in terms of incompatibility resolution/prevention/whatever. and why should we try and solve it? we are a web application framework. we do not support whatever javascript our users decide to include in their components. maybe when javascript has the same kind of library isolation as osgi, or when the js library authors catch on and at least bother to namespace all their code life will be easier. -igor On Sat, Apr 26, 2008 at 3:05 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: And what does this mean? What if 2 different extensions are contributing to a header 2 different versions of YUI or prototype? Is it possible in javascript? I think no. You will definitely have a conflict. One of this versions will take a precedence. Being able to include javascript libraries by hands you still have a change to choose a most compartible version or to solve the conflict on the script level somehow if you can (noConflict mode for jquery for instance). On Sat, Apr 26, 2008 at 10:28 PM, Maurice Marrink [EMAIL PROTECTED] wrote: But this still does not fully support different versions of the lib. So if one extension uses version 1.0 of javascript lib A and another uses version 2.0, chances are you have a problem. because both extensions call some api that might not be available or has changed in the other version. just my 2c, Maurice On Fri, Apr 25, 2008 at 6:24 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Vitaly Tsaplin wrote: Isn't it often better to explicitly declare the list of javascript libraries the component uses and let the user add this libraries to the web content folder manually on his/her preferred location? I like that you package your component to run off the fly, and then you can overide so that you yourself can put in javascript libs, just like the prototip from minis, although I havent done this myself this gives full flexibility. On Fri, Apr 25, 2008 at 4:51 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: If you just need the javascript library, I also use header contribution. You can also take a look at wicket input events or datepicker etc... If you have your js files locally(in your project) you can use the packagedRessource so it gets gziped.. http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-stuff-contrib-input-events Vitaly Tsaplin wrote: Hi everyone, There are many usecases when it could be necessary to write some javascript by hands directly in the html file. So I need to reference the library I use in a head section of my html file. But having a reusable component written in java which is depending on the same javascript library I use a header contribution to inject a reference to the library that I have somewhere in a java package. So what is the preferred way to include a javascript library to a wicket project? Vitaly - To unsubscribe, e
Re: what is the preferred way to include a javascript library to a wicket project?
| if you contribute an incompatible version you are still left with a | nonworking component. so what is better now? At least I'll be able to include the latest one. Anyway in this scenario a component author will (I hope) properly define the list of all libraries the component depends on specifying a version of every library the component was tested with. You do the same including velocity or spring to the wicket distribution. And I can always change it. But doing a header contribution I can't change anything due to the fact that wicket puts all contributed stuff just after everything I already have included. So the contributed stuff will always take a precedence. Is there any way to override? In addition I would point to the fact that the existing practice of an inclusion of javascript libraries from a java package will finally lead to an enormous count of included versions of the same library taking time to be downloaded by a client's browser. But just the only lastly included one is going to be really used. It's obviously more related to extension writers then to wicket developers because it's clearly more the matter of the best practice then a technical issue. On Sun, Apr 27, 2008 at 1:50 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: but what good will that do? so components do not automatically contribute the javascript. instead you have to now do it yourself, and if you contribute an incompatible version you are still left with a nonworking component. so what is better now? wicket-datetime is not part of core, and even if it was you dont have to use it. its a choice you make. you can see all the javascript it includes easily. i agree that it would be super awesome if datepicker depended on our own internal and namespaced javascript. but looking at the modal window and autocomplete textfield, i dont think that is a business we want to be in necessarily as it is a huge timesink. -igor On Sat, Apr 26, 2008 at 4:28 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I am not talking about a level of wicket perfection :) I really like the idea to contribute to the header scripts that are locally stored in the java package if those scripts are somehow proprietary for the component being imported. But I am a bit worried about the fact that such commonly used components like datepicker or whatever are contributing YUI or prototype or some another library. It can quickly turn into the problem once it's getting out of regular support. You will end up with the fact that your application is sensitive to the order in which your components are added to the page. It seems that you should somehow emphasize that fact and try to somehow enforce extension writers to not include such libraries to they extensions locally but just put all required libs to they zips but out of the jar file. It's probably should be accepted as a best practice. I am just trying to discuss it... I guess it's quite important since wicket is enforcing a component oriented design. On Sun, Apr 27, 2008 at 12:45 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: and so what do we do in this situation or how can we ever fix it as a framework? you can always come up with a scenario that breaks under some condition. nothing is perfect. if i code against jquery 1.2.1 and someone else codes against jquery 1.0, then the two components are incompatible just like the two versions of the library they use. there isnt much we can do in terms of incompatibility resolution/prevention/whatever. and why should we try and solve it? we are a web application framework. we do not support whatever javascript our users decide to include in their components. maybe when javascript has the same kind of library isolation as osgi, or when the js library authors catch on and at least bother to namespace all their code life will be easier. -igor On Sat, Apr 26, 2008 at 3:05 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: And what does this mean? What if 2 different extensions are contributing to a header 2 different versions of YUI or prototype? Is it possible in javascript? I think no. You will definitely have a conflict. One of this versions will take a precedence. Being able to include javascript libraries by hands you still have a change to choose a most compartible version or to solve the conflict on the script level somehow if you can (noConflict mode for jquery for instance). On Sat, Apr 26, 2008 at 10:28 PM, Maurice Marrink [EMAIL PROTECTED] wrote: But this still does not fully support different versions of the lib. So if one extension uses version 1.0 of javascript lib A and another uses
Re: what is the preferred way to include a javascript library to a wicket project?
-- personally i like to be able to simply include the datepicker and not -- have to worry or research what javascript library it uses. I would definitely do the same but the javascript often comes the developer hell and any hidden includes injected by the component itself can make things just worse. I would definitely like to be able to turn it off instead of being dictated whatever version of acriptaculous or prototype or YUI I should finally use or to include 2,4,6 or more completely identical versions of the same library just because it's not so obvious how to spell the name of the library in the contributor script.aculos.us or scriptaculosus. It can come to be just rediculous. The situation can get worse as more serious commercial companies having a lot of legacy staff and pages with preincluded libs will be migrating to wicket. But it's just my personal opinion... I think something like contributeDependencies seems be be a good compromise. On Sun, Apr 27, 2008 at 3:39 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: personally i like to be able to simply include the datepicker and not have to worry or research what javascript library it uses. but sure, i guess we can add a simple boolean datepicker.contributeDependencies() that you can then override and return false. of course then it puts burden on any component that encapsulates a datepicker to forward this breakout... -igor On Sat, Apr 26, 2008 at 5:20 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: | if you contribute an incompatible version you are still left with a | nonworking component. so what is better now? At least I'll be able to include the latest one. Anyway in this scenario a component author will (I hope) properly define the list of all libraries the component depends on specifying a version of every library the component was tested with. You do the same including velocity or spring to the wicket distribution. And I can always change it. But doing a header contribution I can't change anything due to the fact that wicket puts all contributed stuff just after everything I already have included. So the contributed stuff will always take a precedence. Is there any way to override? In addition I would point to the fact that the existing practice of an inclusion of javascript libraries from a java package will finally lead to an enormous count of included versions of the same library taking time to be downloaded by a client's browser. But just the only lastly included one is going to be really used. It's obviously more related to extension writers then to wicket developers because it's clearly more the matter of the best practice then a technical issue. On Sun, Apr 27, 2008 at 1:50 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: but what good will that do? so components do not automatically contribute the javascript. instead you have to now do it yourself, and if you contribute an incompatible version you are still left with a nonworking component. so what is better now? wicket-datetime is not part of core, and even if it was you dont have to use it. its a choice you make. you can see all the javascript it includes easily. i agree that it would be super awesome if datepicker depended on our own internal and namespaced javascript. but looking at the modal window and autocomplete textfield, i dont think that is a business we want to be in necessarily as it is a huge timesink. -igor On Sat, Apr 26, 2008 at 4:28 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I am not talking about a level of wicket perfection :) I really like the idea to contribute to the header scripts that are locally stored in the java package if those scripts are somehow proprietary for the component being imported. But I am a bit worried about the fact that such commonly used components like datepicker or whatever are contributing YUI or prototype or some another library. It can quickly turn into the problem once it's getting out of regular support. You will end up with the fact that your application is sensitive to the order in which your components are added to the page. It seems that you should somehow emphasize that fact and try to somehow enforce extension writers to not include such libraries to they extensions locally but just put all required libs to they zips but out of the jar file. It's probably should be accepted as a best practice. I am just trying to discuss it... I guess it's quite important since wicket is enforcing a component oriented design. On Sun, Apr 27, 2008 at 12:45 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: and so what do we do
what is the preferred way to include a javascript library to a wicket project?
Hi everyone, There are many usecases when it could be necessary to write some javascript by hands directly in the html file. So I need to reference the library I use in a head section of my html file. But having a reusable component written in java which is depending on the same javascript library I use a header contribution to inject a reference to the library that I have somewhere in a java package. So what is the preferred way to include a javascript library to a wicket project? Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: what is the preferred way to include a javascript library to a wicket project?
I mean sometimes the library like prototype or whatever is necessary just to make some decorations in a markup. A good example is 100% height correction. So there is no reason to start a web server just to see a page markup with a working script. And what about duplicating entries of the same library? For instance datepicker which is using YUI has it included locally in its package. So any other component is going to include the same library again blowing out the project? On Fri, Apr 25, 2008 at 4:51 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: If you just need the javascript library, I also use header contribution. You can also take a look at wicket input events or datepicker etc... If you have your js files locally(in your project) you can use the packagedRessource so it gets gziped.. http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-stuff-contrib-input-events Vitaly Tsaplin wrote: Hi everyone, There are many usecases when it could be necessary to write some javascript by hands directly in the html file. So I need to reference the library I use in a head section of my html file. But having a reusable component written in java which is depending on the same javascript library I use a header contribution to inject a reference to the library that I have somewhere in a java package. So what is the preferred way to include a javascript library to a wicket project? Vitaly - 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: what is the preferred way to include a javascript library to a wicket project?
Isn't it often better to explicitly declare the list of javascript libraries the component uses and let the user add this libraries to the web content folder manually on his/her preferred location? On Fri, Apr 25, 2008 at 4:51 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: If you just need the javascript library, I also use header contribution. You can also take a look at wicket input events or datepicker etc... If you have your js files locally(in your project) you can use the packagedRessource so it gets gziped.. http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-stuff-contrib-input-events Vitaly Tsaplin wrote: Hi everyone, There are many usecases when it could be necessary to write some javascript by hands directly in the html file. So I need to reference the library I use in a head section of my html file. But having a reusable component written in java which is depending on the same javascript library I use a header contribution to inject a reference to the library that I have somewhere in a java package. So what is the preferred way to include a javascript library to a wicket project? Vitaly - 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: what is the preferred way to include a javascript library to a wicket project?
Yep. I meant the javascript sometimes can be considered as a css html extension if those're lacking :) I am not sure that wicket can scan for duplicates since I can refer to src/scriptaculous.js and you to scripts/scriptaculous/src/scriptaculous.js... On Fri, Apr 25, 2008 at 5:12 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Vitaly Tsaplin wrote: I mean sometimes the library like prototype or whatever is necessary just to make some decorations in a markup. A good example is 100% height correction. So there is no reason to start a web server just to see a page markup with a working script. What do you mean? Wicket needs to run in a servlet container Ahh you mean if youre designing the page? And what about duplicating entries of the same library? Yup that can be a problem if your using different versions of the library, im not sure if wicket scans for duplicates? For instance datepicker which is using YUI has it included locally in its package. So any other component is going to include the same library again blowing out the project? On Fri, Apr 25, 2008 at 4:51 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: If you just need the javascript library, I also use header contribution. You can also take a look at wicket input events or datepicker etc... If you have your js files locally(in your project) you can use the packagedRessource so it gets gziped.. http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-stuff-contrib-input-events Vitaly Tsaplin wrote: Hi everyone, There are many usecases when it could be necessary to write some javascript by hands directly in the html file. So I need to reference the library I use in a head section of my html file. But having a reusable component written in java which is depending on the same javascript library I use a header contribution to inject a reference to the library that I have somewhere in a java package. So what is the preferred way to include a javascript library to a wicket project? Vitaly - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to close a popup window after a form submition and update an arbitrary component on a parent page via ajax?
As I said its a true browser window. I open it using a regular link and supplying the popup settings. So where can I find windowclosedcallback? On Wed, Apr 23, 2008 at 9:04 AM, Maurice Marrink [EMAIL PROTECTED] wrote: use a windowclosedcallback to update the parent page. Maurice On Wed, Apr 23, 2008 at 1:06 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi everyone, A page containing a form is opened in a popup window (a true browser window) and being submitted if the form has been processed successfully it should close itself automatically and update a part of a parent page (the opener) using an ajax call. Have anyone faced a similar problem? Any ideas? Vitaly - 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]
How to close a popup window after a form submition and update an arbitrary component on a parent page via ajax?
Hi everyone, A page containing a form is opened in a popup window (a true browser window) and being submitted if the form has been processed successfully it should close itself automatically and update a part of a parent page (the opener) using an ajax call. Have anyone faced a similar problem? Any ideas? Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Why does the method getObject of IModel return Object but not Serializable?
Hi everyone, I am going to ask probably the most stupid question ever :) Why does the method getObject of IModel return Object but not Serializable? I suspect a model object is meant to be always stored in a session? Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket is the state into which all web frameworks will eventually evolve
...It's also worth to mention an extremely helpful community! On Tue, Apr 15, 2008 at 10:39 PM, Andrew Broderick [EMAIL PROTECTED] wrote: Hi, Just wanted to take time to say I LOVE WICKET! It is a completely different approach from the other MVC frameworks. For modularity, stability, ease of use, and separation of concerns, it blows them out of the water. We have been using Wicket 1.3 intensively for a month now. We are building a major public website (it has to stay under wraps until after its official launch on May 1st). Learning Wicket has not been without teething troubles - after all, no framework is perfect. But, the inherent ease of splitting things up into components, and the inherent encapsulation that comes with this, has shrunk our development time markedly. It also gives us a high level of confidence in what we've built, because once you get something working in isolation, it keeps working wherever you eventually put it. This is, I think, the single biggest benefit it gives us. We've thrown our site together quickly and under great time pressure, and Wicket has delivered. The inherent type safety you get from building the site from Java classes helps hugely. It means very few run-time bugs. The separation of markup means our web designer can work in the same codebase as our Java guys too, so no duplication of effort. In fact, what we have done wouldn't be possible in such a short time frame with any other framework. So, a huge thank you to the Wicket development team. Keep up the good work! ___ The information in this email or in any file attached hereto is intended only for the personal and confiden- tial use of the individual or entity to which it is addressed and may contain information that is propri- etary and confidential. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communica- tion is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product. Email trans- mission cannot be guaranteed to be secure or error- free. P6070214 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pass an arbitrary javascript variable to onSubmit?
I am doing it exactly like this. I am wondering if there is a formless way to do this? Probably I can mount a page and then just add some parameters to this URL? On Fri, Apr 11, 2008 at 9:06 AM, Maurice Marrink [EMAIL PROTECTED] wrote: You could add a HiddenField to the Form and then in your markup set it to your javascriptvariable. Maurice On Thu, Apr 10, 2008 at 5:39 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi everyone, How to pass an arbitrary javascript variable to onSubmit? Vitaly - 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: Good example for FormComponentPanel?
package org.apache.wicket.extensions.markup.html.tabs; public class TabbedPanel extends Panel --- it extends the panel { ... } Am I wrong? :) On Sat, Apr 12, 2008 at 2:11 AM, Michael Mehrle [EMAIL PROTECTED] wrote: Yes, I agree, Vitaly - but unfortunately the design decision is out of my hand. It's got to have tabs. Of course it is possible to do the tabbing by CSS styling, but I wanted to see if FormComponentPanel is a way to go since the complexity of managing the tabbed panel would then be shifted to the CSS/JS side. I just looked at the Multiply example and it seems to make sense. Again, if anyone wants to share any tips/input regarding this (or how to avoid traps), please don't be shy ;-) Michael -Original Message- From: Vitaly Tsaplin [mailto:[EMAIL PROTECTED] Sent: Friday, April 11, 2008 4:52 PM To: users@wicket.apache.org Subject: Re: Good example for FormComponentPanel? It seems that a simple panel would be the best approach. On Sat, Apr 12, 2008 at 1:37 AM, Michael Mehrle [EMAIL PROTECTED] wrote: I need to build a TabbedPanel with three tabs which are part of one form - the selected tab will contain form components which need to be submitted by that one form. It seems FormComponentPanel is the way to go: are there any good examples of this? Also, would this be the recommended approach? Thanks, Michael - 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]
How to pass an arbitrary javascript variable to onSubmit?
Hi everyone, How to pass an arbitrary javascript variable to onSubmit? Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: a transparent conversion of a CheckBoxMultipleChoice value
What is going to happen if I call getModel on such a component? The model should be properly unwrapped I suspect. It's a logical behavior. Is it possible to achieve? On Wed, Apr 9, 2008 at 3:03 PM, John Krasnay [EMAIL PROTECTED] wrote: On Tue, Apr 08, 2008 at 11:03:52PM +0200, Vitaly Tsaplin wrote: Yep. It looks simple and efficient. But it's quite a repetitive task. As I already mentioned I am going to create a component. And a data conversion should be its direct responsibility. The model wrapper cannot be provided from outside. It would be conceptually wrong in this case. I think this question is a bit wider then just a particular case with choices to bits conversion. I am getting running into this problem again and again. Wicket was created with a component driven design in mind and for, wasn't it? That's fine too. Create a panel, or subclass CheckBoxMultipleChoice, and have your panel|subclass apply the BitMapModel wrapper. Converters are primarily for use with TextFields. They can only convert to/from Strings. jk - 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: a transparent conversion of a CheckBoxMultipleChoice value
The method getModel will always return a wrapper and that fact breaks an encapsulation. So we can say that any wrapping can be done only from outside which is not good. A conversion is an essential part of an internal component's functionality and it's normally shoudn't be exposed. I am not so strict as you can think but since wicket people are struggling for every final keyword in the API I am trying to be conceptual as well :) On Wed, Apr 9, 2008 at 5:30 PM, John Krasnay [EMAIL PROTECTED] wrote: On Wed, Apr 09, 2008 at 05:09:03PM +0200, Vitaly Tsaplin wrote: What is going to happen if I call getModel on such a component? The model should be properly unwrapped I suspect. It's a logical behavior. Is it possible to achieve? If you extend CheckBoxMultipleChoice, getModel() must return a Collection. That's the contract that CheckBoxMultipleChoice offers, as you will see when Wicket becomes generified in 1.4. If you create a panel, then your model can be whatever you want, as long as you provide an appropriate model to the CheckBoxMultipleChoice when you create it. Wicket does no unwrapping of models; the fact that a model delegates a portion of its operation to another model is purely an implementation detail of that model. jk - 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]
a transparent conversion of a CheckBoxMultipleChoice value
Hi everyone, Lets say I am going to use a single integer value as a model object for the component CheckBoxMultipleChoice packing the selected choices somehow to this value as bits. Where can I do such a conversion? The method getConvertor is not called... the methods getConvertedInput and setConvertedInput are final... Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: a transparent conversion of a CheckBoxMultipleChoice value
Thanks John, It was the idea that came to my mind first. The question is where I can create such a wrapper? I need to have it compatible with CompountPropertyModel... That's the sticking point. Since I cannot store an array in my mysql database anyway I am going to implement a subclass of CheckBoxMultipleChoice and use it most of the time. Everything else like IChoiceRenderer and so on I have already implemented. The only problem is where to put the conversion code. Any ideas? On Tue, Apr 8, 2008 at 7:36 PM, John Krasnay [EMAIL PROTECTED] wrote: On Tue, Apr 08, 2008 at 06:41:20PM +0200, Vitaly Tsaplin wrote: Hi everyone, Lets say I am going to use a single integer value as a model object for the component CheckBoxMultipleChoice packing the selected choices somehow to this value as bits. Where can I do such a conversion? The method getConvertor is not called... the methods getConvertedInput and setConvertedInput are final... Vitaly ListMultipleChoice/CheckBoxMultipleChoice require a model that returns a Collection object, so your best bet is to create a model that wraps your integer-returning model and presents the bits as a list of integers. Here's some pseudocode that might help: public class BitMapModel implements IModel { private IModel targetModel; public BitMapModel(IModel targetModel) { this.targetModel = targetModel; } public Object getObject() { List list = new ArrayList(); int bits = (Integer) targetModel.getObject(); for each bit in bits: if bit==1: add bit value to list return list; } public void setObject(Object value) { List list = (List) value; int bits = 0; for each bit in list: bits |= bit; } targetModel.setObject(bits); } } For example, if targetModel.getObject() returned the 5 (i.e. bits 0101), this wrapper model would return the list [ 2, 0 ], and vice-versa for setObject. You'll also need a ChoiceRenderer to convert the bit values to reasonable strings. jk - 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: a transparent conversion of a CheckBoxMultipleChoice value
Yep. It looks simple and efficient. But it's quite a repetitive task. As I already mentioned I am going to create a component. And a data conversion should be its direct responsibility. The model wrapper cannot be provided from outside. It would be conceptually wrong in this case. I think this question is a bit wider then just a particular case with choices to bits conversion. I am getting running into this problem again and again. Wicket was created with a component driven design in mind and for, wasn't it? On Tue, Apr 8, 2008 at 10:29 PM, John Krasnay [EMAIL PROTECTED] wrote: On Tue, Apr 08, 2008 at 08:16:18PM +0200, Vitaly Tsaplin wrote: Thanks John, It was the idea that came to my mind first. The question is where I can create such a wrapper? I need to have it compatible with CompountPropertyModel... That's the sticking point. CompoundPropertyModel is just meant as a convenience. There's nothing wrong with using it for your other fields and giving an explicit model to your CheckBoxMultipleChoice... form = new Form(form new CompoundPropertyModel(domainModel)); add(form); form.add(new TextBox(textProperty)); // uses compound model form.add(new CheckBoxMultipleChoice(intProperty, new BitMapModel(new PropertyModel(domainModel, intProperty)), new BitMapModel(new Model(-1)), // all bits set new ChoiceRenderer() { ... })); jk - 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: Customerize captcha image
Create your own captcha :) The idea of the RenderedDynamicImageResource is brilliant. You just need to implement the render (Graphics2D gfx) method. Draw there whatever you want. It's even better. No one will be able to reuse the algorithm to teach a neuronet :) On Thu, Apr 3, 2008 at 2:32 PM, wenm [EMAIL PROTECTED] wrote: Does anybody have an idea how to change the background image and font size etc of wicket captcha image? -- View this message in context: http://www.nabble.com/Customerize-captcha-image-tp16467447p16467447.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: How to use an action level authorization?
Actually I am not going to use anything from wicket staff here. I have just one role - a user which is logged in :) And so I am just going to use the RENDER action defined by wicket to avoid an explicit call of setVisible () and to use authorization mechanism instead to hide components from guests (who is not logged in). I guess the isActionAuthorized () method of the IAuthorizationStrategy class is a rigth place to do the check. The only thing is missing for me is how to add an auth info to a particular component. This info can be extracted later by isActionAuthorized () to decide weither rendering allowed or not. On Sat, Mar 29, 2008 at 6:54 PM, Maurice Marrink [EMAIL PROTECTED] wrote: Using either wicket-auth-roles or swarm you typically only declare which action you want to check and don't do the actual check yourself unless you plan on doing something special. How you declare which action is required depends on the security framework you are using. In wicket-auth-roles you add an AuthorizeActions annotation. In swarm you declare permissions in a policy file, which are or are not granted to the user. Maurice On Fri, Mar 28, 2008 at 4:42 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi people, My question is simple... :) How to use an action level authorization. I cannot find any info or example. As I can guess I have to associate a role using setMetaData () with a component and then in IAuthorizationStrategy.isActionAuthorized () I do an actual check by taking the associated role from the given component by key and comparing it with a role of a current user. Is it correct guess? Vitaly - 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]
PagingNavigator: styling a link to a current page?
Hi, How do I change an appearance of a link pointing to a currently presented page? It seems I am supposed to implement my own navigator component from scratch? Any ideas? Vitalz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PagingNavigator: styling a link to a current page?
It simply doesn't work. That's why I am asking... em tag is created for surrounding disabled links and a for active ones. I do not see any way how to distinguish the current page... On Sun, Mar 30, 2008 at 12:59 AM, Matthew Young [EMAIL PROTECTED] wrote: The current page is like this: span id=pageLink21 wicket:id=pageLinkemspan wicket:id=pageNumber7/span/em/span So you can just style the em tag to whichever way you like. On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi, How do I change an appearance of a link pointing to a currently presented page? It seems I am supposed to implement my own navigator component from scratch? Any ideas? Vitalz - 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: PagingNavigator: styling a link to a current page?
It works but as I said it highlights not only the link to a current page, but also links to next and previous pages (increments) if you navigate to the leftmost or rightmost page since em is created for links to which a navigation is impossible or makes no sense. On Sun, Mar 30, 2008 at 1:38 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: div class=nav wicket:id=navigator style div.nav em { color:red; } /style -igor On Sat, Mar 29, 2008 at 5:04 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It simply doesn't work. That's why I am asking... em tag is created for surrounding disabled links and a for active ones. I do not see any way how to distinguish the current page... On Sun, Mar 30, 2008 at 12:59 AM, Matthew Young [EMAIL PROTECTED] wrote: The current page is like this: span id=pageLink21 wicket:id=pageLinkemspan wicket:id=pageNumber7/span/em/span So you can just style the em tag to whichever way you like. On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi, How do I change an appearance of a link pointing to a currently presented page? It seems I am supposed to implement my own navigator component from scratch? Any ideas? Vitalz - 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]
Re: PagingNavigator: styling a link to a current page?
Probably you can add a class attribute to incrementing links or change its tag... The reason is to be able to apply a styling to this links separately. On Sun, Mar 30, 2008 at 1:56 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It works but as I said it highlights not only the link to a current page, but also links to next and previous pages (increments) if you navigate to the leftmost or rightmost page since em is created for links to which a navigation is impossible or makes no sense. On Sun, Mar 30, 2008 at 1:38 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: div class=nav wicket:id=navigator style div.nav em { color:red; } /style -igor On Sat, Mar 29, 2008 at 5:04 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It simply doesn't work. That's why I am asking... em tag is created for surrounding disabled links and a for active ones. I do not see any way how to distinguish the current page... On Sun, Mar 30, 2008 at 12:59 AM, Matthew Young [EMAIL PROTECTED] wrote: The current page is like this: span id=pageLink21 wicket:id=pageLinkemspan wicket:id=pageNumber7/span/em/span So you can just style the em tag to whichever way you like. On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi, How do I change an appearance of a link pointing to a currently presented page? It seems I am supposed to implement my own navigator component from scratch? Any ideas? Vitalz - 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]
Re: PagingNavigator: styling a link to a current page?
Thanks for your help, Matthew, but it seems doesn't help me neither... I still cannot distinguish a regular page link and a incrementing link (which is made of angle brackets). On Sun, Mar 30, 2008 at 3:18 AM, Matthew Young [EMAIL PROTECTED] wrote: Ok, I see what your problem really is. Here is your solution: final IBehavior currentPageLinkClassifier = new AbstractBehavior() { private static final long serialVersionUID = 1L; @Override public void onComponentTag(Component c, ComponentTag tag) { if (((Link) c).isEnabled() == false) { CharSequence current = tag.getString(class); tag.put(class, current_page_link + (current == null ? : current)); } } }; navigator = new PagingNavigator(navigator, photoListView) { private static final long serialVersionUID = 1L; @Override protected PagingNavigation newNavigation(final IPageable pageable, final IPagingLabelProvider labelProvider) { return new AjaxPagingNavigation(navigation, pageable, labelProvider) { private static final long serialVersionUID = 1L; @Override protected Link newPagingNavigationLink(String id, IPageable pageable, int pageIndex) { Link link = super.newPagingNavigationLink(id, pageable, pageIndex); link.add(currentPageLinkClassifier); return link; } }; } }; .current_page_link { whatever } On Sat, Mar 29, 2008 at 5:56 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It works but as I said it highlights not only the link to a current page, but also links to next and previous pages (increments) if you navigate to the leftmost or rightmost page since em is created for links to which a navigation is impossible or makes no sense. On Sun, Mar 30, 2008 at 1:38 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: div class=nav wicket:id=navigator style div.nav em { color:red; } /style -igor On Sat, Mar 29, 2008 at 5:04 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It simply doesn't work. That's why I am asking... em tag is created for surrounding disabled links and a for active ones. I do not see any way how to distinguish the current page... On Sun, Mar 30, 2008 at 12:59 AM, Matthew Young [EMAIL PROTECTED] wrote: The current page is like this: span id=pageLink21 wicket:id=pageLinkemspan wicket:id=pageNumber7/span/em/span So you can just style the em tag to whichever way you like. On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi, How do I change an appearance of a link pointing to a currently presented page? It seems I am supposed to implement my own navigator component from scratch? Any ideas? Vitalz - 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]
Re: PagingNavigator: styling a link to a current page?
Ohh, sorry. I see :) It should work... On Sun, Mar 30, 2008 at 3:27 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Thanks for your help, Matthew, but it seems doesn't help me neither... I still cannot distinguish a regular page link and a incrementing link (which is made of angle brackets). On Sun, Mar 30, 2008 at 3:18 AM, Matthew Young [EMAIL PROTECTED] wrote: Ok, I see what your problem really is. Here is your solution: final IBehavior currentPageLinkClassifier = new AbstractBehavior() { private static final long serialVersionUID = 1L; @Override public void onComponentTag(Component c, ComponentTag tag) { if (((Link) c).isEnabled() == false) { CharSequence current = tag.getString(class); tag.put(class, current_page_link + (current == null ? : current)); } } }; navigator = new PagingNavigator(navigator, photoListView) { private static final long serialVersionUID = 1L; @Override protected PagingNavigation newNavigation(final IPageable pageable, final IPagingLabelProvider labelProvider) { return new AjaxPagingNavigation(navigation, pageable, labelProvider) { private static final long serialVersionUID = 1L; @Override protected Link newPagingNavigationLink(String id, IPageable pageable, int pageIndex) { Link link = super.newPagingNavigationLink(id, pageable, pageIndex); link.add(currentPageLinkClassifier); return link; } }; } }; .current_page_link { whatever } On Sat, Mar 29, 2008 at 5:56 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It works but as I said it highlights not only the link to a current page, but also links to next and previous pages (increments) if you navigate to the leftmost or rightmost page since em is created for links to which a navigation is impossible or makes no sense. On Sun, Mar 30, 2008 at 1:38 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: div class=nav wicket:id=navigator style div.nav em { color:red; } /style -igor On Sat, Mar 29, 2008 at 5:04 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It simply doesn't work. That's why I am asking... em tag is created for surrounding disabled links and a for active ones. I do not see any way how to distinguish the current page... On Sun, Mar 30, 2008 at 12:59 AM, Matthew Young [EMAIL PROTECTED] wrote: The current page is like this: span id=pageLink21 wicket:id=pageLinkemspan wicket:id=pageNumber7/span/em/span So you can just style the em tag to whichever way you like. On Sat, Mar 29, 2008 at 4:46 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi, How do I change an appearance of a link pointing to a currently presented page? It seems I am supposed to implement my own navigator component from scratch? Any ideas? Vitalz - 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]
Is there any way to query if the page is still valid during an ajax handling method invocation?
Hi everyone, It seems I have a problem with an ajax request interapted by a page reload. I suspect it happens because my page is reloaded before the request is finished. Is there any way to query if the page is still valid during an ajax handling method invocation? Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is there any way to query if the page is still valid during an ajax handling method invocation?
Sorry... It seems it is my fault. Something wrong in my code :) On Wed, Mar 26, 2008 at 10:09 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi everyone, It seems I have a problem with an ajax request interapted by a page reload. I suspect it happens because my page is reloaded before the request is finished. Is there any way to query if the page is still valid during an ajax handling method invocation? Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What is the best way to reset (or clear or set) a model value every time when page rendered?
Hi gays, What is the best way to reset (or clear or set) a model value every time when page rendered? I am trying to do it in onBeforeRender () but it seems to not work. Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What is the best way to reset (or clear or set) a model value every time when page rendered?
What is the proper location for the setModelObject () method to be called from? ...onBeforeRender ()? P.S. Sorry... a spell checker doen't help... true... :)) On Wed, Mar 26, 2008 at 8:40 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: On Wed, Mar 26, 2008 at 11:40 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi gays, i guess even a spellchecker wouldnt be of much help here... :) What is the best way to reset (or clear or set) a model value every time when page rendered? I am trying to do it in onBeforeRender () but it seems to not work. the best way is to store this value in a property and use a property model to poll it, that way all you need to do is to change the property value in onbeforerender other then that a simple setmodelobject(newvalue) should work also. -igor Vitaly - 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]
RenderedDynamicImageResource: how to add a random attribute to an URL?
Hi guys, How to add a random attribute to an URL created by a RenderedDynamicImageResource subclass to enforce a browser update on every request? I think I saw it somewhere but I cannot remember where exactly... Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RenderedDynamicImageResource: how to add a random attribute to an URL?
As I found out the problem is actually different. The way I create an image is the following add (new Image (captcha, new CaptchaImageResource (100, 40, new PropertyModel (this, captchaValue; But it seems that an image does request an attached image resource only first time it's created. I need it be rendered again and again every time my page is rendered. How to achieve this goal? On Mon, Mar 24, 2008 at 9:40 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: see NonCachingImage -igor On Mon, Mar 24, 2008 at 11:29 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, How to add a random attribute to an URL created by a RenderedDynamicImageResource subclass to enforce a browser update on every request? I think I saw it somewhere but I cannot remember where exactly... Vitaly - 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]
AjaxSelfUpdatingTimerBehavior: how to conditionally skip a component update?
Hi everyone, Does anyone know how to conditionally skip a component update in case of using the AjaxSelfUpdatingTimerBehavior? For example if the data is not updated and so there is no need to update the component. Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
the wicket markup reference
Hi everyone, Is there any wicket markup reference? Is it documented? Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: the wicket markup reference
Wow! Exactly. Thanks Erik. On Thu, Mar 20, 2008 at 2:56 PM, Erik van Oosten [EMAIL PROTECTED] wrote: Do you mean http://cwiki.apache.org/WICKET/wickets-xhtml-tags.html? Regards, Erik. Vitaly Tsaplin schreef: Hi everyone, Is there any wicket markup reference? Is it documented? Vitaly -- Erik van Oosten http://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]
the checkRequired () magic is back (bug or a normal behavior?)
Hi guys, According to the wicket javadoc the method checkRequired () of the FormComponent class ...should typically only be called when isRequired() returns true. But it seems to be different... public final void validate() { validateRequired(); here if (isValid()) { convertInput(); if (isValid() isRequired() getConvertedInput() == null isInputNullable()) { reportRequiredError(); } if (isValid()) { validateValidators(); } } } protected final void validateRequired() { if (!checkRequired()) - and here { reportRequiredError(); } } As you can see the checkRequired () is called unconditionally. Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: the checkRequired () magic is back (bug or a normal behavior?)
checkRequired () itself shouldn't be called at all unless setRequired is true... On Wed, Mar 19, 2008 at 9:43 PM, Johan Compagner [EMAIL PROTECTED] wrote: and did you look at checkRequired? public boolean checkRequired() { if (isRequired()) { On Wed, Mar 19, 2008 at 2:24 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, According to the wicket javadoc the method checkRequired () of the FormComponent class ...should typically only be called when isRequired() returns true. But it seems to be different... public final void validate() { validateRequired(); here if (isValid()) { convertInput(); if (isValid() isRequired() getConvertedInput() == null isInputNullable()) { reportRequiredError(); } if (isValid()) { validateValidators(); } } } protected final void validateRequired() { if (!checkRequired()) - and here { reportRequiredError(); } } As you can see the checkRequired () is called unconditionally. Vitaly - 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: the checkRequired () magic is back (bug or a normal behavior?)
But the javadoc says: public boolean checkRequired() Checks if the form component's 'required' requirement is met. This method should typically only be called when FormComponent.isRequired() returns true. And I agree with javadoc :) checkRequired () should be called only to know if the form component's 'required' requirement is met. In case isRequired() returns false this call does not make any sense... Basically if isRequired () returns true you know that a component is required but what you don't know is whether the requirement condition is met or not and so to check it out you call checkRequired (). checkRequired () shouldn't call isRequired () itself. On Wed, Mar 19, 2008 at 10:39 PM, Johan Compagner [EMAIL PROTECTED] wrote: it checks if the required needs to be checked and if that is the case it checks if the input is set On Wed, Mar 19, 2008 at 10:32 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: checkRequired () itself shouldn't be called at all unless setRequired is true... On Wed, Mar 19, 2008 at 9:43 PM, Johan Compagner [EMAIL PROTECTED] wrote: and did you look at checkRequired? public boolean checkRequired() { if (isRequired()) { On Wed, Mar 19, 2008 at 2:24 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, According to the wicket javadoc the method checkRequired () of the FormComponent class ...should typically only be called when isRequired() returns true. But it seems to be different... public final void validate() { validateRequired(); here if (isValid()) { convertInput(); if (isValid() isRequired() getConvertedInput() == null isInputNullable()) { reportRequiredError(); } if (isValid()) { validateValidators(); } } } protected final void validateRequired() { if (!checkRequired()) - and here { reportRequiredError(); } } As you can see the checkRequired () is called unconditionally. Vitaly - 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: the checkRequired () magic is back (bug or a normal behavior?)
but then you are pushing this check to users who change what checkrequired() means, they will probably forget to do isrequired() check first... ^^ | -Sure, sure, sure! :) That what is really annoying. On Wed, Mar 19, 2008 at 10:57 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: but then you are pushing this check to users who change what checkrequired() means, they will probably forget to do isrequired() check first... -igor On Wed, Mar 19, 2008 at 2:56 PM, Johan Compagner [EMAIL PROTECTED] wrote: i disagree i will not check everywhere for isRequired() that can be done in 1 method On Wed, Mar 19, 2008 at 10:54 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i agree with vitaly, johan? -igor On Wed, Mar 19, 2008 at 2:51 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But the javadoc says: public boolean checkRequired() Checks if the form component's 'required' requirement is met. This method should typically only be called when FormComponent.isRequired() returns true. And I agree with javadoc :) checkRequired () should be called only to know if the form component's 'required' requirement is met. In case isRequired() returns false this call does not make any sense... Basically if isRequired () returns true you know that a component is required but what you don't know is whether the requirement condition is met or not and so to check it out you call checkRequired (). checkRequired () shouldn't call isRequired () itself. On Wed, Mar 19, 2008 at 10:39 PM, Johan Compagner [EMAIL PROTECTED] wrote: it checks if the required needs to be checked and if that is the case it checks if the input is set On Wed, Mar 19, 2008 at 10:32 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: checkRequired () itself shouldn't be called at all unless setRequired is true... On Wed, Mar 19, 2008 at 9:43 PM, Johan Compagner [EMAIL PROTECTED] wrote: and did you look at checkRequired? public boolean checkRequired() { if (isRequired()) { On Wed, Mar 19, 2008 at 2:24 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, According to the wicket javadoc the method checkRequired () of the FormComponent class ...should typically only be called when isRequired() returns true. But it seems to be different... public final void validate() { validateRequired(); here if (isValid()) { convertInput(); if (isValid() isRequired() getConvertedInput() == null isInputNullable()) { reportRequiredError(); } if (isValid()) { validateValidators(); } } } protected final void validateRequired() { if (!checkRequired()) - and here { reportRequiredError(); } } As you can see the checkRequired () is called unconditionally. Vitaly - 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
Re: the checkRequired () magic is back (bug or a normal behavior?)
The code should follow the design and not conversely... On Wed, Mar 19, 2008 at 11:10 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: thats kinda cludge imho. checkrequired() defines the process of checking, whether that needs to be invoked or not is up to the formcomponent and its required attribute. we can make validaterequired() public, although i dont see where you would call only that instead of the entire validate() pipeline. also right now checkrequired() is only ever called from validaterequired() and i think checkrequired() should not be public anyways -igor On Wed, Mar 19, 2008 at 3:06 PM, Johan Compagner [EMAIL PROTECTED] wrote: if you also want to check it in validateRequired() thats fine by me by the way But i dont want it to be removed in checkRequired() And the javadoc must be updated anyway johan On Wed, Mar 19, 2008 at 11:05 PM, Johan Compagner [EMAIL PROTECTED] wrote: nope i am against that validateRequired is protected checkRequired is public And if i want to test for requirement from outside i dont want to call first for every thing isRequired first i find it very odd that a method can return very funny stuff when you dont call one method before it first it should be self contained And this way it works for quite some time now, so i dont really change anything. it is just stupid to have a method which behavior is not really defined based on that you can call it or not. it doesn't make any sense to me to not call isRequired() in checkRequired() johan On Wed, Mar 19, 2008 at 10:57 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: why dont we build that check into validateRequired() so validateRequired() { if (isrequired() { ...current code } } that way you never have to call checkrequired() directly, just call validaterequired() -igor On Wed, Mar 19, 2008 at 2:54 PM, Johan Compagner [EMAIL PROTECTED] wrote: i dont agree then you have to do everywhere if (isRequired()) checkRequired() thats horrible, checkRequired() can test that just as fine i will update the javadoc johan On Wed, Mar 19, 2008 at 10:51 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But the javadoc says: public boolean checkRequired() Checks if the form component's 'required' requirement is met. This method should typically only be called when FormComponent.isRequired() returns true. And I agree with javadoc :) checkRequired () should be called only to know if the form component's 'required' requirement is met. In case isRequired() returns false this call does not make any sense... Basically if isRequired () returns true you know that a component is required but what you don't know is whether the requirement condition is met or not and so to check it out you call checkRequired (). checkRequired () shouldn't call isRequired () itself. On Wed, Mar 19, 2008 at 10:39 PM, Johan Compagner [EMAIL PROTECTED] wrote: it checks if the required needs to be checked and if that is the case it checks if the input is set On Wed, Mar 19, 2008 at 10:32 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: checkRequired () itself shouldn't be called at all unless setRequired is true... On Wed, Mar 19, 2008 at 9:43 PM, Johan Compagner [EMAIL PROTECTED] wrote: and did you look at checkRequired? public boolean checkRequired() { if (isRequired()) { On Wed, Mar 19, 2008 at 2:24 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, According to the wicket javadoc the method checkRequired () of the FormComponent class ...should typically only be called when isRequired() returns true. But it seems to be different... public final void validate() { validateRequired(); here if (isValid()) { convertInput(); if (isValid() isRequired
Re: the checkRequired () magic is back (bug or a normal behavior?)
Any component is overridable, nothing prevents my from overriding the FormComponent in case if my component does not require any complex markup. On Wed, Mar 19, 2008 at 11:22 PM, Johan Compagner [EMAIL PROTECTED] wrote: ì guess checkRequired( ) is only overridable because of FormComponentPanel so that again that can be overriden to have there own requirement check? so yes it should really be at least protected On Wed, Mar 19, 2008 at 11:10 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: thats kinda cludge imho. checkrequired() defines the process of checking, whether that needs to be invoked or not is up to the formcomponent and its required attribute. we can make validaterequired() public, although i dont see where you would call only that instead of the entire validate() pipeline. also right now checkrequired() is only ever called from validaterequired() and i think checkrequired() should not be public anyways -igor On Wed, Mar 19, 2008 at 3:06 PM, Johan Compagner [EMAIL PROTECTED] wrote: if you also want to check it in validateRequired() thats fine by me by the way But i dont want it to be removed in checkRequired() And the javadoc must be updated anyway johan On Wed, Mar 19, 2008 at 11:05 PM, Johan Compagner [EMAIL PROTECTED] wrote: nope i am against that validateRequired is protected checkRequired is public And if i want to test for requirement from outside i dont want to call first for every thing isRequired first i find it very odd that a method can return very funny stuff when you dont call one method before it first it should be self contained And this way it works for quite some time now, so i dont really change anything. it is just stupid to have a method which behavior is not really defined based on that you can call it or not. it doesn't make any sense to me to not call isRequired() in checkRequired() johan On Wed, Mar 19, 2008 at 10:57 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: why dont we build that check into validateRequired() so validateRequired() { if (isrequired() { ...current code } } that way you never have to call checkrequired() directly, just call validaterequired() -igor On Wed, Mar 19, 2008 at 2:54 PM, Johan Compagner [EMAIL PROTECTED] wrote: i dont agree then you have to do everywhere if (isRequired()) checkRequired() thats horrible, checkRequired() can test that just as fine i will update the javadoc johan On Wed, Mar 19, 2008 at 10:51 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But the javadoc says: public boolean checkRequired() Checks if the form component's 'required' requirement is met. This method should typically only be called when FormComponent.isRequired() returns true. And I agree with javadoc :) checkRequired () should be called only to know if the form component's 'required' requirement is met. In case isRequired() returns false this call does not make any sense... Basically if isRequired () returns true you know that a component is required but what you don't know is whether the requirement condition is met or not and so to check it out you call checkRequired (). checkRequired () shouldn't call isRequired () itself. On Wed, Mar 19, 2008 at 10:39 PM, Johan Compagner [EMAIL PROTECTED] wrote: it checks if the required needs to be checked and if that is the case it checks if the input is set On Wed, Mar 19, 2008 at 10:32 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: checkRequired () itself shouldn't be called at all unless setRequired is true... On Wed, Mar 19, 2008 at 9:43 PM, Johan Compagner [EMAIL PROTECTED] wrote: and did you look at checkRequired? public boolean checkRequired() { if (isRequired()) { On Wed, Mar 19, 2008 at 2:24 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, According to the wicket javadoc the method checkRequired () of the FormComponent
Re: the checkRequired () magic is back (bug or a normal behavior?)
validaterequired() public, although i dont see where you would call only that instead of the entire validate() pipeline. also right now checkrequired() is only ever called from validaterequired() and i think checkrequired() should not be public anyways -igor On Wed, Mar 19, 2008 at 3:06 PM, Johan Compagner [EMAIL PROTECTED] wrote: if you also want to check it in validateRequired() thats fine by me by the way But i dont want it to be removed in checkRequired() And the javadoc must be updated anyway johan On Wed, Mar 19, 2008 at 11:05 PM, Johan Compagner [EMAIL PROTECTED] wrote: nope i am against that validateRequired is protected checkRequired is public And if i want to test for requirement from outside i dont want to call first for every thing isRequired first i find it very odd that a method can return very funny stuff when you dont call one method before it first it should be self contained And this way it works for quite some time now, so i dont really change anything. it is just stupid to have a method which behavior is not really defined based on that you can call it or not. it doesn't make any sense to me to not call isRequired() in checkRequired() johan On Wed, Mar 19, 2008 at 10:57 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: why dont we build that check into validateRequired() so validateRequired() { if (isrequired() { ...current code } } that way you never have to call checkrequired() directly, just call validaterequired() -igor On Wed, Mar 19, 2008 at 2:54 PM, Johan Compagner [EMAIL PROTECTED] wrote: i dont agree then you have to do everywhere if (isRequired()) checkRequired() thats horrible, checkRequired() can test that just as fine i will update the javadoc johan On Wed, Mar 19, 2008 at 10:51 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But the javadoc says: public boolean checkRequired() Checks if the form component's 'required' requirement is met. This method should typically only be called when FormComponent.isRequired() returns true. And I agree with javadoc :) checkRequired () should be called only to know if the form component's 'required' requirement is met. In case isRequired() returns false this call does not make any sense... Basically if isRequired () returns true you know that a component is required but what you don't know is whether the requirement condition is met or not and so to check it out you call checkRequired (). checkRequired () shouldn't call isRequired () itself. On Wed, Mar 19, 2008 at 10:39 PM, Johan Compagner [EMAIL PROTECTED] wrote: it checks if the required needs to be checked and if that is the case it checks if the input is set On Wed, Mar 19, 2008 at 10:32 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: checkRequired () itself shouldn't be called at all unless setRequired is true... On Wed, Mar 19, 2008 at 9:43 PM, Johan Compagner [EMAIL PROTECTED] wrote: and did you look at checkRequired? public boolean checkRequired
Re: the checkRequired () magic is back (bug or a normal behavior?)
Whatever... the only thing you should do asap is to modify the javadoc... according to the current state. For now it's confusing... On Thu, Mar 20, 2008 at 1:18 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: What if a requirement cannot be met if an input contains only spaces. I would override the checkRequired to do so. And it could be done for a text field. Why not? Anyway if I can override checkRequired I may not be calling isRequired and it's perfectly legal. Because the method is under my control. But...setRequired is still there and anyone can call it excpecting it's normal behavior. Setting required property to false (setRequired) should prevent any requirement check whatever it would be. On Thu, Mar 20, 2008 at 12:57 AM, Johan Compagner [EMAIL PROTECTED] wrote: hmm the more i think about it the more i stand with my initial reply. checkRequired was always meant to be standalone it always checked from day 1 if required must be checked (thats why it is called *check*Required) and then it actually did the test. it was first protected final and then a long time public final validateRequired does something else it calls checkRequired and with that return value it sets an adds an error message But that is not always what you want (the reason why checkRequired is public) so validateRequired is not a substitute and i guess checkRequired has to be public because we made it public for a reason. (see the thread) The only thing i come up with now is, but that will break all formcomponentpanels that did have implemented checkRequired(), that we make it final again (keep it public) and create a protected overridable method that can be used in FCP something like protected boolean doRequiredInputCheck() { } or what ever better name we can come up with. that way we suddenly dont have a completely different definition of a method johan On Thu, Mar 20, 2008 at 12:03 AM, Johan Compagner [EMAIL PROTECTED] wrote: no some protected methods can be called just fine from the outside world like validateRequired() (that could be public yes) But checkRequired() doesn't make much to call from the outside world because we have validateRequired() except that validateRequired() does set an error then and doesn't return the actual boolean So i guess that that is the reason why checkRequired() is public. it was first public final that as removed for FormComponentPanel and when it was public final it made perfect sense to also check for required there.. So the definition is really changed when we removed final before that it was really what i thought initially because it is a public callable method (back then the javadoc also didnt specify that it was typically required that isRequired must be callled) so suddenly final is gone and the definition changed... Nobody would call isRequired() before it would call checkRequired() and it was it first few months (2006) it was protected final, then you made it public final because of this thread [Wicket-user] Components Label for FeedbackMessage So if anybody programmed against that method back then because of that thread. Those are not calling isRequired() first before calling checkRequired() Even if i type this i still find it odd that i have to do that first, looking at the names, if i read formcomponent.checkRequired() then i will always asume that it will not return the wrong value if isRequired == false.. maybe it is my bad englisch but that will not change for me) johan On Wed, Mar 19, 2008 at 11:40 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: do we need to add that to all our protected methods? if someone needs it, and they probably do since we made it public, we should prob make validateRequired() public - it is final iirc -igor On Wed, Mar 19, 2008 at 3:36 PM, Johan Compagner [EMAIL PROTECTED] wrote: yes and add a big javadoc warning that this method is not meant to be called only meant to be overriden.. johan On Wed, Mar 19, 2008 at 11:35 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: ok, so given that we make checkrequired protected (pushes it into 1.5 timeframe) are you ok with moving isrequired() check out into validaterequired() ? -igor On Wed, Mar 19, 2008 at 3:22 PM, Johan Compagner [EMAIL PROTECTED] wrote: ì guess checkRequired( ) is only overridable because of FormComponentPanel so that again that can be overriden to have
Re: the checkRequired () magic is back (bug or a normal behavior?)
For me that's probably fine if you will clearly right in javadoc that anyone who overrides checkRequired should carefully call isRequired in order to conform the common behavior. On Thu, Mar 20, 2008 at 1:33 AM, Johan Compagner [EMAIL PROTECTED] wrote: Thats all fine, but it was not build/designed that way period... The biggest api break was at the moment we removed final, which was there for quite sometime, and then sneaky add javadoc that it is required to call isRequired first before calling this method! but before that for this public callable method this was not needed, so everybody who uses that method suddenly breaks because of a sneaky javadoc update and the removal of the final keyword. What the javadoc should have stated is that overrides should ALWAYS first check the isRequired() itself just like the method that they override already did for 2 years! The removal of the final keyword had in this particular case big consequentes it really changed the api behavior. Johan On 3/20/08, Vitaly Tsaplin [EMAIL PROTECTED] wrote: What if a requirement cannot be met if an input contains only spaces. I would override the checkRequired to do so. And it could be done for a text field. Why not? Anyway if I can override checkRequired I may not be calling isRequired and it's perfectly legal. Because the method is under my control. But...setRequired is still there and anyone can call it excpecting it's normal behavior. Setting required property to false (setRequired) should prevent any requirement check whatever it would be. On Thu, Mar 20, 2008 at 12:57 AM, Johan Compagner [EMAIL PROTECTED] wrote: hmm the more i think about it the more i stand with my initial reply. checkRequired was always meant to be standalone it always checked from day 1 if required must be checked (thats why it is called *check*Required) and then it actually did the test. it was first protected final and then a long time public final validateRequired does something else it calls checkRequired and with that return value it sets an adds an error message But that is not always what you want (the reason why checkRequired is public) so validateRequired is not a substitute and i guess checkRequired has to be public because we made it public for a reason. (see the thread) The only thing i come up with now is, but that will break all formcomponentpanels that did have implemented checkRequired(), that we make it final again (keep it public) and create a protected overridable method that can be used in FCP something like protected boolean doRequiredInputCheck() { } or what ever better name we can come up with. that way we suddenly dont have a completely different definition of a method johan On Thu, Mar 20, 2008 at 12:03 AM, Johan Compagner [EMAIL PROTECTED] wrote: no some protected methods can be called just fine from the outside world like validateRequired() (that could be public yes) But checkRequired() doesn't make much to call from the outside world because we have validateRequired() except that validateRequired() does set an error then and doesn't return the actual boolean So i guess that that is the reason why checkRequired() is public. it was first public final that as removed for FormComponentPanel and when it was public final it made perfect sense to also check for required there.. So the definition is really changed when we removed final before that it was really what i thought initially because it is a public callable method (back then the javadoc also didnt specify that it was typically required that isRequired must be callled) so suddenly final is gone and the definition changed... Nobody would call isRequired() before it would call checkRequired() and it was it first few months (2006) it was protected final, then you made it public final because of this thread [Wicket-user] Components Label for FeedbackMessage So if anybody programmed against that method back then because of that thread. Those are not calling isRequired() first before calling checkRequired() Even if i type this i still find it odd that i have to do that first, looking at the names, if i read formcomponent.checkRequired() then i will always asume that it will not return the wrong value if isRequired == false.. maybe it is my bad englisch but that will not change for me) johan On Wed, Mar 19, 2008 at 11:40 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: do we need to add that to all our protected methods? if someone needs
Re: the checkRequired () magic is back (bug or a normal behavior?)
Oh, sorry. I meant write in javadoc :) On Thu, Mar 20, 2008 at 2:02 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: For me that's probably fine if you will clearly right in javadoc that anyone who overrides checkRequired should carefully call isRequired in order to conform the common behavior. On Thu, Mar 20, 2008 at 1:33 AM, Johan Compagner [EMAIL PROTECTED] wrote: Thats all fine, but it was not build/designed that way period... The biggest api break was at the moment we removed final, which was there for quite sometime, and then sneaky add javadoc that it is required to call isRequired first before calling this method! but before that for this public callable method this was not needed, so everybody who uses that method suddenly breaks because of a sneaky javadoc update and the removal of the final keyword. What the javadoc should have stated is that overrides should ALWAYS first check the isRequired() itself just like the method that they override already did for 2 years! The removal of the final keyword had in this particular case big consequentes it really changed the api behavior. Johan On 3/20/08, Vitaly Tsaplin [EMAIL PROTECTED] wrote: What if a requirement cannot be met if an input contains only spaces. I would override the checkRequired to do so. And it could be done for a text field. Why not? Anyway if I can override checkRequired I may not be calling isRequired and it's perfectly legal. Because the method is under my control. But...setRequired is still there and anyone can call it excpecting it's normal behavior. Setting required property to false (setRequired) should prevent any requirement check whatever it would be. On Thu, Mar 20, 2008 at 12:57 AM, Johan Compagner [EMAIL PROTECTED] wrote: hmm the more i think about it the more i stand with my initial reply. checkRequired was always meant to be standalone it always checked from day 1 if required must be checked (thats why it is called *check*Required) and then it actually did the test. it was first protected final and then a long time public final validateRequired does something else it calls checkRequired and with that return value it sets an adds an error message But that is not always what you want (the reason why checkRequired is public) so validateRequired is not a substitute and i guess checkRequired has to be public because we made it public for a reason. (see the thread) The only thing i come up with now is, but that will break all formcomponentpanels that did have implemented checkRequired(), that we make it final again (keep it public) and create a protected overridable method that can be used in FCP something like protected boolean doRequiredInputCheck() { } or what ever better name we can come up with. that way we suddenly dont have a completely different definition of a method johan On Thu, Mar 20, 2008 at 12:03 AM, Johan Compagner [EMAIL PROTECTED] wrote: no some protected methods can be called just fine from the outside world like validateRequired() (that could be public yes) But checkRequired() doesn't make much to call from the outside world because we have validateRequired() except that validateRequired() does set an error then and doesn't return the actual boolean So i guess that that is the reason why checkRequired() is public. it was first public final that as removed for FormComponentPanel and when it was public final it made perfect sense to also check for required there.. So the definition is really changed when we removed final before that it was really what i thought initially because it is a public callable method (back then the javadoc also didnt specify that it was typically required that isRequired must be callled) so suddenly final is gone and the definition changed... Nobody would call isRequired() before it would call checkRequired() and it was it first few months (2006) it was protected final, then you made it public final because of this thread [Wicket-user] Components Label for FeedbackMessage So if anybody programmed against that method back then because of that thread. Those are not calling isRequired() first before calling checkRequired() Even if i type this i still find it odd that i have to do that first, looking at the names, if i read formcomponent.checkRequired
Is wicket an efficient, enterprise level web framework?
Hi everyone, Does anyone try to do any scalability tests with wicket? How is it suitable for real world enterprise level applications? And the most important question: What are the design principals I should follow in order to turn my homemade application into a real, highly responsive and memory inexpensive app? Where can I read about it? Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is wicket an efficient, enterprise level web framework?
Hi Johan, Many thanks for your answer. A real world enterprise level app is usually about complex user interface and many many concurrent users at one time. When I told about real world applications I meant mostly a comparison with some other popular frameworks like JSF. It wasn't obvious, sorry :) I mean having a framework which is at least not less efficient then JSF automatically implies that we can do all that stuff which is done with JSF. So in its turn it means that wicket is perfectly suitable for enterprise level apps as well as JSF. I do not mean that JSF is a good choice but it's proven in practice. Vitaly On Mon, Mar 17, 2008 at 10:33 AM, Johan Compagner [EMAIL PROTECTED] wrote: we have our own threadtest (see svn) to test scaling What is a real world enterprise level app? Is that about the complexitiy of the user inteface and the application itself? or is it that it is used by many many concurrent users at one time but the app is pretty simple? About design principals, use detachable models everwhere to keep the state als low as possible, To be Highly responsive doesn't mean that you have to have a memory inexpensive app. Wicket apps do use session memory for pages, For 1.3 only 1 page per pagemap, so most of the time 1 page per session/user And what a page cost in mem is very dependend on the complexity. johan On Mon, Mar 17, 2008 at 10:01 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi everyone, Does anyone try to do any scalability tests with wicket? How is it suitable for real world enterprise level applications? And the most important question: What are the design principals I should follow in order to turn my homemade application into a real, highly responsive and memory inexpensive app? Where can I read about it? Vitaly - 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: Is wicket an efficient, enterprise level web framework?
I am just looking at the number of job offers for JSF :) It's a lot! That demand means that there are a lot of development in JSF. On Mon, Mar 17, 2008 at 11:38 AM, Johan Compagner [EMAIL PROTECTED] wrote: where is the complex JSF app that has many many concurrent users? Most of the time the more complex the app gets the less concurrent users it will have. Because those kind of complex apps are mostly targetted at a specific group of people. Where are for example Enterprise level apps just open on the internet? On Mon, Mar 17, 2008 at 11:20 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi Johan, Many thanks for your answer. A real world enterprise level app is usually about complex user interface and many many concurrent users at one time. When I told about real world applications I meant mostly a comparison with some other popular frameworks like JSF. It wasn't obvious, sorry :) I mean having a framework which is at least not less efficient then JSF automatically implies that we can do all that stuff which is done with JSF. So in its turn it means that wicket is perfectly suitable for enterprise level apps as well as JSF. I do not mean that JSF is a good choice but it's proven in practice. Vitaly On Mon, Mar 17, 2008 at 10:33 AM, Johan Compagner [EMAIL PROTECTED] wrote: we have our own threadtest (see svn) to test scaling What is a real world enterprise level app? Is that about the complexitiy of the user inteface and the application itself? or is it that it is used by many many concurrent users at one time but the app is pretty simple? About design principals, use detachable models everwhere to keep the state als low as possible, To be Highly responsive doesn't mean that you have to have a memory inexpensive app. Wicket apps do use session memory for pages, For 1.3 only 1 page per pagemap, so most of the time 1 page per session/user And what a page cost in mem is very dependend on the complexity. johan On Mon, Mar 17, 2008 at 10:01 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi everyone, Does anyone try to do any scalability tests with wicket? How is it suitable for real world enterprise level applications? And the most important question: What are the design principals I should follow in order to turn my homemade application into a real, highly responsive and memory inexpensive app? Where can I read about it? Vitaly - 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]
cannot override chechRequired ()
Hi guys, It seams that there is a bug in the FormComponent code. I try to override chechRequired method but it seams to not work at all. Here is a snippet from the sources. As you can see there is a second requirement check. /** * Checks if the raw input value is not null if this component is required. */ protected final void validateRequired() { if (!checkRequired()) the first check { reportRequiredError(); } } /** * Performs full validation of the form component, which consists of calling validateRequired(), * convertInput(), and validateValidators(). This method should only be used if the form * component needs to be fully validated outside the form process. */ public final void validate() { validateRequired(); if (isValid()) { convertInput(); if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } if (isValid()) { validateValidators(); } } } Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cannot override chechRequired ()
But if checkRequired () returns true isRequired () called again generating a validation error... if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 7:47 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: sure it does, see the first line of validate() -igor On Mon, Mar 17, 2008 at 11:06 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, It seams that there is a bug in the FormComponent code. I try to override chechRequired method but it seams to not work at all. Here is a snippet from the sources. As you can see there is a second requirement check. /** * Checks if the raw input value is not null if this component is required. */ protected final void validateRequired() { if (!checkRequired()) the first check { reportRequiredError(); } } /** * Performs full validation of the form component, which consists of calling validateRequired(), * convertInput(), and validateValidators(). This method should only be used if the form * component needs to be fully validated outside the form process. */ public final void validate() { validateRequired(); if (isValid()) { convertInput(); if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } if (isValid()) { validateValidators(); } } } Vitaly - 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: cannot override chechRequired ()
It should be probably like this if (isValid() (isRequired() ? !checkRequired () : true) getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 8:02 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But if checkRequired () returns true isRequired () called again generating a validation error... if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 7:47 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: sure it does, see the first line of validate() -igor On Mon, Mar 17, 2008 at 11:06 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, It seams that there is a bug in the FormComponent code. I try to override chechRequired method but it seams to not work at all. Here is a snippet from the sources. As you can see there is a second requirement check. /** * Checks if the raw input value is not null if this component is required. */ protected final void validateRequired() { if (!checkRequired()) the first check { reportRequiredError(); } } /** * Performs full validation of the form component, which consists of calling validateRequired(), * convertInput(), and validateValidators(). This method should only be used if the form * component needs to be fully validated outside the form process. */ public final void validate() { validateRequired(); if (isValid()) { convertInput(); if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } if (isValid()) { validateValidators(); } } } Vitaly - 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: cannot override chechRequired ()
I am not sure but I suspect that if the method checkRequired returns true a requirement condition must always met in any case or the behavior is different? On Mon, Mar 17, 2008 at 8:57 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: why should we call checkrequired() twice? -igor On Mon, Mar 17, 2008 at 12:06 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It should be probably like this if (isValid() (isRequired() ? !checkRequired () : true) getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 8:02 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But if checkRequired () returns true isRequired () called again generating a validation error... if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 7:47 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: sure it does, see the first line of validate() -igor On Mon, Mar 17, 2008 at 11:06 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, It seams that there is a bug in the FormComponent code. I try to override chechRequired method but it seams to not work at all. Here is a snippet from the sources. As you can see there is a second requirement check. /** * Checks if the raw input value is not null if this component is required. */ protected final void validateRequired() { if (!checkRequired()) the first check { reportRequiredError(); } } /** * Performs full validation of the form component, which consists of calling validateRequired(), * convertInput(), and validateValidators(). This method should only be used if the form * component needs to be fully validated outside the form process. */ public final void validate() { validateRequired(); if (isValid()) { convertInput(); if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } if (isValid()) { validateValidators(); } } } Vitaly - 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]
Re: cannot override chechRequired ()
I run into this problem implementing my own component as a subclass of the FormComponentPanel class. In my case the method checkRequired just always returns TRUE but if I set required property to TRUE the component always generate a validation error (field bla-bla-bla is required). On Mon, Mar 17, 2008 at 9:09 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I am not sure but I suspect that if the method checkRequired returns true a requirement condition must always met in any case or the behavior is different? On Mon, Mar 17, 2008 at 8:57 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: why should we call checkrequired() twice? -igor On Mon, Mar 17, 2008 at 12:06 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It should be probably like this if (isValid() (isRequired() ? !checkRequired () : true) getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 8:02 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But if checkRequired () returns true isRequired () called again generating a validation error... if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 7:47 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: sure it does, see the first line of validate() -igor On Mon, Mar 17, 2008 at 11:06 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, It seams that there is a bug in the FormComponent code. I try to override chechRequired method but it seams to not work at all. Here is a snippet from the sources. As you can see there is a second requirement check. /** * Checks if the raw input value is not null if this component is required. */ protected final void validateRequired() { if (!checkRequired()) the first check { reportRequiredError(); } } /** * Performs full validation of the form component, which consists of calling validateRequired(), * convertInput(), and validateValidators(). This method should only be used if the form * component needs to be fully validated outside the form process. */ public final void validate() { validateRequired(); if (isValid()) { convertInput(); if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } if (isValid()) { validateValidators(); } } } Vitaly - 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]
Re: cannot override chechRequired ()
If the method checkRequired () returns TRUE that means, I guess, the requirement condition check must always pass, but it doesn't happens. On Mon, Mar 17, 2008 at 10:09 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: the reason formcomponentpanel.checkrequired() always returns true is that for a formcomponentpanel it is often a noop. so that is the best default implementation we can provide. you can always override it to implement some logic if you need... -igor On Mon, Mar 17, 2008 at 1:13 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I run into this problem implementing my own component as a subclass of the FormComponentPanel class. In my case the method checkRequired just always returns TRUE but if I set required property to TRUE the component always generate a validation error (field bla-bla-bla is required). On Mon, Mar 17, 2008 at 9:09 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I am not sure but I suspect that if the method checkRequired returns true a requirement condition must always met in any case or the behavior is different? On Mon, Mar 17, 2008 at 8:57 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: why should we call checkrequired() twice? -igor On Mon, Mar 17, 2008 at 12:06 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It should be probably like this if (isValid() (isRequired() ? !checkRequired () : true) getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 8:02 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But if checkRequired () returns true isRequired () called again generating a validation error... if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 7:47 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: sure it does, see the first line of validate() -igor On Mon, Mar 17, 2008 at 11:06 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, It seams that there is a bug in the FormComponent code. I try to override chechRequired method but it seams to not work at all. Here is a snippet from the sources. As you can see there is a second requirement check. /** * Checks if the raw input value is not null if this component is required. */ protected final void validateRequired() { if (!checkRequired()) the first check { reportRequiredError(); } } /** * Performs full validation of the form component, which consists of calling validateRequired(), * convertInput(), and validateValidators(). This method should only be used if the form * component needs to be fully validated outside the form process. */ public final void validate() { validateRequired(); if (isValid()) { convertInput(); if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } if (isValid()) { validateValidators(); } } } Vitaly
Re: cannot override chechRequired ()
Ok :) I have the following checkRequired () { return true; } isRequired () { return true; } In the case above Do I have an error message saying that the field is required? On Mon, Mar 17, 2008 at 10:42 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: no, that means that effectively required check is disabled - eg it always passes -igor On Mon, Mar 17, 2008 at 2:15 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: If the method checkRequired () returns TRUE that means, I guess, the requirement condition check must always pass, but it doesn't happens. On Mon, Mar 17, 2008 at 10:09 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: the reason formcomponentpanel.checkrequired() always returns true is that for a formcomponentpanel it is often a noop. so that is the best default implementation we can provide. you can always override it to implement some logic if you need... -igor On Mon, Mar 17, 2008 at 1:13 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I run into this problem implementing my own component as a subclass of the FormComponentPanel class. In my case the method checkRequired just always returns TRUE but if I set required property to TRUE the component always generate a validation error (field bla-bla-bla is required). On Mon, Mar 17, 2008 at 9:09 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I am not sure but I suspect that if the method checkRequired returns true a requirement condition must always met in any case or the behavior is different? On Mon, Mar 17, 2008 at 8:57 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: why should we call checkrequired() twice? -igor On Mon, Mar 17, 2008 at 12:06 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It should be probably like this if (isValid() (isRequired() ? !checkRequired () : true) getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 8:02 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But if checkRequired () returns true isRequired () called again generating a validation error... if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 7:47 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: sure it does, see the first line of validate() -igor On Mon, Mar 17, 2008 at 11:06 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, It seams that there is a bug in the FormComponent code. I try to override chechRequired method but it seams to not work at all. Here is a snippet from the sources. As you can see there is a second requirement check. /** * Checks if the raw input value is not null if this component is required. */ protected final void validateRequired() { if (!checkRequired()) the first check { reportRequiredError(); } } /** * Performs full validation of the form component, which consists of calling validateRequired(), * convertInput(), and validateValidators(). This method should only be used if the form * component needs to be fully validated outside the form process. */ public final void validate
Re: cannot override chechRequired ()
True. But I do... unfortunately. On Mon, Mar 17, 2008 at 11:15 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: you should not, since checkrequired() will pass. -igor On Mon, Mar 17, 2008 at 2:47 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Ok :) I have the following checkRequired () { return true; } isRequired () { return true; } In the case above Do I have an error message saying that the field is required? On Mon, Mar 17, 2008 at 10:42 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: no, that means that effectively required check is disabled - eg it always passes -igor On Mon, Mar 17, 2008 at 2:15 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: If the method checkRequired () returns TRUE that means, I guess, the requirement condition check must always pass, but it doesn't happens. On Mon, Mar 17, 2008 at 10:09 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: the reason formcomponentpanel.checkrequired() always returns true is that for a formcomponentpanel it is often a noop. so that is the best default implementation we can provide. you can always override it to implement some logic if you need... -igor On Mon, Mar 17, 2008 at 1:13 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I run into this problem implementing my own component as a subclass of the FormComponentPanel class. In my case the method checkRequired just always returns TRUE but if I set required property to TRUE the component always generate a validation error (field bla-bla-bla is required). On Mon, Mar 17, 2008 at 9:09 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I am not sure but I suspect that if the method checkRequired returns true a requirement condition must always met in any case or the behavior is different? On Mon, Mar 17, 2008 at 8:57 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: why should we call checkrequired() twice? -igor On Mon, Mar 17, 2008 at 12:06 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It should be probably like this if (isValid() (isRequired() ? !checkRequired () : true) getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 8:02 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But if checkRequired () returns true isRequired () called again generating a validation error... if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 7:47 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: sure it does, see the first line of validate() -igor On Mon, Mar 17, 2008 at 11:06 AM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi guys, It seams that there is a bug in the FormComponent code. I try to override chechRequired method but it seams to not work at all. Here is a snippet from the sources. As you can see there is a second requirement check. /** * Checks if the raw input value is not null if this component is required. */ protected final void validateRequired
Re: cannot override chechRequired ()
It seem it happens because the method getConvertedInput () of the FormComponentPanel returns null since methods setConvertedInput (), setModeValue and convertInput() were never called. public final void validate() { validateRequired(); if (isValid()) { convertInput(); if (isValid() isRequired() getConvertedInput() == null isInputNullable()) { reportRequiredError(); } if (isValid()) { validateValidators(); } } } On Mon, Mar 17, 2008 at 11:18 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: True. But I do... unfortunately. On Mon, Mar 17, 2008 at 11:15 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: you should not, since checkrequired() will pass. -igor On Mon, Mar 17, 2008 at 2:47 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Ok :) I have the following checkRequired () { return true; } isRequired () { return true; } In the case above Do I have an error message saying that the field is required? On Mon, Mar 17, 2008 at 10:42 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: no, that means that effectively required check is disabled - eg it always passes -igor On Mon, Mar 17, 2008 at 2:15 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: If the method checkRequired () returns TRUE that means, I guess, the requirement condition check must always pass, but it doesn't happens. On Mon, Mar 17, 2008 at 10:09 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: the reason formcomponentpanel.checkrequired() always returns true is that for a formcomponentpanel it is often a noop. so that is the best default implementation we can provide. you can always override it to implement some logic if you need... -igor On Mon, Mar 17, 2008 at 1:13 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I run into this problem implementing my own component as a subclass of the FormComponentPanel class. In my case the method checkRequired just always returns TRUE but if I set required property to TRUE the component always generate a validation error (field bla-bla-bla is required). On Mon, Mar 17, 2008 at 9:09 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I am not sure but I suspect that if the method checkRequired returns true a requirement condition must always met in any case or the behavior is different? On Mon, Mar 17, 2008 at 8:57 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: why should we call checkrequired() twice? -igor On Mon, Mar 17, 2008 at 12:06 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It should be probably like this if (isValid() (isRequired() ? !checkRequired () : true) getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 8:02 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But if checkRequired () returns true isRequired () called again generating a validation error... if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 7:47 PM, Igor Vaynberg [EMAIL PROTECTED] wrote
Re: cannot override chechRequired ()
My component accepts 3 models as parameters, and uses this models internally. The component's model is not involved at all. You mean the method convertinput () must return at least something other then null? On Tue, Mar 18, 2008 at 1:10 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: i assumed you properly implemented convertinput(). you cannot call setrequired(true) on the formcomponentpanel and then expect to completely avoid the required check. the required check is two-pronged. first half is done in the checkRequired() and works on the raw input. second part makes sure that your type-conversion did not take a non-null input and convert it into null...this is the part that is failing for you. that is something you should properly implement... -igor On Mon, Mar 17, 2008 at 3:18 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: True. But I do... unfortunately. On Mon, Mar 17, 2008 at 11:15 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: you should not, since checkrequired() will pass. -igor On Mon, Mar 17, 2008 at 2:47 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Ok :) I have the following checkRequired () { return true; } isRequired () { return true; } In the case above Do I have an error message saying that the field is required? On Mon, Mar 17, 2008 at 10:42 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: no, that means that effectively required check is disabled - eg it always passes -igor On Mon, Mar 17, 2008 at 2:15 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: If the method checkRequired () returns TRUE that means, I guess, the requirement condition check must always pass, but it doesn't happens. On Mon, Mar 17, 2008 at 10:09 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: the reason formcomponentpanel.checkrequired() always returns true is that for a formcomponentpanel it is often a noop. so that is the best default implementation we can provide. you can always override it to implement some logic if you need... -igor On Mon, Mar 17, 2008 at 1:13 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I run into this problem implementing my own component as a subclass of the FormComponentPanel class. In my case the method checkRequired just always returns TRUE but if I set required property to TRUE the component always generate a validation error (field bla-bla-bla is required). On Mon, Mar 17, 2008 at 9:09 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: I am not sure but I suspect that if the method checkRequired returns true a requirement condition must always met in any case or the behavior is different? On Mon, Mar 17, 2008 at 8:57 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: why should we call checkrequired() twice? -igor On Mon, Mar 17, 2008 at 12:06 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: It should be probably like this if (isValid() (isRequired() ? !checkRequired () : true) getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired () { reportRequiredError(); } On Mon, Mar 17, 2008 at 8:02 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: But if checkRequired () returns true isRequired () called again generating a validation error... if (isValid() isRequired() getConvertedInput() == null isInputNullable()) the second check. Doesn't call the chechRequired
Re: cannot override chechRequired ()
Thanks Igor, With the Date object we have a very nice and consistent example. I implemented my DatePicker exactly this way. But sometimes if the data is spread over different properties of a bean or even between different beans but still needs to be processed in a consistent manner the solution is not so elegant. I decided to use the FormComponentPanel over a simple panel only because I was keeping in my mind a form level validation scenario since the FormValidator requires an array of objects of the FormComponent class to be returned by one of its methods. Vitaly On Tue, Mar 18, 2008 at 2:21 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: well, you dont want to implement input processing, yet you are using setrequired - which is used in that processing...you see the delema? what you should do is: class mypanel extends fcp { public mypanel { super(id, new Model()); } convertinput() { setconvertedinput(Boolean.TRUE); } } then everything should work; however, this is not how the fcp is meant to be used. it is meant to allow assembling of inputs from smaller pieces, so a proper implementation would look like class mydatefiled extends fcp { private TextField day,mo,year; public mydatefield(string id, imodel model) { add(new textfield(day, new Model()); add(new textfield(mo, new Model()); ... } convertinput() { MyDate date=new MyDate(); date.setDay(day.getconvertedinput()); date.setMonth(month.getConvertedInput()); ... setConvertedInput(date.toDate()); } } that way 1) set required works properly 2) any validators attached to it work on the resulting Date object 3) you do not need to pass in 3 models, you pass in one and fcp combines its inputs into it makes sense? so in short, you are not using the right tool for the job. sounds like what you are doing can be accomplished with a regular panel that has a setrequired(boolean) method... -igor On Mon, Mar 17, 2008 at 5:41 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: My component accepts 3 models as parameters, and uses this models internally. The component's model is not involved at all. You mean the method convertinput () must return at least something other then null? On Tue, Mar 18, 2008 at 1:10 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: i assumed you properly implemented convertinput(). you cannot call setrequired(true) on the formcomponentpanel and then expect to completely avoid the required check. the required check is two-pronged. first half is done in the checkRequired() and works on the raw input. second part makes sure that your type-conversion did not take a non-null input and convert it into null...this is the part that is failing for you. that is something you should properly implement... -igor On Mon, Mar 17, 2008 at 3:18 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: True. But I do... unfortunately. On Mon, Mar 17, 2008 at 11:15 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: you should not, since checkrequired() will pass. -igor On Mon, Mar 17, 2008 at 2:47 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Ok :) I have the following checkRequired () { return true; } isRequired () { return true; } In the case above Do I have an error message saying that the field is required? On Mon, Mar 17, 2008 at 10:42 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: no, that means that effectively required check is disabled - eg it always passes -igor On Mon, Mar 17, 2008 at 2:15 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: If the method checkRequired () returns TRUE that means, I guess, the requirement condition check must always pass, but it doesn't happens. On Mon, Mar 17, 2008 at 10:09 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: the reason formcomponentpanel.checkrequired() always returns true is that for a formcomponentpanel it is often a noop. so that is the best default implementation we can provide. you can always override it to implement some logic if you need... -igor On Mon, Mar 17, 2008 at 1:13 PM, Vitaly Tsaplin [EMAIL PROTECTED
A model driven visibility. Howto?
Hi everyone, How to implement a model driven visibility? Are there any best practices? Should I use the AttributeModifier to set a style visibility attribute or there is a better way? Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is there any way to be notified somehow just after the CompoundPropertyModel is resolved by the component hierarchy?
Many thanks Johan, I am just going to explain why I need it. Lets say we have a component which accepts one or some models as a parameter(s). So it can apply initial values to its internal component hierarchy. But in case of use the CompoundPropertyModel we have no chance to do such preparations in a constructor. Probably you would suggest a better way to do it? Is there any specifically designed solution to fit this situation? Vitaly On Fri, Mar 14, 2008 at 10:39 AM, Johan Compagner [EMAIL PROTECTED] wrote: override this method: /** * [EMAIL PROTECTED] org.apache.wicket.model.IComponentAssignedModel#wrapOnAssignment( org.apache.wicket.Component) */ *public* IWrapModel wrapOnAssignment(*final* Component component) { *return* *new* AssignmentWrapper(component, propertyName); } On Thu, Mar 13, 2008 at 3:32 PM, Vitaly Tsaplin [EMAIL PROTECTED] wrote: Hi everyone, Is there any way to be notified somehow just after the CompoundPropertyModel is resolved by the component hierarchy? Vitaly - 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]
A link-o-label needed
Hi experts, Does anyone know how to create a label link in wicket? In other words I need a clickable label or a link which acts as a label taking its text from a model exactly like a wicket's label. Vitaly - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]