Re: Wicket and CoC
With IComponentResolver you can easily roll your own 'CoC' solution. Sven Ricardo Mayerhofer schrieb: I started to use wicket some time ago, and I'm really enjoying it. Best framework ever. But I've some suggestions. I think wicket could be better if it had less boiler plate code. This could be reduced by using CoC. Take the FeedBackPanel for example, you always have to add the component on the web page, even if no special handling is requires (which is almost the case). Wicket could have some reserved ids, so if I add a markup with id feedbackPanel, a feedbackpanel component is automatically added to that page. Another example is SubmitLink component. No special handling required, but for wicket sake the developer must add it on the java the page. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Switchable panel via select ajax
Why don't you just replace the current panel depending on a selection in your select field, see: MarkupContainer#addOrReplace(Component) Much easier than tinkering with the internals of Wicket's rendering. Sven Александър Шопов schrieb: Hi guys, I was wondering of a good strategy of making a panel that is changed via ajax by a select field. I was aiming at easy maintainability of the code, and thought of the following. +-+-++---+ |typeOfPan|V|| | +-+-+| Panel | | | +---+ I add an Ajax Behaviour to typeOfPan. The target of updating will contain the second panel. I have several versions of the Panel - for example one with text input fields, several with selects and probably more in the future. In the page I add a normal Panel. However I overload its onComponentTag, onComponentTagBody, renderHead and delegate them to those of the real panel that has the real components. I switch the real panel based on the selection of typeOfPan. All of the panels are constructed with the same id, however, just one of them is added to the page. Will such a strategy actually work? I will be experimenting today, however two things can be tricky - the id's in html of the real panels - since they have never been added properly to the page and the second is the real html that will be used to render the panel. Will that be the one from the delegating panel or that of the real implementations? I'd really like to separate the panels - each with its own code and html and be able to switch between them, so if there is a better (or in fact other working way) comments would be welcome. Kind regards: al_shopov - 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: Palette, AbstractOptions and localizer
Done: https://issues.apache.org/jira/browse/WICKET-1982 Igor Vaynberg schrieb: yes, i think we can. i am not really sure why it works the way it does right now. please create a jira issue. and, btw, this can only be fixed in 1.4. -igor On Tue, Dec 16, 2008 at 12:15 AM, s...@meiers.net wrote: Hi, is there a reason why AbstractOptions (Palette) uses id and value for localization of options? value = getLocalizer().getString(id + . + value, this, value); This requires me to duplicate parts of the keys in my property file. If I'm using a ChoiceRenderer(name, name) for a hypothetical class B it looks like: Bar.A.Bar.A = Aaaa Bar.B.Bar.B = Bbbb Bar.C.Bar.C = Cccc Could we align AbstractOptions with how AbstractChoice works, localizing the displayValue only without the id? display = getLocalizer().getString(displayValue, this, displayValue); Thanks Sven - 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: [GMAP2] how to add float Panel
Use absolute CSS positioning to let your panel float over the GMap2 component.|| | |Sven NHSoft.YHW schrieb: my requirement desc: 1.add a float panel component at top left corner of the GMAP2, when the map zoom in or zoom out, the panel alway show at top left corner. 2.adjust panel transparency, so user can see map image behind the panel. so i want to know how to code in GMAP2. thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Why you should not override isVisible
But the model's value is accessed by many other methods, not just isVisible(). If you want to save the reflection overhead why don't you put a caching model between your component and the CompoundPropertyModel? Or access the model of the containing component if this is applicable: public void CartPanel(IModel cart) { super(new CompoundPropertyModel(cart)); add(new Label(total) { public boolean isVisible() { ((Cart)CartPanel.this.getModelObject()).getTotal().isPositive(); } }); } I still don't see the need to introduce visibility caching into Wicket core. Sven Scott Swank schrieb: That comes from a CompoundPropertyModelCart and is bound to total. So getModelObject() corresponds to cart.getTotal(). From there, isPositive() is quite cheap. And we can, of course, keep implementing ad hoc caching of visibility. It's in no way complex, however it seems preferable to have this as the default behavior since only a very few components are likely to want to change their visibility over the course of rendering. Is this something that could be examined in 1.4 or 1.5 or is it simply inappropriate -- perhaps due to component details with which I'm unfamiliar? On Fri, Jan 16, 2009 at 12:53 AM, s...@meiers.net wrote: What's taking so long in your isVisible() method? The model object should be cached, and is isPositive() so expensive? Sven - Ursprüngliche Nachricht - Von: Scott Swank Gesendet: 16.01.09 02:06 Uhr An: users@wicket.apache.org Betreff: Re: Why you should not override isVisible We have implemented this, perhaps a dozen times or more across our application. For example, there are several payment options whose relevance is determined by whether the customer owes any money on their purchase (e.g. as opposed to using a gift card). These total the order and determine visibility methods were particular hot spots. @Override public boolean isVisible() { if (visible == null) visible = ((Money) getModelObject()).isPositive(); return visible; } While this is an idiosyncratic example, I can vouch for the fact that performance woes in isVisible() show up in profiling. On Thu, Jan 15, 2009 at 4:56 PM, Jonathan Locke jonathan.lo...@gmail.com wrote: oh i suppose you also need to reset the value in onBeforeRender(). it's a small pain, but how often does this really become a quantifiable problem and not just a worry? Jonathan Locke wrote: sure, that's the clean way to do it, but it comes at the expense of possibly breaking user code by surprise. i'm not sure how big of a deal this is. i've heard people talk about it, but i'd be interested in some examples of how performance of this method has been a problem for people. i've never run into it myself and if i did see it in a profiler, i'd probably just cache the value in a Boolean. it's literally just this little bit in your anonymous class: Boolean visible = null; public isVisible() { if (visible == null) { visible = // whatever boolean computation } return visible; } and then it disappears from the profiler and who cares about the rest. Scott Swank wrote: My idea what an inversion of that one: Add a method to Component, such as isVisibleInternal() [no I don't love the name] that would cache the results of isVisible(). Then all code that currently calls isVisible() would be changed to call isVisibleInternal() instead. Someone who really wanted non-cached visibility (seemingly the 1% case) could override isVisibleInternal(), but everyone else would get caching for free with their current code. On Thu, Jan 15, 2009 at 2:35 PM, Jonathan Locke jonathan.lo...@gmail.com wrote: well, one simple design that would avoid the reuse problem is: Boolean Component#isCachedVisible() { return null; } then override to use visibility caching and return true or false. if you don't override you get the current functionality. of course you need two more bits in Component to support this... one for whether isCachedVisible returned non-null and another for the value it returned. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21490479.html Sent from the Wicket - User mailing list archive at Nabble.com.
Re: Dynamically changing CSS style attribute
Why not keep the fixed settings in a style class and just update the style attribute with the current value (utilizing an AttributeModifier)? .Needle { z-index: 1; width: 2px; ... } span wicket:id=needle class=Needle style=left: 20%;/ Seven Corners schrieb: I have a control with a needle that moves. The needle's value is continually changing, so on a timer I ask the server its value and set its position with the left CSS attribute, as in: .Needle { z-index: 1; width: 2px; ... left: 20%; } I do have a bean that returns a percentage string for the value, and I have verified I hit that getter when the update occurs. It looks like I need to create an AttributeModifier for this object's style attribute, and spit out ALL the style attributes in the model, not just the value for the left style attribute. I don't want to do that, because it hard-codes irrelevant styles attributes and I might want to change them in the future. I could use an AttributeAppender, but wouldn't that just add a left to the end of the style attribute, so that over time (the timer goes off every minute), the style attribute would become a really long string? Don't want to do that either. Is there some way just to tweak a single CSS attribute? Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: patterns for web ui apps. mvc models
Well, in Wicket the markup doesn't do much (which is a good thing) besides layout. If you're correctly using CSS, the markup isn't even responsible for the look (and feel). I don't know if this qualifies it as a 'V' in MVC. Sven James Carman schrieb: On Tue, Jul 1, 2008 at 1:56 PM, Eelco Hillenius [EMAIL PROTECTED] wrote: I've been thinking about the way in which wicket is an MVC framework and whether people use it according to the MVC pattern. The MVC pattern is bastardized - especially when it comes to web application frameworks - up to the point that it is hardly useful to use the term. Everyone seems to have their own interpretation. If you had to explain Wicket in MVC terms, my take would be that components represent the Controller and View (together, just like Swing), and the model is separated behind the IModel interface. But I think it is better to just let the whole MVC mania behind us and explain frameworks on their own terms :-) You could argue that the view is the markup file and the controller is the component/page class? - 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: generics
Wouldn't it be better to leave the generic part to this reusable link then? Why 'pollute' all links with a generic parameter? Back to your definition: (1) only components that use their model have a generic type (components you are likely to call getmodel/getmodelobject on as a user). What now? Components that use their model *or* you're likely to call getmodel on? Seems to me as two different things: Link doesn't fit in the first category nor is it always used with a model. Sven Igor Vaynberg schrieb: if your link is anonymous, yes. if you have reusable links in their own class, then no. -igor On Tue, Jul 1, 2008 at 12:24 PM, Joni Freeman [EMAIL PROTECTED] wrote: Isn't this a same thing: onPopulateItem(final ItemUser item) { add(new Link(delete) { protected void onClick() { service.delete(item.getModelObject()); } }); } Joni On Tue, 2008-07-01 at 11:56 -0700, Igor Vaynberg wrote: onPopulateItem(ItemUser item) { add(new LinkUser(delete, item.getModel()) { protected void onClick() { service.delete(getModelObject()); } }); } -igor On Tue, Jul 1, 2008 at 11:51 AM, Rodolfo Hansen [EMAIL PROTECTED] wrote: I too like this compromise alot Although I don't see a good use case for generifying Link ? Am I missing something? On Fri, Jun 27, 2008 at 2:49 PM, Timo Rantalaiho [EMAIL PROTECTED] wrote: On Fri, 27 Jun 2008, Igor Vaynberg wrote: since no one complained, should we apply this change over the weekend? and soon thereafter release m3? I prefer this over M2. Even though: user). so far these are link,form,formcomponent Link might be better without the type parameter. It's no big deal though. And yes, it would be good if for example Johan and Gerolf who have invested a lot of effort on the generification could have a closer look and tell what they think before proceeding. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: generics
Just because you're using a CompoundPropertyModel on your Forms doesn't mean you need it generified. Sven Roland Huss schrieb: igor.vaynberg wrote: On Tue, Jul 1, 2008 at 11:28 PM, Eelco Hillenius [EMAIL PROTECTED] wrote: thats my point. you work on fields of one object, true, but it does not necessarily have to be the form's modelobject unless you use a compound property model. The usage of a CompoundPropertyModel as a Form-model saved us quite some typing and it's IMO a very common use case. In fact, this it propbably the most relevant use case for a CPM anyway. So, I'm in favor of having a Form with Model (or at least a variation like a ModelFormT ...) ... roland - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: generics
Another thought: Why do we have a setter for the model actually? I never call setDefaultModel() (formerly setModel()) in my code. In wicket-examples it seems that most calls to setDefaultModel() are done from inside the constructor (where it is sometimes needed because you cannot call instance methods before the super constructor call). Shouldn't we declare this method (final) protected? Custom components could just handle generified models in the constructor, the non-final getDefaultModel() could be overriden with the preferred return type (as already suggested). And we could get rid of the 'default' in all this method names which frankly don't look too good to me. Sven Johan Compagner schrieb: thats completely up how you use it I can think of a lot that dont use models on FormComponents but only on Forms If you use CompoundModel then you never will touch or give a FormComponent a model. and all your stuff is done on the Model of the Form. (in the onSubmit for example) So this can never be generalized like this will never be used this way The only way for this is to have a complete separate stack of ModelComponents/GenericComponents See for example Link, Igor says i use model a lot. Eelco says he never uses it.. (but he uses it on button if i read correctly which is the same thing as a link) johan On Wed, Jul 2, 2008 at 9:15 AM, Jan Kriesten [EMAIL PROTECTED] wrote: Hi, i agree that its no big deal, i am just trying to figure out some sort of guidelines for when we do include the type and when we dont. if we say that we only include the type when the component uses its model then neither Link nor Form qualify. in fact neither will ListItem. only things like ListView and FormComponents will qualify. I'd actually prefer untyped Link and Form, since I also don't use Models on them directly most of the time. But other's may have a different style and always use Models... Best regards, --- Jan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Internationalizing a DDC
You can do without the ChoiceRenderer if you put your terms in a property file next to your panel/page: A.java new DropDownChoice(period, ...) { protected boolean localizeDisplayValues() { return true; } } A.html select wicket:id=period/ A.properties period.1 = Day period.7 = Week period.14 = Fortnight period.30 = Month period.365 = Year Sven insom schrieb: I'm using John Krasnay's approach to defining display values for a DropDownChoice, like so: new DropDownChoice(period, new PropertyModel(myObject, period), periods, new ChoiceRenderer() { public String getDisplayValue(Object object) { int period = ((Integer) object).intValue(); switch (period) { case 1: return Day; case 7: return Week; case 14: return Fortnight; case 30: return Month; case 365: return Year; default: throw new RuntimeException(); } } } ); My question is, how can I take advantage of Wicket's internationalization capabilities to replace the return values with the proper values for the locale? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [announce] Wicket in Action e-book has been published!
Almost 4 years of using Wicket, being productive, having fun and learning every day - and just now I ordered my copy of Wicket in Action*. Many thanks to all core developers Sven *the 'living-tree' edition ;) Martijn Dashorst schrieb: Almost 3 years of hard work, loosing friends, moving abroad, marrying lovely wives, late nights, early mornings, frustrated family, and all other bad (and good) things that cross one's life is now rewarded with the availability of the e-book edition of Wicket in Action. The print edition (also know as dead-tree edition) will be available in just over 2 weeks (estimated at Aug 29th). Eelco and I are *really*, *really* glad that the journey is finally over. We think it was worth it. Now we leave the book in your capable hands to make beautiful applications that make your boss and customers happy and we are sure you'll enjoy creating them. Eelco Hillenius Martijn Dashorst About Wicket in Action Wicket in Action is a comprehensive guide for Java developers building Wicket-based web applications. It introduces Wicket's structure and components, and moves quickly into examples of Wicket at work. Written by core committers, this book shows you the how-to and the why of Wicket. You'll learn to use and customize Wicket components, to interact with Spring and Hibernate, and to implement rich Ajax-driven features. Some quotes of early access reviewers: Finally, the Web Framework of web framework, Apache Wicket, now has a bible of its own. - Per Ejeklint Without question, Wicket in Action... is the be-all and end-all when it comes to Wicket. - Geertjan Wielenga Wicket In Action glues the areas of web development with Apache Wicket together and gives a great overview of Apache Wicket...it will make a great compendium. - Nino Martinez Wael You can read full reviews here: - Nick Heudecker: Wicket In Action Book Review http://www.theserverside.com/news/thread.tss?thread_id=50326 - Geertjan Wielenga: Wicket in Action: Undoubtedly The Wicket Bible http://blogs.sun.com/geertjan/entry/wicket_in_action_undoubtedly_the Free content If you don't think these reviewers are qualified to tell you to buy Wicket in Action, let these free samples convince you: * Chapter 1: http://www.manning.com/dashorst/ch01_dashorst.pdf * Chapter 8: http://www.manning.com/dashorst/ch08_dashorst.pdf * Excerpt: Creating Secure Web Applications with Apache Wicket (http://www.manning.com/free/excerpt_Wicket.html) MEAP readers If you bought the MEAP edition you'll receive a personal download link for the final e-book in your inbox today (or possibly tomorrow). We'd like to extend our gratitude to the MEAP readers - without you and your encouragements we would've given up. Limited summer discount There is a 35% discount when you buy Wicket in Action at the manning website before the end of August. For more details look here: http://manning.com/dashorst - 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: Wicketstuff snapshots
Hi all, I've adjusted the offending line to the latest generics changes in wicket core. wicketstuff-prototype is now building fine too. Sven francisco treacy schrieb: somehow it doesn't find prototype which is a dependency. you can install it manually. svn co https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-prototype prototype cd prototype mvn install and retry building scriptaculous. now my problem is; is wicketstuff-scriptaculous broken? trunk won't compile: [INFO] Compilation failure C:\Documents and Settings\m\scriptaculous\src\java\org\wicketstuff\scriptaculous \dragdrop\SortableListView.java:[46,2] cannot find symbol symbol : constructor SortableListView(java.lang.String,java.lang.String,org.apa che.wicket.model.IModeljava.util.List? extends T) location: class org.wicketstuff.scriptaculous.dragdrop.SortableListViewT C:\Documents and Settings\m\scriptaculous\src\java\org\wicketstuff\scriptaculous \dragdrop\SortableListView.java:[46,2] cannot find symbol symbol : constructor SortableListView(java.lang.String,java.lang.String,org.apa che.wicket.model.IModeljava.util.List? extends T) location: class org.wicketstuff.scriptaculous.dragdrop.SortableListViewT i guess this is a problem with wicket generic support -- but what should i do to get scriptaculous to work? btw i tried with snapshots from 1.3 and 1.4 and nothing is working with wicket-1.4m3. (1.3) java.lang.NoSuchMethodError: org.wicketstuff.scriptaculous.dragdrop.SortableListView.add(Lorg/apache/wicket/behavior/IBehavior;)Lorg/apache/wicket/Component; at org.wicketstuff.scriptaculous.dragdrop.SortableListView.init(SortableListView.java:54) at org.wicketstuff.scriptaculous.dragdrop.SortableListView.init(SortableListView.java:46) same thing as kaspar with (1.4): java.lang.NoSuchMethodError: org.wicketstuff.scriptaculous.dragdrop.SortableListView.getModelObject()Ljava/lang/Object; could you give me some hints on how to make this work? thanks! francisco On Tue, Aug 19, 2008 at 3:26 PM, Kaspar Fischer [EMAIL PROTECTED] wrote: I guess the first error (see below) is not relevant as other projects have it, too. Regarding the second error: Does anybody have an idea why wicketstuff-prototype makes the build fail? I can see wicketstuff-prototype in the SVN repo but it is not listed on http://wicketstuff.org/teamcity/overview.html -- is this normal? Being a Maven newbie, I am a lost here. Maybe the problem is that the scriptaculous-pom.xml lists the repo as repository idwicket-stuff-repository/id nameWicket-Stuff Repository/name urlhttp://www.wicketstuff.org/maven/repository//url /repository without a snapshots enabledtrue/enabled /snapshots ? Too many trees in this forest for me ;-) On 19.08.2008, at 13:30, Kaspar Fischer wrote: Loggin into teamcity as guest, I see Problems with VCS connection: Failed for the root 'Wicket Stuff 1.4 repository' #3: Checking changes for checkout rule 'trunk/wicket-contrib-tinymce=trunk/wicket-contrib-tinymce' failed with erorr: org.tmatesoft.svn.core.SVNException: svn: PROPFIND request failed on '/svnroot/wicket-stuff/trunk/wicket-contrib-tinymce/src/java/wicket/contrib/tinymce/tiny_mce/langs/tw.js' svn: Network is unreachable and in addition a build error: [ERROR] BUILD ERROR [12:26:40]: [INFO] [12:26:40]: [INFO] Failed to resolve artifact. [12:26:40]: [12:26:40]: Missing: [12:26:40]: -- [12:26:40]: 1) org.wicketstuff:wicketstuff-prototype:jar:1.4-SNAPSHOT [12:26:40]: [12:26:40]: Try downloading the file manually from the project website. [12:26:40]: [12:26:40]: Then, install it using the command: [12:26:40]: mvn install:install-file -DgroupId=org.wicketstuff -DartifactId=wicketstuff-prototype -Dversion=1.4-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file [12:26:40]: [12:26:40]: Alternatively, if you host your own repository you can deploy the file there: [12:26:40]: mvn deploy:deploy-file -DgroupId=org.wicketstuff -DartifactId=wicketstuff-prototype -Dversion=1.4-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] [12:26:40]: [12:26:40]: Path to dependency: [12:26:40]: 1) org.wicketstuff:wicketstuff-scriptaculous:jar:1.4-SNAPSHOT [12:26:40]: 2) org.wicketstuff:wicketstuff-prototype:jar:1.4-SNAPSHOT [12:26:40]: [12:26:40]: -- [12:26:40]: 1 required artifact is missing. [12:26:40]: [12:26:40]: for artifact: [12:26:40]: org.wicketstuff:wicketstuff-scriptaculous:jar:1.4-SNAPSHOT [12:26:40]: [12:26:40]: from the specified remote repositories: [12:26:40]: central (http://repo1.maven.org/maven2), [12:26:40]: wicket-stuff-repository (http://www.wicketstuff.org/maven/repository/) Is the first error the one - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Localization encoding
For encoding the following is relevant in Wicket: - ?xml version=1.0 encoding=UTF-8? The explicit encoding of your markup files. - IMarkupSettings#defaultMarkupEncoding The default encoding to be used by Wicket to read your markup files (if not explicitely specified), default null. - JVM file.encoding The encoding used by Wicket to read your markup files if neither above was specified. - meta http-equiv=content-type content=text/html; charset=UTF-8 / The encoding of your markup as seen by the browser. This should match the following... - IRequestCycleSettings#responseRequestEncoding The encoding to be used by Wicket to stream markup to the browser, default UTF-8. I'd suggest to keep all these the same, e.g. UTF-8. But you could equally well use different encodings for markup reading and writing. XML encoding and charset should always match. As you can see, usually there's no need to mess around with the JVM's file encoding. BTW, if you're encoding your markup in UTF-8, you won't have to think about HTML entities for special characters (e.g. auml;) ever again. Be sure to read: http://cwiki.apache.org/WICKET/how-to-change-the-character-encoding.html Sven Timo Rantalaiho schrieb: On Tue, 30 Sep 2008, Milan K?ápek wrote: So the dynamic content of localized pages (from property files) is displayd well but the static part defined in 'mypage_cs.html' is displazyed wrong. Has anybody met the same problem? Is there any methods for configuring waicket to render pages in utf-8 encoding?? Have you tried passing -Dfile.encoding=utf-8 to your application server? Or checked what is the file.encoding system property runtime. Most probably Java gets the default value from the operating system (locale -a gives hints in Unixes and on Windows I think the encoding is cp1252 which is some microsoftied version of ISO-Latin-1). Best wishes, Timo - 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: Using static HTML in wicket
You can use a single Wicket page using the static html of your CMS as its markup. Sprinkle your templates or content (depending who's in charge) with wicket ids: div wicket:id=shoppingCart/div With custom component resolving you can then inject the dynamic parts, i.e. Wicket panels mainly. We successfully used this technique to integrate Wicket with a CMS in a major 'portal' project. Hope this helps Sven Markus Strickler schrieb: Hi- we have a CMS generating a bunch of static html pages. Now I have to add some dynamic content to each of these pages using wicket. The pages have the basic HTML structure, navigation and some text blob, wicket has to add the page title, whatever JavaScript it requires for form processing, and a form + result view. Now I'm wondering what would be the best way to mix the static HTML and wicket's output. Thanks for any suggestions, -markus This message was sent using IMP, the Internet Messaging Program. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using static HTML in wicket
Hi Markus, mount a single page: mount(new MixedParamUrlCodingStrategy(content, ContentPage.class, new String[] {contentId})); In the constructor you can get hold of the requested content's id: public ContentPage(PageParameters params){ this.contentId = params.get(contentId); } Implement IMarkupResourceStreamProvider loading the markup depending on contentId. (take a look on *IMarkupCacheKeyProvider* too). Use wicket ids in you CMS' pages as an 'API' to resolve components (see IComponentResolver http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/resolver/IComponentResolver.html), e.g. shoppingCart - ShoppingCartPanel.java. Your content foo with all dynamic parts is then accessible via: http://yourserver/yourContext/content/foo Sven Markus Strickler schrieb: Hi Sven, thanks for the reply. What I don't quite get is how I would be able to use the markup from seerat static pages as template for a single wicket page. Thanks again, -markus Zitat von Sven Meier [EMAIL PROTECTED]: You can use a single Wicket page using the static html of your CMS as its markup. Sprinkle your templates or content (depending who's in charge) with wicket ids: div wicket:id=shoppingCart/div With custom component resolving you can then inject the dynamic parts, i.e. Wicket panels mainly. We successfully used this technique to integrate Wicket with a CMS in a major 'portal' project. Hope this helps Sven Markus Strickler schrieb: Hi- we have a CMS generating a bunch of static html pages. Now I have to add some dynamic content to each of these pages using wicket. The pages have the basic HTML structure, navigation and some text blob, wicket has to add the page title, whatever JavaScript it requires for form processing, and a form + result view. Now I'm wondering what would be the best way to mix the static HTML and wicket's output. Thanks for any suggestions, -markus This message was sent using IMP, the Internet Messaging Program. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. This message was sent using IMP, the Internet Messaging Program. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: initial GMap2 bounds question
Regretfully there's no direct API call in GMap2 supporting your case. Here's a description how to do it with Javascript only: http://econym.googlepages.com/basic14.htm We could make up a function that hides the details: GMap2#fitMarkers(ListMarker) Martin, what do you think? Sven Doug Leeper schrieb: Lets say I have two GLatLng Points, i.e. Chicago and Indianapolis. I would like to have the map be centered between these points and bounded to show these points. What is the best way to do this? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JavaScript Framework Dependencies
Hi Uwe, this is exactly the reason why we have wicketstuff-prototype: http://wicketstuff.org/confluence/display/STUFFWIKI/wicketstuff-prototype IMHO we could use something similar for mootools. Sven Uwe Schäfer schrieb: hi forgive me, if this topic is a dead horse already, but it really bugs me that this does not seem to be sorted out. i´m just wondering why there isn´t a project like org.wicketstuff.javascript.mootools/jquery/extjs/whatever the story: i was just implementing some mini behaviour using mootools when i found, that after packaging it nicely in a seperate project, it broke another mootools based behaviour used on a page that combined the two. no suprise there, as they use different versions of mootools. the obvious solution is: ripping the dependency out in a seperate project and make both use this one. (assuming backward compatibility is reliable) so, what do i learn from that? there should be *one single* source for mootools-header-contributions that any behaviour implementor is invited to use in order to prevent scripts form being loaded more than once on a single page (due to coming from different resources) and to give the user (or his maven or whatever he uses for dependency resolution) of these behaviours a chance of choosing the version. yes, i know... maintaining could be work, but it is bearable to at least have all major versions of the bigger JS toolkits bundled together with a simple class defining resources to use those things. to make it crystal clear: this is just about providing a single access point for using these scripts, not wrapping them with wicket components. bad idea? cu uwe - 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 detect model leakage into session
Hi, you're probably doing something like the following: add(new Label(foo, ldm.getObject().getFoo())); Never do that, instead use: add(new Label(foo, new PropertyModel(ldm, foo))); ... or ... add(new Label(foo, new AbstractReadonlyModel() { public Object getObject() { return ldm.getObject().getFoo()); } })); ... or even better ... setModel(new CompoundPropertyModel(ldm)); add(new Label(foo)); // - getFoo() add(new Label(bar)); // - getBar() add(new Label(baz)); // - getBaz() HTH Sven On Mi, 2009-08-26 at 21:29 +0200, Bas Gooren wrote: Hi all, My problem is as follows: I use LoadableDetachableModels throughout my application, and have made sure I never use a model without it being attached to a component to prevent models which never get their detach() method called. Nonetheless, after hitting two fairly simple pages which list some database data in my application, I get a 100kb session which is filled with literal strings from model objects. I've fired up my (Eclipse) debugger and have stepped through all models on one of the pages after setting a breakpoint on the pages onDetach() method. I see all LoadableDetachableModels are detached, so I have no idea what's causing this. What would be a good strategy for finding the source of this problem? Bas - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: removing a behavior
component.add(new HeaderContributor(new IHeaderContributor() { private static final long serialVersionUID = 1L; public void renderHead(IHeaderResponse response) { response.renderCSSReference(getCurrentResource()); } })); Just let getCurrentResource() return the current theme's resource. Sven Pierre Goupil wrote: Thanks for your reply! Let me explain. I have three CSS files (1, 2, 3) and only one page (Page). On this Page, there's a Component which contains three links which purpose are to swith the graphical theme of the page, based on the CSS files. When the user clicks on one of these links, the onClick() method performs a add(CSSPackageResource .getHeaderContribution([1,2,3].css)) in order to swith theme. Then the user goes back to the Page. BUT, I want one and only one of the CSS files at any given moment. If I click on sequence on each of these 3 links, the theme switches normally, but then it can't switch anymore as all three files are already loaded in my page, as Firebug confirms. Hence, my question is: how to remove one of these HeaderContributor? Since, when my user clicks on one of the links, I want to add a HeaderContributor, but also to remove the old one(s). Regards, Zala On Sun, Sep 13, 2009 at 9:06 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: What about just not adding it instead? So in the first cycle you add it and in the next rendering you do not? 2009/9/13 Pierre Goupil goupilpie...@gmail.com: Good morning, I use CSSPackageResource .getHeaderContribution(style.css) in order to load CSS files into my page. But is there any way to remove the HeaderContributor ? If I just add another one in a subsequent request, the old CSS is still there, which I don't want. Regards, Zala -- Sans amis était le grand maître des mondes, Eprouvait manque, ce pour quoi il créa les esprits, Miroirs bienveillants de sa béatitude. Mais au vrai, il ne trouva aucun égal, Du calice du royaume total des âmes Ecume jusqu'à lui l'infinité. (Schiller, l'amitié) - 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: removing a behavior
Hi, you have to add the header contributor only once. See here for a live example of a theme chooser: http://wicket-tree.appspot.com Sven Pierre Goupil wrote: I did it, but there problem is still the same: all CSS files keep being in the header as soon as I add one of them. What I'd like to do is to have only one CSS at a given moment in the page. Any ideas? Regards, Zala On Sun, Sep 13, 2009 at 4:59 PM, Sven Meier s...@meiers.net wrote: component.add(new HeaderContributor(new IHeaderContributor() { private static final long serialVersionUID = 1L; public void renderHead(IHeaderResponse response) { response.renderCSSReference(getCurrentResource()); } })); Just let getCurrentResource() return the current theme's resource. Sven Pierre Goupil wrote: Thanks for your reply! Let me explain. I have three CSS files (1, 2, 3) and only one page (Page). On this Page, there's a Component which contains three links which purpose are to swith the graphical theme of the page, based on the CSS files. When the user clicks on one of these links, the onClick() method performs a add(CSSPackageResource .getHeaderContribution([1,2,3].css)) in order to swith theme. Then the user goes back to the Page. BUT, I want one and only one of the CSS files at any given moment. If I click on sequence on each of these 3 links, the theme switches normally, but then it can't switch anymore as all three files are already loaded in my page, as Firebug confirms. Hence, my question is: how to remove one of these HeaderContributor? Since, when my user clicks on one of the links, I want to add a HeaderContributor, but also to remove the old one(s). Regards, Zala On Sun, Sep 13, 2009 at 9:06 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: What about just not adding it instead? So in the first cycle you add it and in the next rendering you do not? 2009/9/13 Pierre Goupil goupilpie...@gmail.com: Good morning, I use CSSPackageResource .getHeaderContribution(style.css) in order to load CSS files into my page. But is there any way to remove the HeaderContributor ? If I just add another one in a subsequent request, the old CSS is still there, which I don't want. Regards, Zala -- Sans amis était le grand maître des mondes, Eprouvait manque, ce pour quoi il créa les esprits, Miroirs bienveillants de sa béatitude. Mais au vrai, il ne trouva aucun égal, Du calice du royaume total des âmes Ecume jusqu'à lui l'infinité. (Schiller, l'amitié) - 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: Update Tree Model on Ajax timer. What's wrong ?
Hi Eric, if Wicket's Swing tree model usage gives you a headache ... advertisement ... you should definitely take a look at http://code.google.com/p/wicket-tree . /advertisement Regards Sven Eric Bouer wrote: Hello. Preface: Wicket Tree is very confusing since it's some kind of hybrid between swing Tree model and wicket tree so please forgive me for any stupid/irrelevant questions. I created a tree with a model based on database schema.I'm trying to refresh the tree so that it will change node names after some DB update. I added AJAX timer to self update the tree , the ajax stuff work but it doesn't even try to update the model. To create my tree I have this on my page: tree = new TreeTable(treeTable, createTreeModel(), columns); tree.getTreeState().setAllowSelectMultiple(true); tree.setOutputMarkupId(true); add(tree); tree.add(new AjaxSelfUpdatingTimerBehavior(Duration.ONE_SECOND) { @Override protected void onPostProcessTarget(AjaxRequestTarget target) { super.onPostProcessTarget(target); VectorObject p = new VectorObject(); //To keep it simple. I'm only trying to update the root. p.add(tree.getModel().getObject().getRoot()); TreeModelEvent event = new TreeModelEvent(tree,p.toArray()); tree.treeNodesChanged(event); }); } Nothing get updates. I tried adding customized TreeModelListener however it doesn't get called at all. Any idea or reference to documentation that explain this? Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Bug with firefox when submitting an ajax form inside a modal window
Short answer: You have to enclose your modal window in a form component, see modal window javadoc. Long answer: The modal window javascript generates an additional form when opening. When your panel is re-rendered, Firefox drops your form from the markup because in HTML it's not allowed to have forms nested in other forms. The required parental form component will force your form component to be rendered as a DIV. My questions: -Could someone explain what this additional form is needed for? -Are there plans to improve this situation in 1.4? Sven Anthony DePalma wrote: To be more specific, I ran into this problem when trying to submit a form from a panel that was rendered inside a modal window, but only if the panel itself was rendered by ajax. In my case, that meant calling somePanel.replaceWith(TestPanel), and having a form inside TestPanel fail. The problem only happens with firefox. I created a TestPanel to demonstrate the problem. To replicate, you can put this panel inside a modal window and click submit twice. import org.apache.wicket.Component; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.form.AjaxButton; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.panel.Panel; /** * TestPanel.java * If this panel is put inside a modal window, it should break firefox on the second submit * */ public class TestPanel extends Panel { // constructor public TestPanel(final String id) { super(id); setOutputMarkupId(true); final Form form = new Form(f); form.add(new AjaxButton(a) { @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { Component c = form.getParent(); TestPanel t = new TestPanel(c.getId()); c.replaceWith(t); target.addComponent(t); } }); add(form); } } TestPanel.html: html xmlns:wicket wicket:panel Will the second submit error in FF form wicket:id=f input type=submit value=submit wicket:id=a/ /form /wicket:panel /html This is what is rendered: FIRST RENDER: Will the second submit error in FF form id=f23b method=post action=?x=Ujs-j6lQXZBnnVo2YVvBrjA7*96Dtg3BoJNwgV1fwVh0oY*DDl4a42-LLtnecFT3hOa*Lt3BY4dxfIrvlVJg6wdiv style=display: none;input name=f23b_hf_0 id=f23b_hf_0 type=hidden/div input value=submit name=a id=a23c onclick=var wcall=wicketSubmitFormById('f23b', '?x=Ujs-j6lQXZBnnVo2YVvBrjA7*96Dtg3BoJNwgV1fwVh0oY*DDl4a435szDVJJj4ocOSp5oPS3lx*cNQSCnt70GRKCdS7TsxjzEE65pPiz3d5hXasbKbCjkAQviGteakozDIGY11GEi4flR8kUeR9Hw', 'a' ,null,null, function() {return Wicket.$$(this)amp;amp;Wicket.$$('f23b')}.bind(this));;; return false; type=submit /form SECOND RENDER: Will the second submit error in FF div style=display: none;input name=f245_hf_0 id=f245_hf_0 type=hidden/div input value=submit name=a id=a246 onclick=var wcall=wicketSubmitFormById('f245', '?x=Ujs-j6lQXZBnnVo2YVvBrjA7*96Dtg3BoJNwgV1fwVh0oY*DDl4a435szDVJJj4ocOSp5oPS3lx*cNQSCnt70GRKCdS7TsxjzEE65pPiz3d5hXasbKbCjkAQviGteakozDIGY11GEi4flR8kUeR9Hw', 'a' ,null,null, function() {return Wicket.$$(this)amp;amp;Wicket.$$('f245')}.bind(this));;; return false; type=submit /div For some reason the form tag seems to drop. Also, I dont think this happened in 1.3. I believe this is the same error someone was describing here: http://www.nabble.com/Wicketstuff-releases--td24931965i20.html#a24960539 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Bug with firefox when submitting an ajax form inside a modal window
Hmm what exactly does that mean? form wicket:id=form div wicket:id=window/div /form - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Update Tree Model on Ajax timer. What's wrong ?
This wicket-tree seems really nice. Well done! Thanks - Wicket makes it really easy to build reusable components. Why isn't it in wicketstuff? It may even replace the headache swing wicket-extension one (in 1.5?)... Well, Sourceforge isn't the only place for projects. IMHO some Wicket components (mainly in extensions) need a major overhaul and new independent projects like wicket-tree can prove how things can be solved differently (better?). I'm just in progress of publishing another Wicket library and after that I'm planning to tackle another headache. If 1.5 shall include a replacement for the current tree components, I'm the first to volunteer with a contribution. Regards Sven - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
[ANN] wicket-dnd project
Hi all, I'm happy to announce wicket-dnd, a generic drag and drop framework for Wicket. The API has not been fully stabilized yet but you are invited to take a first look: http://code.google.com/p/wicket-dnd/ Have fun Sven - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [ANN] wicket-dnd project
Well, google apps isn't what I call a performant hosting ;). 'In reality' (on your own server) dnd operations are as fast as any other AJAX roundtrip. Regards Sven Martin Makundi wrote: BTW, Why is the demo very slow? Is this what it is like in reality? ** Martin 2009/10/3 Ralf Eichinger ralf.eichin...@pixotec.de: Sven Meier wrote: I'm happy to announce wicket-dnd, a generic drag and drop framework for Wicket. http://code.google.com/p/wicket-dnd/ I added it to the Wicket Wiki: http://cwiki.apache.org/confluence/display/WICKET/Related+Projects - 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: Generics and SortableDataProvider
Hi John, I believe the consensus on this list is that you should change your approach: Why don't you just iterate over your domain objects in the first place? They will be loaded anyway to be displayed on your component. So your approach triggers 1+n selects instead of 1 select for all required objects at once. Sven jonny.w...@fiveprime.com wrote: Hi, Working on my first application using 1.4.x and generics and have a question regarding the use of SortableDataProvider. Within my extensions of this class I quite commonly obtain the id of an object within the iterator method and then load the object via a LoadableDetchableModel within the model method. My question is how to implement such an approach using the new generic classes. For example, the generic model method has the signature public IModelT model(T object) but using the id based approach I would pass in a Long and return a model containing my domain model. The signature assumes the method parameter and model returned operate on the same type. Anyone tell me what I'm missing or if my approach is flawed? Thanks, Jonny This email message and any attached files are for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution of this email message is prohibited. If you are not the intended recipient, please inform the sender by reply email and destroy all copies of the original message and your reply. If you are the intended recipient, please be advised that the content of this message is subject to access, review and disclosure by the sender's Email System Administrator - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Generics and SortableDataProvider
Hi Jonny, yes, it works exactly like you described it. Sven jwray wrote: Hi Sven, Thanks for your reply. Since I sent the original question I ended up doing what you suggested and now I'm wondering why I ever used the id projection approach. Habit I guess, formed with previous frameworks. Just to make sure I've got this right, as long as I use a DetachableModel as a return from model method, the domain objects aren't stored in the session even if they are returned from the iterator. Am I correct in this? Jonny svenmeier wrote: Hi John, I believe the consensus on this list is that you should change your approach: Why don't you just iterate over your domain objects in the first place? They will be loaded anyway to be displayed on your component. So your approach triggers 1+n selects instead of 1 select for all required objects at once. Sven - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Tree
Hi, with wicket-tree you can of course use multiple trees on a single page. moving tree nodes around from one tree to another tree. How to you want to move the nodes? You could use selectable nodes which are moved on a button click. Or you add wicket-dnd to the mix and use dragdrop gestures. See the following example (one tree only though): http://wicket-dnd.appspot.com/ Regards Sven ping ping wrote: How to post my question to the forum? I'm new to wicket development and currently working on wicket tree.. Ive previously tried on the checkbox wickettree from http://code.google.com/p/wicket-tree/ But now i would like to work on displaying multiple treeview(with or without) display on a single page for the purpose of moving tree nodes around from one tree to another tree. Was wondering whether the wickettree would be able to perform to that extent of flexibbility. I came across the dojo tree, but not have never tried using it though and not sure whether its applicable. Am looking forward for some suggestions and guidance here for a wicket newbie to get started on dynamic tree nodes manipulation. _ NEW! Get Windows Live FREE. http://www.get.live.com/wl/all - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ListView for only one element. Something wrong.
Hi Nicolas, you can just use a WebMarkupContainer and recreate its children on each request in #onBeforeRender(). But the question is: why do you need to refresh your components at all? It seems you don't use models correctly. Show us some code. Sven Nicolas Melendez wrote: Hi, i want to use a ListView to use the onpopulate method so when the panel refresh i can see the new data.But the listView has always one element and i think it was made for lots of elements. Something is wrong in the way i am thinking. Any suggestion? NM - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ListView for only one element. Something wrong.
Hi Nicolas, use more models: -- class MyPage: private IModelList businessObjects; private MyPanel myPanel; myPanel = new MyPanel(businessObjects); this.add(myPanel); - class MyPanel(final IModelList businessObjects): this.add(new SomeComponent(new AbstractReadOnlyModel() { public Object getObject() { return businessObjects.getObject().get(0); } })); this.add(new ListView(new AbstractReadOnlyModel() { public Object getObject() { return businessObjects.getObject().subList(1, businessObjects.getObject().size()); } }) { ... }); -- HTH Sven Nicolas Melendez schrieb: Hi: Sven, thanks for replying! I've added some code below. -- class MyPage: private List businessObjectList; private MyPanel myPanel; list is populated somehow myPanel = new MyPanel(businessObjectList); this.add(myPanel); ... on some behavior - target.addComponent(myPanel); - class MyPanel(businessObjectList): this.add(SomeComponent(first element of businessObjectList)); this.add(new ListView(businessObjectList wihout first element){ ... }); -- I'm aware that as the panel receives a modelObject and not a model, then when it's refreshed it will show the previous list. So, I was thinking about myPanel receiving a PropertyModel(this, businessObjectList), but the thing is: how can it retrieve the first business object (which needs to be shown differently) in a dynamic way so when the panel is refreshed, it will take it from the new list (I could use another repeater that will loop only once, but I was hoping there's a nicer way). Thanks again, NM On Thu, Oct 8, 2009 at 7:50 PM, Sven Meier s...@meiers.net wrote: Hi Nicolas, you can just use a WebMarkupContainer and recreate its children on each request in #onBeforeRender(). But the question is: why do you need to refresh your components at all? It seems you don't use models correctly. Show us some code. Sven Nicolas Melendez wrote: Hi, i want to use a ListView to use the onpopulate method so when the panel refresh i can see the new data.But the listView has always one element and i think it was made for lots of elements. Something is wrong in the way i am thinking. Any suggestion? NM - 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: [ANN] wicket-dnd project
Hi Doug, you're adding a second drop target to your currentContainer: currentContainer.add(new DropTarget(Operation.COPY) { ... }.dropBottom(div)); But there aren't any DIVs contained inside your currentContainer, so wicket-dnd isn't able to find a drop location. If you just want to support drop operations even if no items are already present, you can do so with a single drop target: currentContainer.add(new DropTarget(Operation.MOVE, Operation.COPY) { @Override public void onDrop(AjaxRequestTarget target, Transfer transfer, Location location) throws Reject { System.out.println((tr) onDrop: + transfer.getOperation()); if (location == null) { // no location supplied - drop on whole container } else { // location supplied - drop on given location, see Location#anchor and Location#component } } }.dropTopAndBottom(tr)); HTH Sven Doug Leeper wrote: Sven, I have downloaded wicket-dnd and have integrated into our project. I had a few issues but got around them. The biggest is that we are using DataView instead of DataTable. While there was no exact example for DataView, I was able to get through and see what I needed to do: - needed a container apply the DataSource - needed to item.setOutputMarkupId( true ) in the populateItem The DropTarget is working (the UI changes when I hover over the target)...but when I initiate a drop, I get a PageExpiredException. Any thoughts? BTW..I have uploaded our simple test case for reference. Thanks - Doug http://www.nabble.com/file/p25859163/DndTestPage.java DndTestPage.java http://www.nabble.com/file/p25859163/DndTestPage.html DndTestPage.html http://www.nabble.com/file/p25859163/WicketApplication.java WicketApplication.java - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [ANN] wicket-dnd project
Well, wicket-dnd combines Wicket's standard AJAX support, prototype's Javascript enhancements and a few custom functions to move HTML elements around. I'm glad you like it. Sven Pierre Goupil wrote: It looks great, men! Which AJAX framework do you use? Regards, Pierre On Tue, Oct 13, 2009 at 3:55 PM, Doug Leeper douglee...@yahoo.com wrote: Thanks Sven! Got it working. -- View this message in context: http://www.nabble.com/-ANN--wicket-dnd-project-tp25727819p25873355.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AW: file download using ajaxLink
I've added an alternative solution with a behavior. Thanks for the original idea. Sven Giambalvo, Christian wrote: Updated http://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com www.twitter.com/excelsis_info Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Mittwoch, 21. Oktober 2009 09:40 An: users@wicket.apache.org Betreff: Re: file download using ajaxLink Maybe this might help http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html Ernesto On Tue, Oct 20, 2009 at 10:12 PM, tubin gen fachh...@gmail.com wrote: I do download in traditional way here is the code public void download(String filename, byte[] filedata){ setRedirect(false); WebResponse response = (WebResponse) getResponse(); response.setAttachmentHeader(filename); response.setLastModifiedTime(Time.now()); response.setContentType(application/octet-stream); response.write( new ByteArrayInputStream(filedata)); response.close(); } item.add(new LinkVoid(download){ { add(new Label(filename, eaAuditProgramAttachment.getFileName())); } @Override public void onClick() { ((BasePage)getPage()).download(eaAuditProgramAttachment.getFileName(), eaAuditProgramAttachment.getEaBlob().getBlobData()); } }); If I replace this link with AjaxLink it will not work and I must use an ajaxlinkplease tell me how can I use ajaxLink for download - 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: AW: file download using ajaxLink
I added my description to the well-known Wiki page: http://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow IMHO the solution with a behavior is simpler. Furthermore huge amounts of data shouldn't be kept in the session but better be generated on the fly. Regards Sven Ernesto Reinaldo Barreiro wrote: Can you share your solution with the rest of us? I can imagine using a behavior for adding the resource listener part... but it will be nice to see what you are doing. Best, Ernesto On Wed, Oct 21, 2009 at 9:12 PM, Sven Meier s...@meiers.net wrote: I've added an alternative solution with a behavior. Thanks for the original idea. Sven Giambalvo, Christian wrote: Updated http://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com www.twitter.com/excelsis_info Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Mittwoch, 21. Oktober 2009 09:40 An: users@wicket.apache.org Betreff: Re: file download using ajaxLink Maybe this might help http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html Ernesto On Tue, Oct 20, 2009 at 10:12 PM, tubin gen fachh...@gmail.com wrote: I do download in traditional way here is the code public void download(String filename, byte[] filedata){ setRedirect(false); WebResponse response = (WebResponse) getResponse(); response.setAttachmentHeader(filename); response.setLastModifiedTime(Time.now()); response.setContentType(application/octet-stream); response.write( new ByteArrayInputStream(filedata)); response.close(); } item.add(new LinkVoid(download){ { add(new Label(filename, eaAuditProgramAttachment.getFileName())); } @Override public void onClick() { ((BasePage)getPage()).download(eaAuditProgramAttachment.getFileName(), eaAuditProgramAttachment.getEaBlob().getBlobData()); } }); If I replace this link with AjaxLink it will not work and I must use an ajaxlinkplease tell me how can I use ajaxLink for download - 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: AW: file download using ajaxLink
Yes, that's better :). IMHO the behavior+resourcestream combination is much simpler: - no additional markup needed, - no state to keep (even if it's only the web resource and not the actual byte array). Do you mind if I tidy up the Wiki page? Sven Ernesto Reinaldo Barreiro wrote: Hi Seven, Thanks for sharing! More neat solution indeed. About caching data on session: is you diff the wiki page, or see the original code at http://code.google.com/p/antilia/source/browse/trunk/com.antilia.ext/src/com/antilia/web/ajaxdownload/MyPdfResource.java you will see nothing was cached on the solution I proposed. That part was introduced later on. Best, Ernesto On Thu, Oct 22, 2009 at 6:58 PM, Sven Meier s...@meiers.net wrote: I added my description to the well-known Wiki page: http://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow IMHO the solution with a behavior is simpler. Furthermore huge amounts of data shouldn't be kept in the session but better be generated on the fly. Regards Sven Ernesto Reinaldo Barreiro wrote: Can you share your solution with the rest of us? I can imagine using a behavior for adding the resource listener part... but it will be nice to see what you are doing. Best, Ernesto On Wed, Oct 21, 2009 at 9:12 PM, Sven Meier s...@meiers.net wrote: I've added an alternative solution with a behavior. Thanks for the original idea. Sven Giambalvo, Christian wrote: Updated http://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com www.twitter.com/excelsis_info Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Mittwoch, 21. Oktober 2009 09:40 An: users@wicket.apache.org Betreff: Re: file download using ajaxLink Maybe this might help http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html Ernesto On Tue, Oct 20, 2009 at 10:12 PM, tubin gen fachh...@gmail.com wrote: I do download in traditional way here is the code public void download(String filename, byte[] filedata){ setRedirect(false); WebResponse response = (WebResponse) getResponse(); response.setAttachmentHeader(filename); response.setLastModifiedTime(Time.now()); response.setContentType(application/octet-stream); response.write( new ByteArrayInputStream(filedata)); response.close(); } item.add(new LinkVoid(download){ { add(new Label(filename, eaAuditProgramAttachment.getFileName())); } @Override public void onClick() { ((BasePage)getPage()).download(eaAuditProgramAttachment.getFileName(), eaAuditProgramAttachment.getEaBlob().getBlobData()); } }); If I replace this link with AjaxLink it will not work and I must use an ajaxlinkplease tell me how can I use ajaxLink for download - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Proposal: Fake implementation of AjaxRequestTarget instead of null
Hi all, IMHO Vladimir has made a reasonable suggestion. I think he meant wasting CPU cycles for constructing your components which will be added to no-op ajaxrequesttarget I don't think he meant a *complete* no-op request target, just the method addComponent() would be a no-op. The fake request target will rerender the complete page as any other standard request would do. BTW why don't we get rid of all those AjaxFallback... components and just let *all* Ajax... components support use of a standard HTML request as fallback? Regards Sven Martin Grigorov wrote: I think he meant wasting CPU cycles for constructing your components which will be added to no-op ajaxrequesttarget then you'll have to make check like if (target instanceOf NullAjaxRequestTarget) {return;} which is not better than before El sáb, 24-10-2009 a las 12:18 +0200, Andreas Petersson escribió: I think it absolutely makes sense (for a future release of wicket). having a NullObject instance of AjaxRequestTarget would not waste a lot of cpu cycles at all, at least not how i use it. the only thing i do with the object is call .addComponent() and then refering a already-initialized variable. how likely is it that the object is in fact null? its 5% of users who have javascript disabled. so this would affect only a small amount of requests. from a jvm perspective calling methods with empty bodys very often is not something expensive. they will get inlined by the hotspot compiler and be effectively free. (i am not 100% sure if this also applys to polymorphism chains.) from a clean-code prespective it is often considered a code smell to have a lot of null checks. in your example providing a FakeDatabaseConnection that throws an UnsrupportedOperationException(you have no database!) is better than seeing a null pointer exception. Sounds weird. Why should my component burn cpu cycles to feed a fake ajax target which does nothing at all? I would prefer some null checks in that case. Would you also provide a FakeDatabaseConnection in case you application does not support databases? :-) Am 24.10.2009 um 07:42 schrieb Vladimir Kovalyuk: I believe all those null-checks of request target can be omited in user code if fallback components would provide fake implementation of AjaxRequestTarget instead of passing null. Does it make sense? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Wizard Functionality (Extensions)
Hi James, but Wicket's implementation seems to only evaluate the condition at step creation and not when I'm changing the state of my radios. see NextButton#isEnabled() and FinishButton#isEnabled(). As far as I can see these method should support your usecase. Implementing ICondition as you did seems right to me. I assume you're notifying changes of the current radio choice to the server via AJAX? Are you adding the whole wizard to the request so the button bar is re-rendered? Sven Corbin, James wrote: I am writing a two step wizard using wicket's wizard implementation and having some issues. I am using Wicket 1.4.1. My first wizard step contains a RadioChoice with 3 options. I would like the Finish Button to be enabled on Wizard Step 1 if either the first or second radio choice is selected. Also, if the first or second radio is selected, then the next button should not be enabled. If the 3rd Radio Choice is selected, then I want the Finish Button to be DISABLED, and the next button to be enabled so the user can go to the final step. My question I'm not sure how to set this up in wicket's wizard implementation. I tried specifying an ICondition on step two, to only make that step available if the selected type is Radio Choice Option 3 from step one, but Wicket's implementation seems to only evaluate the condition at step creation and not when I'm changing the state of my radios - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Wizard Functionality (Extensions)
Hi James, regretfully the standard Wicket dialog doesn't support non-AJAX request - perhaps this restriction applies to the YUI version too? You'll have to ajax-ify the wizard - see Wizard#newButtonBar(). I've done it for our project but I don't have the code available at the moment. Regards Sven Corbin, James wrote: Hi Sven, I'm running the wizard in a modal popup (YUI). One other thing that is happening is when I press the next button in the wizard that should take me to the next step, my dialog closes. I'm not sure what would cause the dialog to dismiss/close in this manner. J.D. -Original Message- From: Sven Meier [mailto:s...@meiers.net] Sent: Saturday, October 24, 2009 8:32 AM To: users@wicket.apache.org Subject: Re: Wicket Wizard Functionality (Extensions) Hi James, but Wicket's implementation seems to only evaluate the condition at step creation and not when I'm changing the state of my radios. see NextButton#isEnabled() and FinishButton#isEnabled(). As far as I can see these method should support your usecase. Implementing ICondition as you did seems right to me. I assume you're notifying changes of the current radio choice to the server via AJAX? Are you adding the whole wizard to the request so the button bar is re-rendered? Sven Corbin, James wrote: I am writing a two step wizard using wicket's wizard implementation and having some issues. I am using Wicket 1.4.1. My first wizard step contains a RadioChoice with 3 options. I would like the Finish Button to be enabled on Wizard Step 1 if either the first or second radio choice is selected. Also, if the first or second radio is selected, then the next button should not be enabled. If the 3rd Radio Choice is selected, then I want the Finish Button to be DISABLED, and the next button to be enabled so the user can go to the final step. My question I'm not sure how to set this up in wicket's wizard implementation. I tried specifying an ICondition on step two, to only make that step available if the selected type is Radio Choice Option 3 from step one, but Wicket's implementation seems to only evaluate the condition at step creation and not when I'm changing the state of my radios - 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: Proposal: Fake implementation of AjaxRequestTarget instead of null
Nothing broken on this side of the fence: onclick(target) { deleteRow(); if (target==null) { // don't bother } else { target.addComponent(table); } } Sven Igor Vaynberg wrote: On Sat, Oct 24, 2009 at 7:18 AM, Sven Meier s...@meiers.net wrote: I don't think he meant a *complete* no-op request target, just the method addComponent() would be a no-op. The fake request target will rerender the complete page as any other standard request would do. this is not possible. all public contracts of the request target have to be properly implemented. eg if a component was added it should be returned by getcomponents(), also any registered listeners have to be notified, etc. i really dont understand the point of this change. if you have a fake ajaxrequesttarget then the code for a fallback is essentially a noop, so your app is broken in fallback. most of the code i have written that utilizes the fallback functionality looks like this: onclick(target) { if (target==null) { setresponsepage(new editpage(...)); } else { setupInp+laceEditPanel(); } } the workflows are divergent. -igor BTW why don't we get rid of all those AjaxFallback... components and just let *all* Ajax... components support use of a standard HTML request as fallback? Regards Sven Martin Grigorov wrote: I think he meant wasting CPU cycles for constructing your components which will be added to no-op ajaxrequesttarget then you'll have to make check like if (target instanceOf NullAjaxRequestTarget) {return;} which is not better than before El sáb, 24-10-2009 a las 12:18 +0200, Andreas Petersson escribió: I think it absolutely makes sense (for a future release of wicket). having a NullObject instance of AjaxRequestTarget would not waste a lot of cpu cycles at all, at least not how i use it. the only thing i do with the object is call .addComponent() and then refering a already-initialized variable. how likely is it that the object is in fact null? its 5% of users who have javascript disabled. so this would affect only a small amount of requests. from a jvm perspective calling methods with empty bodys very often is not something expensive. they will get inlined by the hotspot compiler and be effectively free. (i am not 100% sure if this also applys to polymorphism chains.) from a clean-code prespective it is often considered a code smell to have a lot of null checks. in your example providing a FakeDatabaseConnection that throws an UnsrupportedOperationException(you have no database!) is better than seeing a null pointer exception. Sounds weird. Why should my component burn cpu cycles to feed a fake ajax target which does nothing at all? I would prefer some null checks in that case. Would you also provide a FakeDatabaseConnection in case you application does not support databases? :-) Am 24.10.2009 um 07:42 schrieb Vladimir Kovalyuk: I believe all those null-checks of request target can be omited in user code if fallback components would provide fake implementation of AjaxRequestTarget instead of passing null. Does it make sense? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Wizard Functionality (Extensions)
Yes, you can implement your own button bar which adds AjaxFormSubmitBehavior to the normal wizard buttons. Sven Corbin, James wrote: Thanks for the info Sven. I assume by Ajax-ify you mean to create a new implementation that mirrors WizardButton but extends AjaxButton instead of just Button? Also, our code base is currently on 1.4.1, I noticed 1.4.3 (stable?) is released but the main Apache Wicket Page hasn't been updated? What are your thoughts on upgrading directly to 1.4.3, or should we stick with a 1.4.2 upgrade? J.D. -Original Message- From: Sven Meier [mailto:s...@meiers.net] Sent: Saturday, October 24, 2009 11:35 AM To: users@wicket.apache.org Subject: Re: Wicket Wizard Functionality (Extensions) Hi James, regretfully the standard Wicket dialog doesn't support non-AJAX request - perhaps this restriction applies to the YUI version too? You'll have to ajax-ify the wizard - see Wizard#newButtonBar(). I've done it for our project but I don't have the code available at the moment. Regards Sven Corbin, James wrote: Hi Sven, I'm running the wizard in a modal popup (YUI). One other thing that is happening is when I press the next button in the wizard that should take me to the next step, my dialog closes. I'm not sure what would cause the dialog to dismiss/close in this manner. J.D. -Original Message- From: Sven Meier [mailto:s...@meiers.net] Sent: Saturday, October 24, 2009 8:32 AM To: users@wicket.apache.org Subject: Re: Wicket Wizard Functionality (Extensions) Hi James, but Wicket's implementation seems to only evaluate the condition at step creation and not when I'm changing the state of my radios. see NextButton#isEnabled() and FinishButton#isEnabled(). As far as I can see these method should support your usecase. Implementing ICondition as you did seems right to me. I assume you're notifying changes of the current radio choice to the server via AJAX? Are you adding the whole wizard to the request so the button bar is re-rendered? Sven Corbin, James wrote: I am writing a two step wizard using wicket's wizard implementation and having some issues. I am using Wicket 1.4.1. My first wizard step contains a RadioChoice with 3 options. I would like the Finish Button to be enabled on Wizard Step 1 if either the first or second radio choice is selected. Also, if the first or second radio is selected, then the next button should not be enabled. If the 3rd Radio Choice is selected, then I want the Finish Button to be DISABLED, and the next button to be enabled so the user can go to the final step. My question I'm not sure how to set this up in wicket's wizard implementation. I tried specifying an ICondition on step two, to only make that step available if the selected type is Radio Choice Option 3 from step one, but Wicket's implementation seems to only evaluate the condition at step creation and not when I'm changing the state of my radios - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Proposal: Fake implementation of AjaxRequestTarget instead of null
Hi, thinking more about this 'issue' I realized that in these simple cases one can just use a simple helper method: onclick(target) { AjaxHelper.addComponent(componentToReRenderOnAjaxRequest); } It was already discussed how components could automagically be added for re-rendering on each AjaxRequest. Such a feature would make a lot of calls to AjaxRequestTarget#addComponent() obsolete. Regards Sven Vladimir K wrote: Although it is possible I wouldn't recommend authoring certainly different UI basing on the asynchronisity of the request. For instance I experience inconvinience when mistakely opening Outlook Web Access in Firefox instead of MS IE and seeing a bit different non-ajaxy UI. All the handlers of fallback components in my code perform the same logic for ajax and non-ajax requests. The only difference is that I have to tell Wicket what components are invalidated due to changes in data model. I find it to be a good design style. That sort of information is just a garbage for the current Wicket rendering algorithm but thing could be different in the future if you decided to optimize the re-rendering process. From the other hand I would prefer to just call RequestTarget.isAjax() to distinguish what interface I should present to the user in case when it is reasonable different. Checking whether the object is null is much dangerous and non-self-descriptive. IMHO it is no-no design practice. Since the number of fallback components is pretty small it is not difficult to derive from them some project-local components and wrap event handling in a manner I proposed to guard from NPE. But intention was to improve the Wicket API not only for that particular case. igor.vaynberg wrote: On Sat, Oct 24, 2009 at 7:18 AM, Sven Meier s...@meiers.net wrote: I don't think he meant a *complete* no-op request target, just the method addComponent() would be a no-op. The fake request target will rerender the complete page as any other standard request would do. this is not possible. all public contracts of the request target have to be properly implemented. eg if a component was added it should be returned by getcomponents(), also any registered listeners have to be notified, etc. i really dont understand the point of this change. if you have a fake ajaxrequesttarget then the code for a fallback is essentially a noop, so your app is broken in fallback. most of the code i have written that utilizes the fallback functionality looks like this: onclick(target) { if (target==null) { setresponsepage(new editpage(...)); } else { setupInp+laceEditPanel(); } } the workflows are divergent. -igor BTW why don't we get rid of all those AjaxFallback... components and just let *all* Ajax... components support use of a standard HTML request as fallback? Regards Sven Martin Grigorov wrote: I think he meant wasting CPU cycles for constructing your components which will be added to no-op ajaxrequesttarget then you'll have to make check like if (target instanceOf NullAjaxRequestTarget) {return;} which is not better than before El sáb, 24-10-2009 a las 12:18 +0200, Andreas Petersson escribió: I think it absolutely makes sense (for a future release of wicket). having a NullObject instance of AjaxRequestTarget would not waste a lot of cpu cycles at all, at least not how i use it. the only thing i do with the object is call .addComponent() and then refering a already-initialized variable. how likely is it that the object is in fact null? its 5% of users who have javascript disabled. so this would affect only a small amount of requests. from a jvm perspective calling methods with empty bodys very often is not something expensive. they will get inlined by the hotspot compiler and be effectively free. (i am not 100% sure if this also applys to polymorphism chains.) from a clean-code prespective it is often considered a code smell to have a lot of null checks. in your example providing a FakeDatabaseConnection that throws an UnsrupportedOperationException(you have no database!) is better than seeing a null pointer exception. Sounds weird. Why should my component burn cpu cycles to feed a fake ajax target which does nothing at all? I would prefer some null checks in that case. Would you also provide a FakeDatabaseConnection in case you application does not support databases? :-) Am 24.10.2009 um 07:42 schrieb Vladimir Kovalyuk: I believe all those null-checks of request target can be omited in user code if fallback components would provide fake implementation of AjaxRequestTarget instead of passing null. Does it make sense? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe
Re: Wicket Wizard Functionality (Extensions)
Hi Corbin, sorry, but I have to look that part up tomorrow. Sven Corbin, James wrote: Hi Sven, What exactly am I supposed to implement in the AjaxFormSubmittingBehavior.onSubmit(...)? I've tried everything I can think of and the popup still dismisses(closes) when I press the Next button after completing step 1. J -Original Message- From: Sven Meier [mailto:s...@meiers.net] Sent: Saturday, October 24, 2009 11:35 AM To: users@wicket.apache.org Subject: Re: Wicket Wizard Functionality (Extensions) Hi James, regretfully the standard Wicket dialog doesn't support non-AJAX request - perhaps this restriction applies to the YUI version too? You'll have to ajax-ify the wizard - see Wizard#newButtonBar(). I've done it for our project but I don't have the code available at the moment. Regards Sven Corbin, James wrote: Hi Sven, I'm running the wizard in a modal popup (YUI). One other thing that is happening is when I press the next button in the wizard that should take me to the next step, my dialog closes. I'm not sure what would cause the dialog to dismiss/close in this manner. J.D. -Original Message- From: Sven Meier [mailto:s...@meiers.net] Sent: Saturday, October 24, 2009 8:32 AM To: users@wicket.apache.org Subject: Re: Wicket Wizard Functionality (Extensions) Hi James, but Wicket's implementation seems to only evaluate the condition at step creation and not when I'm changing the state of my radios. see NextButton#isEnabled() and FinishButton#isEnabled(). As far as I can see these method should support your usecase. Implementing ICondition as you did seems right to me. I assume you're notifying changes of the current radio choice to the server via AJAX? Are you adding the whole wizard to the request so the button bar is re-rendered? Sven Corbin, James wrote: I am writing a two step wizard using wicket's wizard implementation and having some issues. I am using Wicket 1.4.1. My first wizard step contains a RadioChoice with 3 options. I would like the Finish Button to be enabled on Wizard Step 1 if either the first or second radio choice is selected. Also, if the first or second radio is selected, then the next button should not be enabled. If the 3rd Radio Choice is selected, then I want the Finish Button to be DISABLED, and the next button to be enabled so the user can go to the final step. My question I'm not sure how to set this up in wicket's wizard implementation. I tried specifying an ICondition on step two, to only make that step available if the selected type is Radio Choice Option 3 from step one, but Wicket's implementation seems to only evaluate the condition at step creation and not when I'm changing the state of my radios - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [ANN] wicket-dnd project
Hi Alex, I'm not sure I understand your question: wicket-tree is an alternative to the tree classes in wicket-core and wicket-extensions. DefaultNestedTree gives you almost the same functionality as LabelTree. Regards Sven nestrmu wrote: Hi, Sven I'm trying to use you wonderfull wicket-dnd, but i met with the problem - how can i use it with a regular wicket tree like a LabelTree, for example. Is it possible? Alex svenmeier wrote: Hi all, I'm happy to announce wicket-dnd, a generic drag and drop framework for Wicket. The API has not been fully stabilized yet but you are invited to take a first look: http://code.google.com/p/wicket-dnd/ Have fun Sven - 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: 508 accessibility support
Hi, at a short glance (http://www.webaim.org/standards/508/checklist) I didn't find anything inherent in Wicket violating this standard. Of course you will have to provide most of the required markup by yourself (how should Wicket know values for alt attributes?). Nevertheless if you're able to identify something valuable to be added to Wicket's components, we're all ears. Regards Sven Jeremy Thomerson wrote: Override their HTML or make your own components. Simple. Done. -- Jeremy Thomerson http://www.wickettraining.com On Fri, Oct 30, 2009 at 9:06 AM, fachhoch fachh...@gmail.com wrote: some of the html is generated by wicket like AjaxFallbackDataTable , pagination , AjaxTabs , DatePicker etc if these components have provision to make them 508 that will be really helpful. kinabalu wrote: Wicket uses HTML as its template markup. So as long as you code your HTML properly, and it is 508 compliant, you're in the clear. Wicket doesn't present any roadblocks to 508 compliance. On Oct 29, 2009, at 9:04 PM, tubin gen wrote: Will wicket ever provide support for 508 accessibility in current or any of the future releases ? here is 508 accessibility (http://www.section508.gov/) To our success! Mystic Coders, LLC | Code Magic | www.mysticcoders.com ANDREW LOMBARDI | and...@mysticcoders.com 2321 E 4th St. Ste C-128, Santa Ana CA 92705 ofc: 714-816-4488 fax: 714-782-6024 cell: 714-697-8046 linked-in: http://www.linkedin.com/in/andrewlombardi twitter: http://www.twitter.com/kinabalu Eco-Tip: Printing e-mails is usually a waste. This message is for the named person's use only. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. -- View this message in context: http://old.nabble.com/508-accessibility-support-tp26119812p26130678.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Custom model for lists
Hi Steffen, use an IConverter on your textfield. Sven Steffen Dienst wrote: Hi, I need a model to represent a list of integers. I'd like to represent this list as a comma separated string in a text field. Is there any model I can use as a foundation? Where can I learn about implementing this (converting list to comma separated string and back)? Thanks in advance, Steffen - 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: CompoundPropertyModel in conjunction with RadioChoiceChoiceRenderers
Hi Xavier, I suppose this error comes from having a ModelObject of type String and also having a ChoiceRenderer refering to 'id' property your choice is working on SimpleElementDTOs while your Person class has a String property - this cannot work. Ideally you would just set a Department instance into your Person objects, but what you're trying to do can only be accomplished with a custom model. Sven Xavier López wrote: Hi, I have a question regarding the use of RadioChoice and ChoiceRenderer's in conjunction with CompoundPropertyModel. I'm new to Wicket (but already a convinced user ;) ), so maybe my approach on this one is not at all as it should be... Any comments are welcome ! I'll get into details. Let's say I have a class in my domain model named Person. This entity has a property named 'deptId' of type String. The Person entity is the backing for a CompundPropertyModel applied to the whole form. The 'deptId' field is inputted by the user, let's say, by means of a RadioChoice (I guess it makes no difference from a DropDownChoice taking into account the point of the question). The choice list for the RadioChoice component is a List made up of DTO objects with properties id and description. To ensure proper rendering of labels, I use a suitable ChoiceRenderer. Now, problems come when the 'deptId' property has a value in the Person entity used in the CompoundPropertyModel. I get an error saying that class String does not have any property called 'id' (I suppose this error comes from having a ModelObject of type String and also having a ChoiceRenderer refering to 'id' property). I'll provide some sample code: markup - ... form wicket:id=form ... span valign=top wicket:id=deptId/span ... /form ... Java - ... ListSimpleElementDTO choices = contextData.getChoices(); Person p = new Person(...); Form f = new Form(form){...}; f.setModel(new CompoundPropertyModel(p)); ChoiceRenderer cr = new ChoiceRenderer(deptId, choices, new ChoiceRenderer(id, description)); f.add(cr); ... I suppose the 'normal' way of doing things would be providing a custom Model to 'cr', but I'd like to know if there is a possibility to achieve this point still using CompoundPropertyModel... The stack trace I get is the following: WicketMessage: No get method defined for class: class java.lang.String expression: id Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class java.lang.String expression: id at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) at org.apache.wicket.markup.html.form.ChoiceRenderer.getIdValue(ChoiceRenderer.java:140) at org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:144) at org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:797) at org.apache.wicket.markup.html.form.RadioChoice.onComponentTagBody(RadioChoice.java:407) at org.apache.wicket.Component.renderComponent(Component.java:2480) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411) at org.apache.wicket.Component.render(Component.java:2317) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1297) ... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: CompoundPropertyModel in conjunction with RadioChoiceChoiceRenderers
Hi Pedro, with your condition inside the renderer you've beaten me by originality ;). But I doubt that the choice will be able to store the selected DTO in the entity's String property. Sven Pedro Santos wrote: Hi Sven, he stell can write some specialized render... but I think the best way is you have your depid property of type Department. Than all this thread would not have started :) class YourCustomRender { @Override public String getIdValue(Object object, int index) { if (object instanceof DTO) { return ((DTO)object).getDeptId() } else { return (String)object;//already is the depid string } } @Override public Object getDisplayValue(Object object) { if (object instanceof DTO) { return ((DTO)object).getDescription(); } else { return contextData.getDTOBasedOnDepid(object); } } } On Wed, Nov 4, 2009 at 1:29 PM, Xavier López xavil...@gmail.com wrote: Hi, I have a question regarding the use of RadioChoice and ChoiceRenderer's in conjunction with CompoundPropertyModel. I'm new to Wicket (but already a convinced user ;) ), so maybe my approach on this one is not at all as it should be... Any comments are welcome ! I'll get into details. Let's say I have a class in my domain model named Person. This entity has a property named 'deptId' of type String. The Person entity is the backing for a CompundPropertyModel applied to the whole form. The 'deptId' field is inputted by the user, let's say, by means of a RadioChoice (I guess it makes no difference from a DropDownChoice taking into account the point of the question). The choice list for the RadioChoice component is a List made up of DTO objects with properties id and description. To ensure proper rendering of labels, I use a suitable ChoiceRenderer. Now, problems come when the 'deptId' property has a value in the Person entity used in the CompoundPropertyModel. I get an error saying that class String does not have any property called 'id' (I suppose this error comes from having a ModelObject of type String and also having a ChoiceRenderer refering to 'id' property). I'll provide some sample code: markup - ... form wicket:id=form ... span valign=top wicket:id=deptId/span ... /form ... Java - ... ListSimpleElementDTO choices = contextData.getChoices(); Person p = new Person(...); Form f = new Form(form){...}; f.setModel(new CompoundPropertyModel(p)); ChoiceRenderer cr = new ChoiceRenderer(deptId, choices, new ChoiceRenderer(id, description)); f.add(cr); ... I suppose the 'normal' way of doing things would be providing a custom Model to 'cr', but I'd like to know if there is a possibility to achieve this point still using CompoundPropertyModel... The stack trace I get is the following: WicketMessage: No get method defined for class: class java.lang.String expression: id Root cause: org.apache.wicket.WicketRuntimeException: No get method defined for class: class java.lang.String expression: id at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:440) at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:282) at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91) at org.apache.wicket.markup.html.form.ChoiceRenderer.getIdValue(ChoiceRenderer.java:140) at org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:144) at org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:797) at org.apache.wicket.markup.html.form.RadioChoice.onComponentTagBody(RadioChoice.java:407) at org.apache.wicket.Component.renderComponent(Component.java:2480) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411) at org.apache.wicket.Component.render(Component.java:2317) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1297) ... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: correct way to call necessary javascript initialization when a component is added via ajax
Right? Wrong, see explanation below. Sven mbrictson wrote: Actually wicket-ajax.js is smart enough to fire these dom ready events after an ajax request. Of course, a jQuery $(document).ready() will not fire; neither will the ready events of other various JS libraries. However if you specifically use Wicket's dom ready event (i.e. renderOnDomReadyJavascript() as in the Java example below, or manually in JavaScript using Wicket.Event.addDomReadyEvent()), then the event will fire after the ajax call. jthomerson wrote: Won't work on an ajax request because the dom ready event isn't fired. Right? -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 11, 2009 at 2:23 AM, svenmeier s...@meiers.net wrote: Why so complicated? @Override public void renderHead(IHeaderResponse response) { response.renderOnDomReadyJavascript(init_slider_js()); } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxFallBackLink updating a listview in a listview (blog entry)
I'm afraid forcing the reader to enter credentials isn't going to increase your comment count. Nevertheless here are some suggestions: A) Use PropertyListView and you won't have to twiddle with the item's model. B) IMHO passing the container into EditableQuestionPanel isn't a good idea - why should it know anything about its parent? Instead I'd add a hook method into EditableQuestionPanel so that it can notify about changes. The containing QuestionEditPanel can then do whatever it needs to update itself on an Ajax request. C) Why is QuestionNavigationPanel concerned with the model object of one of its ancestors? QuestionEditPanel should use a LoadableDetachableModel to always work on up-to-date data. When notified of changes (see hook method above) it can detach its model explicitly so the data is fetched again from your QuestionProcessor. Hope this helps Sven pieter claassen wrote: Hi Guys, Here is a blog entry on how I update listviews in listviews with Ajax. http://skeptical-inquirer.blogspot.com/2009/11/updating-listview-in-listview-with-ajax.html I would appreciate any comments to help me improve this pattern. Cheers, Pieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Listview clears all the data in the textfileds after adding new element in the List
Hi, if you're using a Link, the browser won't send the edited values back to your application. Use a SubmitLink instead. Sven ayman elwany wrote: Hi All , I'm new to Apache Wicket , I started working with it from 2 weeks and I'm really enjoying it .but I have a little problem that I don't know what is the problem with it . I have a Listview contains three text fields as a table data raw with a Link which onClick adds a raw to the List view ,and everything works fine except that the text fields gets cleared whenever I Press the add Link and a new raw added . here is my Html Mark up *HTML:* tr wicket:id=employersList tdinput type=text wicket:id=companyName //td tdinput type=text wicket:id=startDate //td tdinput type=text wicket:id=endDate //td /tr tr tda wicket:id=add href=#add/a/td /tr *J**ava code:* *public class CarPage extends WebPage {* * .. * * ...* * ** *private ListEmployer employerList =new ArrayListEmployer(); public CarPage() { ** ** ListView employersListView=getEmployersListView(); add(employersListView); Link addLink=new Link(add) {...@override public void onClick() { // TODO Auto-generated method stub employerList.add(new Employer()); } }; add(addLink); } private ListView getEmployersListView() { // TODO Auto-generated method stub ListView employersListView=new ListView(employersList,employerList) { @Override protected void populateItem(ListItem item) { // TODO Auto-generated method stub Employer employer=(Employer)item.getModelObject(); item.add(new TextFieldString(companyName,new PropertyModelString(employer, companyName))); item.add(new DateTextField(startDate, new PropertyModelDate(employer, startDate), new StyleDateConverter( S-, true)).add(new DatePicker())); item.add(new DateTextField(endDate, new PropertyModelDate(employer, endDate), new StyleDateConverter( S-, true)).add(new DatePicker())); } }; return employersListView; } * ...* *...* } class Employer implements Serializable{ String companyName; Date startDate, endDate; //Setters and getters } Thanks in advnce ... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Converter for AjaxEditableMultiLineLabel
AjaxEditableMultiLineLabel doesn't use its converter for the wrapped editor as AjaxEditableLabel does - see #newEditor(). You should create a RFE in JIRA. Sven Alec Swan wrote: I am using to allow the user to enter a Velocity template in the editor and then preview the bound template content in the label. I created a TemplateConverter class and overrode AjaxEditableMultiLineLabel#getConverter() method to return an instance of TemplateConverter. However, the AjaxEditableMultiLineLabel#getConverter() is never called. What am I doing wring and what is the recommended way to do this? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Why feedback panel won't work
Hi, feedback messages are tied to components they are reported for (the link in your case). Since this component isn't located on your response page, the message will not be rendered. Use Session#info() instead. Regards Sven uud ashr wrote: Hi all, Why does wicket panel don't work if I do this: class MyPage extends WebPage { public MyPage() { add(new LinkVoid(myLink) { public void onClick() { * info(You just click me);* *setResponsePage(MyAnotherPage.class); // feedback panel won't work* } }); } } class MyAnotherPage extends WebPage { public MyAnotherPage() { add(new FeedbackPanel(feedback)); } } Won't work using: setResponsePage(MyAnotherPage.class); But fine when use constructor: setResponsePage(new MyAnotherPage()); Is this a bug or not a bug? Regards, uudashr - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Why feedback panel won't work
Should be the same. Sven Pieter Degraeuwe wrote: I was thinking this as well, but the message should in that case also NOT appear when you do setResponsePage(new MyAnotherPage()), no ? On Mon, Dec 28, 2009 at 9:39 AM, Sven Meier s...@meiers.net wrote: Hi, feedback messages are tied to components they are reported for (the link in your case). Since this component isn't located on your response page, the message will not be rendered. Use Session#info() instead. Regards Sven uud ashr wrote: Hi all, Why does wicket panel don't work if I do this: class MyPage extends WebPage { public MyPage() { add(new LinkVoid(myLink) { public void onClick() { * info(You just click me);* *setResponsePage(MyAnotherPage.class); // feedback panel won't work* } }); } } class MyAnotherPage extends WebPage { public MyAnotherPage() { add(new FeedbackPanel(feedback)); } } Won't work using: setResponsePage(MyAnotherPage.class); But fine when use constructor: setResponsePage(new MyAnotherPage()); Is this a bug or not a bug? Regards, uudashr - 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: how to iterate over checkboxes?
Take a look on wicket-phonebook - it features a checkbox column for selection of rows. Sven HB wrote: I think you got me wrong. There is a check box at the end of each row of AjaxFallbackDefaultDataTable. Upon click a button, I want to iterate over the checkboxes and collects the objects associated with them. - 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: Panel and Model inside of a wizard
Hi Jeffrey, new CompoundPropertyModel(model.getObject().getEstimate()) this doesn't look good, does the estimate object change its values or is it replaced by another object after an AJAX request? Sven Jeffrey Schneller wrote: I am trying to figure out why a panel in a step of my wizard is not showing the correct data after an Ajax call. The step contains a re-usable panel (TotalPanel) for displaying information from the wizard that is backing the model.The problem is the values in the TotalPanel never reflect the values that have been updated via the Ajax call. I know everything should work because if I change the TotalPanel to take the entire model then everything works. The problem being, I only want my TotalPanel to need to take an Estimate and not the CheckoutModel. At the wizard level I have: CheckoutModel bean = new CheckoutModel(); CompoundPropertyModelCheckoutModel myModel = new CompoundPropertyModelCheckoutModel(bean); setDefaultModel(myModel); On the step of the wizard that I want to display my re-usable panel I have: final TotalPanel totalPanel = new TotalPanel(total_panel, new CompoundPropertyModel(model.getObject().getEstimate())); totalPanel.setOutputMarkupId(true); add(totalPanel); btw... Estimate is a property of the CheckoutModel. Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Panel and Model inside of a wizard
If you call #getEstimate() you pull the value once out of your object and never again. With PropertyModel(model, estimate) you'll always get a fresh value from your model. Calling a getter should *always* be done as late as possible. Hope this helps Sven Jeffrey Schneller wrote: It does change its values. I have since changed it to: final TotalPanel totalPanel = new TotalPanel(total_panel, new CompoundPropertyModel(new PropertyModel(model, estimate))); this seems to work. I guess I had the chaining of models wrong. Am I right, or is still off base? -Original Message- From: Sven Meier [mailto:s...@meiers.net] Sent: Tuesday, January 19, 2010 3:11 PM To: users@wicket.apache.org Subject: Re: Panel and Model inside of a wizard Hi Jeffrey, new CompoundPropertyModel(model.getObject().getEstimate()) this doesn't look good, does the estimate object change its values or is it replaced by another object after an AJAX request? Sven Jeffrey Schneller wrote: I am trying to figure out why a panel in a step of my wizard is not showing the correct data after an Ajax call. The step contains a re-usable panel (TotalPanel) for displaying information from the wizard that is backing the model.The problem is the values in the TotalPanel never reflect the values that have been updated via the Ajax call. I know everything should work because if I change the TotalPanel to take the entire model then everything works. The problem being, I only want my TotalPanel to need to take an Estimate and not the CheckoutModel. At the wizard level I have: CheckoutModel bean = new CheckoutModel(); CompoundPropertyModelCheckoutModel myModel = new CompoundPropertyModelCheckoutModel(bean); setDefaultModel(myModel); On the step of the wizard that I want to display my re-usable panel I have: final TotalPanel totalPanel = new TotalPanel(total_panel, new CompoundPropertyModel(model.getObject().getEstimate())); totalPanel.setOutputMarkupId(true); add(totalPanel); btw... Estimate is a property of the CheckoutModel. Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: The Field 'emailInput' is required
FormComponent#setLabel() ? Sven Whats'Up wrote: Sorry, I think I wrote not enough, to tell you the problem. With the code test.emailInput.Required=The Email address is required: I have to write for every field the same code, but the wicket code is ok, and I thought it is perhaps possible only to change the field name. Normally I get the error code: Field 'emailInput' is required. I only want to change the field-name and not the completely error-code. The standart wicket-error code ist ok, and I only want to change the field name, because I have very much fields. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Using SimpleAttributeModifier
target.addComponent(addLink) ?? BTW you could override isVisible() and getOutputMarkupPlaceholderTag() instead of the attribute modifier. Sven Anna Simbirtsev wrote: Hi, I am trying to use SimpleAttributeModifier to make an ADD MORE link invisible once the maximum number of text fields that it adds have been reached. But I can not get it to render the link component. My code: addLink = new AjaxSubmitLink(addRow, form) { private static final long serialVersionUID = 8103461308100688184L; @Override public void onSubmit(AjaxRequestTarget target, Form? form) { if (tech_count max_tech_contacts) { lv.getModelObject().add(new String()); if (target != null) { target.addComponent( techPanel); tech_count++; } if (tech_count = max_tech_contacts) addLink.add(new SimpleAttributeModifier( style, display:none)); } } }; addLink.setDefaultFormProcessing(false); form.add(addLink); I am guessing it adds style=display:none to the addLink, but does not render it again, so the link is still visible. Thanks, Anna - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: dynamically adding components to a ListView
Hi, you'll have to tell the request target which components to redraw: Put your list inside a markupcontainer and use addComponent(). Sven zdmytriv wrote: Could anyone tell me why it doesn't work? Thanks InteractivePanelPage.html table tr td # Add Panel /td /tr tr wicket:id=interactiveListView td /td /tr /table InteractivePanelPage.java // ... imports public class InteractivePanelPage extends WebPage { public LinkedListInteractivePanel interactivePanels = new LinkedListInteractivePanel(); private ListViewInteractivePanel interactiveList; public InteractivePanelPage() { add(new AjaxLinkString(addPanelLink) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { try { System.out.println(link clicked); InteractivePanel newInteractivePanel = new InteractivePanel( interactiveItemPanel); newInteractivePanel.setOutputMarkupId(true); interactiveList.getModelObject().add(newInteractivePanel); } catch (Exception e) { e.printStackTrace(); } } }); interactivePanels.add(new InteractivePanel(interactiveItemPanel)); interactiveList = new ListViewInteractivePanel(interactiveListView, new PropertyModelListInteractivePanel(this, interactivePanels)) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItemInteractivePanel item) { item.add(item.getModelObject()); } }; interactiveList.setOutputMarkupId(true); add(interactiveList); } public ListInteractivePanel getInteractivePanels() { return interactivePanels; } } InteractivePanel.html html xmlns:wicket wicket:panel input type=button value=BLAAA wicket:id=simpleButton/ /wicket:panel /html InteractivePanel.java // ... imports public class InteractivePanel extends Panel { private static final long serialVersionUID = 1L; public InteractivePanel(String id) { super(id); add(new Button(simpleButton)); } } zkn wrote: On 22.01.2010, at 03:18, vasil.pup...@gmail.com wrote: http://old.nabble.com/dynamically-adding-components-to-a-ListView-td26626657.html In this post you said You found it. Could you please post how did you do it? Zinovii in addPanel() replaced panels.add(panel); with panels.getModelObject().add(panel); On 04.12.2009, at 00:17, zkn wrote: found it. On 03.12.2009, at 16:19, zkn wrote: Hi, I'm trying to dynamically add components to an existing ListView but I can't figure out how to do that. Here is my case: MyPanelContainer class with markup wicket:panel wicket:container wicket:id=panels wicket:container wicket:id=panel / /wicket:container # add panel /wicket:panel and here is how I create the container in the constructor of my page .. MyPanelContainer container = new MyPanelContainer(panels_list_1); ListMyPanel panels = new ArrayListMyPanel(); for (int j = 0; j 5; j++) { MyPanel panel = new MyPanel(panel); . panels.add(panel); . container.add(new ListViewMyPanel(panels, panels) { protected void populateItem(ListItemMyPanel item) { item.add( item.getModelObject()); } }); add(Container); .. This works fine and I can see all MyPanel inside the container. Now I'm trying to add another MyPanel inside the container on user click. Here is the constructor of MyPanelContainer public MyPanelContainer(String id) { super(id); add(new Link(addPanel) { @Override public void onClick() { addPanel(); } }); . .. public void addPanel() { ListView MyPanel panels = (ListView MyPanel ) get(panels); MyPanel panel = new MyPanel(panel); ... panels.add(panel); } Basically addPanel() does the same thing as in page constructor to add panels to the list but nothing shows up. Thanks in advance for your help Ozkan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Avoiding 'WicketMessage: Unable to find component with id' error
You should add the listView right away and keep it invisible until a search result is available. Sven On Mi, 2009-05-06 at 10:07 -0500, Vasu Srinivasan wrote: Im a wicket newbie .. I have a Search Page with some search criteria inputs and below it, the list of data based on search. The first time the page is hit, the listView component is not still present, because Im adding that only onSubmit() -- like this: class XPage extends WebPage { class XForm extends Form { ... @Override public void onSubmit() { List resultList = searchDao.search(searchOptions); add(new ListView (listView, resultList ) { }); } } The html is straightforward.. form ... /form div id=resultArea table tr wicket:id=listView ... /tr /table /div Even at first hit of the page, wicket shows up the message Unable to find component with id listView .. Is there a way to make Wicket not worry about unfound components or is there any other standard way of handling it ? Appreciate any help... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
[ANN] wicket-tree project
Hi all, i would like to announce wicket-tree, a new project hosting a clean slate development of tree components for Wicket. The API has not been fully stabilized yet but you are invited to take a first look: http://code.google.com/p/wicket-tree/ Have fun Sven - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [ANN] wicket-tree project
Hi, the project contains an example application: mvn jetty:run ... should get you going. The usual Jetty start class is contained too. So do a mvn eclipse:eclipse ... and you're able to play with it in Eclipse. Regards Sven On Sa, 2009-07-25 at 22:29 +0300, Martin Makundi wrote: Any live examples, would be nice? ** Martin 2009/7/25 Sven Meier s...@meiers.net: Hi all, i would like to announce wicket-tree, a new project hosting a clean slate development of tree components for Wicket. The API has not been fully stabilized yet but you are invited to take a first look: http://code.google.com/p/wicket-tree/ Have fun Sven - 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: [ANN] wicket-tree project
Hi Peter, // at the chekcedfoldercontent (nested tree) example if I check the parent, then the kids won't be checked in, is this for purpose? no purpose here, it's just an example and has nothing to do with the tree code. Is there any chance, that a tree would come, which nodes are links (maybe folders could disable this function) and the opening of the nodes is via ajax, but the links would be normal bookmarkablepagelinks This is just a matter of tree usage, create you custom content and do what ever you want. See the new example: http://code.google.com/p/wicket-tree/source/browse/trunk/wicket-tree/src/main/java/wickettree/examples/content/BookmarkableFolderContent.java Hope this helps Sven , so in the markup wouldn't be only #'s? :) (as you can see: http://www.wicket-library.com/wicket-examples/ajax/tree/simple.3 when you open the folders, the nodes gonna be links to simple.3# , so instead of simple.3# i'm wanna a normal link) Great work anyway Regards, Peter 2009-07-25 21:29 keltezéssel, Martin Makundi írta: Any live examples, would be nice? ** Martin 2009/7/25 Sven Meiers...@meiers.net: Hi all, i would like to announce wicket-tree, a new project hosting a clean slate development of tree components for Wicket. The API has not been fully stabilized yet but you are invited to take a first look: http://code.google.com/p/wicket-tree/ Have fun Sven - 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: [ANN] wicket-tree project
Sure, wicket-tree is still in its conception phase. I'll tidy up the project structure soon. Sven On Sa, 2009-07-25 at 18:57 -0400, James Carman wrote: So is the project a war (since it runs with jetty:run)? Wouldn't that make it hard to use in other projects? On Jul 25, 2009 6:18 PM, Major Péter majorpe...@sch.bme.hu wrote: Cool, that was exactly, what I was looking for. Thanks. Peter 2009-07-26 00:06 keltezéssel, Sven Meier írta: Hi Peter, // at the chekcedfoldercontent (nested tree) example if I check the parent, t... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [ANN] wicket-tree project
Hi, I've added single selection to the example. I'm not sure how sorting and filtering applies to hierarchical data though. API will be finalized after sufficient feedback from the Wicket community - so keep on firing questions ;). Sven On So, 2009-07-26 at 01:51 -0700, Vladimir K wrote: Nested tree and tree table seems promicing. What I missed in your example is single-selection mode, and sortable headers with filters. One of my the upcoming tasks is to build a selector component that knows whether the object is hierarchical and puts inside a datatable with navigator or treetable. Since wicket-extentions project has completely incompatible components in this regard my component that unifies both looks pretty complex to do. Your treetable components seems to be more close to datable so it definitely might come in handy. When are you going to finalize the component contract (api)? svenmeier wrote: Sure, wicket-tree is still in its conception phase. I'll tidy up the project structure soon. Sven On Sa, 2009-07-25 at 18:57 -0400, James Carman wrote: So is the project a war (since it runs with jetty:run)? Wouldn't that make it hard to use in other projects? On Jul 25, 2009 6:18 PM, Major Péter majorpe...@sch.bme.hu wrote: Cool, that was exactly, what I was looking for. Thanks. Peter 2009-07-26 00:06 keltezéssel, Sven Meier írta: Hi Peter, // at the chekcedfoldercontent (nested tree) example if I check the parent, t... - 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: [ANN] wicket-tree project
Hi, ITreeProvider and IDataProvider are not exactly compatible, I don't think we gain anything by extending the former from the latter. Selection is not part of the tree components. There are just to many different notions of selection: - single/multiple selection - subtree selection - continuous/discontinuous selection - several selections on a single tree (see example with checkable *and* selectable content) - no selection at all - ... IMHO it's better to leave these requirements out of a tree implementation. If you need a selected class attribute on a TableTree, override #newRowItem() and do it yourself. Ever noticed that DataTable has no notion of selection too? Regards Sven On So, 2009-07-26 at 02:13 -0700, Vladimir K wrote: Why you don't extend ITreeProvider from IDataProvider? They looks compatible for now. I can add IDataProvider to my implementation class and delegate roots() to iterator(). From the other hand it is just extra method. One thing to mention. There should be full row select option. You just need to add a selected class attribute for selected TDs. Vladimir K wrote: Nested tree and tree table seems promicing. What I missed in your example is single-selection mode, and sortable headers with filters. One of my the upcoming tasks is to build a selector component that knows whether the object is hierarchical and puts inside a datatable with navigator or treetable. Since wicket-extentions project has completely incompatible components in this regard my component that unifies both looks pretty complex to do. Your treetable components seems to be more close to datable so it definitely might come in handy. When are you going to finalize the component contract (api)? svenmeier wrote: Sure, wicket-tree is still in its conception phase. I'll tidy up the project structure soon. Sven On Sa, 2009-07-25 at 18:57 -0400, James Carman wrote: So is the project a war (since it runs with jetty:run)? Wouldn't that make it hard to use in other projects? On Jul 25, 2009 6:18 PM, Major Péter majorpe...@sch.bme.hu wrote: Cool, that was exactly, what I was looking for. Thanks. Peter 2009-07-26 00:06 keltezéssel, Sven Meier írta: Hi Peter, // at the chekcedfoldercontent (nested tree) example if I check the parent, t... - 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: [ANN] wicket-tree project
ITreeProvider and IDataProvider are not exactly compatible, I don't think we gain anything by extending the former from the latter. I don't insist. But you do have IDataProvider wrapper over ITreeProvider in TableTree.java :) Yes, indeed ;). I din't find API to control expanded state of node. Say I would like to add a button to collapse all nodes, or I would like to save expanded state and restore when the user returns back to this page again. AbstractTree offers expand(), collapse() and getState(). All expanded nodes are put in the tree's model. You may implement this model as you like (e.g. store ids) but ProviderSubset is a default implementation which offers detachment out-of-the-box. Please explain how I should operate with the state of tree (what nodes are expanded and what nodes are selected). Once I realize I will be able to override newRowItem properly. The tree implementation does not know anything about selection, this is not part of a tree's state. If you need it, implement it by yourself - please see the examples. You can expand/collect nodes with the corresponding methods in AbstracTree and benefit from an AJAX update automatically (only the relevant branch for NestedTree or the complete Tree for TableTree). Or you control the expand state directly in the tree's model - in case of an AJAX request you have to add the tree for rendering by yourself though. Regards Sven - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [ANN] wicket-tree project
Hi, *Nested*Tree... *Table*Tree... I hope this makes sense ;). I will align the markup for TableTree with the markup of DataTable, thanks for the hint. Sven On So, 2009-07-26 at 16:29 -0700, Vladimir K wrote: Sven, i added TableTree (why not TreeTable?) to my panel and added a button to switch between tree and table representation. The problem is that DataTable relies on the user that binds it to the table tag at the time when your TableTree contains table within. It is not a big deal just an unconvinience. I have 12 lines of code and 5 lines of markup instead of single addOrReplace call. Hmm ... from the other hand I see a showstopper - I can't add my attributes and styles to TableTree because it is hidden inside. That's a big problem. Please consider removing table tags from TableTree markup. You can make sure that the user provided correct tag in onComponentTag method. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Label i18n in 1.4 final
Shouldn't that be: sidebar.header.header = Sidebar Header! ?? Sven On Di, 2009-08-04 at 16:53 +0200, Robin Sander wrote: sidebar.header = Sidebar Header! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket example Simple tree
Sure, see LinkTree and #setLinkType(). Sven * *fachhoch wrote: I mean links to show popups, like modal window , or file download etc ? fachhoch wrote: is it possible to put Ajaxlinks in tree nodes ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket example Simple tree
This code from the example is just building the tree model - no place for Wicket components yet. Creating an AjaxLink comes later, when the tree nodes are represented by Wicket components - see AbstractTree#newLinkComponent(). Sven fachhoch wrote: here the code from wicket examples private void add(DefaultMutableTreeNode parent, List sub) { for (Iterator i = sub.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof List) { DefaultMutableTreeNode child = new DefaultMutableTreeNode(new ModelBean( subtree...)); parent.add(child); add(child, (List)o); } else { DefaultMutableTreeNode child = new DefaultMutableTreeNode(new ModelBean( o.toString())); parent.add(child); } } } in else block I want to add a ajaxLink , and any link needs an id so in this case what id can I give ? svenmeier wrote: Sure, see LinkTree and #setLinkType(). Sven * *fachhoch wrote: I mean links to show popups, like modal window , or file download etc ? fachhoch wrote: is it possible to put Ajaxlinks in tree nodes ? - 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: Model Values Not Updating on Form Submit
Hi Matthew, use a Check instead of a Checkbox. Sven Matthew Arck wrote: Hey all, Go easy on me here as I'm not only brand new to wicket but this is also my first email to this user group! I've inherited a project from a co-worker who has left the company and a request has been put into to ask new users to specify their race and ethnicity when they register on our web site. After doing a good deal of reading and experimenting I have the questions displaying properly and the form submits with no exceptions. The problem I have is that my user model doesn't get updated with any of the race or ethnicity selections. Race and ethnicity are essentially handled the same way so to keep things short I'll just post what I'm doing for the possible race selections. Here's my markup: div class=vertical-form-field label span wicket:id=selectOneOrMoreRacesSelect one or more races to indicate what you consider yourself to be./span br / span class=field wicket:id=races span wicket:id=raceGroup input wicket:id=value type=checkbox / span wicket:id=racDesc style=font-weight:normal;Race Text/span br / /span /span /div Here's my markup the code I have for setting up the relevant parts of the form: public NewAccountForm(final String id, CompoundPropertyModel userModel) { super(id, userModel); /* * Set up a bunch of fields and validations */ // ADD RACE QUESTION String raceQuestion = fhDAO.getRaceQuestion(); Label selectOneOrMoreRacesLabel = new Label(selectOneOrMoreRaces, new Model(raceQuestion)); add(selectOneOrMoreRacesLabel); CheckGroup racesCheckGroup = new CheckGroupRaceAnswer(races); add(racesCheckGroup); ListView races = new ListView(raceGroup, fhDAO.getRaceAnswers()) { protected void populateItem(ListItem item) { RaceAnswer access = (RaceAnswer)item.getModelObject(); CheckBox chk = new CheckBox(value, item.getModel()); item.add(chk); item.add(new Label(racDesc, access.getDescription())); } }; racesCheckGroup.add(races); } And finally, the relevant portions of my user model: private ArrayListRaceAnswer race; public ArrayListRaceAnswer getRaces() { return race; } public void setRaces(ArrayListRaceAnswer races) { race = races; } My RaceAnswer model consists of getters and setters for the Value property (String) and Description property (also a String). If anyone is able to point out where I've gone wrong or just help me with the proper way to bind an ArrayList to a CheckGroup I would be forever grateful. Thanks, Matt - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: gmap2 opera slow
Do you allow moving of markers or use other Ajax notifications? Once the map is set up in there should be no performance difference between wicket-gmap2 and using gmap2 directly on a web page. Sven Gatos wrote: Hello, I have noticed that in opera gmap2 is more slow that in FF. I have checked maps.google.com and it seems to be faster. Does any1 know what could be the cause of the problem? Thank you - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ajax has too much control?
Hi David, DropDownChoice#wantOnSelectionChangedNotifications() will trigger rendering of the complete page. On Ajax request only those components are rendered you explicitely 'add' to the request, see AjaxRequestTarget#addComponent(). If you want to have the same for Ajax requests, you can just 'add' the complete page. This is not very efficient though. Sven David Chang wrote: Forgive me about this meaningless subject, but I cannot think of a better one. I have been learning Wicket through the WIA book. I just found out something interesting to me. Not sure it is a bug, design, or something I did wrong. I have a page with three Wicket elements: 1. Locale selector through a DropDownChoice list. WIA has complete code about how this works and I copied the solution into this page 2. Country DropDownChoice, whose values change between English and Chinese depending on Locale DDC. 3. State DropDownChoice, whose values change between English and Chinese depending on Locale DDC. The values in this DDC depends on the chosen value in Country DDC. Here are the experiments Experiment#1. Country DDC does not control values in State DDC via Ajax and it has protected boolean wantOnSelectionChangedNotifications() { return true; } Everything works like a charm, which means (1) when Country DDC value changes, State DDC changes accodingly. (2) when Locale changes, both Country DDC and State DDC lists change display values accordingly (which means both DDCs show a list of values in the same language). Experiment#2. Country DDC controls values in State DDC via Ajax. In this case, when page is first loaded, I do not touch the Country DDC or State DDC. I simply change locale value any number of times, both Country DDC and State DDC lists change correctly depending on the session locale. Here is the strange thing. Then I change Country DDC value, State DDC changes correctly. Since then, HOWEVER, if I change locale values, ONLY Country DDC list changes correctly; State DDC list is not updated. It seems Wicket decides that State DDC is forever Aja-controlled by Country DDC only. Not qure sure if this a bug, design, or I did something wrong. Please let me if you have difficulty understanding the experiments. Thanks for any info or help. Cheers! - 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: Ajax has too much control?
David, It seems that you do not understand the problem I have obviously not ;). A quickstart would help me to understand your problem better, but perhaps others have already a clue? Sven David Chang wrote: Sven, Thanks for your input. It seems that you do not understand the problem I have (Wicket problem??? or my page problem???). I know how Ajax works by adding components to Ajax request target. When it is non-Ajax, my page runs correctly with all three controls. When Country DDC Ajax-controls State DDC, the two DDC works correctly. The problem is that once this Ajax control is triggered by selecting a value in Country DDC, the State DDC list is NOT updated when the Locale DDC value is changed. I have a feel that Wicket has a problem here. I am using Wicket 1.4.7. Regards. -David --- On Sun, 3/21/10, Sven Meier s...@meiers.net wrote: From: Sven Meier s...@meiers.net Subject: Re: Ajax has too much control? To: users@wicket.apache.org Date: Sunday, March 21, 2010, 7:25 AM Hi David, DropDownChoice#wantOnSelectionChangedNotifications() will trigger rendering of the complete page. On Ajax request only those components are rendered you explicitely 'add' to the request, see AjaxRequestTarget#addComponent(). If you want to have the same for Ajax requests, you can just 'add' the complete page. This is not very efficient though. Sven David Chang wrote: Forgive me about this meaningless subject, but I cannot think of a better one. I have been learning Wicket through the WIA book. I just found out something interesting to me. Not sure it is a bug, design, or something I did wrong. I have a page with three Wicket elements: 1. Locale selector through a DropDownChoice list. WIA has complete code about how this works and I copied the solution into this page 2. Country DropDownChoice, whose values change between English and Chinese depending on Locale DDC. 3. State DropDownChoice, whose values change between English and Chinese depending on Locale DDC. The values in this DDC depends on the chosen value in Country DDC. Here are the experiments Experiment#1. Country DDC does not control values in State DDC via Ajax and it has protected boolean wantOnSelectionChangedNotifications() { return true; } Everything works like a charm, which means (1) when Country DDC value changes, State DDC changes accodingly. (2) when Locale changes, both Country DDC and State DDC lists change display values accordingly (which means both DDCs show a list of values in the same language). Experiment#2. Country DDC controls values in State DDC via Ajax. In this case, when page is first loaded, I do not touch the Country DDC or State DDC. I simply change locale value any number of times, both Country DDC and State DDC lists change correctly depending on the session locale. Here is the strange thing. Then I change Country DDC value, State DDC changes correctly. Since then, HOWEVER, if I change locale values, ONLY Country DDC list changes correctly; State DDC list is not updated. It seems Wicket decides that State DDC is forever Aja-controlled by Country DDC only. Not qure sure if this a bug, design, or I did something wrong. Please let me if you have difficulty understanding the experiments. Thanks for any info or help. Cheers! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ListView and Serialization
Hi Michael, there's no requirement for components inside ListView to be stateless - I wonder were you got that from. You can have Links, Buttons or anything else in there so removing all on detach is a recipe for disaster for the next incoming request. Sven Michael Gottschalk wrote: Hi, I have a question concerning the serialization of subcomponents of ListView. If I understand correctly, then the components that are added to a ListView in the populateItem method should be stateless, since they are removed in the onPopulate method each time the list view is rendered (as long as reuseItems is set to false). Nevertheless, the subcomponents are saved in the ListView and so they are serialized/stored in the session after the page with the ListView has been rendered. This seems unnecessary to me. Why do we have to store components that are discarded before the next rendering phase anyway? So I created a subclass of ListView with the following method overridden: @Override protected void onDetach() { super.onDetach(); if ( !getReuseItems() ) { removeAll(); } } This removes the subcomponents before the page is stored in the session and should save some memory in most cases. Is there a reason why this is not done in ListView itself? Has nobody thought about it yet or could there be any problems with this approach? Cheers, Michael - 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: ListView and Serialization
Hi Michael, the only difference in my proposal is to call removeAll earlier: not in onBeforeRender of the next request cycle, but in onDetach of the current request cycle. it makes a huge difference: If you call removeAll in onDetach, the next request to a component inside the ListView will no longer find its receiver: populateItem(ListItem item) { item.add(new Link(link) { onClick() { // how should this link be clicked when all components are already removed?? } }); } Sven Michael Gottschalk wrote: Hi Sven, you wrote: there's no requirement for components inside ListView to be stateless - I wonder were you got that from. I got that from the ListView class comment and from studying the code. The comment says: By default, setReuseItems is false, which has the effect that ListView replaces all child components by new instances. The idea behind this is that you always render the fresh data, and as people usually use ListViews for displaying read-only lists [...]. You can have Links, Buttons or anything else in there so removing all on detach is a recipe for disaster for the next incoming request. I don't think so, because removeAll is already called in ListView. In onPopulate, which is called in onBeforeRender by AbstractRepeater, the following can be found: if (getReuseItems()) { [...] } else { // Automatically rebuild all ListItems before rendering the // list view removeAll(); } ... then the components are recreated using populateItem. In my opinion, the only difference in my proposal is to call removeAll earlier: not in onBeforeRender of the next request cycle, but in onDetach of the current request cycle. Cheers, Michael - 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: Trying to do something complicated with ListMultipleChoice model
Hi, ListMultipleChoice puts all selected parties into the model object you're returning in #getObject(). Either you should return a copy of your collection in #getObject() or just do nothing in #setObject(). Your current call to #clear() is effectively clearing the new selection (i.e. affectedParties and arg0 are identical). Regards Sven Ray Weidner wrote: Hi, I'm pretty new to Wicket and trying to get a better understanding of how models work. That's probably why this is such a tricky problem for me. On my site, users are submitting a form for a new Issue to be created. One of the fields of this Issue is affectedParties; in the data model, this is represented by a collection of PartyIssue objects, which associate a Party with an Issue. Here's the simplified code: public class Issue { ... private Set PartyIssue affectedParties; public Set PartyIssue getAffectedParties () { ... } public void setAffectedParties (Set PartyIssue affectedParties) { ... } ... } public class Party { ... } public class PartyIssue { private Issue issue; private Party party; ... } The new Issue Form uses a new Issue object as the argument for the CompoundPropertyModel. What I want to do is allow users to specify the affected parties by multi-selecting from a list of Parties. Then, at the time of submission, we should iterate through this list and construct corresponding PartyIssues, which are associated with the Issue and then created by the service layer (with validation etc.). So, how would I do this? This is how I've been trying to construct the ListMultipleChoice: private Set Party affectedParties = new HashSet Party (); private ListMultipleChoice Party buildPartyDropdown (String property) { IModel Collection Party affectedPartyModel = new IModel Collection Party () { @Override public Collection Party getObject () { return affectedParties; } @Override public void setObject (Collection Party arg0) { affectedParties.clear (); affectedParties.addAll (arg0); } @Override public void detach () { // Nothing to do here } }; IChoiceRenderer Party partyListRenderer = new IChoiceRenderer Party () { private static final long serialVersionUID = -1588547331340300417L; @Override public Object getDisplayValue (Party arg0) { return arg0.getFullName (); } @Override public String getIdValue (Party arg0, int arg1) { return Long.toString (arg0.getRecordId ()); } }; ListMultipleChoice Party choice = new ListMultipleChoice Party (property, affectedPartyModel, new Vector Party (getAllParties ()), partyListRenderer); return choice; } In my onSubmit() code for the Form, I attempt to iterate through the affectedParties Set to create the Set of PartyIssues. However, this is always turning out to be empty no matter what is selected on the form. The problem isn't in the onSubmit() code because the rest of the form is processed and persisted properly, and log messages show that affectedParties is empty at that point. Note that the list choices are being rendered properly. I'm sure I'm doing something very wrong so I'd appreciate any guidance. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How do I provide digit-only IDs to make childs safe?
Hi Alexandros, it's just that the example uses the location's name as an id for a label shown as content in a GInfoWindowTab. See the following line in the example: new GInfoWindowTab(address, new Label(*address*, address)) The label will end up inside a repeater which is complaining about the id. Sven Alexandros Karypidis wrote: Hi, I'm a new Wicket user who is also getting familiar with the GMap2 module from wicket-stuff. I'm using the geocode example as a basis for creating a form which allows you to search for a location and set the map viewport to display it: https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/gmap2-parent/gmap2-examples/src/main/java/wicket/contrib/examples/gmap/geocode/ The code works, but every time I search for a place I get a warning: WARN - AbstractRepeater - Child component of repeater org.apache.wicket.markup.repeater.RepeatingView:content has a non-safe child id of [STRING_SEARCHED]. Safe child ids must be composed of digits only. The [STRING_SEARCHED] is whatever I typed in the text field (e.g. Barcelona, Spain or Athens, Greece). So apparently, GMap2 sets an ID somewhere using the text field's value, violating some Wicket expectation that such IDs should be composed using digits only. How can I fix this? - 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: show ConfirmDialog in the middle of some action/function
Hi Roman, you'd need continuations for modal dialogs, see: https://issues.apache.org/jira/browse/WICKET-598 Sven Roman Ilin wrote: Any ideas? On Thu, Apr 15, 2010 at 1:33 PM, Roman Ilin roman.i...@gmail.com wrote: Hello dear Wicket Gurus, I'm currently rewrite one fat client java program to wicket one. And I have to say that mostly this isn't a big issue but there is one thing that I really miss in wicket. In a program is a lot of business logic there and we used ConfirmDialogs to go through branches. For ex. public void save(){ // do some stuff here if( ! MessageDialog.openConfirm(some confirm message)){ return; } // do more stuff here if( ! MessageDialog.openConfirm(some other confirm message)){ // do one more stuff here } // do end stuff here } Is it possible to write wicket ConfirmDialog component to show HTML confirmation dialog and then go back to my previously executed method/place. Maybe with custom request cycle? Regards Roman - 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: Failing to remove item from list when drag and dropping
Hi Johan, seems to me http://code.google.com/p/wicket-dnd/ supports everything you need without any hacking. Regards Sven Johan Haleby wrote: Hi, I have a use case that reads as follows: I need two lists next to each other. When starting up the left list is empty and I add items to it by dragging them from the right list and dropping them on the left. These items should be copied, (i.e. _not_ moved, the right list should be static) from the right list into the selected position in the left list. It should also be possible to reorder the items in the left list using drag and drop. The last thing is that you should be able to remove items from the left list by dragging and dropping them back to the right list. Since the right list is static the item should _not_ be added to the right list but rather just removed from the left list. After some investigation I've settled on using the YuiDDListView (from the wicket-yui project) which extends from a standard Wicket ListView. I've chosen this component since it supports positioning items in the list (i.e. you know to which index you dropped the item in the list). After MUCH hacking around I've managed to get most things working. There are mainly two things left and here I would really appreciate some help: 1) I cannot seem to remove _the last_ item in the left list (i.e. by drag and dropping to the right list). It works fine for all other items but for the last item it fails saying e.g.: Caused by: org.apache.wicket.WicketRuntimeException: component tabs:panel:panel:list:items:0 not found on page com.mycompany.MyPageCompany[id = 4], listener interface = [RequestListenerInterface name=IBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144) ... 28 more What causes this is that in the onDrop method in the left list I remove the dropped item from the list if it's dropped on the right list. Why is this happening? What's the best way to resolve it? 2) When I drag and item from the left to the right it looks like the item is added to the right list until I reload the page. I figure could be a javascript error since the javascript doesn't understand that the item shouldn't be added to the right list at all (it should instead be removed from the left list). What would be the best way to resolve this? I'm using Wicket 1.4.1. /Johan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Failing to remove item from list when drag and dropping
Hi Johan, yes, works with 1.4.x and has an example project in the repository: http://code.google.com/p/wicket-dnd/source/browse/#svn/trunk/wicket-dnd-examples Regards Sven Johan Haleby wrote: Hi, Looks promising indeed. Does it work with Wicket 1.4.1? Do you have any code examples that I could have a look at? /Johan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Modal window and panels replacement
See ModalWindow javadoc: If you want to use form in modal window component make sure that you put the modal window itself in another form ... -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Modal-window-and-panels-replacement-tp2068998p2069096.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: The better way tp add component directly
AbstractRepeater (and its subclasses) does it this way with its onPopulate() method, so this strategy should fit your case too. Perhaps think about a reuse strategy, i.e. don't create a new component if the type hasn't changed. Sven -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/The-better-way-tp-add-component-directly-tp2122805p2123830.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: doctype and markup inheritance
#setStripXmlDeclarationFromOutput() has nothing to do with doctype - it controls the xml prolog. Sven -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Html-root-tag-and-contents-repeating-in-response-after-302-redirect-tp2173315p2173399.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicketstuff-prototype download
Hi, either use maven to build wicket-dnd or do what maven does - look in the right places: http://code.google.com/p/wicket-dnd/source/browse/trunk/wicket-dnd/pom.xml Look for repository: http://wicketstuff.org/maven/repository/ Together with dependency this results in: http://wicketstuff.org/maven/repository/org/wicketstuff/prototype/1.4.1/prototype-1.4.1.jar Hope this helps Sven On 05/14/2010 01:16 AM, Hbiloo wrote: Hi, Could someone please tell me where I can download the wicketstuff-prototype library. I want to use Drag and Drop for Wickethttp://code.google.com/p/wicket-dnd/(DND) which needs this library. I'm using Wicket 1.4. Regards, Hbiloo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket vendor lockin and backwards compatibility, 1.4/1.5
It's funny how you combine Wicket (i.e. open source) and vendor lock-in, two antithetic terms I'd never put together in a single sentence. Please search lock in the following post for arguments: http://ptrthomas.wordpress.com/2009/05/15/jsf-sucks/ If you choose JSF, all what's guaranteed is crappy support from your implementation (IBM at least), EOL policy, migration after migration and vendor lock-in. My 2 cents Sven -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-vendor-lockin-and-backwards-compatibility-1-4-1-5-tp2226109p2229767.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [announce] Release Wicket 1.4.9
Sorry, what was the use case after all? Sven -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/announce-Release-Wicket-1-4-9-tp2228179p2229772.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Dataview linkedline
Override DataTable#newRowItem(): @Override protected ItemFoo newRowItem(String id, int index, final IModelFoo model) { ItemFoo item = super.newRowItem(id, index, model); item.add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { ... } }); return item; } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dataview-linkedline-tp2231274p2232746.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [PROPOSAL] Application.runAs() Method...
Hi all, I don't think the proposed method is a good idea. Why add a method to a framework which is not used *by* the framework? Why can't you just create your own static helper method storing the application in an inheritable/non-inheritable thread local? Why would anyone want to pass a web application object to another non-web thread? My 3 questions. Sven On 05/27/2010 04:13 PM, Alex Objelean wrote: Hi James! It would be a good idea to add this feature to next release, since the Application won't be stored in InheritableThreadLocal anymore. Alex - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [PROPOSAL] Application.runAs() Method...
Is @SpringBean used *by* the framework? No, not the core. A thread local won't work for what we're trying to do, hence the long, drawn-out discussion thread(s) we've been having recently. IMHO the discussion threads have not shown a conclusive use case for an ITL. Some folks like to use Wicket as a templating framework so that they can generate emails with links in them that point to Wicket-managed pages. Well, this is a strong argument for improved support of mail generation with Wicket - I'm not yet sure if the ITL is the answer to this issue. Regards Sven -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PROPOSAL-Application-runAs-Method-tp2230030p2234535.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [PROPOSAL] Application.runAs() Method...
OK, no ITL, got it. Then, you can use that Runnable anywhere to run a task with all of the appropriate Wickety goodness set up for you (except for the request cycle of course because you're not executing within a request cycle). But what are the use cases for *this* proposal (beside mail generation)? Sven -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PROPOSAL-Application-runAs-Method-tp2230030p2234572.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [PROPOSAL] Application.runAs() Method...
Why so much trouble inside your UI layer? Normally Wicket components are single-threaded, but with your solution you may introduce race conditions. Move the ExecutorService into your service layer: http://pastebin.com/NN58fiZx new ProcessExecutorPanel(associatedFilesMigration) { @Override protected Future? start() { return injectedSpringBean.startMigration(); } }; -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PROPOSAL-Application-runAs-Method-tp2230030p2234624.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [PROPOSAL] Application.runAs() Method...
Please take another look on http://pastebin.com/NN58fiZx - it will work :). -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PROPOSAL-Application-runAs-Method-tp2230030p2234652.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [PROPOSAL] Application.runAs() Method...
But in my example start() *is* invoked on the request thread, thus the Wicket application is available. Please take another look on http://pastebin.com/NN58fiZx . -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PROPOSAL-Application-runAs-Method-tp2230030p2234769.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [PROPOSAL] Application.runAs() Method...
http://en.wikipedia.org/wiki/Multitier_architecture On 05/28/2010 06:04 PM, Douglas Ferguson wrote: What is the service layer that you speak of? Is this built into wicket? D/ On May 28, 2010, at 9:06 AM, Sven Meier wrote: Why so much trouble inside your UI layer? Normally Wicket components are single-threaded, but with your solution you may introduce race conditions. Move the ExecutorService into your service layer: http://pastebin.com/NN58fiZx new ProcessExecutorPanel(associatedFilesMigration) { @Override protected Future? start() { return injectedSpringBean.startMigration(); } }; -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PROPOSAL-Application-runAs-Method-tp2230030p2234624.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [PROPOSAL] Application.runAs() Method...
The details of thread creation are hidden from your Wicket class - IMHO this is a good thing. Sven On 05/28/2010 07:08 PM, Alex Objelean wrote: Yes, I see now. Thanks! The only drawback of this approach is that the client code is responsible for creating the Future. The initial purpose was to hide the implementation details related to thread creation. Alex - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [PROPOSAL] Application.runAs() Method...
asynchronously where they need the Application in place As I've written I still don't see a reason why they need the Application at all. Sven On 05/28/2010 05:50 PM, James Carman wrote: So, don't use the feature. If yours works, then fine. Some folks are doing things asynchronously where they need the Application in place. On Fri, May 28, 2010 at 11:31 AM, Sven Meiers...@meiers.net wrote: But in my example start() *is* invoked on the request thread, thus the Wicket application is available. Please take another look on http://pastebin.com/NN58fiZx . -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PROPOSAL-Application-runAs-Method-tp2230030p2234769.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org