Re: AutoComplete textfield ignores visible property within hierarchy.
I already opened a jira issue: https://issues.apache.org/jira/browse/WICKET-2497 igor.vaynberg wrote: please open a jira issue. -igor On Tue, Sep 29, 2009 at 7:59 AM, Ann Baert ann.ba...@tvh.be wrote: When writing an autocomplete textfield on a form that is first visible, and after an ajax call rendered invisible, the autocomplete textfields on this form get rendered anyway in the ajax response. The method renderAutocompleteHead in AbstractAutocompleteBehavior gets executed, even if the AutoComplete component to which it is attached is not visible within the component hierarchy. Below the snippet of code that solved it for us ... In the class AbstractAutoCompleteBehavior, a test on the visibility was added. public void renderHead(IHeaderResponse response) { if(this.getComponent().isVisibleInHierarchy()) { super.renderHead(response); renderAutocompleteHead(response); } } The error becomes visible in the debug window on the webpage. There is already a bug report filed within jira, and a demo application is included to simulate the problem. https://issues.apache.org/jira/browse/WICKET-2497 Met vriendelijke groeten, ANN BAERT ICT-DEPARTMENT Internet technologie: Software Engineer Tel.: +32 56 43 42 11 Fax: +32 56 43 44 88 E-mail: ann.ba...@tvh.com Contactsheet: ANN BAERT TVH FORKLIFT PARTS nv-sa - BRABANTSTRAAT 15 - B-8790 WAREGEM Neem even pauze om onze website te bekijken en vertel ons hoe we u kunnen helpen: www.tvh.com/nl Vooraleer ik print, denk ik aan het milieu. DISCLAIMER http://www.tvh.be/newen/pages/emaildisclaimer.html http://www.tvh.be/newen/pages/emaildisclaimer.html This message is delivered to all addressees subject to the conditions set forth in the attached disclaimer, which is an integral part of this message. - 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/AutoComplete-textfield-ignores-%22visible%22-property-within-hierarchy.-tp25664687p25675445.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: Preventing Copy Pasting URL's In Same Browser Session
hi, actually i'm able to make it work some how using this setting getPageSettings().setAutomaticMultiWindowSupport(true); it creates a new page map everytime i open a page in a new tab or new window. however in the wicket documentation it says that it is enabled by default. but upon checking it seems that it is not enabled by default that's why i'm confused. any recommendations regarding this? i can now check the page map name for each page and throw a redirect if a new page map is encountered other than the default. carlo On Wed, Sep 30, 2009 at 5:50 AM, Phil Housley undeconstruc...@gmail.com wrote: 2009/9/29 Carlo Camerino carlo.camer...@gmail.com: Hi everyone, We have this requirement in which we cannot allow the customer to copy paste the url that's appearing in the address bar into the same browser. For example in a different tab or in a new window. This can easily be done in Wicket Framework since the url has a corresponding page attached to it. For example if i get http://localhost/wicket:interface=1 appearing in the address bar, I can open anew tab paste the url and I could get into the same page. The users don't want this behavior. Could I make it work in such a way that I copy http://localhost/wicket:inteface=1, when i try to copy and paste it, it will redirect me to an error page? This happens even after the user has already logged in. Really need help on this one. I've been playing with the ideas from http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html for something of my own, which might fit the bill in a way. Following that you can convince wicket to serve up every instance of a mounted page from exactly the same URL. That means if you copy the url, you get a brand new instance of the page. You lose the ability to refresh, but if you are being strict on that sort of thing, I guess you will have a refresh button on the page when and only when it is appropriate. -- Phil Housley - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket Throwing Out Of Memory Errors When AutomaticMultipleWindowSupport is set to true
Hi, I'm having problems . I think there is a bug in wicket in which the memory usage zooms up exponentially when i copy and paste a url into a new tab continuously. This only happens when I explicity set automaticmultiplewindowsupport to true. It seems to happen due to multiple page maps for the same user. For example I open in a browser http://192.168.1.27:8010/loyalty/?wicket:interface=:1 I copy it to my clipboard, open a new tab, paste the url, open a new tab, paste the url. Tale note that the url changes in each tab... Something like http://192.168.1.27:8010/loyalty/?wicket:interface=:0-1 http://192.168.1.27:8010/loyalty/?wicket:interface=:1-1 I repeat this for a couple of times, and on the 9th or 10th iteration the memory usage is way up afterwards I get an outofmemoryerror already. (lack of heap space) after checking the profiler, byte[] usage is way up. hundreds of megabytes high. I'm using wicket version 1.3.7 thanks carlo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: RadioChoice and Ajax to display a panel of dropdowns
Hey Jeff, did you override this? /** * Override this method if you want onBeforeRender to be called even when your component is not * visible. default this returns false. * * @return boolean, if true then onBeforeRender is called even for none visible components, * default false. * * @see Component#onBeforeRender() */ protected boolean callOnBeforeRenderIfNotVisible() { return false; } If you add a visible and an invisible panel you have to override this on the invisible one. hth Cheers Per I want to create a list of radio buttons [I have that working] and an ajax event to fire whenever a radio button is clicked [I have this working]. If the radio button matches the one I am interested in then I want to display additional information that must be filled in. A radio button selection is required. I cannot get the additional information to display when I add the component back to the target. I think it is because the additional information is originally set to not visible so the output markup id is not written out. How would I go about doing this? It seems pretty standard. Do I need to use panels and swap the appropriate panel [1 - empty panel, 2 - panel with additional info] into the target when needed? That seems like a lot of code to do something fairly simple. My code is below. Thanks. Jeff = HTML: tr tdwicket:message key=userTypeType of User:/wicket:message/td td span wicket:id=accountType input type=radio /option 1 /span /td /tr tr td/td tdspan wicket:id=typeBoxThe additional information/span/td /tr Java Code: // Account Type sub box final WebMarkupContainer typeBox = new WebMarkupContainer(typeBox); typeBox.setVisible(false); typeBox.setOutputMarkupId(true); add(typeBox); // Account Type Select List accountTypes = accountTypeDao.findAll(); ChoiceRenderer accountTypeChoiceRenderer = new ChoiceRenderer(name, code); RadioChoice accountTypeRadio = new RadioChoice(accountType, accountTypes, accountTypeChoiceRenderer); //accountTypeRadio.setRequired(true);// THIS SHOULD REALLY BE REQUIRED // add the on click to the radio button accountTypeRadio.add(new AjaxFormChoiceComponentUpdatingBehavior () { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { RadioChoice choice = (RadioChoice) getComponent(); choice.updateModel(); if (((AccountType) choice.getModelObject()).getCode().equalsIgnoreCase(REP)) { typeBox.setVisible(true); } else { typeBox.setVisible(false); } target.addComponent(typeBox); } }); ___ Jeffrey A. Schneller Envisa End-to-End E-Commerce for the Multi-Channel Merchant 281 Pleasant Street Framingham, MA 01701 P: (508) 405-1220 x115 C: (508) 954-8044 F: (508) 405-1219 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Preventing Copy Pasting URL's In Same Browser Session
the javadoc in the later versions mentions that it is enabled by default, however if you are using the default secondlevel caching page store it will be disabled... -igor On Tue, Sep 29, 2009 at 11:10 PM, Carlo Camerino carlo.camer...@gmail.com wrote: hi, actually i'm able to make it work some how using this setting getPageSettings().setAutomaticMultiWindowSupport(true); it creates a new page map everytime i open a page in a new tab or new window. however in the wicket documentation it says that it is enabled by default. but upon checking it seems that it is not enabled by default that's why i'm confused. any recommendations regarding this? i can now check the page map name for each page and throw a redirect if a new page map is encountered other than the default. carlo On Wed, Sep 30, 2009 at 5:50 AM, Phil Housley undeconstruc...@gmail.com wrote: 2009/9/29 Carlo Camerino carlo.camer...@gmail.com: Hi everyone, We have this requirement in which we cannot allow the customer to copy paste the url that's appearing in the address bar into the same browser. For example in a different tab or in a new window. This can easily be done in Wicket Framework since the url has a corresponding page attached to it. For example if i get http://localhost/wicket:interface=1 appearing in the address bar, I can open anew tab paste the url and I could get into the same page. The users don't want this behavior. Could I make it work in such a way that I copy http://localhost/wicket:inteface=1, when i try to copy and paste it, it will redirect me to an error page? This happens even after the user has already logged in. Really need help on this one. I've been playing with the ideas from http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html for something of my own, which might fit the bill in a way. Following that you can convince wicket to serve up every instance of a mounted page from exactly the same URL. That means if you copy the url, you get a brand new instance of the page. You lose the ability to refresh, but if you are being strict on that sort of thing, I guess you will have a refresh button on the page when and only when it is appropriate. -- Phil Housley - 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 Throwing Out Of Memory Errors When AutomaticMultipleWindowSupport is set to true
try on 1.4.1 and see if you get the same result. -igor On Tue, Sep 29, 2009 at 11:16 PM, Carlo Camerino car...@sxchange.com.ph wrote: Hi, I'm having problems . I think there is a bug in wicket in which the memory usage zooms up exponentially when i copy and paste a url into a new tab continuously. This only happens when I explicity set automaticmultiplewindowsupport to true. It seems to happen due to multiple page maps for the same user. For example I open in a browser http://192.168.1.27:8010/loyalty/?wicket:interface=:1 I copy it to my clipboard, open a new tab, paste the url, open a new tab, paste the url. Tale note that the url changes in each tab... Something like http://192.168.1.27:8010/loyalty/?wicket:interface=:0-1 http://192.168.1.27:8010/loyalty/?wicket:interface=:1-1 I repeat this for a couple of times, and on the 9th or 10th iteration the memory usage is way up afterwards I get an outofmemoryerror already. (lack of heap space) after checking the profiler, byte[] usage is way up. hundreds of megabytes high. I'm using wicket version 1.3.7 thanks carlo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicketstuff-dojo with wicket 1.4 compatibility
I have same problem. my project has used wicketstuff-dojo component, now I want to upgrade wicket from 1.3.7 to 1.4.1, all test well but wicketstuff-dojo's component throw exception. do wicketstuff-dojo project stop develop? On Mon, Sep 28, 2009 at 14:22, Elena Stoll elenast...@alice-dsl.net wrote: Hi, I have a question: Is there a new version of wicketstuff-dojo, which is compatible with the Wicket 1.4 version. If so, where to find it. Thanks in advance. Elena
Re: wicketstuff-dojo with wicket 1.4 compatibility
I find lastest code url is : https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-dojo-1.1
Re: Complicated workflows
2009/9/30 Igor Vaynberg igor.vaynb...@gmail.com: there is really no point in having your tasks be components. why not simply repeatingview rv=.. for (task t:tasks) { if (t.hasUIComponent()) { rv.add(t.getUIComponent()); } } -igor Although only one task panel is ever drawn at the time, that is broadly similar to how I have it set up at the moment. If a task is also a panel, it can elect to have itself displayed, at which point it will be embedded in the page and no stack processing will happen until the panel says it is complete. Any other type of task simply doesn't have the option to display, although it may spawn a panel task, which may ask to be displayed, and so on. The issue is that business logic should really always be in non-UI tasks for things I have in mind, which lack things like easily being able to call this.error(...). I believe you are right about not forcing the issue, so I'm currently thinking I will have to step up the infrastructure to add things like error reporting. Fortunately I can just delegate to Wicket pretty quickly, so shouldn't be too much extra code. Phil. On Tue, Sep 29, 2009 at 2:11 PM, Phil Housley undeconstruc...@gmail.com wrote: Hello list, I'm currently working on some ideas for building apps with fairly complex workflows. My aim is to find a nice pattern/framework for building apps where each unit of work involves many panels, several forms, lots of decisions and so on. In particular I'm aiming at apps where you need to be very confident about exactly what is happening, so very strict control of actions, being careful of multiple renderings of a page each trying to change the server data, and so on. Also, I'm wondering about some options for declarative building of workflows out of existing tasks. My current design involves running from a special page, which maintains a stack of tasks. One type of task is a Workflow, which can be configured to automatically spawn subtasks as required, based on the result of previous tasks. Another type of task is based on a panel, and is able to cause itself to be rendered. The stack processor makes sure that each task is invoked at the right time, that a task can render if it is at the top of the stack, that only the top of the stack can be invoked from a form and so on. This is working ok for some silly demo cases, but there are various issues. For example, any task that is not also a component cannot access dependency injection, or set error messages and so on. I'm not sure how to get around this at the moment, as I don't want to force every task to be a component, when many will likely have no cause to ever be rendered. So, the reason I'm posting is to ask mainly two things: 1) Is this of interest to anyone else? All the code is my own, so I'll open source it if there seems to be some future in it. 2) If so, does anyone have any comments on my current design? Clearly there are problems with it, but should I carry on trying to find ways to work around them, or does the whole thing sounds like so much crack? Thanks, -- Phil Housley - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Complicated workflows
2009/9/30 Randy S. randypo...@gmail.com: Have you thought about using Spring Web Flow for this? I'm not a SWF expert, but it sounds like something well-tailored to your needs. For example, a flow can have steps that don't have UIs. Our group at work is looking into Wicket SWF integration. I have a seen a few comments on the web from folks like Peter Thomas who conclude that you don't need to use SWF with Wicket. We need to externalize the flow of some applications so we have discussed shallow integration (where, for example, a button.onClick explicitly calls SWF to determine what to do next), as well as deep(er) integration (perhaps at the RequestCycleProcessor. At the moment, we are leaning toward the shallow/lightweight integration which gives lots of flexibility to each application to respond to a flow's response in different ways (show a new page, update components via Ajax, redirect to another URL, etc.). In case anyone is interested, reasons we need to externalize flow on some apps are things like: Complex business rules, business unit authoring of flow (via a controlled UI), and delegation to a business process manager layer. Actually, I hadn't realised that WebFlow wasn't limited to Spring MVC. Looking at it now, I am doing something fairly similar, so I probably ought to take a longer look... The reasons I started on this thing with code rather than going totally declarative is that my current experience is that there will be sufficient corner cases to make it necessary to regularly subclass actions or panels for a particular instance. Where that isn't required, I was thinking that a Spring context file would provide a nice declarative way of configuring everything, with prototype scope beans etc being well fitted to creating tasks. Despite all that, I don't particularly want a hard dependency on anything other than Wicket, so plain Java first, other things hopefully on top. Phil On Tue, Sep 29, 2009 at 4:11 PM, Phil Housley undeconstruc...@gmail.comwrote: Hello list, I'm currently working on some ideas for building apps with fairly complex workflows. My aim is to find a nice pattern/framework for building apps where each unit of work involves many panels, several forms, lots of decisions and so on. In particular I'm aiming at apps where you need to be very confident about exactly what is happening, so very strict control of actions, being careful of multiple renderings of a page each trying to change the server data, and so on. Also, I'm wondering about some options for declarative building of workflows out of existing tasks. My current design involves running from a special page, which maintains a stack of tasks. One type of task is a Workflow, which can be configured to automatically spawn subtasks as required, based on the result of previous tasks. Another type of task is based on a panel, and is able to cause itself to be rendered. The stack processor makes sure that each task is invoked at the right time, that a task can render if it is at the top of the stack, that only the top of the stack can be invoked from a form and so on. This is working ok for some silly demo cases, but there are various issues. For example, any task that is not also a component cannot access dependency injection, or set error messages and so on. I'm not sure how to get around this at the moment, as I don't want to force every task to be a component, when many will likely have no cause to ever be rendered. So, the reason I'm posting is to ask mainly two things: 1) Is this of interest to anyone else? All the code is my own, so I'll open source it if there seems to be some future in it. 2) If so, does anyone have any comments on my current design? Clearly there are problems with it, but should I carry on trying to find ways to work around them, or does the whole thing sounds like so much crack? Thanks, -- Phil Housley - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: better way to strip wicket markup / tags per page?
Craig: didn't consider that. So, no clean solution seems to be possible. Pedro: yes I was talking about having the wicket-tags turned on for the application except for a certain (xml) page, since it is causing parse errors in the xml there. Antoine On Tue, Sep 29, 2009 at 9:23 PM, Craig McIlwee craig.mcil...@openroadsconsulting.com wrote: I don't see how this can work reliably when there is more than 1 user, AFAIK wicket has no synchronization in place that prevents 2 pages from going through the render phase at the same time. So if one page finishes rendering and changes the setting to false while another page has just started rendering (e.g. the line immediately after change the setting to true) then that page will render with the wrong value. Craig -Original Message- From: Antoine van Wel [mailto:antoine.van@gmail.com] Sent: Tuesday, September 29, 2009 9:03 AM To: users@wicket.apache.org Subject: Re: better way to strip wicket markup / tags per page? Thanks for the lightning fast reply. Yes it works fine under development. Still I don't like it - after all these statements are also executed during production mode, and even though they can't do any harm there, I'd rather not see them there at all. More a matter of personal taste I guess. Anyway I have something in mind to improve it according to my taste. Will implement that when I got time... This is not really an urgent issue to me. Thanks anyway for the reply - I'm assuming now there really is no other way to do this than temporarily changing the global settings. Antoine On Tue, Sep 29, 2009 at 7:46 PM, Marat Radchenko slonopotamusor...@gmail.com wrote: In some situations during development... With that in mind, this solution is absolutely ok. 2009/9/29 Antoine van Wel antoine.van@gmail.com Hi, on the wiki[1] it is described how to get rid of wicket markup such as wicket:id attributes on a page basis. The solution looks like a dirty hack to me which may go wrong when for instance exceptions occur. Does anybody know of a better way? For completeness sake, here is the code duplicated from the wiki: private boolean stripTags; public TestPage() { stripTags = Application.get().getMarkupSettings().getStripWicketTags(); } @Override protected void onBeforeRender() { Application.get().getMarkupSettings().setStripWicketTags(true); } @Override protected void onAfterRender() { Application.get().getMarkupSettings().setStripWicketTags(stripTags); } Thanks in advance, Antoine. References: [1] http://cwiki.apache.org/WICKET/how-to-remove-wicket-markup-from-output.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Consequences of sharing ajax request target by attribute or by static determination
Hi *, i would like to know if there hidden consequences if i exchange sharing by attribute through sharing by static determination. To couple my event-components with it's higher ranking components i use a listener based approach. Each parent adds a listener to the child can be involved if an event occurs. The problem is that i sometimes use ajax event components and sometimes not. Thus until now i have to provide two different event classes. The one for ajax usage contains an attribute with the current ajax request target. The event sources creates the event and provides the request target. But now if found AjaxRequestTarget.get. Javadoc says Static method that returns current |AjaxRequestTarget| http://wicket.apache.org/docs/1.4/org/apache/wicket/ajax/AjaxRequestTarget.html or |null| of no |AjaxRequestTarget| http://wicket.apache.org/docs/1.4/org/apache/wicket/ajax/AjaxRequestTarget.html is available. So this exactly what i tried to achieve with the two event types. So my question is: Can i simplify my event objects by throwing the request target attribute away and use the AjaxRequestTarget.get method in my listener chain? Or why is this not a good idea? Thanks for clearing it to me. Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicketstuff-dojo with wicket 1.4 compatibility
Feel free to upgrade it to 1.4. It should be easy. Just check out the code, follow the instructions at http://cwiki.apache.org/WICKET/migrating-to-wicket-14.html and if you wish donate your work back to community. El mié, 30-09-2009 a las 14:37 +0800, 新希望软件 -- 俞宏伟 escribió: I find lastest code url is : https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-dojo-1.1 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Where can I find this Wicket application?
http://svn.carmanconsulting.com/public/wicket-advanced/ doesn't work. -Original Message- From: Maarten Bosteels [mailto:mbosteels@gmail.com] Sent: 27. september 2009 19:58 To: users@wicket.apache.org Subject: Re: Where can I find this Wicket application? http://svn.carmanconsulting.com/public/wicket-advanced/ On Sun, Sep 27, 2009 at 6:16 PM, David Chang david_q_zh...@yahoo.comwrote: Hello, I am reading Wicket-related stuff on the net and came across this Wicket discussion thread: http://osdir.com/ml/users-wicket.apache.org/2009-05/msg01196.html In the response, my wicket-advanced example application is mentioned. I would like to know where I can find this application? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org __ Information from ESET NOD32 Antivirus, version of virus signature database 4468 (20090929) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __ Information from ESET NOD32 Antivirus, version of virus signature database 4468 (20090929) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
Show Validation Errors
Hi, I am trying to show validation errors on a page. Somehow it won't function! But I don't understand why? I mean I am using the right Validation class... Why don't wicket show any error when the user does a wrong input? Thanks! import java.util.Date; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.PasswordTextField; import org.apache.wicket.markup.html.form.RequiredTextField; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.form.validation.EqualPasswordInputValidator; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; import org.apache.wicket.util.value.ValueMap; import org.omikron.test.data.Administrator; import org.omikron.test.data.AdministratorDataProvider; /** * * @author sven.dzepina */ public class CreateAdministratorForm extends Form { private ValueMap properties = new ValueMap(); TextFieldString username; TextFieldString email; TextFieldString firstname; TextFieldString lastname; PasswordTextField password; PasswordTextField password2; Boolean isUpdate = false; Administrator a; public CreateAdministratorForm(String id) { super(id); username = new RequiredTextFieldString(username, new PropertyModelString(properties, username)); password = new PasswordTextField(password, new PropertyModelString(properties, password)); password2 = new PasswordTextField(password2, new PropertyModelString(properties, password2)); email = new RequiredTextField(email, new PropertyModel(properties, email)); firstname = new RequiredTextField(firstname, new PropertyModel(properties, firstname)); lastname = new RequiredTextField(lastname, new PropertyModel(properties, lastname)); add(email); add(password2); add(firstname); add(lastname); add(username); add(password); add(new EqualPasswordInputValidator(password, password2)); } public void setUpdate(Administrator a) { this.a = a; isUpdate = true; IModelString usernameModel = Model.of(a.getUsername()); IModelString emailModel = Model.of(a.getEmail()); IModelString firstnameModel = Model.of(a.getFirstname()); IModelString lastnameModel = Model.of(a.getLastname()); username.setModel(usernameModel); email.setModel(emailModel); firstname.setModel(firstnameModel); lastname.setModel(lastnameModel); } @Override public void onSubmit() { if ( !isUpdate ) { Administrator a = new Administrator(); a.setEmail(email.getModel().getObject()); a.setFirstname(firstname.getModel().getObject()); a.setLastname(lastname.getModel().getObject()); a.setPassword(password.getModel().getObject()); a.setUsername(username.getModel().getObject()); a.setSysTimestamp(new Date()); AdministratorDataProvider administratorDataProvider = new AdministratorDataProvider(); administratorDataProvider.save(a); } else { a.setEmail(email.getModel().getObject()); a.setFirstname(firstname.getModel().getObject()); a.setLastname(lastname.getModel().getObject()); a.setPassword(password.getModel().getObject()); a.setUsername(username.getModel().getObject()); a.setSysTimestamp(new Date()); AdministratorDataProvider administratorDataProvider = new AdministratorDataProvider(); administratorDataProvider.save(a); } } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Show Validation Errors
Hi Peter Try adding a FeedbackPanel to your page Without that, wicket doesn't even know where and how to display the messages. Matt Peter Arnulf Lustig wrote: Hi, I am trying to show validation errors on a page. Somehow it won't function! But I don't understand why? I mean I am using the right Validation class... Why don't wicket show any error when the user does a wrong input? Thanks! import java.util.Date; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.PasswordTextField; import org.apache.wicket.markup.html.form.RequiredTextField; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.form.validation.EqualPasswordInputValidator; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; import org.apache.wicket.util.value.ValueMap; import org.omikron.test.data.Administrator; import org.omikron.test.data.AdministratorDataProvider; /** * * @author sven.dzepina */ public class CreateAdministratorForm extends Form { private ValueMap properties = new ValueMap(); TextFieldString username; TextFieldString email; TextFieldString firstname; TextFieldString lastname; PasswordTextField password; PasswordTextField password2; Boolean isUpdate = false; Administrator a; public CreateAdministratorForm(String id) { super(id); username = new RequiredTextFieldString(username, new PropertyModelString(properties, username)); password = new PasswordTextField(password, new PropertyModelString(properties, password)); password2 = new PasswordTextField(password2, new PropertyModelString(properties, password2)); email = new RequiredTextField(email, new PropertyModel(properties, email)); firstname = new RequiredTextField(firstname, new PropertyModel(properties, firstname)); lastname = new RequiredTextField(lastname, new PropertyModel(properties, lastname)); add(email); add(password2); add(firstname); add(lastname); add(username); add(password); add(new EqualPasswordInputValidator(password, password2)); } public void setUpdate(Administrator a) { this.a = a; isUpdate = true; IModelString usernameModel = Model.of(a.getUsername()); IModelString emailModel = Model.of(a.getEmail()); IModelString firstnameModel = Model.of(a.getFirstname()); IModelString lastnameModel = Model.of(a.getLastname()); username.setModel(usernameModel); email.setModel(emailModel); firstname.setModel(firstnameModel); lastname.setModel(lastnameModel); } @Override public void onSubmit() { if ( !isUpdate ) { Administrator a = new Administrator(); a.setEmail(email.getModel().getObject()); a.setFirstname(firstname.getModel().getObject()); a.setLastname(lastname.getModel().getObject()); a.setPassword(password.getModel().getObject()); a.setUsername(username.getModel().getObject()); a.setSysTimestamp(new Date()); AdministratorDataProvider administratorDataProvider = new AdministratorDataProvider(); administratorDataProvider.save(a); } else { a.setEmail(email.getModel().getObject()); a.setFirstname(firstname.getModel().getObject()); a.setLastname(lastname.getModel().getObject()); a.setPassword(password.getModel().getObject()); a.setUsername(username.getModel().getObject()); a.setSysTimestamp(new Date()); AdministratorDataProvider administratorDataProvider = new AdministratorDataProvider(); administratorDataProvider.save(a); } } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org smime.p7s Description: S/MIME Cryptographic Signature
AW: Show Validation Errors
Thank you! That does it! - Ursprüngliche Mail Von: Matthias Keller matthias.kel...@ergon.ch An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 10:23:11 Uhr Betreff: Re: Show Validation Errors Hi Peter Try adding a FeedbackPanel to your page Without that, wicket doesn't even know where and how to display the messages. Matt Peter Arnulf Lustig wrote: Hi, I am trying to show validation errors on a page. Somehow it won't function! But I don't understand why? I mean I am using the right Validation class... Why don't wicket show any error when the user does a wrong input? Thanks! import java.util.Date; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.PasswordTextField; import org.apache.wicket.markup.html.form.RequiredTextField; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.form.validation.EqualPasswordInputValidator; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; import org.apache.wicket.util.value.ValueMap; import org.omikron.test.data.Administrator; import org.omikron.test.data.AdministratorDataProvider; /** * * @author sven.dzepina */ public class CreateAdministratorForm extends Form { private ValueMap properties = new ValueMap(); TextFieldString username; TextFieldString email; TextFieldString firstname; TextFieldString lastname; PasswordTextField password; PasswordTextField password2; Boolean isUpdate = false; Administrator a; public CreateAdministratorForm(String id) { super(id); username = new RequiredTextFieldString(username, new PropertyModelString(properties, username)); password = new PasswordTextField(password, new PropertyModelString(properties, password)); password2 = new PasswordTextField(password2, new PropertyModelString(properties, password2)); email = new RequiredTextField(email, new PropertyModel(properties, email)); firstname = new RequiredTextField(firstname, new PropertyModel(properties, firstname)); lastname = new RequiredTextField(lastname, new PropertyModel(properties, lastname)); add(email); add(password2); add(firstname); add(lastname); add(username); add(password); add(new EqualPasswordInputValidator(password, password2)); } public void setUpdate(Administrator a) { this.a = a; isUpdate = true; IModelString usernameModel = Model.of(a.getUsername()); IModelString emailModel = Model.of(a.getEmail()); IModelString firstnameModel = Model.of(a.getFirstname()); IModelString lastnameModel = Model.of(a.getLastname()); username.setModel(usernameModel); email.setModel(emailModel); firstname.setModel(firstnameModel); lastname.setModel(lastnameModel); } @Override public void onSubmit() { if ( !isUpdate ) { Administrator a = new Administrator(); a.setEmail(email.getModel().getObject()); a.setFirstname(firstname.getModel().getObject()); a.setLastname(lastname.getModel().getObject()); a.setPassword(password.getModel().getObject()); a.setUsername(username.getModel().getObject()); a.setSysTimestamp(new Date()); AdministratorDataProvider administratorDataProvider = new AdministratorDataProvider(); administratorDataProvider.save(a); } else { a.setEmail(email.getModel().getObject()); a.setFirstname(firstname.getModel().getObject()); a.setLastname(lastname.getModel().getObject()); a.setPassword(password.getModel().getObject()); a.setUsername(username.getModel().getObject()); a.setSysTimestamp(new Date()); AdministratorDataProvider administratorDataProvider = new AdministratorDataProvider(); administratorDataProvider.save(a); } } } - 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: Bookmarkable page with a form. The URL switches from the mounted one into an unfriendly one.
I'm having a similar, but different problem. I have a PasswordResetPage for reseting a user password. I am using Spring Security and need to link to it from a login.jsp. So in my WebApplication class I have: mountBookmarkablePage(ConstantsCommon.PASSWORD_RESET_PATH, PasswordResetPage.class); And this allows me to link to the page from the login.jsp. It also allows me to specify in my Spring security that this URL does not require authentication. sec:intercept-url pattern=/wicket/passwordReset* filters=none / So I get to my PasswordResetPage ok. But when I hit the Ok button on my form, it submits to a URL like http://localhost:8080/myapp/wicket/?wicket:interface blah blah blah. And then my Spring Security intercepts it and redirects back to the login.jsp. How can I get the form to submit to the nice URL? I have tried: form.add(new AttributeModifier(action, true, new Model(ConstantsCommon.PASSWORD_RESET_CONTEXT))); But that just re-displays the page. -- View this message in context: http://www.nabble.com/Bookmarkable-page-with-a-form.-The-URL-switches-from-the-mounted-one--into-an-unfriendly-one.-tp23658727p25677674.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
How would you realize a delete-Link in a datagrid row?
Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: How would you realize a delete-Link in a datagrid row?
In addition: my specific problem is, that after clicking on a link which is generated in the datagrid, I am not able to manipulate other components!? How is this possible? - Ursprüngliche Mail Von: Peter Arnulf Lustig u...@yahoo.de An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 11:29:03 Uhr Betreff: How would you realize a delete-Link in a datagrid row? Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? 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: How would you realize a delete-Link in a datagrid row?
Hi Peter For that we usually add an AttributeModifier which adds something like that to the onclick javascript event: if (!confirm('Do you really want to delete this entry')) return false; Matt Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org smime.p7s Description: S/MIME Cryptographic Signature
Re: How would you realize a delete-Link in a datagrid row?
What about replacing the link. e.g. via AJAX, with a new one containing the Do you really want to delete xyz warning... that once clicked actually deletes your entry... and refreshes the datagrid. You could even use the same link and have a flag that says userWantsToDeleteRow and use it to conditionally change the actions to do and the contents to display. Best, Ernesto On Wed, Sep 30, 2009 at 11:29 AM, Peter Arnulf Lustig u...@yahoo.dewrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: How would you realize a delete-Link in a datagrid row?
Hi Ernesto, I don't get it: How can I change the Label-Text? When I try to change the Model of the component Label, nothing happens. The page reloads and the Label has the old Text (not the new one which is meant to be changed) - Ursprüngliche Mail Von: Ernesto Reinaldo Barreiro reier...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 11:38:33 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? What about replacing the link. e.g. via AJAX, with a new one containing the Do you really want to delete xyz warning... that once clicked actually deletes your entry... and refreshes the datagrid. You could even use the same link and have a flag that says userWantsToDeleteRow and use it to conditionally change the actions to do and the contents to display. Best, Ernesto On Wed, Sep 30, 2009 at 11:29 AM, Peter Arnulf Lustig u...@yahoo.dewrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? 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: How would you realize a delete-Link in a datagrid row?
I created a deteletButton as follows. I have a DeleteButton innerclass, and a method that adds this button to the panel that is shown in the table. private class DeleteButton extends Button { private static final long serialVersionUID = 1L; public DeleteButton(final String id, final IModelString model) { super(id, model); } @Override public void onSubmit() { try { deleteData((String) getModelObject()); // a method that does the actual data deletion in the database } catch (SQLException se) { error(StringResources.SQLERROR_GET + '\n' + se.getMessage()); } catch (IOException ie) { error(StringResources.IOERROR + '\n' + ie.getMessage()); } } @Override public boolean isEnabled() { return isEditingAuthorised(); } } private void addDeleteLink(final IModel? model) { String id = (String)getIdFromModel(model); // a method that extracts the id from the model (based on what kind of class is in the model) Button deleteButton = new DeleteButton(delete, new ModelString(id)); deleteButton.add(new Image(deleteIcon, new ResourceReference(EmptyIconReference.class, list-remove.png))); deleteButton.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');)); add(deleteButton); } I hope this helps. Regards, Linda Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.115/2404 - Release Date: 09/30/09 05:52:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How would you realize a delete-Link in a datagrid row?
Use an AJAX link inside a panel that you can replace via AJAX? Once the link is clicked it will go to back to the page set the flag I'm on delete mode and replace itself. All you have to do is has a model that says if(onDeleteMode) return Do you really want to delete XYZ? else { return Delete Record } and change what you do on your action if(onDeleteMode) { delete record and repain the grid (via AJAX) } else { setOnDeleteMode(true); repaints myself via AJAX } This is just one possibility out of many... Best, Ernesto On Wed, Sep 30, 2009 at 11:41 AM, Peter Arnulf Lustig u...@yahoo.dewrote: Hi Ernesto, I don't get it: How can I change the Label-Text? When I try to change the Model of the component Label, nothing happens. The page reloads and the Label has the old Text (not the new one which is meant to be changed) - Ursprüngliche Mail Von: Ernesto Reinaldo Barreiro reier...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 11:38:33 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? What about replacing the link. e.g. via AJAX, with a new one containing the Do you really want to delete xyz warning... that once clicked actually deletes your entry... and refreshes the datagrid. You could even use the same link and have a flag that says userWantsToDeleteRow and use it to conditionally change the actions to do and the contents to display. Best, Ernesto On Wed, Sep 30, 2009 at 11:29 AM, Peter Arnulf Lustig u...@yahoo.de wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? 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
AW: How would you realize a delete-Link in a datagrid row?
Thank you! Your solution is really nice. It functions well! I have a problem which the datagrid. After removing a row in the database it throws an exception, because wicket is unable to populate an item (I assume the deleted one) How can I tell wicket to reload the datagrid because something in the DB changed. - Ursprüngliche Mail Von: Linda van der Pal lvd...@heritageagenturen.nl An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 11:43:40 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? I created a deteletButton as follows. I have a DeleteButton innerclass, and a method that adds this button to the panel that is shown in the table. private class DeleteButton extends Button { private static final long serialVersionUID = 1L; public DeleteButton(final String id, final IModelString model) { super(id, model); } @Override public void onSubmit() { try { deleteData((String) getModelObject()); // a method that does the actual data deletion in the database } catch (SQLException se) { error(StringResources.SQLERROR_GET + '\n' + se.getMessage()); } catch (IOException ie) { error(StringResources.IOERROR + '\n' + ie.getMessage()); } } @Override public boolean isEnabled() { return isEditingAuthorised(); } } private void addDeleteLink(final IModel? model) { String id = (String)getIdFromModel(model); // a method that extracts the id from the model (based on what kind of class is in the model) Button deleteButton = new DeleteButton(delete, new ModelString(id)); deleteButton.add(new Image(deleteIcon, new ResourceReference(EmptyIconReference.class, list-remove.png))); deleteButton.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');)); add(deleteButton); } I hope this helps. Regards, Linda Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.115/2404 - Release Date: 09/30/09 05:52:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Rendered html to string
Hi all, does someone know how to render a wicket component into a String? Thanks Luca
AW: Rendered html to string
getMarkupStream().toString(); maybe? - Ursprüngliche Mail Von: Luca Provenzani eufor...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 12:32:19 Uhr Betreff: Rendered html to string Hi all, does someone know how to render a wicket component into a String? Thanks Luca - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Rendered html to string
http://mail-archives.apache.org/mod_mbox/wicket-users/200811.mbox/%3c5de41c7d0811050222r5948a447r5fd68b5cefac5...@mail.gmail.com%3e 2009/9/30 Peter Arnulf Lustig u...@yahoo.de: getMarkupStream().toString(); maybe? - Ursprüngliche Mail Von: Luca Provenzani eufor...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 12:32:19 Uhr Betreff: Rendered html to string Hi all, does someone know how to render a wicket component into a String? Thanks Luca - 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: better way to strip wicket markup / tags per page?
no clean solution seems to be possible. Inheritance seems to be clean On Wed, Sep 30, 2009 at 4:03 AM, Antoine van Wel antoine.van@gmail.comwrote: Craig: didn't consider that. So, no clean solution seems to be possible. Pedro: yes I was talking about having the wicket-tags turned on for the application except for a certain (xml) page, since it is causing parse errors in the xml there. Antoine On Tue, Sep 29, 2009 at 9:23 PM, Craig McIlwee craig.mcil...@openroadsconsulting.com wrote: I don't see how this can work reliably when there is more than 1 user, AFAIK wicket has no synchronization in place that prevents 2 pages from going through the render phase at the same time. So if one page finishes rendering and changes the setting to false while another page has just started rendering (e.g. the line immediately after change the setting to true) then that page will render with the wrong value. Craig -Original Message- From: Antoine van Wel [mailto:antoine.van@gmail.com] Sent: Tuesday, September 29, 2009 9:03 AM To: users@wicket.apache.org Subject: Re: better way to strip wicket markup / tags per page? Thanks for the lightning fast reply. Yes it works fine under development. Still I don't like it - after all these statements are also executed during production mode, and even though they can't do any harm there, I'd rather not see them there at all. More a matter of personal taste I guess. Anyway I have something in mind to improve it according to my taste. Will implement that when I got time... This is not really an urgent issue to me. Thanks anyway for the reply - I'm assuming now there really is no other way to do this than temporarily changing the global settings. Antoine On Tue, Sep 29, 2009 at 7:46 PM, Marat Radchenko slonopotamusor...@gmail.com wrote: In some situations during development... With that in mind, this solution is absolutely ok. 2009/9/29 Antoine van Wel antoine.van@gmail.com Hi, on the wiki[1] it is described how to get rid of wicket markup such as wicket:id attributes on a page basis. The solution looks like a dirty hack to me which may go wrong when for instance exceptions occur. Does anybody know of a better way? For completeness sake, here is the code duplicated from the wiki: private boolean stripTags; public TestPage() { stripTags = Application.get().getMarkupSettings().getStripWicketTags(); } @Override protected void onBeforeRender() { Application.get().getMarkupSettings().setStripWicketTags(true); } @Override protected void onAfterRender() { Application.get().getMarkupSettings().setStripWicketTags(stripTags); } Thanks in advance, Antoine. References: [1] http://cwiki.apache.org/WICKET/how-to-remove-wicket-markup-from-output.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
exclude wicket:panel
Don't display the wicket:panel tag 1- I am using a wicket panel to create a component here is the code. wicket:panel div ... some code /div /wicket:panel 2- The call to the component is div wicket:id=actionMenuOneactions/div 3- The generated HTML by wicket is div wicket:id=actionMenuOne id=actionMenuOne1 wicket:panel div ... some code /div /wicket:panel /div 4- The tag wicket:panel is breaking some YUI javascript... *Question: * is there a way to exclude wicket:panel tag for this component but keep the div wicket:id=actionMenuOne tag ? -- Martin Letendre 4230 Wilson Montréal, Qc 514.690.8027
Re: Rendered html to string
oops, yes, you are right! :-) 2009/9/30 Peter Arnulf Lustig u...@yahoo.de getMarkupStream().toString(); maybe? - Ursprüngliche Mail Von: Luca Provenzani eufor...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 12:32:19 Uhr Betreff: Rendered html to string Hi all, does someone know how to render a wicket component into a String? Thanks Luca - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: exclude wicket:panel
In your Application class add the following line: getMarkupSettings().setStripWicketTags(true); Martin Letendre wrote: Don't display the wicket:panel tag 1- I am using a wicket panel to create a component here is the code. wicket:panel div ... some code /div /wicket:panel 2- The call to the component is div wicket:id=actionMenuOneactions/div 3- The generated HTML by wicket is div wicket:id=actionMenuOne id=actionMenuOne1 wicket:panel div ... some code /div /wicket:panel /div 4- The tag wicket:panel is breaking some YUI javascript... *Question: * is there a way to exclude wicket:panel tag for this component but keep the div wicket:id=actionMenuOne tag ? -- Martin Letendre 4230 Wilson Montréal, Qc 514.690.8027 -- View this message in context: http://www.nabble.com/exclude-%3Cwicket%3Apanel%3E-tp25678826p25678951.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
Wrong path to wicket-event.js resulting in 404 after calling wicket from javascript
Hallo, I came across strange problem I do not know whether it is mine fault or wicket's problem. On a page, there is a widget, which list news records. Each record has an edit and delete link. Edit link opens new dialog in jquery's thickbox window, which is practically IFrame. The code for page, which holds form and which is displayed in the thickbox window: http://pastebin.com/m5ca60e78 The code for a link, which shows the thickbox window with a page in it: http://pastebin.com/m6339b3a En example usage: http://pastebin.com/m768350aa here on line 72 when I do: target.addComponent(ShopNewsWidgetPanel.this.get(news-container)); after ajax refresh of the component, which contains news records, each record containing edit link, there is 404 error found in the Ajax debug window. From firebug console I can find out that if I add a some component (here it is edit link, which is held by news-container), which also contains AbstractDefaultAjaxBehavior, then upon rendering head of the response, there is wrong path to wicket ajax resources: Correct path: http://localhost:8080/cz.madewithlove/app/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js Wrong path after ajax call: http://localhost:8080/cz.madewithlove/app/shop/rozkovec/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js The page is mounted like so: mount(new IndexedHybridUrlCodingStrategy(shop, ShopModulePage.class)); An ajax function, which is called in the page's ajax button onSubmit() method: function thickbox_window_close(url) { tb_remove(); //removes thickbox window // call url of the behavior, this behavior is attached to the link, which opens the page in thickbox window var wcall=wicketAjaxGet(url, null, null, function() {return true;}); return !wcall; } I could solve it by visiting all components of the parent container except behaviors and add them to the ajax request target, but it would be better to not bother about it and just add the parent container. Any pointers? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Rendered html to string
if you want just one component in the hierarchie to be rendered to a String you have to make a Behaviour and use the StringResponse-class to replace the hole Response in beforeRender for this component. in onRendered you can add the string again to the hole Response. We do this for caching HTML Fragments via EHCache. Martin Luca Provenzani schrieb: oops, yes, you are right! :-) 2009/9/30 Peter Arnulf Lustig u...@yahoo.de getMarkupStream().toString(); maybe? - Ursprüngliche Mail Von: Luca Provenzani eufor...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 12:32:19 Uhr Betreff: Rendered html to string Hi all, does someone know how to render a wicket component into a String? Thanks Luca - 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: Rendered html to string
it seems to be interesting for us... can you send a code example? 2009/9/30 Martin Sachs sachs.mar...@gmail.com if you want just one component in the hierarchie to be rendered to a String you have to make a Behaviour and use the StringResponse-class to replace the hole Response in beforeRender for this component. in onRendered you can add the string again to the hole Response. We do this for caching HTML Fragments via EHCache. Martin Luca Provenzani schrieb: oops, yes, you are right! :-) 2009/9/30 Peter Arnulf Lustig u...@yahoo.de getMarkupStream().toString(); maybe? - Ursprüngliche Mail Von: Luca Provenzani eufor...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 12:32:19 Uhr Betreff: Rendered html to string Hi all, does someone know how to render a wicket component into a String? Thanks Luca - 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: exclude wicket:panel
maybe you want have an custom WicketNamespaceHandler On Wed, Sep 30, 2009 at 8:01 AM, Alex Objelean alex_objel...@yahoo.comwrote: In your Application class add the following line: getMarkupSettings().setStripWicketTags(true); Martin Letendre wrote: Don't display the wicket:panel tag 1- I am using a wicket panel to create a component here is the code. wicket:panel div ... some code /div /wicket:panel 2- The call to the component is div wicket:id=actionMenuOneactions/div 3- The generated HTML by wicket is div wicket:id=actionMenuOne id=actionMenuOne1 wicket:panel div ... some code /div /wicket:panel /div 4- The tag wicket:panel is breaking some YUI javascript... *Question: * is there a way to exclude wicket:panel tag for this component but keep the div wicket:id=actionMenuOne tag ? -- Martin Letendre 4230 Wilson Montréal, Qc 514.690.8027 -- View this message in context: http://www.nabble.com/exclude-%3Cwicket%3Apanel%3E-tp25678826p25678951.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 -- Pedro Henrique Oliveira dos Santos
Re: AW: How would you realize a delete-Link in a datagrid row?
I used this with a AjaxFallbackDefaultDataTable and then I didn't have to tell it that the DB had changed. Peter Arnulf Lustig wrote: Thank you! Your solution is really nice. It functions well! I have a problem which the datagrid. After removing a row in the database it throws an exception, because wicket is unable to populate an item (I assume the deleted one) How can I tell wicket to reload the datagrid because something in the DB changed. - Ursprüngliche Mail Von: Linda van der Pal lvd...@heritageagenturen.nl An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 11:43:40 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? I created a deteletButton as follows. I have a DeleteButton innerclass, and a method that adds this button to the panel that is shown in the table. private class DeleteButton extends Button { private static final long serialVersionUID = 1L; public DeleteButton(final String id, final IModelString model) { super(id, model); } @Override public void onSubmit() { try { deleteData((String) getModelObject()); // a method that does the actual data deletion in the database } catch (SQLException se) { error(StringResources.SQLERROR_GET + '\n' + se.getMessage()); } catch (IOException ie) { error(StringResources.IOERROR + '\n' + ie.getMessage()); } } @Override public boolean isEnabled() { return isEditingAuthorised(); } } private void addDeleteLink(final IModel? model) { String id = (String)getIdFromModel(model); // a method that extracts the id from the model (based on what kind of class is in the model) Button deleteButton = new DeleteButton(delete, new ModelString(id)); deleteButton.add(new Image(deleteIcon, new ResourceReference(EmptyIconReference.class, list-remove.png))); deleteButton.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');)); add(deleteButton); } I hope this helps. Regards, Linda Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.115/2404 - Release Date: 09/30/09 05:52:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.115/2404 - Release Date: 09/30/09 05:52:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: How would you realize a delete-Link in a datagrid row?
could you tell me how to use this? I have a Dataview like this: dataView = new DataViewAdministrator(benutzer, new AdministratorDataProvider()) { } thanks! - Ursprüngliche Mail Von: Linda van der Pal lvd...@heritageagenturen.nl An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 13:37:44 Uhr Betreff: Re: AW: How would you realize a delete-Link in a datagrid row? I used this with a AjaxFallbackDefaultDataTable and then I didn't have to tell it that the DB had changed. Peter Arnulf Lustig wrote: Thank you! Your solution is really nice. It functions well! I have a problem which the datagrid. After removing a row in the database it throws an exception, because wicket is unable to populate an item (I assume the deleted one) How can I tell wicket to reload the datagrid because something in the DB changed. - Ursprüngliche Mail Von: Linda van der Pal lvd...@heritageagenturen.nl An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 11:43:40 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? I created a deteletButton as follows. I have a DeleteButton innerclass, and a method that adds this button to the panel that is shown in the table. private class DeleteButton extends Button { private static final long serialVersionUID = 1L; public DeleteButton(final String id, final IModelString model) { super(id, model); } @Override public void onSubmit() { try { deleteData((String) getModelObject()); // a method that does the actual data deletion in the database } catch (SQLException se) { error(StringResources.SQLERROR_GET + '\n' + se.getMessage()); } catch (IOException ie) { error(StringResources.IOERROR + '\n' + ie.getMessage()); } } @Override public boolean isEnabled() { return isEditingAuthorised(); } } private void addDeleteLink(final IModel? model) { String id = (String)getIdFromModel(model); // a method that extracts the id from the model (based on what kind of class is in the model) Button deleteButton = new DeleteButton(delete, new ModelString(id)); deleteButton.add(new Image(deleteIcon, new ResourceReference(EmptyIconReference.class, list-remove.png))); deleteButton.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');)); add(deleteButton); } I hope this helps. Regards, Linda Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.115/2404 - Release Date: 09/30/09 05:52:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.115/2404 - Release Date: 09/30/09 05:52:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: exclude wicket:panel
My component is ment to be distribute to a third party. I have no access to the Application class. Is there a way to apply the same behavior to a single component... On Wed, Sep 30, 2009 at 7:01 AM, Alex Objelean alex_objel...@yahoo.comwrote: In your Application class add the following line: getMarkupSettings().setStripWicketTags(true); Martin Letendre wrote: Don't display the wicket:panel tag 1- I am using a wicket panel to create a component here is the code. wicket:panel div ... some code /div /wicket:panel 2- The call to the component is div wicket:id=actionMenuOneactions/div 3- The generated HTML by wicket is div wicket:id=actionMenuOne id=actionMenuOne1 wicket:panel div ... some code /div /wicket:panel /div 4- The tag wicket:panel is breaking some YUI javascript... *Question: * is there a way to exclude wicket:panel tag for this component but keep the div wicket:id=actionMenuOne tag ? -- Martin Letendre 4230 Wilson Montréal, Qc 514.690.8027 -- View this message in context: http://www.nabble.com/exclude-%3Cwicket%3Apanel%3E-tp25678826p25678951.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 -- Martin Letendre 4230 Wilson Montréal, Qc 514.690.8027
Re: exclude wicket:panel
take a look at how GMap2 component resolve that problem: /** * @see org.apache.wicket.MarkupContainer#onRender(org.apache.wicket.markup.MarkupStream) */ @Override protected void onRender(MarkupStream markupStream) { super.onRender(markupStream); if (Application.DEVELOPMENT.equalsIgnoreCase(Application.get().getConfigurationType()) !Application.get().getMarkupSettings().getStripWicketTags()) { log.warn(Application is in DEVELOPMENT mode Wicket tags are not stripped, + Firefox 3.0 will not render the GMap. + Change to DEPLOYMENT mode || turn on Wicket tags stripping. + See: + http://www.nabble.com/Gmap2-problem-with-Firefox-3.0-to18137475.html.;); } } On Wed, Sep 30, 2009 at 8:55 AM, Martin Letendre letendre.mar...@gmail.comwrote: My component is ment to be distribute to a third party. I have no access to the Application class. Is there a way to apply the same behavior to a single component... On Wed, Sep 30, 2009 at 7:01 AM, Alex Objelean alex_objel...@yahoo.com wrote: In your Application class add the following line: getMarkupSettings().setStripWicketTags(true); Martin Letendre wrote: Don't display the wicket:panel tag 1- I am using a wicket panel to create a component here is the code. wicket:panel div ... some code /div /wicket:panel 2- The call to the component is div wicket:id=actionMenuOneactions/div 3- The generated HTML by wicket is div wicket:id=actionMenuOne id=actionMenuOne1 wicket:panel div ... some code /div /wicket:panel /div 4- The tag wicket:panel is breaking some YUI javascript... *Question: * is there a way to exclude wicket:panel tag for this component but keep the div wicket:id=actionMenuOne tag ? -- Martin Letendre 4230 Wilson Montréal, Qc 514.690.8027 -- View this message in context: http://www.nabble.com/exclude-%3Cwicket%3Apanel%3E-tp25678826p25678951.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 -- Martin Letendre 4230 Wilson Montréal, Qc 514.690.8027 -- Pedro Henrique Oliveira dos Santos
Re: Consequences of sharing ajax request target by attribute or by static determination
I think ajax fallback strategy is a good idea: class AjaxFallbackEvent{ void handleSomething( target){ // user implementations test for target == null } } On Wed, Sep 30, 2009 at 4:38 AM, Per Newgro per.new...@gmx.ch wrote: Hi *, i would like to know if there hidden consequences if i exchange sharing by attribute through sharing by static determination. To couple my event-components with it's higher ranking components i use a listener based approach. Each parent adds a listener to the child can be involved if an event occurs. The problem is that i sometimes use ajax event components and sometimes not. Thus until now i have to provide two different event classes. The one for ajax usage contains an attribute with the current ajax request target. The event sources creates the event and provides the request target. But now if found AjaxRequestTarget.get. Javadoc says Static method that returns current |AjaxRequestTarget| http://wicket.apache.org/docs/1.4/org/apache/wicket/ajax/AjaxRequestTarget.html or |null| of no |AjaxRequestTarget| http://wicket.apache.org/docs/1.4/org/apache/wicket/ajax/AjaxRequestTarget.html is available. So this exactly what i tried to achieve with the two event types. So my question is: Can i simplify my event objects by throwing the request target attribute away and use the AjaxRequestTarget.get method in my listener chain? Or why is this not a good idea? Thanks for clearing it to me. Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
Re: AW: AW: How would you realize a delete-Link in a datagrid row?
table = new AjaxFallbackDefaultDataTable(datatable, createColumns(), contentProvider, 10); @Override protected IColumn?[] createColumns() { IColumn?[] columns = new IColumn[3]; columns[0] = createActionsColumn(); columns[1] = new PropertyColumnString(new ResourceModel(label.name), name, name); columns[2] = new PropertyColumnString(new ResourceModel(label.owners), owners, owners); return columns; } So datatable would become benutzer, contentProvider would become new AdministratorDataProvider(), and you'd have to add your own columns. (The number 10 is the number of rows you want to show on a page.) On the Wicket-examples site is an extensive example of this construct. Regards, Linda Peter Arnulf Lustig wrote: could you tell me how to use this? I have a Dataview like this: dataView = new DataViewAdministrator(benutzer, new AdministratorDataProvider()) { } thanks! - Ursprüngliche Mail Von: Linda van der Pal lvd...@heritageagenturen.nl An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 13:37:44 Uhr Betreff: Re: AW: How would you realize a delete-Link in a datagrid row? I used this with a AjaxFallbackDefaultDataTable and then I didn't have to tell it that the DB had changed. Peter Arnulf Lustig wrote: Thank you! Your solution is really nice. It functions well! I have a problem which the datagrid. After removing a row in the database it throws an exception, because wicket is unable to populate an item (I assume the deleted one) How can I tell wicket to reload the datagrid because something in the DB changed. - Ursprüngliche Mail Von: Linda van der Pal lvd...@heritageagenturen.nl An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 11:43:40 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? I created a deteletButton as follows. I have a DeleteButton innerclass, and a method that adds this button to the panel that is shown in the table. private class DeleteButton extends Button { private static final long serialVersionUID = 1L; public DeleteButton(final String id, final IModelString model) { super(id, model); } @Override public void onSubmit() { try { deleteData((String) getModelObject()); // a method that does the actual data deletion in the database } catch (SQLException se) { error(StringResources.SQLERROR_GET + '\n' + se.getMessage()); } catch (IOException ie) { error(StringResources.IOERROR + '\n' + ie.getMessage()); } } @Override public boolean isEnabled() { return isEditingAuthorised(); } } private void addDeleteLink(final IModel? model) { String id = (String)getIdFromModel(model); // a method that extracts the id from the model (based on what kind of class is in the model) Button deleteButton = new DeleteButton(delete, new ModelString(id)); deleteButton.add(new Image(deleteIcon, new ResourceReference(EmptyIconReference.class, list-remove.png))); deleteButton.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');)); add(deleteButton); } I hope this helps. Regards, Linda Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.115/2404 - Release Date: 09/30/09 05:52:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.115/2404 - Release Date: 09/30/09 05:52:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail:
Re: How would you realize a delete-Link in a datagrid row?
Another approach would be to created a model window to appear when the delete link is clicked. With the message Are you sure you want to delete xxx? If you select yes, the row is deleted then ajax is used to refresh the dataview. Let me know if you want to use this approach and I will post an example. Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - 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/How-would-you-realize-a-%22delete%22-Link-in-a-datagrid-row--tp2561p25680407.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
Component initModel() order (design issue?)
Hi, I was just trying to create a component of my own which - in some of my pages - is created without a model. In the initModel() method I would then call super.initModel() and wrap the resulting model for use in a child component. The problem is the initialization order: The child model's initModel() gets called first, the parent (my custom component) does not yet have a model (getModelImpl() returns null) so it goes up farther in the component hierarchy and retrieves a wrong model. Looking at the Component source code (Wicket 1.4.1) I see a commented out line where initModel() used to to call the parent getModel() instead of getModelImpl(). There's also a comment explaining that doing so would initialize many inbetween completely useless models. Well, not so useless for what I am trying to do I guess. So, from my perspective this looks like a bug that causes necessary initialization to be bypassed. Obviously though it was done like that on purpose, so I decided to put the issue up here instead of filing a bug report. Has anyone else run into similar issues? Would it really be so bad to just call getModel()? Cheers Edmund -- Liland ...does IT better Liland IT GmbH Software Architekt email: edmund.urb...@liland.at office: +43 (0)463 220111 | fax: +43 (0)463 220111 33 | mobil: +43 (0)699 122011 16 http://www.Liland.at - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: How would you realize a delete-Link in a datagrid row?
How do you achieve, that the dataview is refreshed after clicking delete? - Ursprüngliche Mail Von: rmattler robertmatt...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 14:51:19 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? Another approach would be to created a model window to appear when the delete link is clicked. With the message Are you sure you want to delete xxx? If you select yes, the row is deleted then ajax is used to refresh the dataview. Let me know if you want to use this approach and I will post an example. Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - 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/How-would-you-realize-a-%22delete%22-Link-in-a-datagrid-row--tp2561p25680407.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: exclude wicket:panel
If you're distributing it to third parties, it's really their problem - in that this will be universal for all components in their app. If they don't want the tags there, they will strip them (which is default in production). -- Jeremy Thomerson http://www.wickettraining.com On Wed, Sep 30, 2009 at 6:55 AM, Martin Letendre letendre.mar...@gmail.comwrote: My component is ment to be distribute to a third party. I have no access to the Application class. Is there a way to apply the same behavior to a single component... On Wed, Sep 30, 2009 at 7:01 AM, Alex Objelean alex_objel...@yahoo.com wrote: In your Application class add the following line: getMarkupSettings().setStripWicketTags(true); Martin Letendre wrote: Don't display the wicket:panel tag 1- I am using a wicket panel to create a component here is the code. wicket:panel div ... some code /div /wicket:panel 2- The call to the component is div wicket:id=actionMenuOneactions/div 3- The generated HTML by wicket is div wicket:id=actionMenuOne id=actionMenuOne1 wicket:panel div ... some code /div /wicket:panel /div 4- The tag wicket:panel is breaking some YUI javascript... *Question: * is there a way to exclude wicket:panel tag for this component but keep the div wicket:id=actionMenuOne tag ? -- Martin Letendre 4230 Wilson Montréal, Qc 514.690.8027 -- View this message in context: http://www.nabble.com/exclude-%3Cwicket%3Apanel%3E-tp25678826p25678951.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 -- Martin Letendre 4230 Wilson Montréal, Qc 514.690.8027
RE: RadioChoice and Ajax to display a panel of dropdowns
I did not override the method.I just did and it is still not working. Here is what I have: Also, where would one find this type of information. I don't think the online example show it and blindly guessing methods to look at in javadoc doesn't seem efficient. HTML: tr tdwicket:message key=userTypeType of User:/wicket:message/td td span wicket:id=accountType input type=radio /option 1 /span /td /tr tr td/td tdspan wicket:id=typeBoxThe type box/span/td /tr Code: // Account Type sub box final WebMarkupContainer typeBox = new WebMarkupContainer(typeBox) { /* (non-Javadoc) * @see org.apache.wicket.Component#callOnBeforeRenderIfNotVisible() */ @Override protected boolean callOnBeforeRenderIfNotVisible() { return true; } }; typeBox.setVisible(false); typeBox.setOutputMarkupId(true); add(typeBox); // Account Type Select List accountTypes = accountTypeDao.findAll(); ChoiceRenderer accountTypeChoiceRenderer = new ChoiceRenderer(name, code); RadioChoice accountTypeRadio = new RadioChoice(accountType, accountTypes, accountTypeChoiceRenderer); //accountTypeRadio.setRequired(true); // add the on click to the radio button accountTypeRadio.add(new AjaxFormChoiceComponentUpdatingBehavior () { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { RadioChoice choice = (RadioChoice) getComponent(); choice.updateModel(); if (((AccountType) choice.getModelObject()).getCode().equalsIgnoreCase(REP)) { typeBox.setVisible(true); } else { typeBox.setVisible(false); } target.addComponent(typeBox); } }); add(accountTypeRadio); -Original Message- From: Per Newgro [mailto:per.new...@gmx.ch] Sent: Wednesday, September 30, 2009 2:17 AM To: users@wicket.apache.org Subject: Re: RadioChoice and Ajax to display a panel of dropdowns Hey Jeff, did you override this? /** * Override this method if you want onBeforeRender to be called even when your component is not * visible. default this returns false. * * @return boolean, if true then onBeforeRender is called even for none visible components, * default false. * * @see Component#onBeforeRender() */ protected boolean callOnBeforeRenderIfNotVisible() { return false; } If you add a visible and an invisible panel you have to override this on the invisible one. hth Cheers Per I want to create a list of radio buttons [I have that working] and an ajax event to fire whenever a radio button is clicked [I have this working]. If the radio button matches the one I am interested in then I want to display additional information that must be filled in. A radio button selection is required. I cannot get the additional information to display when I add the component back to the target. I think it is because the additional information is originally set to not visible so the output markup id is not written out. How would I go about doing this? It seems pretty standard. Do I need to use panels and swap the appropriate panel [1 - empty panel, 2 - panel with additional info] into the target when needed? That seems like a lot of code to do something fairly simple. My code is below. Thanks. Jeff = HTML: tr tdwicket:message key=userTypeType of User:/wicket:message/td td span wicket:id=accountType input type=radio /option 1 /span /td /tr tr td/td tdspan wicket:id=typeBoxThe
[tinymce] problem adding/removing TinyMceBehavior dinamically
Hi. I have a problem with this example code: tinyMceBehavior = new TinyMceBehavior(); PropertyModelBoolean richProperty = new PropertyModel(model, rich); add(new AjaxCheckBox(switchRte, richProperty) { @Override protected void onUpdate(AjaxRequestTarget target) { if (getModelObject()) { textArea.add(tinyMceBehavior); } else { textArea.remove(tinyMceBehavior); tinyMceBehavior = new TinyMceBehavior(); } refresh(target); } }); the purpose is to have a checkbox that add and remove the TinyMceBehavior from a text area. It works fine but I have this problem: when I Submit the form the textArea is in after REMOVING the behavior, I have a javascript error: t.win.document is null firebug show the error in tiny_mce_src.js at line 5376 if (!r) r = isIE ? t.win.document.body.createTextRange() : t.win.document.createRange(); I am using tinymce 3.2.7 but the same problem occurs with tinymce used in trunk version of wicket-contrib-tinymce. the effect is that submit does not work. if I click on checkbox again, everything continue to work. Any idea? -- Daniele Dellafiore http://blog.ildella.net http://twitter.com/ildella - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: TinyMCE in an Ajax loaded panel
On Thu, Nov 27, 2008 at 5:57 PM, Martijn Lindhout mlindh...@jointeffort.nl wrote: Hi all, I searched nabble, but couldn't find any recent posts that brought me a solution to this problem: I have a page with two panels, a master/detail setup. The master has a list of items, the detail a TinyMCE editor. The details panel is invisible until the user clicks an item in the master list. The list disappears and the detail panel is shown, all using Ajax. The problem is that the TinyMCE editor doesn't appear, it's just a normal textarea. Has anyone a solution to this problem? Thanks yes, I had this problem and I solved this. I wrote about this here: http://wicketbyexample.com/wicket-tinymce-some-advanced-tips/ specifically in the paragraph Switching to Rich Text after the page is load it is all working now but I have a problem with the checkbox that enable/disable the behavior. I am going to write on this mailing list for help about that. -- Daniele Dellafiore http://blog.ildella.net http://twitter.com/ildella - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component initModel() order (design issue?)
The child model's initModel() gets called first There are no especial ordering programing to initModels calls. Basically they are called by public final IModel? getDefaultModel() { IModel? model = getModelImpl(); // If model is null if (model == null) { // give subclass a chance to lazy-init model model = initModel(); setModelImpl(model); } return model; } What about your custom component gain an model that implements IComponentInheritedModel and assign his children default models with the desired logic? On IComponentInheritedModel you can access your custom component parent model, and if you use getDefaultModel method, you don't need to care with initialization ordering too... On Wed, Sep 30, 2009 at 9:51 AM, Edmund Urbani e...@liland.org wrote: Hi, I was just trying to create a component of my own which - in some of my pages - is created without a model. In the initModel() method I would then call super.initModel() and wrap the resulting model for use in a child component. The problem is the initialization order: The child model's initModel() gets called first, the parent (my custom component) does not yet have a model (getModelImpl() returns null) so it goes up farther in the component hierarchy and retrieves a wrong model. Looking at the Component source code (Wicket 1.4.1) I see a commented out line where initModel() used to to call the parent getModel() instead of getModelImpl(). There's also a comment explaining that doing so would initialize many inbetween completely useless models. Well, not so useless for what I am trying to do I guess. So, from my perspective this looks like a bug that causes necessary initialization to be bypassed. Obviously though it was done like that on purpose, so I decided to put the issue up here instead of filing a bug report. Has anyone else run into similar issues? Would it really be so bad to just call getModel()? Cheers Edmund -- Liland ...does IT better Liland IT GmbH Software Architekt email: edmund.urb...@liland.at office: +43 (0)463 220111 | fax: +43 (0)463 220111 33 | mobil: +43 (0)699 122011 16 http://www.Liland.at - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
Re: Wrong path to wicket-event.js resulting in 404 after calling wicket from javascript
I believe the code that causes the problem is # @Override # protected CharSequence getURL() # { # return super.getURL() + String.format(TB_iframe=trueheight=%dwidth=%dmodal=false, getHeight(), getWidth()); # } IFAIK wicket encodes URL parameters in a special form. And the last part is the number of ../ required for prepending the resource urls. In your app it might be zero so wicket do not generate appropriate ../../.. for your app/shop/rozkovec mount string. Vit Rozkovec wrote: Hallo, I came across strange problem I do not know whether it is mine fault or wicket's problem. On a page, there is a widget, which list news records. Each record has an edit and delete link. Edit link opens new dialog in jquery's thickbox window, which is practically IFrame. The code for page, which holds form and which is displayed in the thickbox window: http://pastebin.com/m5ca60e78 The code for a link, which shows the thickbox window with a page in it: http://pastebin.com/m6339b3a En example usage: http://pastebin.com/m768350aa here on line 72 when I do: target.addComponent(ShopNewsWidgetPanel.this.get(news-container)); after ajax refresh of the component, which contains news records, each record containing edit link, there is 404 error found in the Ajax debug window. From firebug console I can find out that if I add a some component (here it is edit link, which is held by news-container), which also contains AbstractDefaultAjaxBehavior, then upon rendering head of the response, there is wrong path to wicket ajax resources: Correct path: http://localhost:8080/cz.madewithlove/app/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js Wrong path after ajax call: http://localhost:8080/cz.madewithlove/app/shop/rozkovec/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js The page is mounted like so: mount(new IndexedHybridUrlCodingStrategy(shop, ShopModulePage.class)); An ajax function, which is called in the page's ajax button onSubmit() method: function thickbox_window_close(url) { tb_remove(); //removes thickbox window // call url of the behavior, this behavior is attached to the link, which opens the page in thickbox window var wcall=wicketAjaxGet(url, null, null, function() {return true;}); return !wcall; } I could solve it by visiting all components of the parent container except behaviors and add them to the ajax request target, but it would be better to not bother about it and just add the parent container. Any pointers? - 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/Wrong-path-to-wicket-event.js-resulting-in-404-after-calling-wicket-from-javascript-tp25678997p25681934.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
What is preferred/recommended way to localize texts of non-visual components
Hi all, I have an enum type e.g. public enum MapType UNDEFINED,ROADMAP,MOBILE,SATELITE,TERRAIN,HYBRID; public static String toKeyword(MapType mapType) { switch (mapType) { case ROADMAP: return roadmap; ... public static MapType fromKeyword(final String keyword) { final String kw = keyword.toLowerCase(); if (kw.equals(roadmap)) return ROADMAP; else if ... and I'd like to localize a verbal representation of particular elements which I could share throughout Wicket application in many places. i.e. I need something like this: public static String verbose(MapType mapType) { switch (mapType) { case ROADMAP: return getString(verbROADMAP); ... What is a preferred/recommended way to localize it? Thanks, Petr - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How would you realize a delete-Link in a datagrid row?
Sorry spelling error not model window but modal window. rmattler wrote: Another approach would be to created a model window to appear when the delete link is clicked. With the message Are you sure you want to delete xxx? If you select yes, the row is deleted then ajax is used to refresh the dataview. Let me know if you want to use this approach and I will post an example. Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - 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/How-would-you-realize-a-%22delete%22-Link-in-a-datagrid-row--tp2561p25681996.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
AW: How would you realize a delete-Link in a datagrid row?
yes I thought it... :) How do you achieve that the dataview is refreshed after deletion of a row? - Ursprüngliche Mail Von: rmattler robertmatt...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 16:19:11 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? Sorry spelling error not model window but modal window. rmattler wrote: Another approach would be to created a model window to appear when the delete link is clicked. With the message Are you sure you want to delete xxx? If you select yes, the row is deleted then ajax is used to refresh the dataview. Let me know if you want to use this approach and I will post an example. Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - 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/How-would-you-realize-a-%22delete%22-Link-in-a-datagrid-row--tp2561p25681996.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: What is preferred/recommended way to localize texts of non-visual components
Hi Petr We use a custom EnumConverter for that. It can be added to the application like so: @Override protected IConverterLocator newConverterLocator () { ConverterLocator converterLocator = (ConverterLocator) super.newConverterLocator(); converterLocator.set(MyEnum.class, new EnumConverter()); } EnumConverter: ... public String convertToString (Object value, Locale locale) { return EnumUtils.getEnumFromResources((Enum?) value, value.toString()); } ... Then the following helper method looks the enum up in the string resources... /** * Tries to resolve a given Enum instance against the resources. * The following keys are searched for in the resources:br/ * biIf the enum is defined as a top-level enum:/i/b * ul * lipackage.EnumClassName.ENUMNAME/li * liEnumClassName.ENUMNAME/li * /ul * biIf the enum is defined inside another class:/i/b * ul * lipackage.SomeClass$EnumClassName.ENUMNAME/li * lipackage.SomeClass.EnumClassName.ENUMNAME/li * liSomeClass.EnumClassName.ENUMNAME/li * liEnumClassName.ENUMNAME/li * /ul * If no resource could be found, the specified defaultValue is returned. * * @param enu The Enum instance * @param defaultValue The default value in case no resource string was found * @return The matching resource string or ttdefaultValue/tt if there was no match */ public static String getEnumFromResources (Enum? enu, String defaultValue) { final Localizer loc = WebApplication.get().getResourceSettings().getLocalizer(); ListString keyList = new ArrayListString(); keyList.add(enu.getClass().getName()); keyList.add(enu.getClass().getCanonicalName()); if (enu.getClass().getDeclaringClass() != null) { keyList.add(enu.getClass().getDeclaringClass().getSimpleName()+.+enu.getClass().getSimpleName()); } keyList.add(enu.getClass().getSimpleName()); for (String key : keyList) { // The empty string needs to be used here because null is being treated as 'not found', // thus might result in a warning string being returned. String res = loc.getString(key+.+enu.name(), null, ); if (!.equals(res)) { return res; } } return defaultValue; } Petr Fejfar wrote: Hi all, I have an enum type e.g. public enum MapType UNDEFINED,ROADMAP,MOBILE,SATELITE,TERRAIN,HYBRID; public static String toKeyword(MapType mapType) { switch (mapType) { case ROADMAP: return roadmap; ... public static MapType fromKeyword(final String keyword) { final String kw = keyword.toLowerCase(); if (kw.equals(roadmap)) return ROADMAP; else if ... and I'd like to localize a verbal representation of particular elements which I could share throughout Wicket application in many places. i.e. I need something like this: public static String verbose(MapType mapType) { switch (mapType) { case ROADMAP: return getString(verbROADMAP); ... What is a preferred/recommended way to localize it? Thanks, Petr - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org smime.p7s Description: S/MIME Cryptographic Signature
Re: Complicated workflows
I tried JBoss JBPM and it worked for complex compound workflows. It also had a eclipse designer plugin that could save the workflow image and provided a class that visualised the current workflow state. It had persistence module that was based on Hibernate. I had just to implement simple UI to present a user with workflows and tasks. I believe user can stay unaware about how complex is the workflow and whether it is compound. Phil Housley wrote: Hello list, I'm currently working on some ideas for building apps with fairly complex workflows. My aim is to find a nice pattern/framework for building apps where each unit of work involves many panels, several forms, lots of decisions and so on. In particular I'm aiming at apps where you need to be very confident about exactly what is happening, so very strict control of actions, being careful of multiple renderings of a page each trying to change the server data, and so on. Also, I'm wondering about some options for declarative building of workflows out of existing tasks. My current design involves running from a special page, which maintains a stack of tasks. One type of task is a Workflow, which can be configured to automatically spawn subtasks as required, based on the result of previous tasks. Another type of task is based on a panel, and is able to cause itself to be rendered. The stack processor makes sure that each task is invoked at the right time, that a task can render if it is at the top of the stack, that only the top of the stack can be invoked from a form and so on. This is working ok for some silly demo cases, but there are various issues. For example, any task that is not also a component cannot access dependency injection, or set error messages and so on. I'm not sure how to get around this at the moment, as I don't want to force every task to be a component, when many will likely have no cause to ever be rendered. So, the reason I'm posting is to ask mainly two things: 1) Is this of interest to anyone else? All the code is my own, so I'll open source it if there seems to be some future in it. 2) If so, does anyone have any comments on my current design? Clearly there are problems with it, but should I carry on trying to find ways to work around them, or does the whole thing sounds like so much crack? Thanks, -- Phil Housley - 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/Complicated-workflows-tp25671027p25682285.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: What is preferred/recommended way to localize texts of non-visual components
I don't know if you need wicket api to reach your objective: public enum MapType { UNDEFINED, ROADMAP, MOBILE, SATELITE, TERRAIN, HYBRID; public String toKeyword() { return toString().toLowerCase(); } public String verbose() { return verb + this.toString(); } public static MapType fromKeyword(final String keyword) { return Enum.valueOf(MapType.class, keyword.toUpperCase()); } } On Wed, Sep 30, 2009 at 11:22 AM, Matthias Keller matthias.kel...@ergon.chwrote: Hi Petr We use a custom EnumConverter for that. It can be added to the application like so: @Override protected IConverterLocator newConverterLocator () { ConverterLocator converterLocator = (ConverterLocator) super.newConverterLocator(); converterLocator.set(MyEnum.class, new EnumConverter()); } EnumConverter: ... public String convertToString (Object value, Locale locale) { return EnumUtils.getEnumFromResources((Enum?) value, value.toString()); } ... Then the following helper method looks the enum up in the string resources... /** * Tries to resolve a given Enum instance against the resources. * The following keys are searched for in the resources:br/ * biIf the enum is defined as a top-level enum:/i/b * ul * lipackage.EnumClassName.ENUMNAME/li * liEnumClassName.ENUMNAME/li * /ul * biIf the enum is defined inside another class:/i/b * ul * lipackage.SomeClass$EnumClassName.ENUMNAME/li * lipackage.SomeClass.EnumClassName.ENUMNAME/li * liSomeClass.EnumClassName.ENUMNAME/li * liEnumClassName.ENUMNAME/li * /ul * If no resource could be found, the specified defaultValue is returned. * * @param enu The Enum instance * @param defaultValue The default value in case no resource string was found * @return The matching resource string or ttdefaultValue/tt if there was no match */ public static String getEnumFromResources (Enum? enu, String defaultValue) { final Localizer loc = WebApplication.get().getResourceSettings().getLocalizer(); ListString keyList = new ArrayListString(); keyList.add(enu.getClass().getName()); keyList.add(enu.getClass().getCanonicalName()); if (enu.getClass().getDeclaringClass() != null) { keyList.add(enu.getClass().getDeclaringClass().getSimpleName()+.+enu.getClass().getSimpleName()); } keyList.add(enu.getClass().getSimpleName()); for (String key : keyList) { // The empty string needs to be used here because null is being treated as 'not found', // thus might result in a warning string being returned. String res = loc.getString(key+.+enu.name(), null, ); if (!.equals(res)) { return res; } } return defaultValue; } Petr Fejfar wrote: Hi all, I have an enum type e.g. public enum MapType UNDEFINED,ROADMAP,MOBILE,SATELITE,TERRAIN,HYBRID; public static String toKeyword(MapType mapType) { switch (mapType) { case ROADMAP: return roadmap; ... public static MapType fromKeyword(final String keyword) { final String kw = keyword.toLowerCase(); if (kw.equals(roadmap)) return ROADMAP; else if ... and I'd like to localize a verbal representation of particular elements which I could share throughout Wicket application in many places. i.e. I need something like this: public static String verbose(MapType mapType) { switch (mapType) { case ROADMAP: return getString(verbROADMAP); ... What is a preferred/recommended way to localize it? Thanks, Petr - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
Re: What is preferred/recommended way to localize texts of non-visual components
On my applications I add an IStringResourceLoader that looks for resources at packages where beans are defined... So, all I do is register a key like xxx.mypakage.MapType:MOBILE and then this IStringResourceLoader will look for a resource file namedBeans.properties at package xxx.mypakage and then look for property MapType.MOBILE on that resource... That way this localization is common to all pages, panels, etc, using the enum... or Bean. I know Igor added a package resources some time ago, but don't know if that can replace what I'm doing... Hope this is what you where asking for? Best, Ernesto On Wed, Sep 30, 2009 at 4:18 PM, Petr Fejfar petr.fej...@gmail.com wrote: Hi all, I have an enum type e.g. public enum MapType UNDEFINED,ROADMAP,MOBILE,SATELITE,TERRAIN,HYBRID; public static String toKeyword(MapType mapType) { switch (mapType) { case ROADMAP: return roadmap; ... public static MapType fromKeyword(final String keyword) { final String kw = keyword.toLowerCase(); if (kw.equals(roadmap)) return ROADMAP; else if ... and I'd like to localize a verbal representation of particular elements which I could share throughout Wicket application in many places. i.e. I need something like this: public static String verbose(MapType mapType) { switch (mapType) { case ROADMAP: return getString(verbROADMAP); ... What is a preferred/recommended way to localize it? Thanks, Petr - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: What is preferred/recommended way to localize texts of non-visual components
Sorry, I should has said Igor and Juergen... look for org.apache.wicket.resource.loader.PackageStringResourceLoader Ernesto On Wed, Sep 30, 2009 at 4:37 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: On my applications I add an IStringResourceLoader that looks for resources at packages where beans are defined... So, all I do is register a key like xxx.mypakage.MapType:MOBILE and then this IStringResourceLoader will look for a resource file named Beans.properties at package xxx.mypakage and then look for property MapType.MOBILE on that resource... That way this localization is common to all pages, panels, etc, using the enum... or Bean. I know Igor added a package resources some time ago, but don't know if that can replace what I'm doing... Hope this is what you where asking for? Best, Ernesto On Wed, Sep 30, 2009 at 4:18 PM, Petr Fejfar petr.fej...@gmail.comwrote: Hi all, I have an enum type e.g. public enum MapType UNDEFINED,ROADMAP,MOBILE,SATELITE,TERRAIN,HYBRID; public static String toKeyword(MapType mapType) { switch (mapType) { case ROADMAP: return roadmap; ... public static MapType fromKeyword(final String keyword) { final String kw = keyword.toLowerCase(); if (kw.equals(roadmap)) return ROADMAP; else if ... and I'd like to localize a verbal representation of particular elements which I could share throughout Wicket application in many places. i.e. I need something like this: public static String verbose(MapType mapType) { switch (mapType) { case ROADMAP: return getString(verbROADMAP); ... What is a preferred/recommended way to localize it? Thanks, Petr - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: User name validation - how to check database to find if a name has already been taken?
igor.vaynberg wrote: form { onsubmit() { try { users.persist(getmodelobject()); } catch (usernamealreadyexistsexception e) { error(error.username.exists); } } } -igor Thanks, it works like a charm. I did not know I could show an error message by calling Component.error and then use a filter to catch all error messages targeting a specific FormComponent. -- View this message in context: http://www.nabble.com/User-name-validation---how-to-check-database-to-find-if-a-name-has--already-been-taken--tp25614625p25682499.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: User name validation - how to check database to find if a name has already been taken?
why do you use an exception for user already exits?Don`t you think that return true/false, could be better? i said that, because if the application start growing, you will have lot of exceptions class. thanks, NM On Wed, Sep 30, 2009 at 4:43 PM, Paul Huang paulhuan...@gmail.com wrote: igor.vaynberg wrote: form { onsubmit() { try { users.persist(getmodelobject()); } catch (usernamealreadyexistsexception e) { error(error.username.exists); } } } -igor Thanks, it works like a charm. I did not know I could show an error message by calling Component.error and then use a filter to catch all error messages targeting a specific FormComponent. -- View this message in context: http://www.nabble.com/User-name-validation---how-to-check-database-to-find-if-a-name-has--already-been-taken--tp25614625p25682499.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: User name validation - how to check database to find if a name has already been taken?
The AbstractValidator approach is fine, or you can do it the shorter way the Igor showed. Either way, when the page that has the username is submitted, you're going to have to write that record to the database, even if you don't have all the info. The way you wrote the question, I presume you are collecting info on multiple pages. First page gets username et al, then next as in a wizard page. When you check the username and it's not in use, write the record. The table should have audit columns that include record_status and last_mod_datetime. Initially write the record with status I (in process) and when the user is finished registering, update it with A (active). If the user fills out page 1 and then closes the browser you'll have a record there with status I. You'll need a job that fires off periodically (I do it once a day at 2 or 3am) that finds those records that are more than, say, 24 hours old, and purges them. Then, to quote a sith, there is no conflict. -hth Thanks for your suggestion. Currently, I only have a single user input page. But as the application evolves, I may eventually need to have a wizard and implement the record_status check process as you suggested to make sure that the database is always consistent. -- View this message in context: http://www.nabble.com/User-name-validation---how-to-check-database-to-find-if-a-name-has--already-been-taken--tp25614625p25682624.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: [tinymce] problem adding/removing TinyMceBehavior dinamically
It's not possible to add TinyMCE dynamically due to the way TinyMCE works. What you can do however, is pre-load TinyMCE, and dynamically enable/disable it on a component. Daniele Dellafiore wrote: Hi. I have a problem with this example code: tinyMceBehavior = new TinyMceBehavior(); PropertyModelBoolean richProperty = new PropertyModel(model, rich); add(new AjaxCheckBox(switchRte, richProperty) { @Override protected void onUpdate(AjaxRequestTarget target) { if (getModelObject()) { textArea.add(tinyMceBehavior); } else { textArea.remove(tinyMceBehavior); tinyMceBehavior = new TinyMceBehavior(); } refresh(target); } }); the purpose is to have a checkbox that add and remove the TinyMceBehavior from a text area. It works fine but I have this problem: when I Submit the form the textArea is in after REMOVING the behavior, I have a javascript error: t.win.document is null firebug show the error in tiny_mce_src.js at line 5376 if (!r) r = isIE ? t.win.document.body.createTextRange() : t.win.document.createRange(); I am using tinymce 3.2.7 but the same problem occurs with tinymce used in trunk version of wicket-contrib-tinymce. the effect is that submit does not work. if I click on checkbox again, everything continue to work. Any idea? -- Daniele Dellafiore http://blog.ildella.net http://twitter.com/ildella - 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/-tinymce--problem-adding-removing-TinyMceBehavior-dinamically-tp25681833p25682644.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: [tinymce] problem adding/removing TinyMceBehavior dinamically
Actually AFAIK the resources just need to be on path, then you can pretty much do whatever you want. Could be what your definition of preloading are :) I have a panel that are added by ajax so I had to make sure the resources used by that panel always where on the containing page. regards 2009/9/30 bgooren b...@iswd.nl It's not possible to add TinyMCE dynamically due to the way TinyMCE works. What you can do however, is pre-load TinyMCE, and dynamically enable/disable it on a component. Daniele Dellafiore wrote: Hi. I have a problem with this example code: tinyMceBehavior = new TinyMceBehavior(); PropertyModelBoolean richProperty = new PropertyModel(model, rich); add(new AjaxCheckBox(switchRte, richProperty) { @Override protected void onUpdate(AjaxRequestTarget target) { if (getModelObject()) { textArea.add(tinyMceBehavior); } else { textArea.remove(tinyMceBehavior); tinyMceBehavior = new TinyMceBehavior(); } refresh(target); } }); the purpose is to have a checkbox that add and remove the TinyMceBehavior from a text area. It works fine but I have this problem: when I Submit the form the textArea is in after REMOVING the behavior, I have a javascript error: t.win.document is null firebug show the error in tiny_mce_src.js at line 5376 if (!r) r = isIE ? t.win.document.body.createTextRange() : t.win.document.createRange(); I am using tinymce 3.2.7 but the same problem occurs with tinymce used in trunk version of wicket-contrib-tinymce. the effect is that submit does not work. if I click on checkbox again, everything continue to work. Any idea? -- Daniele Dellafiore http://blog.ildella.net http://twitter.com/ildella - 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/-tinymce--problem-adding-removing-TinyMceBehavior-dinamically-tp25681833p25682644.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: Wrong path to wicket-event.js resulting in 404 after calling wicket from javascript
I have tried removing the override completely, but it did not help. I just would like to know, whether I am doing something obviously stupid, or if I should start debugging deeper or make a quickstart. Vit I believe the code that causes the problem is # @Override # protected CharSequence getURL() # { # return super.getURL() + String.format(TB_iframe=trueheight=%dwidth=%dmodal=false, getHeight(), getWidth()); # } IFAIK wicket encodes URL parameters in a special form. And the last part is the number of ../ required for prepending the resource urls. In your app it might be zero so wicket do not generate appropriate ../../.. for your app/shop/rozkovec mount string. Vit Rozkovec wrote: Hallo, I came across strange problem I do not know whether it is mine fault or wicket's problem. On a page, there is a widget, which list news records. Each record has an edit and delete link. Edit link opens new dialog in jquery's thickbox window, which is practically IFrame. The code for page, which holds form and which is displayed in the thickbox window: http://pastebin.com/m5ca60e78 The code for a link, which shows the thickbox window with a page in it: http://pastebin.com/m6339b3a En example usage: http://pastebin.com/m768350aa here on line 72 when I do: target.addComponent(ShopNewsWidgetPanel.this.get(news-container)); after ajax refresh of the component, which contains news records, each record containing edit link, there is 404 error found in the Ajax debug window. From firebug console I can find out that if I add a some component (here it is edit link, which is held by news-container), which also contains AbstractDefaultAjaxBehavior, then upon rendering head of the response, there is wrong path to wicket ajax resources: Correct path: http://localhost:8080/cz.madewithlove/app/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js Wrong path after ajax call: http://localhost:8080/cz.madewithlove/app/shop/rozkovec/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js The page is mounted like so: mount(new IndexedHybridUrlCodingStrategy(shop, ShopModulePage.class)); An ajax function, which is called in the page's ajax button onSubmit() method: function thickbox_window_close(url) { tb_remove(); //removes thickbox window // call url of the behavior, this behavior is attached to the link, which opens the page in thickbox window var wcall=wicketAjaxGet(url, null, null, function() {return true;}); return !wcall; } I could solve it by visiting all components of the parent container except behaviors and add them to the ajax request target, but it would be better to not bother about it and just add the parent container. Any pointers? - 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/Wrong-path-to-wicket-event.js-resulting-in-404-after-calling-wicket-from-javascript-tp25678997p25681934.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: How would you realize a delete-Link in a datagrid row?
Wrap the dataview in a WebMarkupContainer . 1) Create a WebMarkupContainer 2) Create your data view 3) Add the dataview into the wmc 4) Don't forget to set .setOutputMarkupId(true); on the dataview 5) On the return of the Modal window refresh the target I.E. target.addComponent(wmcDataTable); Or this example will work with an ajax link instead of a modal window. final WebMarkupContainer wmcDataTable = new WebMarkupContainer(wmcDataTable); wmcDataTable.setOutputMarkupId(true); final DataViewUsers eachUser = new DataViewUsers(eachUser, dp) { protected void populateItem(final ItemUsers item) { final Users user = (Users) item.getModelObject(); item.setModel(new CompoundPropertyModelUsers(user)); item.add(new AjaxLinkUsers(deleteLink, item.getModel()) { public void onClick(AjaxRequestTarget target) { modalUsersDelete.setContent(new VendorProfileUsersDeletePanel(modalUsersDelete.getContentId(), (Users) item.getDefaultModelObject())); modalUsersDelete.show(target); } }); // add items }); eachUser.setItemsPerPage(ROWS_TO_DISPLAY); eachUser.setOutputMarkupId(true); wmcDataTable.add(eachUser); form.add(wmcDataTable); modalUsersDelete = new ModalWindow(modalUsersDelete); modalUsersDelete.setInitialWidth(450); modalUsersDelete.setInitialHeight(230); modalUsersDelete.setOutputMarkupId(true); modalUsersDelete.setTitle(Delete User); modalUsersDelete.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { public void onClose(AjaxRequestTarget target) { target.addComponent(wmcDataTable); } }); form.add(modalUsersDelete); Peter Arnulf Lustig wrote: yes I thought it... :) How do you achieve that the dataview is refreshed after deletion of a row? - Ursprüngliche Mail Von: rmattler robertmatt...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 16:19:11 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? Sorry spelling error not model window but modal window. rmattler wrote: Another approach would be to created a model window to appear when the delete link is clicked. With the message Are you sure you want to delete xxx? If you select yes, the row is deleted then ajax is used to refresh the dataview. Let me know if you want to use this approach and I will post an example. Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - 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/How-would-you-realize-a-%22delete%22-Link-in-a-datagrid-row--tp2561p25681996.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 -- View this message in context: http://www.nabble.com/How-would-you-realize-a-%22delete%22-Link-in-a-datagrid-row--tp2561p25683095.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: User name validation - how to check database to find if a name has already been taken?
actually you got it completely wrong. especially as your project, and the number of devs who work on it, grows exceptions are a much more scalable way of handling errors. 1) the compiler tells you exactly what the exceptions are right off the bat 2) exception class name gives you a clue as to what the error is without reading javadoc 3) exception classes can contain error-related data that is easy to retrieve 4) you cannot forget to handle a checked exception 5) if someone adds a new error code you do not have to hunt down all the places that now need to be changed - once again you get a compile time error 6) a bunch of other stuff i dont feel like typing out -igor On Wed, Sep 30, 2009 at 7:55 AM, Nicolas Melendez nmelen...@getsense.com.ar wrote: why do you use an exception for user already exits?Don`t you think that return true/false, could be better? i said that, because if the application start growing, you will have lot of exceptions class. thanks, NM On Wed, Sep 30, 2009 at 4:43 PM, Paul Huang paulhuan...@gmail.com wrote: igor.vaynberg wrote: form { onsubmit() { try { users.persist(getmodelobject()); } catch (usernamealreadyexistsexception e) { error(error.username.exists); } } } -igor Thanks, it works like a charm. I did not know I could show an error message by calling Component.error and then use a filter to catch all error messages targeting a specific FormComponent. -- View this message in context: http://www.nabble.com/User-name-validation---how-to-check-database-to-find-if-a-name-has--already-been-taken--tp25614625p25682499.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: [tinymce] problem adding/removing TinyMceBehavior dinamically
Well, that's what I meant with preloading. You cannot use TinyMCE if you're loading its javascripts from your ajax request. If the TinyMCE scripts are loaded from the containing page, then it will work (as you say). nino martinez wael wrote: Actually AFAIK the resources just need to be on path, then you can pretty much do whatever you want. Could be what your definition of preloading are :) I have a panel that are added by ajax so I had to make sure the resources used by that panel always where on the containing page. regards 2009/9/30 bgooren b...@iswd.nl It's not possible to add TinyMCE dynamically due to the way TinyMCE works. What you can do however, is pre-load TinyMCE, and dynamically enable/disable it on a component. Daniele Dellafiore wrote: Hi. I have a problem with this example code: tinyMceBehavior = new TinyMceBehavior(); PropertyModelBoolean richProperty = new PropertyModel(model, rich); add(new AjaxCheckBox(switchRte, richProperty) { @Override protected void onUpdate(AjaxRequestTarget target) { if (getModelObject()) { textArea.add(tinyMceBehavior); } else { textArea.remove(tinyMceBehavior); tinyMceBehavior = new TinyMceBehavior(); } refresh(target); } }); the purpose is to have a checkbox that add and remove the TinyMceBehavior from a text area. It works fine but I have this problem: when I Submit the form the textArea is in after REMOVING the behavior, I have a javascript error: t.win.document is null firebug show the error in tiny_mce_src.js at line 5376 if (!r) r = isIE ? t.win.document.body.createTextRange() : t.win.document.createRange(); I am using tinymce 3.2.7 but the same problem occurs with tinymce used in trunk version of wicket-contrib-tinymce. the effect is that submit does not work. if I click on checkbox again, everything continue to work. Any idea? -- Daniele Dellafiore http://blog.ildella.net http://twitter.com/ildella - 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/-tinymce--problem-adding-removing-TinyMceBehavior-dinamically-tp25681833p25682644.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 -- View this message in context: http://www.nabble.com/-tinymce--problem-adding-removing-TinyMceBehavior-dinamically-tp25681833p25683255.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: Newbie question - HTML Labels and IDs
see FormComponentLabel and SimpleFormComponentLabel -igor On Wed, Sep 30, 2009 at 8:34 AM, Phillip Sacre psa...@clifford-thames.com wrote: Hi, I've been using Wicket now for a couple of weeks and am getting on pretty well with it. I still run into issues occasionally though, and I'd like to know what the recommended way of solving this one is! I have the following HTML snippet in a component: tr td label for=modelModel/label /td td select id=model wicket:id=filterModel/select /td /tr The problem is, the select component (DropDownChoice) has setOutputMarkupId on it, so the ID on the label for= tag is not correct. Is there a recommended way of solving this problem? I think it would be possible to bind the label tag to a component and then set the for attribute on it manually, but that seems quite a long way round of doing things. Thanks for your help, Phill This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. - 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: Newbie question - HTML Labels and IDs
That's great, thanks - I knew there must be a simple way of doing it! Phill -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: 30 September 2009 16:36 To: users@wicket.apache.org Subject: Re: Newbie question - HTML Labels and IDs see FormComponentLabel and SimpleFormComponentLabel -igor This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: What is preferred/recommended way to localize texts of non-visual components
On Wed, Sep 30, 2009 at 4:40 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Thank you for the prompt reply to all of you. for org.apache.wicket.resource.loader.PackageStringResourceLoader Currently I used iteration through getStringResourceLoaders(), later on I'd like to implement EnumConverted as adviced by Matthias Keller. BTW, why all of those IStringResourceLoaders have overloaded methods loadStringResource(Class?, String, ) loadStringResource(Component, String, ) but Localizer's getStrings() supports just Components? Should/could not be there methods accepting classes as well? Thanks, Petr - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
1 EAR, 2 WARs causes Spring Context Problem
Hi All, I'm not sure if this is a Wicket, Spring or WebSphere issue or some combination of the 3. General Setup: WebSphere 6.1, wicket 1.3.7, Spring 2.5.6 Specific Setup: 1 EAR contains 2 WARs, call them WAR1 and WAR2. Each WAR uses the Wicket Spring frameworks. The EAR is deployed to WebSphere -- each WAR's deployment descriptor uses the WicketServlet and SpringContextLoaderServlet to control their respective frameworks (see http://cwiki.apache.org/WICKET/websphere.html#Websphere-WicketServletratherthanWicketFilter) Each WAR holds its Spring application configuration file (applicationContext.xml) under its WEB-INF directory. Each applicationContext.xml file wires up a service bean. The service beans are for two completely different classes, call them Service1 (in WAR1) and Service2 (in WAR2). Problem: If I run the WAR1 web application first, then it successfully uses its Service1 bean. But, if I then run the WAR2 web application, it cannot find its Service2 bean. This also happens in reverse order. That is, if I run the WAR2 web application first, then it successfully uses its Service2 bean, but then running the WAR1 application fails to find its Service1 bean. The failure exception is like: java.lang.IllegalStateException: bean of type [war1.Service1] not found at org.apache.wicket.spring.SpringBeanLocator.getBeanNameOfClass(SpringBeanLocator.java:107) at org.apache.wicket.spring.SpringBeanLocator.getBeanName(SpringBeanLocator.java:192) at org.apache.wicket.spring.SpringBeanLocator.isSingletonBean(SpringBeanLocator.java:133) at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:90) at org.apache.wicket.injection.Injector.inject(Injector.java:108) at org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInjector.java:39) Has anyone come across this issue before? Thanks, Steve
Re: [tinymce] problem adding/removing TinyMceBehavior dinamically
that is what I do. enable disable for me means add/remove to/from a component, while the javascript is loaded as the page is loaded. but, after removing the behavior, the save generate that error. or maybe you mean something different with enable/disable. On Wed, Sep 30, 2009 at 4:50 PM, bgooren b...@iswd.nl wrote: It's not possible to add TinyMCE dynamically due to the way TinyMCE works. What you can do however, is pre-load TinyMCE, and dynamically enable/disable it on a component. Daniele Dellafiore wrote: Hi. I have a problem with this example code: tinyMceBehavior = new TinyMceBehavior(); PropertyModelBoolean richProperty = new PropertyModel(model, rich); add(new AjaxCheckBox(switchRte, richProperty) { �...@override protected void onUpdate(AjaxRequestTarget target) { if (getModelObject()) { textArea.add(tinyMceBehavior); } else { textArea.remove(tinyMceBehavior); tinyMceBehavior = new TinyMceBehavior(); } refresh(target); } }); the purpose is to have a checkbox that add and remove the TinyMceBehavior from a text area. It works fine but I have this problem: when I Submit the form the textArea is in after REMOVING the behavior, I have a javascript error: t.win.document is null firebug show the error in tiny_mce_src.js at line 5376 if (!r) r = isIE ? t.win.document.body.createTextRange() : t.win.document.createRange(); I am using tinymce 3.2.7 but the same problem occurs with tinymce used in trunk version of wicket-contrib-tinymce. the effect is that submit does not work. if I click on checkbox again, everything continue to work. Any idea? -- Daniele Dellafiore http://blog.ildella.net http://twitter.com/ildella - 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/-tinymce--problem-adding-removing-TinyMceBehavior-dinamically-tp25681833p25682644.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 -- Daniele Dellafiore http://blog.ildella.net http://twitter.com/ildella - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component initModel() order (design issue?)
You're right, getDefaultModel ensures initialization. I should have suggested that instead of getModel (which is not available in the component class anymore in 1.4.x). However, I did not want to override the initModel() method (and copy most of its code) just for that. So now I solved it by creating a new wrap model, which I pass to the child component and which wraps around the parent.getDefaultModel(). public class ComponentWrapModelT implements IWrapModelT { private Component component; public ComponentWrapModel(Component component) { // component = parent this.component=component; } @Override public IModel? getWrappedModel() { return component.getDefaultModel(); } } Here's some more background which should explain why I chose to do this: I replace form components (eg. Textfield) with custom components (eg. MyTextfield) to add a few things my application needs to them. The name MyTextfield is a bit misleading here, because this is actually a subclass of Panel, and it merely contains a Textfield as a child. Still I wanted to use MyTextfield as a drop-in replacement, even when used in a form with a CompoundPropertyModel. This is where things got a little tricky, because the Textfield would end up trying to retrieve a property model matching its own wicket:id, when the relevant wicket:id had now become that of MyTextfield. Anyway I would have expected that wicket ensures the parent component model gets initialized first, seeing how components generally query their parents when they don't have a model of their own. And I'm still considering to report this as a bug in Jira. Cheers Edmund Pedro Santos wrote: The child model's initModel() gets called first There are no especial ordering programing to initModels calls. Basically they are called by public final IModel? getDefaultModel() { IModel? model = getModelImpl(); // If model is null if (model == null) { // give subclass a chance to lazy-init model model = initModel(); setModelImpl(model); } return model; } What about your custom component gain an model that implements IComponentInheritedModel and assign his children default models with the desired logic? On IComponentInheritedModel you can access your custom component parent model, and if you use getDefaultModel method, you don't need to care with initialization ordering too... On Wed, Sep 30, 2009 at 9:51 AM, Edmund Urbani e...@liland.org wrote: Hi, I was just trying to create a component of my own which - in some of my pages - is created without a model. In the initModel() method I would then call super.initModel() and wrap the resulting model for use in a child component. The problem is the initialization order: The child model's initModel() gets called first, the parent (my custom component) does not yet have a model (getModelImpl() returns null) so it goes up farther in the component hierarchy and retrieves a wrong model. Looking at the Component source code (Wicket 1.4.1) I see a commented out line where initModel() used to to call the parent getModel() instead of getModelImpl(). There's also a comment explaining that doing so would initialize many inbetween completely useless models. Well, not so useless for what I am trying to do I guess. So, from my perspective this looks like a bug that causes necessary initialization to be bypassed. Obviously though it was done like that on purpose, so I decided to put the issue up here instead of filing a bug report. Has anyone else run into similar issues? Would it really be so bad to just call getModel()? Cheers Edmund - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component initModel() order (design issue?)
why not class mytextefield extends panel { public mytextfield { add(new textfield() { initmodel() { return mytextfield.this.getdefaultmodel(); }}); } } since this is essentially what you want to do - have textfield use the same model as the panel. -igor On Wed, Sep 30, 2009 at 9:47 AM, Edmund Urbani e...@liland.org wrote: You're right, getDefaultModel ensures initialization. I should have suggested that instead of getModel (which is not available in the component class anymore in 1.4.x). However, I did not want to override the initModel() method (and copy most of its code) just for that. So now I solved it by creating a new wrap model, which I pass to the child component and which wraps around the parent.getDefaultModel(). public class ComponentWrapModelT implements IWrapModelT { private Component component; public ComponentWrapModel(Component component) { // component = parent this.component=component; } �...@override public IModel? getWrappedModel() { return component.getDefaultModel(); } } Here's some more background which should explain why I chose to do this: I replace form components (eg. Textfield) with custom components (eg. MyTextfield) to add a few things my application needs to them. The name MyTextfield is a bit misleading here, because this is actually a subclass of Panel, and it merely contains a Textfield as a child. Still I wanted to use MyTextfield as a drop-in replacement, even when used in a form with a CompoundPropertyModel. This is where things got a little tricky, because the Textfield would end up trying to retrieve a property model matching its own wicket:id, when the relevant wicket:id had now become that of MyTextfield. Anyway I would have expected that wicket ensures the parent component model gets initialized first, seeing how components generally query their parents when they don't have a model of their own. And I'm still considering to report this as a bug in Jira. Cheers Edmund Pedro Santos wrote: The child model's initModel() gets called first There are no especial ordering programing to initModels calls. Basically they are called by public final IModel? getDefaultModel() { IModel? model = getModelImpl(); // If model is null if (model == null) { // give subclass a chance to lazy-init model model = initModel(); setModelImpl(model); } return model; } What about your custom component gain an model that implements IComponentInheritedModel and assign his children default models with the desired logic? On IComponentInheritedModel you can access your custom component parent model, and if you use getDefaultModel method, you don't need to care with initialization ordering too... On Wed, Sep 30, 2009 at 9:51 AM, Edmund Urbani e...@liland.org wrote: Hi, I was just trying to create a component of my own which - in some of my pages - is created without a model. In the initModel() method I would then call super.initModel() and wrap the resulting model for use in a child component. The problem is the initialization order: The child model's initModel() gets called first, the parent (my custom component) does not yet have a model (getModelImpl() returns null) so it goes up farther in the component hierarchy and retrieves a wrong model. Looking at the Component source code (Wicket 1.4.1) I see a commented out line where initModel() used to to call the parent getModel() instead of getModelImpl(). There's also a comment explaining that doing so would initialize many inbetween completely useless models. Well, not so useless for what I am trying to do I guess. So, from my perspective this looks like a bug that causes necessary initialization to be bypassed. Obviously though it was done like that on purpose, so I decided to put the issue up here instead of filing a bug report. Has anyone else run into similar issues? Would it really be so bad to just call getModel()? Cheers Edmund - 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: RadioChoice and Ajax to display a panel of dropdowns
Only a shot in the dark, but is typeBox.setOutputMarkupPlaceholderTag(true) helping? You could use it instead of setOutputMarkupId(true), because its done there to. Otherwise i would have to create a testcase for this situation. There are different places to get informations: - search this list - read the wiki - check the examples - read a wicket book (many good out there) It's all explained on the website. Or do you expect them elsewhere? Cheers Per I did not override the method.I just did and it is still not working. Here is what I have: Also, where would one find this type of information. I don't think the online example show it and blindly guessing methods to look at in javadoc doesn't seem efficient. HTML: tr tdwicket:message key=userTypeType of User:/wicket:message/td td span wicket:id=accountType input type=radio /option 1 /span /td /tr tr td/td tdspan wicket:id=typeBoxThe type box/span/td /tr Code: // Account Type sub box final WebMarkupContainer typeBox = new WebMarkupContainer(typeBox) { /* (non-Javadoc) * @see org.apache.wicket.Component#callOnBeforeRenderIfNotVisible() */ @Override protected boolean callOnBeforeRenderIfNotVisible() { return true; } }; typeBox.setVisible(false); typeBox.setOutputMarkupId(true); add(typeBox); // Account Type Select List accountTypes = accountTypeDao.findAll(); ChoiceRenderer accountTypeChoiceRenderer = new ChoiceRenderer(name, code); RadioChoice accountTypeRadio = new RadioChoice(accountType, accountTypes, accountTypeChoiceRenderer); //accountTypeRadio.setRequired(true); // add the on click to the radio button accountTypeRadio.add(new AjaxFormChoiceComponentUpdatingBehavior () { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { RadioChoice choice = (RadioChoice) getComponent(); choice.updateModel(); if (((AccountType) choice.getModelObject()).getCode().equalsIgnoreCase(REP)) { typeBox.setVisible(true); } else { typeBox.setVisible(false); } target.addComponent(typeBox); } }); add(accountTypeRadio); -Original Message- From: Per Newgro [mailto:per.new...@gmx.ch] Sent: Wednesday, September 30, 2009 2:17 AM To: users@wicket.apache.org Subject: Re: RadioChoice and Ajax to display a panel of dropdowns Hey Jeff, did you override this? /** * Override this method if you want onBeforeRender to be called even when your component is not * visible. default this returns false. * * @return boolean, if true then onBeforeRender is called even for none visible components, * default false. * * @see Component#onBeforeRender() */ protected boolean callOnBeforeRenderIfNotVisible() { return false; } If you add a visible and an invisible panel you have to override this on the invisible one. hth Cheers Per I want to create a list of radio buttons [I have that working] and an ajax event to fire whenever a radio button is clicked [I have this working]. If the radio button matches the one I am interested in then I want to display additional information that must be filled in. A radio button selection is required. I cannot get the additional information to display when I add the component back to the target. I think it is because the additional information is originally set to not visible so the output markup id is not written out. How would I go about doing this? It seems pretty standard. Do I need to use panels and swap the appropriate panel [1 - empty panel, 2 - panel with additional info] into the target when needed? That seems like a lot of code to do something fairly simple. My code is below. Thanks. Jeff = HTML: tr
Re: Wicket in Italy
On Wed, Sep 23, 2009 at 7:49 PM, Giovanni pino_o...@yahoo.com wrote: Hi, are there any Wicketers living in Turin, Italy? Hi, Milano :) -- Daniele Dellafiore http://blog.ildella.net http://twitter.com/ildella - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: 1 EAR, 2 WARs causes Spring Context Problem
Hi, you have to user a classloader per Webapp, so the InjectorHolder has for each webapp the correct Springcontext. (injectorholder uses a static variable) martin Steve Hiller schrieb: Hi All, I'm not sure if this is a Wicket, Spring or WebSphere issue or some combination of the 3. General Setup: WebSphere 6.1, wicket 1.3.7, Spring 2.5.6 Specific Setup: 1 EAR contains 2 WARs, call them WAR1 and WAR2. Each WAR uses the Wicket Spring frameworks. The EAR is deployed to WebSphere -- each WAR's deployment descriptor uses the WicketServlet and SpringContextLoaderServlet to control their respective frameworks (see http://cwiki.apache.org/WICKET/websphere.html#Websphere-WicketServletratherthanWicketFilter) Each WAR holds its Spring application configuration file (applicationContext.xml) under its WEB-INF directory. Each applicationContext.xml file wires up a service bean. The service beans are for two completely different classes, call them Service1 (in WAR1) and Service2 (in WAR2). Problem: If I run the WAR1 web application first, then it successfully uses its Service1 bean. But, if I then run the WAR2 web application, it cannot find its Service2 bean. This also happens in reverse order. That is, if I run the WAR2 web application first, then it successfully uses its Service2 bean, but then running the WAR1 application fails to find its Service1 bean. The failure exception is like: java.lang.IllegalStateException: bean of type [war1.Service1] not found at org.apache.wicket.spring.SpringBeanLocator.getBeanNameOfClass(SpringBeanLocator.java:107) at org.apache.wicket.spring.SpringBeanLocator.getBeanName(SpringBeanLocator.java:192) at org.apache.wicket.spring.SpringBeanLocator.isSingletonBean(SpringBeanLocator.java:133) at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:90) at org.apache.wicket.injection.Injector.inject(Injector.java:108) at org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInjector.java:39) Has anyone come across this issue before? Thanks, Steve - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxPagingNavigation
That's my point. If your url is getting replaced, then it isn't using ajax. It is redrawing the page. D/ On Sep 29, 2009, at 3:56 PM, Pedro Santos wrote: I'm using the AjaxPagingNavigation component and it works well, but when I click on one of the links, my url is replaced with /?wicket:interface=:3:4::: You refers to html A tag generated by navigations links. What you got on onclick tag attribute on your rendered page? On Mon, Sep 28, 2009 at 9:57 PM, Douglas Ferguson doug...@douglasferguson.us wrote: I'm using the AjaxPagingNavigation component and it works well, but when I click on one of the links, my url is replaced with /?wicket:interface=:3:4::: This is making me thing that the entire page is getting replaced and not using ajax. Is is possible to get IPagingNavigationIncrementLink to use href=# instead of updating the url? D/ -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxPagingNavigation
Ok, it is a bug. Could you send us some code? I'm curios to see the html code generated to link on your page. On Wed, Sep 30, 2009 at 3:59 PM, Douglas Ferguson doug...@douglasferguson.us wrote: That's my point. If your url is getting replaced, then it isn't using ajax. It is redrawing the page. D/ On Sep 29, 2009, at 3:56 PM, Pedro Santos wrote: I'm using the AjaxPagingNavigation component and it works well, but when I click on one of the links, my url is replaced with /?wicket:interface=:3:4::: You refers to html A tag generated by navigations links. What you got on onclick tag attribute on your rendered page? On Mon, Sep 28, 2009 at 9:57 PM, Douglas Ferguson doug...@douglasferguson.us wrote: I'm using the AjaxPagingNavigation component and it works well, but when I click on one of the links, my url is replaced with /?wicket:interface=:3:4::: This is making me thing that the entire page is getting replaced and not using ajax. Is is possible to get IPagingNavigationIncrementLink to use href=# instead of updating the url? D/ -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
RE: RadioChoice and Ajax to display a panel of dropdowns
Adding the call to that method seemed to solve the problem. The places you mentioned are the usual places to look for information. However I searched the list, read the wiki, checked the examples, and looked through some books. I also tried to google what I was trying to do. It just seemed like this was a pretty common thing to do and I would have thought an answer would have been found much quicker. Do you recommend any books in particular. I have Wicket in Action and have ordered Pro Wicket. Are there other books that I should be looking at? Thanks. Jeff -Original Message- From: Per Newgro [mailto:per.new...@gmx.ch] Sent: Wednesday, September 30, 2009 2:09 PM To: users@wicket.apache.org Subject: Re: RadioChoice and Ajax to display a panel of dropdowns Only a shot in the dark, but is typeBox.setOutputMarkupPlaceholderTag(true) helping? You could use it instead of setOutputMarkupId(true), because its done there to. Otherwise i would have to create a testcase for this situation. There are different places to get informations: - search this list - read the wiki - check the examples - read a wicket book (many good out there) It's all explained on the website. Or do you expect them elsewhere? Cheers Per I did not override the method.I just did and it is still not working. Here is what I have: Also, where would one find this type of information. I don't think the online example show it and blindly guessing methods to look at in javadoc doesn't seem efficient. HTML: tr tdwicket:message key=userTypeType of User:/wicket:message/td td span wicket:id=accountType input type=radio /option 1 /span /td /tr tr td/td tdspan wicket:id=typeBoxThe type box/span/td /tr Code: // Account Type sub box final WebMarkupContainer typeBox = new WebMarkupContainer(typeBox) { /* (non-Javadoc) * @see org.apache.wicket.Component#callOnBeforeRenderIfNotVisible() */ @Override protected boolean callOnBeforeRenderIfNotVisible() { return true; } }; typeBox.setVisible(false); typeBox.setOutputMarkupId(true); add(typeBox); // Account Type Select List accountTypes = accountTypeDao.findAll(); ChoiceRenderer accountTypeChoiceRenderer = new ChoiceRenderer(name, code); RadioChoice accountTypeRadio = new RadioChoice(accountType, accountTypes, accountTypeChoiceRenderer); //accountTypeRadio.setRequired(true); // add the on click to the radio button accountTypeRadio.add(new AjaxFormChoiceComponentUpdatingBehavior () { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { RadioChoice choice = (RadioChoice) getComponent(); choice.updateModel(); if (((AccountType) choice.getModelObject()).getCode().equalsIgnoreCase(REP)) { typeBox.setVisible(true); } else { typeBox.setVisible(false); } target.addComponent(typeBox); } }); add(accountTypeRadio); -Original Message- From: Per Newgro [mailto:per.new...@gmx.ch] Sent: Wednesday, September 30, 2009 2:17 AM To: users@wicket.apache.org Subject: Re: RadioChoice and Ajax to display a panel of dropdowns Hey Jeff, did you override this? /** * Override this method if you want onBeforeRender to be called even when your component is not * visible. default this returns false. * * @return boolean, if true then onBeforeRender is called even for none visible components, * default false. * * @see Component#onBeforeRender() */ protected boolean callOnBeforeRenderIfNotVisible() { return false; } If you add a visible and an invisible panel you have to override this on the invisible one. hth Cheers Per I want to create a list of radio buttons [I have that working] and an ajax event to fire
Re: RadioChoice and Ajax to display a panel of dropdowns
The books you mentioned are the places to look at. If i google wicket component not visible the third entry brings up the solution. And in the list this question was answered quite often. But it surely depends on search phrase. But now it's answered again. At least here you will get almost ever an answer. Cheers Per Adding the call to that method seemed to solve the problem. The places you mentioned are the usual places to look for information. However I searched the list, read the wiki, checked the examples, and looked through some books. I also tried to google what I was trying to do. It just seemed like this was a pretty common thing to do and I would have thought an answer would have been found much quicker. Do you recommend any books in particular. I have Wicket in Action and have ordered Pro Wicket. Are there other books that I should be looking at? Thanks. Jeff - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Bookmarkable link to parent frame from a Modal window?
Hi- How do I make a bookmarkable link to the parent window from a Modal window? I added a bookmarkable link and a target=_top, this functionally works good, but it adds a pagemap parameter to the URL: http://localhost:8080/my/page/wicket:pageMapName/modal-dialog-pagemap How can I remove the page map name? It looks like I could set the IPageMap on the BookmarkablePageLink, but from within the modal window (iframe), how do I get access to this? thanks for any pointers ryan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Default implementation of IChainingModel
I searched the JIRA for IChainingModel and didn't get any hits. Did anyone create a JIRA issue? Here's an implementation of mine. public class BaseChainingModel implements IChainingModel { private static final long serialVersionUID = 1L; private Object target; public BaseChainingModel(Object modelObject) { if (modelObject == null) { throw new IllegalArgumentException(Parameter modelObject cannot be null); } else { target = modelObject; } } @Override public void detach() { if (target instanceof IDetachable) ((IDetachable) target).detach(); } @Override public IModel getChainedModel() { if (target instanceof IModel) return (IModel) target; else return null; } @Override public void setChainedModel(IModel model) { target = model; } @Override public Object getObject() { Object object = target; while (object instanceof IModel) { Object tmp = ((IModel) object).getObject(); if (tmp == object) { break; // pathological } object = tmp; } return object; } @Override public void setObject(Object obj) { if (target instanceof IModel) ((IModel) target).setObject(obj); else if (obj == null || obj instanceof Serializable) target = obj; else throw new WicketRuntimeException(Model object must be Serializable); } } Scott On Wed, Apr 8, 2009 at 2:53 PM, Jeremy Thomerson jer...@wickettraining.com wrote: I think that's a good idea - I have done a similar thing in my own projects. Please open a JIRA so this idea doesn't get lost, but this is one I may try to do soon. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Apr 8, 2009 at 4:36 PM, Juan G. Arias juangar...@gmail.com wrote: Hi all,First of all, I'm using wicket 1.3.5 I'm writing a model and ai need it to be chaineable. I mean, I need this model to contain another model, so my model can obtain the data, for example, from a property model. Ok, I've been reading and this is solved by the IChainingModel. But I couldn't find any default implementation of this interface. There are two classes currently implementing this interface, AbstractPropertyModel and CompoundPropertyModel. Both classes has some code duplicated, specifically: - void detach() - IModel getChainedModel() - void setChainedModel(IModel model) - some lines of void setObject(Object object) - the code in CompuntPropertyModel#getObject() and AbstarctPropertyModel#getTarget() is different, but the logic is the same. And I'm afraid my code will be the same as those classes. So, finally, my point. Is there any default implementation of this behavior? Is there a chance to add a super-class with this code? Thanks! Juan Arias - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Default implementation of IChainingModel
I don't think one was ever created and it fell off my radar. If you create one, can you post yours and post a link to it back on this thread? Thanks! -- Jeremy Thomerson http://www.wickettraining.com On Wed, Sep 30, 2009 at 4:45 PM, Scott Swank scott.sw...@gmail.com wrote: I searched the JIRA for IChainingModel and didn't get any hits. Did anyone create a JIRA issue? Here's an implementation of mine. public class BaseChainingModel implements IChainingModel { private static final long serialVersionUID = 1L; private Object target; public BaseChainingModel(Object modelObject) { if (modelObject == null) { throw new IllegalArgumentException(Parameter modelObject cannot be null); } else { target = modelObject; } } @Override public void detach() { if (target instanceof IDetachable) ((IDetachable) target).detach(); } @Override public IModel getChainedModel() { if (target instanceof IModel) return (IModel) target; else return null; } @Override public void setChainedModel(IModel model) { target = model; } @Override public Object getObject() { Object object = target; while (object instanceof IModel) { Object tmp = ((IModel) object).getObject(); if (tmp == object) { break; // pathological } object = tmp; } return object; } @Override public void setObject(Object obj) { if (target instanceof IModel) ((IModel) target).setObject(obj); else if (obj == null || obj instanceof Serializable) target = obj; else throw new WicketRuntimeException(Model object must be Serializable); } } Scott On Wed, Apr 8, 2009 at 2:53 PM, Jeremy Thomerson jer...@wickettraining.com wrote: I think that's a good idea - I have done a similar thing in my own projects. Please open a JIRA so this idea doesn't get lost, but this is one I may try to do soon. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Apr 8, 2009 at 4:36 PM, Juan G. Arias juangar...@gmail.com wrote: Hi all,First of all, I'm using wicket 1.3.5 I'm writing a model and ai need it to be chaineable. I mean, I need this model to contain another model, so my model can obtain the data, for example, from a property model. Ok, I've been reading and this is solved by the IChainingModel. But I couldn't find any default implementation of this interface. There are two classes currently implementing this interface, AbstractPropertyModel and CompoundPropertyModel. Both classes has some code duplicated, specifically: - void detach() - IModel getChainedModel() - void setChainedModel(IModel model) - some lines of void setObject(Object object) - the code in CompuntPropertyModel#getObject() and AbstarctPropertyModel#getTarget() is different, but the logic is the same. And I'm afraid my code will be the same as those classes. So, finally, my point. Is there any default implementation of this behavior? Is there a chance to add a super-class with this code? Thanks! Juan Arias - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Default implementation of IChainingModel
https://issues.apache.org/jira/browse/WICKET-2498 We're still on Wicket 1.3.5, so I put in a 1 hour estimate for someone to add generic typing. Scott On Wed, Sep 30, 2009 at 3:58 PM, Jeremy Thomerson jer...@wickettraining.com wrote: I don't think one was ever created and it fell off my radar. If you create one, can you post yours and post a link to it back on this thread? Thanks! -- Jeremy Thomerson http://www.wickettraining.com On Wed, Sep 30, 2009 at 4:45 PM, Scott Swank scott.sw...@gmail.com wrote: I searched the JIRA for IChainingModel and didn't get any hits. Did anyone create a JIRA issue? Here's an implementation of mine. public class BaseChainingModel implements IChainingModel { private static final long serialVersionUID = 1L; private Object target; public BaseChainingModel(Object modelObject) { if (modelObject == null) { throw new IllegalArgumentException(Parameter modelObject cannot be null); } else { target = modelObject; } } �...@override public void detach() { if (target instanceof IDetachable) ((IDetachable) target).detach(); } �...@override public IModel getChainedModel() { if (target instanceof IModel) return (IModel) target; else return null; } �...@override public void setChainedModel(IModel model) { target = model; } �...@override public Object getObject() { Object object = target; while (object instanceof IModel) { Object tmp = ((IModel) object).getObject(); if (tmp == object) { break; // pathological } object = tmp; } return object; } �...@override public void setObject(Object obj) { if (target instanceof IModel) ((IModel) target).setObject(obj); else if (obj == null || obj instanceof Serializable) target = obj; else throw new WicketRuntimeException(Model object must be Serializable); } } Scott On Wed, Apr 8, 2009 at 2:53 PM, Jeremy Thomerson jer...@wickettraining.com wrote: I think that's a good idea - I have done a similar thing in my own projects. Please open a JIRA so this idea doesn't get lost, but this is one I may try to do soon. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Apr 8, 2009 at 4:36 PM, Juan G. Arias juangar...@gmail.com wrote: Hi all,First of all, I'm using wicket 1.3.5 I'm writing a model and ai need it to be chaineable. I mean, I need this model to contain another model, so my model can obtain the data, for example, from a property model. Ok, I've been reading and this is solved by the IChainingModel. But I couldn't find any default implementation of this interface. There are two classes currently implementing this interface, AbstractPropertyModel and CompoundPropertyModel. Both classes has some code duplicated, specifically: - void detach() - IModel getChainedModel() - void setChainedModel(IModel model) - some lines of void setObject(Object object) - the code in CompuntPropertyModel#getObject() and AbstarctPropertyModel#getTarget() is different, but the logic is the same. And I'm afraid my code will be the same as those classes. So, finally, my point. Is there any default implementation of this behavior? Is there a chance to add a super-class with this code? Thanks! Juan Arias - 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: Complicated workflows
We are also trying to find the right balance of how much we move to declarative. It will depend on how well we get Web Flow to fit in. With Wicket being Controller-less and wanting to launch right into the home page, Web Flow is a clear candidate to do initial data load and logic to determine the first page. With Wicket out of the box, it seems that the app's home page would need to have this conditional logic which could include different panels or redirect depending on state. But that doesn't seem very elegant. Also, because we run in very large clusters, redirects are out of the question due to the potential that the second request hits a different server before HTTP session has been properly persisted/shared. On Wed, Sep 30, 2009 at 1:51 AM, Phil Housley undeconstruc...@gmail.comwrote: 2009/9/30 Randy S. randypo...@gmail.com: Have you thought about using Spring Web Flow for this? I'm not a SWF expert, but it sounds like something well-tailored to your needs. For example, a flow can have steps that don't have UIs. Our group at work is looking into Wicket SWF integration. I have a seen a few comments on the web from folks like Peter Thomas who conclude that you don't need to use SWF with Wicket. We need to externalize the flow of some applications so we have discussed shallow integration (where, for example, a button.onClick explicitly calls SWF to determine what to do next), as well as deep(er) integration (perhaps at the RequestCycleProcessor. At the moment, we are leaning toward the shallow/lightweight integration which gives lots of flexibility to each application to respond to a flow's response in different ways (show a new page, update components via Ajax, redirect to another URL, etc.). In case anyone is interested, reasons we need to externalize flow on some apps are things like: Complex business rules, business unit authoring of flow (via a controlled UI), and delegation to a business process manager layer. Actually, I hadn't realised that WebFlow wasn't limited to Spring MVC. Looking at it now, I am doing something fairly similar, so I probably ought to take a longer look... The reasons I started on this thing with code rather than going totally declarative is that my current experience is that there will be sufficient corner cases to make it necessary to regularly subclass actions or panels for a particular instance. Where that isn't required, I was thinking that a Spring context file would provide a nice declarative way of configuring everything, with prototype scope beans etc being well fitted to creating tasks. Despite all that, I don't particularly want a hard dependency on anything other than Wicket, so plain Java first, other things hopefully on top. Phil On Tue, Sep 29, 2009 at 4:11 PM, Phil Housley undeconstruc...@gmail.com wrote: Hello list, I'm currently working on some ideas for building apps with fairly complex workflows. My aim is to find a nice pattern/framework for building apps where each unit of work involves many panels, several forms, lots of decisions and so on. In particular I'm aiming at apps where you need to be very confident about exactly what is happening, so very strict control of actions, being careful of multiple renderings of a page each trying to change the server data, and so on. Also, I'm wondering about some options for declarative building of workflows out of existing tasks. My current design involves running from a special page, which maintains a stack of tasks. One type of task is a Workflow, which can be configured to automatically spawn subtasks as required, based on the result of previous tasks. Another type of task is based on a panel, and is able to cause itself to be rendered. The stack processor makes sure that each task is invoked at the right time, that a task can render if it is at the top of the stack, that only the top of the stack can be invoked from a form and so on. This is working ok for some silly demo cases, but there are various issues. For example, any task that is not also a component cannot access dependency injection, or set error messages and so on. I'm not sure how to get around this at the moment, as I don't want to force every task to be a component, when many will likely have no cause to ever be rendered. So, the reason I'm posting is to ask mainly two things: 1) Is this of interest to anyone else? All the code is my own, so I'll open source it if there seems to be some future in it. 2) If so, does anyone have any comments on my current design? Clearly there are problems with it, but should I carry on trying to find ways to work around them, or does the whole thing sounds like so much crack? Thanks, -- Phil Housley - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional
Re: AjaxPagingNavigation
Well.. I have a class that overrides AjaxPagingNavigation I just add that to my page. Class markup below: public class BSPagingNavigator extends AjaxPagingNavigator { private static final long serialVersionUID = -1l; IPageable pageable; public BSPagingNavigator(String id, IPageable pageable, IPagingLabelProvider labelProvider) { super(id, pageable, labelProvider); this.pageable = pageable; setOutputMarkupPlaceholderTag(true); } public BSPagingNavigator(String id, IPageable pageable) { this(id, pageable, null); } protected PagingNavigation newNavigation(final IPageable pageable, final IPagingLabelProvider labelProvider) { return new PagingNavigation(navigation, pageable, labelProvider) { private static final long serialVersionUID = -1l; { setViewSize(6); // setMargin(0); setSeparator(|); } }; } @Override protected void onBeforeRender() { super.onBeforeRender(); setVisible(getPageable().getPageCount() 1); boolean hideControls = pageable.getPageCount() 10; boolean onLastPage = pageable.getPageCount() == pageable.getCurrentPage(); boolean onFirstPage = pageable.getCurrentPage() == 0; get(last).setVisible(!hideControls !onLastPage); get(prev).setVisible(!hideControls); get(next).setVisible(!hideControls); get(first).setVisible(!hideControls !onFirstPage); } } markup wicket:panel div class=font-xsmall span class=font-xsmall wicket:id=firstemlt;lt;/em/ spannbsp; a href=# class=font-xsmall prev wicket:id=prevprev/a span class=font-xsmall wicket:id=navigation a href=# class=font-xsmall wicket:id=pageLinkspan class=pagin-number wicket:id=pageNumber1/span/a /span a href=# class=font-xsmall next wicket:id=nextnext/ anbsp; a href=# class=font-xsmall wicket:id=lastgt;gt;/a /div /wicket:panel On Sep 30, 2009, at 2:07 PM, Pedro Santos wrote: Ok, it is a bug. Could you send us some code? I'm curios to see the html code generated to link on your page. On Wed, Sep 30, 2009 at 3:59 PM, Douglas Ferguson doug...@douglasferguson.us wrote: That's my point. If your url is getting replaced, then it isn't using ajax. It is redrawing the page. D/ On Sep 29, 2009, at 3:56 PM, Pedro Santos wrote: I'm using the AjaxPagingNavigation component and it works well, but when I click on one of the links, my url is replaced with /?wicket:interface=:3:4::: You refers to html A tag generated by navigations links. What you got on onclick tag attribute on your rendered page? On Mon, Sep 28, 2009 at 9:57 PM, Douglas Ferguson doug...@douglasferguson.us wrote: I'm using the AjaxPagingNavigation component and it works well, but when I click on one of the links, my url is replaced with /?wicket:interface=:3:4::: This is making me thing that the entire page is getting replaced and not using ajax. Is is possible to get IPagingNavigationIncrementLink to use href=# instead of updating the url? D/ -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxPagingNavigation
I just realized that this might be what you wanted to know.. a class=font-xsmall title=Go to page 2 wicket:id=pageLink href=?wicket:interface=:3:pagination:navigation: 1:pageLink::ILinkListener:: span class=pagin-number wicket:id=pageNumber2/span /a On Sep 30, 2009, at 2:07 PM, Pedro Santos wrote: Ok, it is a bug. Could you send us some code? I'm curios to see the html code generated to link on your page. On Wed, Sep 30, 2009 at 3:59 PM, Douglas Ferguson doug...@douglasferguson.us wrote: That's my point. If your url is getting replaced, then it isn't using ajax. It is redrawing the page. D/ On Sep 29, 2009, at 3:56 PM, Pedro Santos wrote: I'm using the AjaxPagingNavigation component and it works well, but when I click on one of the links, my url is replaced with /?wicket:interface=:3:4::: You refers to html A tag generated by navigations links. What you got on onclick tag attribute on your rendered page? On Mon, Sep 28, 2009 at 9:57 PM, Douglas Ferguson doug...@douglasferguson.us wrote: I'm using the AjaxPagingNavigation component and it works well, but when I click on one of the links, my url is replaced with /?wicket:interface=:3:4::: This is making me thing that the entire page is getting replaced and not using ajax. Is is possible to get IPagingNavigationIncrementLink to use href=# instead of updating the url? D/ -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
is it possible to somehow create a url to return the contents of a panel
Hi - hopefully I can explain this clearly... I understand that I can use the AjaxEventBehavior to refresh the contents of any components that I have on the screen or add new components. I am trying to use a tooltip to display additional details for grid data. I plan to use a tooltip library which supports retrieving content via an ajax call. The question is: how (or is it possible at all) can I take a Panel and get a url that would return the contents of that Panel. I'm probably not explaining this well so, here is an example: AbstractLink link = createLink(IModel rowModel); Private AbstractLink createLink(IModel rowModel) { // I need to return a URL which would contain the contents of the additional details panel // for this particular row in the grid // the tooltip library will use the href attribute of this link to dynamically retrieve the contents of the tooltip when displayed } Any help or ideas would be greatly appreciated. Thanks. Joe
Re: is it possible to somehow create a url to return the contents of a panel
search this list for how to generate emails with wicket. there are a bunch of posts of that sort. that will teach you how to render a component to a string. this could be used to return the contents. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Sep 30, 2009 at 8:10 PM, Joe Hudson joe.hud...@clear2pay.comwrote: Hi - hopefully I can explain this clearly... I understand that I can use the AjaxEventBehavior to refresh the contents of any components that I have on the screen or add new components. I am trying to use a tooltip to display additional details for grid data. I plan to use a tooltip library which supports retrieving content via an ajax call. The question is: how (or is it possible at all) can I take a Panel and get a url that would return the contents of that Panel. I'm probably not explaining this well so, here is an example: AbstractLink link = createLink(IModel rowModel); Private AbstractLink createLink(IModel rowModel) { // I need to return a URL which would contain the contents of the additional details panel // for this particular row in the grid // the tooltip library will use the href attribute of this link to dynamically retrieve the contents of the tooltip when displayed } Any help or ideas would be greatly appreciated. Thanks. Joe
RE: Complicated workflows
Also, because we run in very large clusters, redirects are out of the question due to the potential that the second request hits a different server before HTTP session has been properly persisted/shared. Can't you set up server affinity for the cluster to avoid that from occurring? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: RE: Complicated workflows
We use server affinity but you can't guarantee same server and I can't go in with a 100% plan. We have had funny routing in some cases where requests from the same user even bounce from one data center to another... and back. We've done a lot of work to prevent these things but in the end it's never guaranteed. On the other hand, the chances of two back-to-back requests (as in the case of a redirect) being routed to the same node are extremely high. On Sep 30, 2009 9:58 PM, Chris Colman chr...@stepaheadsoftware.com wrote: Also, because we run in very large clusters, redirects are out of the question due to the potent... Can't you set up server affinity for the cluster to avoid that from occurring? - To unsubscribe, e-mail: users...