Re: Int based PropertyModel throws convertion error
Thats weird somehow it translates 0 to null. Dont know where or why it would do that. Can you make a jira issue for this? On 4/29/08, Michael Mehrle [EMAIL PROTECTED] wrote: I've got a radio group that's tied to a propertymodel which is set to '0' by default: RadioGroup monthlyRadioGroup = new RadioGroup(eventSchedule.intervalOfMonth); When saving my form I get this error: org.apache.wicket.util.convert.ConversionException: Can't convert null value to a primitive class: int for setting it on [EMAIL PROTECTED]null] at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(Pr opertyResolver.java:1079) I can see the value of intervalOfMonth being '0' in the setter/getter. When I set the value to anything else but '0' it doesn't throw this. I'm must be missing something here, but '0' should be allowed, correct? Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modal Window not opening the second time
We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no affect to the memory-usage? Cristi Manole wrote: I am 99% certain that if you change your code from : *final MyChooser myChooser = new MyChooser(modal);* *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } } * to this : *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return new MyChooser(modal); } } * it will work. Try it. Cristi Manole On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, can't anyone help me with this problem? If I need to code it differently, please tell me. Thanks !! Marieke Vandamme wrote: Hello, i'm having problems with the modal window. It shows up fine when I click my link the first time, but after closing the window with the 'X', it won't open again. I don't know if I'm using it wrong or if it's a bug. Any help is welcome ! thanks. Marieke. My code : public class TestModalWindow extends WebPage { public TestModalWindow() { final ModalWindow modal = new ModalWindow(dataChooser); add(modal); final MyChooser myChooser = new MyChooser(modal); modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } }); add(new AjaxLink(lnkOpen) { public void onClick(AjaxRequestTarget target) { myChooser.reload(target); } }); } public class MyChooser extends WebPage { private ModalWindow window; public MyChooser(ModalWindow w) { this.window = w; } public void reload(AjaxRequestTarget target) { this.window.show(target); } } } -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session.isNew - Check if a (permanent) session was created in the given request
Session.isTemporary(); Maurice On Tue, Apr 29, 2008 at 6:14 AM, mfs [EMAIL PROTECTED] wrote: Hello Everyone, Is there a way to check if a (permanent) session was created in the given request, in other words want to know if a JSESSIONID cookie is being set in the resulting response. I need to set another cookie alongside JSESSION id in the same request. Any pointers..? -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16952899.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Anchor Links
Analyse then what is exactly wrong in the html output On 4/29/08, tbt [EMAIL PROTECTED] wrote: yes it does. At the end of the url a string is appended starting with '#'. I can see this when I move the cursor over a hyperlink and the url is displayed at the bottom of the browser. Cristi Manole wrote: does your descriptionLabel start with #? On Mon, Apr 28, 2008 at 11:17 AM, tbt [EMAIL PROTECTED] wrote: Hi I'm new to wicket and I have a listview which dynamically creates links. I'm using the following code to anchor links so that when the user clicks a link, it will be directed to the correct area in the page. protected void populateItem(ListItem item) { Link boardLink = new Link(boardLink) { public void onClick() { } }; Label descriptionLabel = new Label(description); descriptionLabel.setOutputMarkupId(true); boardLink.setAnchor(descriptionLabel); item.add(descriptionLabel); item.add(boardLink ); } .. However this code is not working. How should i modify the code. Thanks -- View this message in context: http://www.nabble.com/Anchor-Links-tp16930767p16930767.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Anchor-Links-tp16930767p16952902.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: submit form to bookmarkable page
What you want is just stateless forms, but if you just want to do a get to a page then your page with the form can be really simple Just 1 markup container for the form tag that just has an atribute modifier that sets the action to the page url. On 4/29/08, Doug Donohoe [EMAIL PROTECTED] wrote: Obviously, if you post with GET method, you don't get those dialogs. A post and redirect means two hits to the server where-as a GET is only one. Using the GET method makes your average web page bookmarkable. The code I used was basically this: super.onComponentTag(tag) tag.put(action, urlFor(Foo.class, params); That doesn't work. It still submits using the 'interface' stuff - apparently because of hidden fields. I tried using a WebMarkupContainer instead of a form, but that fails due to the ? in the URL. Also, for some reason the form elements are renamed 'formname:elementname' when using a WebMarkupContainer. I really like Wicket quite a bit, but this issue with forms and constant 'session expired' messages are my biggest sticking point. -Doug igor.vaynberg wrote: thats what stateless forms are for. after a submit you want a redirect anyways so that a refresh doesnt popup that annoying post values dialog. overriding oncomponenttag() should work just fine, you just have to make sure to call super first. -igor On Mon, Apr 28, 2008 at 7:08 PM, Doug Donohoe [EMAIL PROTECTED] wrote: Overriding onComponentTag doesn't seem to work. The URL that gets generated (using urlFor) starts with a question mark which isn't included when the form is submitted. The only thing passed down is the form parameters, which obviously doesn't work since the page is missing. I'm using the default URL encoding strategy - was saving that investigation for later. Maybe I need to bump that up in the queue. I'll also look at using a stateless form next (and redirecting to a bookmarkable page so the URL is nice). Just a general comment on this. I basically want a form that can be submitted at any time, regardless if a session is there or not. This is a common use case (e.g., google, login, search) and for all the excellent stuff in wicket, this seems very hard to do. Does anyone else have advice on how to do nice-looking-urls using GET-method form posts? In other words, if I wanted to build Google's home page in wicket and be able to bookmark search results, how would I do it? If anyone has an example they can share, I would appreciate it. Regards, -Doug igor.vaynberg wrote: override the form's action value in its oncomponenttag callback with a url to a bookmarkable page. but then you have to parse all posted values yourself. if you dont care about the url you can use a statelessform instead and probably avoid a bunch of headache. -igor On Sat, Apr 26, 2008 at 6:36 AM, Doug Donohoe [EMAIL PROTECTED] wrote: Hi, I'm like to submit a form using bookmarkable page style, so that a) the form can always be submitted, regardless if the session is expired or not (think of a Google search submission e.g., http://www.google.com/search?q=wicket) b) the form remembers PageParameters that were there when the page was generated (think of google advanced search where you change the number of items per page and that is remembered in subsequent searches e.g., http://www.google.com/search?q=wicketnum=30) How do I tell the form to submit using bookmarkable format (using the assigned URL encoding strategy)? Thanks, -Doug -- View this message in context: http://www.nabble.com/submit-form-to-bookmarkable-page-tp16912974p16912974.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/submit-form-to-bookmarkable-page-tp16912974p16951990.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/submit-form-to-bookmarkable-page-tp16912974p16952274.html Sent from
Spring 2.5 and Wicket, our vision about integration (a few explanations)
Well, I appreciate all the comments, but i want to explain things about how we work here. In our vision about how a wicket + spring + hibernate should be, in 99% of cases only services are injected into controller layer. There are no reason to make reusable components that calls a service, because that's the model layer, and it's very unusual that you can reuse the model. There are no reason to make reusable jars that have dependencies with the model layer. Also, the services in our common applications would be, at the most, twenty services. Twenty services in a real very big application. Our common application has about ten services. I respect all your visions about how a right architecture must be, but our vision is different. -- View this message in context: http://www.nabble.com/Spring-2.5-and-Wicket%2C-our-vision-about-integration-tp16930960p16953853.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HttpServletRequest and Filter Class
This is the code we used PageParameters parameters = new PageParameters(); parameters.put(ApplicationConstants.REQUEST_USERNAME,userIdField.getModelObject().toString()); parameters.put(ApplicationConstants.REQUEST_PASSWORD,passField.getModelObject().toString()); setResponsePage(RegistrationPage.class,parameters); You can see we tried to add the values for the authentication as parameters as well as attribute but in the filter class we couldn't find it. If that is a redirect or not anyway I would expect to to find that parameters in the request in the filter class Johan Compagner wrote: Because its a redirect?? Then you have a new http request object without you attributes On 4/28/08, andrea pantaleoni [EMAIL PROTECTED] wrote: Hi, I and my colleagues decided to write a custom filter class to check authorization against a LDAP server Inside the Filter class we got some parameters or attributes such as netId and password from the HttpServletRequest object and we check that against the server. Our first page is a wicket page called LoginPage from this page we call another page adding in the HttpServletRequest two attributes (the netId and the password) WebRequest wRequest = (WebRequest)webpage.getRequest(); wRequest.getHttpServletRequest().setAttribute(...)... In this way before the other wicket page is loaded the filter class is invoked, then the request object inside the filter class is completely empty without any attributes or parameters. Anyway if we get a HttpSession inside the LoginPage from the request object and we add in the session the attributes we are able to access them from filter class(the session in not empty). Anyone of you has already faced a problem such that. Thanks in advance Andrea -- View this message in context: http://www.nabble.com/HttpRequest-and-Filter-class-tp16945908p16945908.html Sent from the Wicket - Dev mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/HttpServletRequest-and-Filter-Class-tp16953905p16953905.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: About Wicket Session life-cycle
Thanks igor, the reason i asked so was because i am seeing this wierd behavior on oc4j where even if i just do a redirect to an external app in my CustomWebWession (on the very first request to my wicket app) without even rendering any wicket page, i see a jsessionId cookie being set.. igor.vaynberg wrote: correct you can also bind the session manually by calling bind() -igor On Mon, Apr 28, 2008 at 10:46 PM, mfs [EMAIL PROTECTED] wrote: Correct me if i am wrong.. - Wicket creates a permanent session only when a stateful page is rendered. And it is at this time when the wicket session is bind with the http-session, and hence a jsessionID is generated by the servlet container and set as a cookie in the response. - On the contrary, for stateless-pages wicket does create temporary session which i believe are alive only for that particular request cycle...and is not bind with the httpsession in any way. ? Thanks in advance. -- View this message in context: http://www.nabble.com/About-Wicket-Session-life-cycle-tp16953686p16953686.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/About-Wicket-Session-life-cycle-tp16953686p16953916.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modal Window not opening the second time
I wasn't able to reuse a ModalWindow object in my projects. I always had to build it again. I obviously must be doing something wrong if you managed to do exactly this. Anyways, this is the output of the javascript debug window when using the code Marieke initially wrote (it doesn't give me any clues): *NFO: *focus set on linkOpen2*INFO: * *INFO: * Initiating Ajax GET request on ;jsessionid=DC1CC910C0903823CB6D89780AA63227?wicket:interface=:0:linkOpen::IBehaviorListener:0:random=0.8450107536275825 *INFO: *Invoking pre-call handler(s)... *INFO: *Received ajax response (1678 characters) *INFO: * ?xml version=1.0 encoding=UTF-8?ajax-responseheader-contribution encoding=wicket1 ![CDATA[head xmlns:wicket= http://wicket.apache.org;script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js/script script type=text/javascript id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/ wicketAjaxDebugEnable=true; /*--]^]^*//script script type=text/javascript src=resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.js/script link rel=stylesheet type=text/css href=resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.css / /head]]/header-contributioncomponent id=dataChooser1 ![CDATA[div id=dataChooser1 style=display:none div id=content3 /div /div]]/componentevaluate![CDATA[var settings = new Object(); settings.minWidth=200; settings.minHeight=200; settings.className=w_blue; settings.width=600; settings.height=400; settings.resizable=true; settings.src=?wicket:interface=:1; settings.iframeName=modal-dialog-pagemap; settings.mask=semi-transparent; settings.onClose = function() { var wcall=wicketAjaxGet('?wicket:interface=:0:dataChooser::IBehaviorListener:1:-1',null,null, function() {return Wicket.$('dataChooser1') != null;}.bind(this)); }; Wicket.Window.create(settings).show(); ]]/evaluate/ajax-response *INFO: *Response parsed. Now invoking steps... *INFO: * *INFO: * Initiating Ajax GET request on resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js *INFO: *Invoking pre-call handler(s)... *INFO: *Received ajax response (6062 characters) *INFO: *Invoking post-call handler(s)... *INFO: * *INFO: * Initiating Ajax GET request on resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js *INFO: *Invoking pre-call handler(s)... *INFO: *Received ajax response (60129 characters) *INFO: *Invoking post-call handler(s)... *INFO: * *INFO: * Initiating Ajax GET request on resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js *INFO: *Invoking pre-call handler(s)... *INFO: *Received ajax response (8183 characters) *INFO: *Invoking post-call handler(s)... *INFO: * *INFO: * Initiating Ajax GET request on resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.js *INFO: *Invoking pre-call handler(s)... *INFO: *Received ajax response (41693 characters) *INFO: *Invoking post-call handler(s)... *INFO: *Response processed successfully. *INFO: *Invoking post-call handler(s)... *INFO: *last focus id was not set *INFO: *focus set on *INFO: *focus removed from *INFO: * *INFO: * Initiating Ajax GET request on ?wicket:interface=:0:dataChooser::IBehaviorListener:1:-1random=0.8103637903503486 *INFO: *Invoking pre-call handler(s)... *INFO: *Received ajax response (69 characters) *INFO: * ?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response *INFO: *Response parsed. Now invoking steps... *INFO: *Response processed successfully. *INFO: *Invoking post-call handler(s)... *INFO: *last focus id was not set *INFO: *focus set on linkOpen2 *INFO: * *INFO: * Initiating Ajax GET request on ;jsessionid=DC1CC910C0903823CB6D89780AA63227?wicket:interface=:0:linkOpen::IBehaviorListener:0:random=0.6139253992868053 *INFO: *Invoking pre-call handler(s)... *INFO: *Received ajax response (69 characters) *INFO: * ?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response *INFO: *Response parsed. Now invoking steps... *INFO: *Response processed successfully. *INFO: *Invoking post-call handler(s)... *INFO: *Calling focus on linkOpen2 *INFO: *focus removed from linkOpen2 Cristi Manole On Tue, Apr 29, 2008 at 9:51 AM, Johan Compagner [EMAIL PROTECTED] wrote: We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no
Re: Wicket stuff dojo/toaster?
Thanks, i'll look into it. However the example does not do that, and do not have any troubles: http://wicketstuff.org/wicketdojo13/?wicket:bookmarkablePage=%3Aorg.wicketstuff.dojo.examples.toaster.ToasterSample Igor Vaynberg wrote: perhaps you should use shared resources along with IInitializer to make sure the javascript is available immediately upon startup -igor On Mon, Apr 28, 2008 at 5:49 AM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Hi Im using the toaster from dojo. I get a javascript thing which tells me that a fatal error has happend, it only happens when session are initialized if I reload the page there are no problems. It seems a little like it's related to this thread: http://mail-archives.apache.org/mod_mbox/wicket-users/200711.mbox/[EMAIL PROTECTED] Heres the stack trace FATAL exception raised: Could not load 'dojo.debug.console'; last tried '__package__.js' FATAL exception raised: Could not load 'dojo.widget.Toaster'; last tried '__package__.js' -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What is the best way to create layouts in Wicket?
Are there such factory initializers in Wicket? There is one, initModel(), but I have not yet evaluated if it is being called on page repaint. I have had to implement my own intializer methods for page repaints in evolved state. ** Martin 2008/4/28 Scott Swank [EMAIL PROTECTED]: Agreed. It has to be a stateless factory method. On Mon, Apr 28, 2008 at 1:39 PM, James Carman [EMAIL PROTECTED] wrote: So, how do you know that everything is good to go in the subclass then? You really shouldn't be calling a method implemented by the subclass in the superclass' constructor. In your case, it may work, but in general, it's bad practice. On Mon, Apr 28, 2008 at 4:34 PM, Scott Swank [EMAIL PROTECTED] wrote: Yes, in the constructor. - Scott On Mon, Apr 28, 2008 at 11:12 AM, James Carman [EMAIL PROTECTED] wrote: And, when does the base page do the adding? In the constructor? On Mon, Apr 28, 2008 at 1:38 PM, Scott Swank [EMAIL PROTECTED] wrote: I have done this by creating an abstract base page with an abstract factory methods getFooPanel() or getBarPanel(). Then the base page add()s the result of getFooPanel(), while the implementations supply it. - Scott On Mon, Apr 28, 2008 at 10:09 AM, Cristi Manole [EMAIL PROTECTED] wrote: To answer your second point : -NO, at this point you cannot define multiple wicket:child anywhere. Try using fragments or generic panels (i don't know which would be better for you). Replace a generic panel with the specific panel you need. Cristi Manole On Mon, Apr 28, 2008 at 11:34 AM, Martin Makundi [EMAIL PROTECTED] wrote: Well, here you have an example of a panel: http://www.javalobby.org/java/forums/t60926.html It is reusable, so you can use it from anywhere, or decide not to use it. Design one page which uses panels. Then change the panels according to some session state, for example. Here is a trivial bad example: public class MyChangingPage extends WebPage { private static int pageReloadCount; public MyChangingPage() { pageReloadCount++; boolean even = (pageReloadCount % 2) == 0; if (even) { add(new EvenPanel(panel_id)); } else { add(new OddPanel(panel_id)); } } } Ofcourse in real life a static counter is not what you want. ** Martin 2008/4/28 Azzeddine Daddah [EMAIL PROTECTED]: Could you or somebody else please provide some code? I didn't understand your last sentence Start with one hard coded layout and then tune it using an internal state, for example. Thank you, Azzeddine On Mon, Apr 28, 2008 at 10:16 AM, Martin Makundi [EMAIL PROTECTED] wrote: I would guess that it is better to use panels or fragments and instead of using setXXX, just initialize everyting in its place according to an internal state. Start with one hard coded layout and then tune it using an internal state, for example. ** Martin 2008/4/28 Azzeddine Daddah [EMAIL PROTECTED]: Hi there, I'm new to Wicket trying to build my first application :). I've already token a look at Creating layouts using markup inheritance tutorial from the Wicket website, but still have some questions: Suppose that I've a base page which I want that some of my pages inherits the layout from it. What I want to do is to have some protected methods like f.e. appendComponen(final Component comp, String position) and setTitle(String title). The position string In the first method indicates the position where the component in the page should be appended. 1. How can I implement this? 2. Is
Re: Modal Window not opening the second time
The javascript debug window is printing no error. The server returns an empty response (?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response) I did some debugging and came to the function in ModalWindow public void show(AjaxRequestTarget target) there the boolean shown is tested. The content is only showed when shown=false, in my case shown=true... Can you please try the code from my first post? If you say you reuse the dialog, what am I doing wrong? How do you guys do it? Thanks ! Johan Compagner wrote: We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no affect to the memory-usage? Cristi Manole wrote: I am 99% certain that if you change your code from : *final MyChooser myChooser = new MyChooser(modal);* *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } } * to this : *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return new MyChooser(modal); } } * it will work. Try it. Cristi Manole On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, can't anyone help me with this problem? If I need to code it differently, please tell me. Thanks !! Marieke Vandamme wrote: Hello, i'm having problems with the modal window. It shows up fine when I click my link the first time, but after closing the window with the 'X', it won't open again. I don't know if I'm using it wrong or if it's a bug. Any help is welcome ! thanks. Marieke. My code : public class TestModalWindow extends WebPage { public TestModalWindow() { final ModalWindow modal = new ModalWindow(dataChooser); add(modal); final MyChooser myChooser = new MyChooser(modal); modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } }); add(new AjaxLink(lnkOpen) { public void onClick(AjaxRequestTarget target) { myChooser.reload(target); } }); } public class MyChooser extends WebPage { private ModalWindow window; public MyChooser(ModalWindow w) { this.window = w; } public void reload(AjaxRequestTarget target) { this.window.show(target); } } } -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16955484.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modal Window not opening the second time
Im doing it like this: AjaxLink popupLink = new AjaxLink(manageWeightPop) { @Override public void onClick(AjaxRequestTarget target) { target modalWindow.setTitle(getString(weightlog)); modalWindow.setMinimalHeight(700); modalWindow.setContent(new ManageWeightPanel(modalWindow .getContentId(), modalWindow, new BaseEntityDetachableModel(getPerson(; modalWindow.show(target); } }; Marieke Vandamme wrote: The javascript debug window is printing no error. The server returns an empty response (?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response) I did some debugging and came to the function in ModalWindow public void show(AjaxRequestTarget target) there the boolean shown is tested. The content is only showed when shown=false, in my case shown=true... Can you please try the code from my first post? If you say you reuse the dialog, what am I doing wrong? How do you guys do it? Thanks ! Johan Compagner wrote: We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no affect to the memory-usage? Cristi Manole wrote: I am 99% certain that if you change your code from : *final MyChooser myChooser = new MyChooser(modal);* *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } } * to this : *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return new MyChooser(modal); } } * it will work. Try it. Cristi Manole On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, can't anyone help me with this problem? If I need to code it differently, please tell me. Thanks !! Marieke Vandamme wrote: Hello, i'm having problems with the modal window. It shows up fine when I click my link the first time, but after closing the window with the 'X', it won't open again. I don't know if I'm using it wrong or if it's a bug. Any help is welcome ! thanks. Marieke. My code : public class TestModalWindow extends WebPage { public TestModalWindow() { final ModalWindow modal = new ModalWindow(dataChooser); add(modal); final MyChooser myChooser = new MyChooser(modal); modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } }); add(new AjaxLink(lnkOpen) { public void onClick(AjaxRequestTarget target) { myChooser.reload(target); } }); } public class MyChooser extends WebPage { private ModalWindow window; public MyChooser(ModalWindow w) { this.window = w; } public void reload(AjaxRequestTarget target) { this.window.show(target); } } } -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modal Window not opening the second time
Exactly, you always create a new panel for content. Can you reuse the ManageWeightPanel object? Cristi Manole On Tue, Apr 29, 2008 at 11:24 AM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Im doing it like this: AjaxLink popupLink = new AjaxLink(manageWeightPop) { @Override public void onClick(AjaxRequestTarget target) { target modalWindow.setTitle(getString(weightlog)); modalWindow.setMinimalHeight(700); modalWindow.setContent(new ManageWeightPanel(modalWindow .getContentId(), modalWindow, new BaseEntityDetachableModel(getPerson(; modalWindow.show(target); } }; Marieke Vandamme wrote: The javascript debug window is printing no error. The server returns an empty response (?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response) I did some debugging and came to the function in ModalWindow public void show(AjaxRequestTarget target) there the boolean shown is tested. The content is only showed when shown=false, in my case shown=true... Can you please try the code from my first post? If you say you reuse the dialog, what am I doing wrong? How do you guys do it? Thanks ! Johan Compagner wrote: We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no affect to the memory-usage? Cristi Manole wrote: I am 99% certain that if you change your code from : *final MyChooser myChooser = new MyChooser(modal);* *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } } * to this : *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return new MyChooser(modal); } } * it will work. Try it. Cristi Manole On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, can't anyone help me with this problem? If I need to code it differently, please tell me. Thanks !! Marieke Vandamme wrote: Hello, i'm having problems with the modal window. It shows up fine when I click my link the first time, but after closing the window with the 'X', it won't open again. I don't know if I'm using it wrong or if it's a bug. Any help is welcome ! thanks. Marieke. My code : public class TestModalWindow extends WebPage { public TestModalWindow() { final ModalWindow modal = new ModalWindow(dataChooser); add(modal); final MyChooser myChooser = new MyChooser(modal); modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } }); add(new AjaxLink(lnkOpen) { public void onClick(AjaxRequestTarget target) { myChooser.reload(target); } }); } public class MyChooser extends WebPage { private ModalWindow window; public MyChooser(ModalWindow w) { this.window = w; } public void reload(AjaxRequestTarget target) { this.window.show(target); } } } -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.html Sent from the Wicket - User mailing list archive at Nabble.com.
Re: Modal Window not opening the second time
You are creating a new instance of your Panel. I don't need to create a new ModalWindow or Panel, because all the data on my ModalWindow is the same. Your solution works because setContent sets shown = false. Shouldn't it work without this call to setContent? Nino.Martinez wrote: Im doing it like this: AjaxLink popupLink = new AjaxLink(manageWeightPop) { @Override public void onClick(AjaxRequestTarget target) { target modalWindow.setTitle(getString(weightlog)); modalWindow.setMinimalHeight(700); modalWindow.setContent(new ManageWeightPanel(modalWindow .getContentId(), modalWindow, new BaseEntityDetachableModel(getPerson(; modalWindow.show(target); } }; Marieke Vandamme wrote: The javascript debug window is printing no error. The server returns an empty response (?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response) I did some debugging and came to the function in ModalWindow public void show(AjaxRequestTarget target) there the boolean shown is tested. The content is only showed when shown=false, in my case shown=true... Can you please try the code from my first post? If you say you reuse the dialog, what am I doing wrong? How do you guys do it? Thanks ! Johan Compagner wrote: We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no affect to the memory-usage? Cristi Manole wrote: I am 99% certain that if you change your code from : *final MyChooser myChooser = new MyChooser(modal);* *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } } * to this : *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return new MyChooser(modal); } } * it will work. Try it. Cristi Manole On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, can't anyone help me with this problem? If I need to code it differently, please tell me. Thanks !! Marieke Vandamme wrote: Hello, i'm having problems with the modal window. It shows up fine when I click my link the first time, but after closing the window with the 'X', it won't open again. I don't know if I'm using it wrong or if it's a bug. Any help is welcome ! thanks. Marieke. My code : public class TestModalWindow extends WebPage { public TestModalWindow() { final ModalWindow modal = new ModalWindow(dataChooser); add(modal); final MyChooser myChooser = new MyChooser(modal); modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } }); add(new AjaxLink(lnkOpen) { public void onClick(AjaxRequestTarget target) { myChooser.reload(target); } }); } public class MyChooser extends WebPage { private ModalWindow window; public MyChooser(ModalWindow w) { this.window = w; } public void reload(AjaxRequestTarget target) { this.window.show(target); } } } -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684
properties files
Hi, I have one simple question. but I had no luck in finding an answer on mailing list. I have web application with probably twenty pages. I am usisng properties files (e.g. MyPage_en_US.properties) for localization. Because I am using a lot of forms on my pages, there are some common string that I want to localize. So I need to have some common.properties common_en_US.properties, that will be used by every page in my application. But I do not see the way how to do it. Thanks for any advice. Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: About Wicket Session life-cycle
are you sure that you custom web session isnt calling dirty()? On Tue, Apr 29, 2008 at 9:48 AM, mfs [EMAIL PROTECTED] wrote: Thanks igor, the reason i asked so was because i am seeing this wierd behavior on oc4j where even if i just do a redirect to an external app in my CustomWebWession (on the very first request to my wicket app) without even rendering any wicket page, i see a jsessionId cookie being set.. igor.vaynberg wrote: correct you can also bind the session manually by calling bind() -igor On Mon, Apr 28, 2008 at 10:46 PM, mfs [EMAIL PROTECTED] wrote: Correct me if i am wrong.. - Wicket creates a permanent session only when a stateful page is rendered. And it is at this time when the wicket session is bind with the http-session, and hence a jsessionID is generated by the servlet container and set as a cookie in the response. - On the contrary, for stateless-pages wicket does create temporary session which i believe are alive only for that particular request cycle...and is not bind with the httpsession in any way. ? Thanks in advance. -- View this message in context: http://www.nabble.com/About-Wicket-Session-life-cycle-tp16953686p16953686.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/About-Wicket-Session-life-cycle-tp16953686p16953916.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modal Window not opening the second time
Cristi Manole wrote: Exactly, you always create a new panel for content. True. Can you reuse the ManageWeightPanel object? Probably could. Havent looked into it, since all of the panel needs to updated anyhow. Cristi Manole On Tue, Apr 29, 2008 at 11:24 AM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Im doing it like this: AjaxLink popupLink = new AjaxLink(manageWeightPop) { @Override public void onClick(AjaxRequestTarget target) { target modalWindow.setTitle(getString(weightlog)); modalWindow.setMinimalHeight(700); modalWindow.setContent(new ManageWeightPanel(modalWindow .getContentId(), modalWindow, new BaseEntityDetachableModel(getPerson(; modalWindow.show(target); } }; Marieke Vandamme wrote: The javascript debug window is printing no error. The server returns an empty response (?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response) I did some debugging and came to the function in ModalWindow public void show(AjaxRequestTarget target) there the boolean shown is tested. The content is only showed when shown=false, in my case shown=true... Can you please try the code from my first post? If you say you reuse the dialog, what am I doing wrong? How do you guys do it? Thanks ! Johan Compagner wrote: We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no affect to the memory-usage? Cristi Manole wrote: I am 99% certain that if you change your code from : *final MyChooser myChooser = new MyChooser(modal);* *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } } * to this : *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return new MyChooser(modal); } } * it will work. Try it. Cristi Manole On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, can't anyone help me with this problem? If I need to code it differently, please tell me. Thanks !! Marieke Vandamme wrote: Hello, i'm having problems with the modal window. It shows up fine when I click my link the first time, but after closing the window with the 'X', it won't open again. I don't know if I'm using it wrong or if it's a bug. Any help is welcome ! thanks. Marieke. My code : public class TestModalWindow extends WebPage { public TestModalWindow() { final ModalWindow modal = new ModalWindow(dataChooser); add(modal); final MyChooser myChooser = new MyChooser(modal); modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } }); add(new AjaxLink(lnkOpen) { public void onClick(AjaxRequestTarget target) { myChooser.reload(target); } }); } public class MyChooser extends WebPage { private ModalWindow window; public MyChooser(ModalWindow w) { this.window = w; } public void reload(AjaxRequestTarget target) { this.window.show(target); } } } -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684
Re: properties files
Use your MyApplication.properties On 4/29/08, Milan Křápek [EMAIL PROTECTED] wrote: Hi, I have one simple question. but I had no luck in finding an answer on mailing list. I have web application with probably twenty pages. I am usisng properties files (e.g. MyPage_en_US.properties) for localization. Because I am using a lot of forms on my pages, there are some common string that I want to localize. So I need to have some common.properties common_en_US.properties, that will be used by every page in my application. But I do not see the way how to do it. Thanks for any advice. Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3
Re: What is the best way to create layouts in Wicket?
no Scott just told you that you should create such initializers completely static. They should be 'static' without touching state of the current object/class itself. On Tue, Apr 29, 2008 at 10:18 AM, Martin Makundi [EMAIL PROTECTED] wrote: Are there such factory initializers in Wicket? There is one, initModel(), but I have not yet evaluated if it is being called on page repaint. I have had to implement my own intializer methods for page repaints in evolved state. ** Martin 2008/4/28 Scott Swank [EMAIL PROTECTED]: Agreed. It has to be a stateless factory method. On Mon, Apr 28, 2008 at 1:39 PM, James Carman [EMAIL PROTECTED] wrote: So, how do you know that everything is good to go in the subclass then? You really shouldn't be calling a method implemented by the subclass in the superclass' constructor. In your case, it may work, but in general, it's bad practice. On Mon, Apr 28, 2008 at 4:34 PM, Scott Swank [EMAIL PROTECTED] wrote: Yes, in the constructor. - Scott On Mon, Apr 28, 2008 at 11:12 AM, James Carman [EMAIL PROTECTED] wrote: And, when does the base page do the adding? In the constructor? On Mon, Apr 28, 2008 at 1:38 PM, Scott Swank [EMAIL PROTECTED] wrote: I have done this by creating an abstract base page with an abstract factory methods getFooPanel() or getBarPanel(). Then the base page add()s the result of getFooPanel(), while the implementations supply it. - Scott On Mon, Apr 28, 2008 at 10:09 AM, Cristi Manole [EMAIL PROTECTED] wrote: To answer your second point : -NO, at this point you cannot define multiple wicket:child anywhere. Try using fragments or generic panels (i don't know which would be better for you). Replace a generic panel with the specific panel you need. Cristi Manole On Mon, Apr 28, 2008 at 11:34 AM, Martin Makundi [EMAIL PROTECTED] wrote: Well, here you have an example of a panel: http://www.javalobby.org/java/forums/t60926.html It is reusable, so you can use it from anywhere, or decide not to use it. Design one page which uses panels. Then change the panels according to some session state, for example. Here is a trivial bad example: public class MyChangingPage extends WebPage { private static int pageReloadCount; public MyChangingPage() { pageReloadCount++; boolean even = (pageReloadCount % 2) == 0; if (even) { add(new EvenPanel(panel_id)); } else { add(new OddPanel(panel_id)); } } } Ofcourse in real life a static counter is not what you want. ** Martin 2008/4/28 Azzeddine Daddah [EMAIL PROTECTED]: Could you or somebody else please provide some code? I didn't understand your last sentence Start with one hard coded layout and then tune it using an internal state, for example. Thank you, Azzeddine On Mon, Apr 28, 2008 at 10:16 AM, Martin Makundi [EMAIL PROTECTED] wrote: I would guess that it is better to use panels or fragments and instead of using setXXX, just initialize everyting in its place according to an internal state. Start with one hard coded layout and then tune it using an internal state, for example. ** Martin 2008/4/28 Azzeddine Daddah [EMAIL PROTECTED] : Hi there, I'm new to Wicket trying to build my first application :). I've already token a look at Creating layouts using markup inheritance tutorial from the Wicket website, but still have some questions: Suppose that I've a base page which I want that some of my pages inherits the layout from it. What I want to do is to have some protected methods like
Re: Modal Window not opening the second time
exactly what i thought somehow your shown boolean stays on true So the problem is not showing it again The problem for you is in the closing.. Because the shown boolean should be reverted to false johan On Tue, Apr 29, 2008 at 10:21 AM, Marieke Vandamme [EMAIL PROTECTED] wrote: The javascript debug window is printing no error. The server returns an empty response (?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response) I did some debugging and came to the function in ModalWindow public void show(AjaxRequestTarget target) there the boolean shown is tested. The content is only showed when shown=false, in my case shown=true... Can you please try the code from my first post? If you say you reuse the dialog, what am I doing wrong? How do you guys do it? Thanks ! Johan Compagner wrote: We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no affect to the memory-usage? Cristi Manole wrote: I am 99% certain that if you change your code from : *final MyChooser myChooser = new MyChooser(modal);* *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } } * to this : *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return new MyChooser(modal); } } * it will work. Try it. Cristi Manole On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, can't anyone help me with this problem? If I need to code it differently, please tell me. Thanks !! Marieke Vandamme wrote: Hello, i'm having problems with the modal window. It shows up fine when I click my link the first time, but after closing the window with the 'X', it won't open again. I don't know if I'm using it wrong or if it's a bug. Any help is welcome ! thanks. Marieke. My code : public class TestModalWindow extends WebPage { public TestModalWindow() { final ModalWindow modal = new ModalWindow(dataChooser); add(modal); final MyChooser myChooser = new MyChooser(modal); modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } }); add(new AjaxLink(lnkOpen) { public void onClick(AjaxRequestTarget target) { myChooser.reload(target); } }); } public class MyChooser extends WebPage { private ModalWindow window; public MyChooser(ModalWindow w) { this.window = w; } public void reload(AjaxRequestTarget target) { this.window.show(target); } } } -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16955484.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modal Window not opening the second time
Marieke Vandamme wrote: You are creating a new instance of your Panel. True, I was just writing how I did it:) I don't need to create a new ModalWindow or Panel, because all the data on my ModalWindow is the same. Mine arent. Your solution works because setContent sets shown = false. Yes the idea is that modal window are not shown all the time.. When I update the internal stuff(in modal window) I just do it the ordinary way with ajax(how ever you need to setup modal windows for this), by adding the component to the parent container: downChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) { @Override protected void onUpdate(AjaxRequestTarget target) { linkRemove.setVisible(true); target.addComponent(removeLinkContainer); formAddNewWeight.setModel(new CompoundPropertyModel( currentWeightModel)); target.addComponent(formAddNewWeight); update = true; } Shouldn't it work without this call to setContent? no I need to call set content since I also do this, another place in another component on the same page: item.add(new AjaxLink(switchExercise) { @Override public void onClick(AjaxRequestTarget target) { target modalWindow.setTitle(getString(exerciseOverview)); modalWindow.setMinimalHeight(700); modalWindow.setContent(new ExerciseOverviewPanel( modalWindow.getContentId(), new BaseEntityDetachableModel(trainingSet), modalWindow, TrainingSchemePanel.this)); modalWindow.show(target); } }); Nino.Martinez wrote: Im doing it like this: AjaxLink popupLink = new AjaxLink(manageWeightPop) { @Override public void onClick(AjaxRequestTarget target) { target modalWindow.setTitle(getString(weightlog)); modalWindow.setMinimalHeight(700); modalWindow.setContent(new ManageWeightPanel(modalWindow .getContentId(), modalWindow, new BaseEntityDetachableModel(getPerson(; modalWindow.show(target); } }; Marieke Vandamme wrote: The javascript debug window is printing no error. The server returns an empty response (?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response) I did some debugging and came to the function in ModalWindow public void show(AjaxRequestTarget target) there the boolean shown is tested. The content is only showed when shown=false, in my case shown=true... Can you please try the code from my first post? If you say you reuse the dialog, what am I doing wrong? How do you guys do it? Thanks ! Johan Compagner wrote: We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no affect to the memory-usage? Cristi Manole wrote: I am 99% certain that if you change your code from : *final MyChooser myChooser = new MyChooser(modal);* *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } } * to this : *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return new MyChooser(modal); } } * it will work. Try it. Cristi Manole On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, can't anyone help me with this problem? If I need to code it differently, please tell me. Thanks !! Marieke Vandamme wrote: Hello, i'm having problems with the modal window. It shows up fine when I click my link the first time, but after closing the window with the 'X', it won't open again. I don't know if I'm using it wrong or if it's a bug. Any help is welcome ! thanks. Marieke. My code : public class TestModalWindow extends WebPage { public TestModalWindow() { final ModalWindow modal = new ModalWindow(dataChooser); add(modal); final MyChooser myChooser = new MyChooser(modal); modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() {
Re: loadStringResource(Component component, String key) - correct method to check if the component IS a Page?
yepp, then the TransparentWebMarkupContainer gets passed in. And you're right, it's gonna be a filthy hack if you try to find out if its a Page. Unfortunately I've got no further suggestions but it'd be interesting to know why you want to distinguish between pages and other components anyway ... regards, Michael Ned Collyer wrote: Thanks for your reply, Maybe it's because I am using a wicket:message key=foobar/ in the markup?! There isn't really any code to show. I put the wicket:message into the page, then i check the params coming in to the method. I'll have a bit more of a play I think, but I would be interested in what your results are with the wicket:message key=foobar/ Rgds Ned Michael Sparer wrote: I just subclassed ComponentStringResourceLoader and tried calling getString(foobar); from a page (that extends another page). There instanceof Page returns true. Maybe it'd be helpful to see some code (and your usecase 'cause maybe there's another way to do it). regards Michael - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/loadStringResource%28Component-component%2C-String-key%29---correct-method-to-check-if-the-component-IS-a-Page--tp16930303p16955747.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Unique identifying name in gridview
Hi all, I have a gridview, which in populateItem is filled with: new PhotoTile(tileContent, (PhotoCardModel) item.getModel()); In PhotoTile's constructor, I do: AjaxLink clickLink = clickLink.add(new Image(thumbnail, rs)); where 'rs' is a WebResource of which the getResourceStream returns a FileResourceStream pointing to the image location on disk. The HTML img tag of the first image on the first row is rendered as follows: img src=?wicket:interface=:0:rows:0:cols:0:tileContent:clickLink:thumbnail::IResourceListener border=0/ When I upload a new photo with my application, a new thumbnail appears on the grid, shifting the existing ones one position lower (I'm sorting descending). But because the image tag of the first thumbnail remains the same (rows:0:cols:0), I see the cached image of the thumbnail that was at that position just before. When I clear my browser cache, I see the right image. I fixed this a bit hacky by using NonCachingImage which add some random stuff to the img url, but that's not what I want, because these images could be cached without problems. I want the image url to be something like: img src=whatever prefix goes here/images/img name / How do I achieve this? -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: loadStringResource(Component component, String key) - correct method to check if the component IS a Page?
Thanks for your reply, Maybe it's because I am using a wicket:message key=foobar/ in the markup?! There isn't really any code to show. I put the wicket:message into the page, then i check the params coming in to the method. I'll have a bit more of a play I think, but I would be interested in what your results are with the wicket:message key=foobar/ Rgds Ned Michael Sparer wrote: I just subclassed ComponentStringResourceLoader and tried calling getString(foobar); from a page (that extends another page). There instanceof Page returns true. Maybe it'd be helpful to see some code (and your usecase 'cause maybe there's another way to do it). regards Michael -- View this message in context: http://www.nabble.com/loadStringResource%28Component-component%2C-String-key%29---correct-method-to-check-if-the-component-IS-a-Page--tp16930303p16955733.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: rendering the navigation toolbar
wow!! cool. That was so educational :) Thanks. If I change this, it will change EVERYTHING, right? What if I want to do something like: em style=color: green; only for this PNL ? Is there a way? My other option is to add this style (attribute and CSS actually) to the inner span. I think that the second option is better. isn't it? Now I need to look how to do this ... On Tue, Apr 29, 2008 at 1:26 AM, Gerolf Seitz [EMAIL PROTECTED] wrote: a PagingNavigationLink is autoenabled (see constructor of PNL). for a PNL this means, that when the page the PNL links to is the same as the current page, the link is automatically disabled. the em tags come from a setting in IMarkupSettings. check accessors for defaultBeforeDisabledLink and defaultAfterDisabled link. Gerolf On Mon, Apr 28, 2008 at 4:29 PM, Eyal Golan [EMAIL PROTECTED] wrote: hi all, I've been trying to change some styling in the navigation toolbar. I have a StyledAjaxNavigationToolbar which inherit from AjaxNavigationToolbar. I thought to override newPagingNavigator that will return StyledAjaxPagingNavigator (inherit AjaxPagingNavigator). I overridden AjaxNavigationToolbar to add class for the navigation toolbar (A small change in the html file). Here's the html: ?xml version=1.0? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.sourceforge.net/; xml:lang=en lang=en wicket:panel tr class=navigation td wicket:id=span div class=navigatorLabelspan wicket:id=navigatorLabel[navigator-label]/span/div div class=navigatorspan wicket:id=navigator[navigator]/span/div /td /tr /wicket:panel /html OK, so what is actually my question? In the navigation toolbar we have the labels of the pages. Each label is a link EXCEPT the one of the current page. All I want to do is add a class to this label (which is in a span). I could not find where Wicket put a em before the span of the current page and how it is not a link. How should I build the hierarchy? thanks -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/
Re: Modal Window not opening the second time
Sorry, but I don't know what the solution is for me now? When looking into ModalWindow again : public void close(AjaxRequestTarget target) { getContent().setVisible(false); target.appendJavascript(getCloseJavacript()); shown = false; } When debugging, the shown is set to false. But the next time, in the show function, it's true again... Should I set it somewhere to false myself? Johan Compagner wrote: exactly what i thought somehow your shown boolean stays on true So the problem is not showing it again The problem for you is in the closing.. Because the shown boolean should be reverted to false johan On Tue, Apr 29, 2008 at 10:21 AM, Marieke Vandamme [EMAIL PROTECTED] wrote: The javascript debug window is printing no error. The server returns an empty response (?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response) I did some debugging and came to the function in ModalWindow public void show(AjaxRequestTarget target) there the boolean shown is tested. The content is only showed when shown=false, in my case shown=true... Can you please try the code from my first post? If you say you reuse the dialog, what am I doing wrong? How do you guys do it? Thanks ! Johan Compagner wrote: We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no affect to the memory-usage? Cristi Manole wrote: I am 99% certain that if you change your code from : *final MyChooser myChooser = new MyChooser(modal);* *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } } * to this : *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return new MyChooser(modal); } } * it will work. Try it. Cristi Manole On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, can't anyone help me with this problem? If I need to code it differently, please tell me. Thanks !! Marieke Vandamme wrote: Hello, i'm having problems with the modal window. It shows up fine when I click my link the first time, but after closing the window with the 'X', it won't open again. I don't know if I'm using it wrong or if it's a bug. Any help is welcome ! thanks. Marieke. My code : public class TestModalWindow extends WebPage { public TestModalWindow() { final ModalWindow modal = new ModalWindow(dataChooser); add(modal); final MyChooser myChooser = new MyChooser(modal); modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } }); add(new AjaxLink(lnkOpen) { public void onClick(AjaxRequestTarget target) { myChooser.reload(target); } }); } public class MyChooser extends WebPage { private ModalWindow window; public MyChooser(ModalWindow w) { this.window = w; } public void reload(AjaxRequestTarget target) { this.window.show(target); } } } -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16955484.html Sent from the Wicket - User mailing list
Re: VOTE: Generics of IDataProvider
[ ] IDataProviderI,T [ x ] IteratorIModelT , drop model [ ] Leave as is. Maarten On Fri, Apr 25, 2008 at 1:52 AM, Eelco Hillenius [EMAIL PROTECTED] wrote: I would have a better idea if I would have had the chance to actually play with it, but here is mine: [ ] IDataProviderI,T [ x ] IteratorIModelT , drop model [ ] Leave as is. Looks most elegant to me, and it is immediately clear what T is for. Also, I think that generics are bloody verbose anyway, so I'm not much in favor of shortening things up - and not support some of the use cases - for just this occasion. I rather have something that works for everyone. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modal Window not opening the second time
I for one think it's a bug somewhere. Not in Marieke's code. On Tue, Apr 29, 2008 at 12:11 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Sorry, but I don't know what the solution is for me now? When looking into ModalWindow again : public void close(AjaxRequestTarget target) { getContent().setVisible(false); target.appendJavascript(getCloseJavacript()); shown = false; } When debugging, the shown is set to false. But the next time, in the show function, it's true again... Should I set it somewhere to false myself? Johan Compagner wrote: exactly what i thought somehow your shown boolean stays on true So the problem is not showing it again The problem for you is in the closing.. Because the shown boolean should be reverted to false johan On Tue, Apr 29, 2008 at 10:21 AM, Marieke Vandamme [EMAIL PROTECTED] wrote: The javascript debug window is printing no error. The server returns an empty response (?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response) I did some debugging and came to the function in ModalWindow public void show(AjaxRequestTarget target) there the boolean shown is tested. The content is only showed when shown=false, in my case shown=true... Can you please try the code from my first post? If you say you reuse the dialog, what am I doing wrong? How do you guys do it? Thanks ! Johan Compagner wrote: We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no affect to the memory-usage? Cristi Manole wrote: I am 99% certain that if you change your code from : *final MyChooser myChooser = new MyChooser(modal);* *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } } * to this : *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return new MyChooser(modal); } } * it will work. Try it. Cristi Manole On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, can't anyone help me with this problem? If I need to code it differently, please tell me. Thanks !! Marieke Vandamme wrote: Hello, i'm having problems with the modal window. It shows up fine when I click my link the first time, but after closing the window with the 'X', it won't open again. I don't know if I'm using it wrong or if it's a bug. Any help is welcome ! thanks. Marieke. My code : public class TestModalWindow extends WebPage { public TestModalWindow() { final ModalWindow modal = new ModalWindow(dataChooser); add(modal); final MyChooser myChooser = new MyChooser(modal); modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } }); add(new AjaxLink(lnkOpen) { public void onClick(AjaxRequestTarget target) { myChooser.reload(target); } }); } public class MyChooser extends WebPage { private ModalWindow window; public MyChooser(ModalWindow w) { this.window = w; } public void reload(AjaxRequestTarget target) { this.window.show(target); } } } -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modal Window not opening the second time
make a test case then and attach it to a jira issue On Tue, Apr 29, 2008 at 11:11 AM, Marieke Vandamme [EMAIL PROTECTED] wrote: Sorry, but I don't know what the solution is for me now? When looking into ModalWindow again : public void close(AjaxRequestTarget target) { getContent().setVisible(false); target.appendJavascript(getCloseJavacript()); shown = false; } When debugging, the shown is set to false. But the next time, in the show function, it's true again... Should I set it somewhere to false myself? Johan Compagner wrote: exactly what i thought somehow your shown boolean stays on true So the problem is not showing it again The problem for you is in the closing.. Because the shown boolean should be reverted to false johan On Tue, Apr 29, 2008 at 10:21 AM, Marieke Vandamme [EMAIL PROTECTED] wrote: The javascript debug window is printing no error. The server returns an empty response (?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response) I did some debugging and came to the function in ModalWindow public void show(AjaxRequestTarget target) there the boolean shown is tested. The content is only showed when shown=false, in my case shown=true... Can you please try the code from my first post? If you say you reuse the dialog, what am I doing wrong? How do you guys do it? Thanks ! Johan Compagner wrote: We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no affect to the memory-usage? Cristi Manole wrote: I am 99% certain that if you change your code from : *final MyChooser myChooser = new MyChooser(modal);* *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } } * to this : *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return new MyChooser(modal); } } * it will work. Try it. Cristi Manole On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, can't anyone help me with this problem? If I need to code it differently, please tell me. Thanks !! Marieke Vandamme wrote: Hello, i'm having problems with the modal window. It shows up fine when I click my link the first time, but after closing the window with the 'X', it won't open again. I don't know if I'm using it wrong or if it's a bug. Any help is welcome ! thanks. Marieke. My code : public class TestModalWindow extends WebPage { public TestModalWindow() { final ModalWindow modal = new ModalWindow(dataChooser); add(modal); final MyChooser myChooser = new MyChooser(modal); modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } }); add(new AjaxLink(lnkOpen) { public void onClick(AjaxRequestTarget target) { myChooser.reload(target); } }); } public class MyChooser extends WebPage { private ModalWindow window; public MyChooser(ModalWindow w) { this.window = w; } public void reload(AjaxRequestTarget target) { this.window.show(target); } } } -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: rendering the navigation toolbar
On Tue, Apr 29, 2008 at 11:00 AM, Eyal Golan [EMAIL PROTECTED] wrote: wow!! cool. That was so educational :) Thanks. np :) If I change this, it will change EVERYTHING, right? yes, this is the setting for all disabled links. What if I want to do something like: em style=color: green; only for this PNL ? Is there a way? there are numerous ;) you could add a SimpleAttributeModifier to the specific PNL: PNL link = new PNL(...); link.add(new SimpleAttributeModifier(class, green) { public boolean isEnabled() { return !getComponent().isEnabled(); } } you could easily achieve the same result with overriding PNL#onComponentTag ... Gerolf
Passing around a component ref. (specifically BreadCrumbBar)
I have a specific question and a generic question based on it. I have several Panels added to my BreadCrumbPanels, these panels themselves extend the Panel class, and will contain BreadCrumbPanelLinks , to navigate down the hierarchy. My question is how do I pass the BreadCrumbBar from a BreadCrumbPanel to the panels that get added to it ? Of course I can create constructors for these sub panels to take in a IBreadCrumbModel . But this is not an elegant solution, as I have to pass the BreadCrumbBar to each possible constructor of the Panel. The BreadCrumbBar is created in my BasePage, from which all my pages inherit. So I tried doing something like ((BasePage)getPage()).getBreadCrumbBar(), in the sub panels, but it turns out, that a component does not get a Page associated , to it, at Construction time. So what is the best way for a Page, to pass around certain components it initializes, to child panels , without having to have a constructor for the Panel that takes in those components ? I already use spring along with Wicket, so I was thinking of making certain Components, in to Spring Beans with a Custom scope, say a Page scope. i.e. the component gets initialized during the Page's construction and can then be injected to subsequent Components created by the Page's construction. Any thoughts ? -- View this message in context: http://www.nabble.com/Passing-around-a-component-ref.-%28specifically-BreadCrumbBar%29-tp16957263p16957263.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modal Window not opening the second time
I created a jira issue https://issues.apache.org/jira/browse/WICKET-1576 Thanks ! Johan Compagner wrote: make a test case then and attach it to a jira issue On Tue, Apr 29, 2008 at 11:11 AM, Marieke Vandamme [EMAIL PROTECTED] wrote: Sorry, but I don't know what the solution is for me now? When looking into ModalWindow again : public void close(AjaxRequestTarget target) { getContent().setVisible(false); target.appendJavascript(getCloseJavacript()); shown = false; } When debugging, the shown is set to false. But the next time, in the show function, it's true again... Should I set it somewhere to false myself? Johan Compagner wrote: exactly what i thought somehow your shown boolean stays on true So the problem is not showing it again The problem for you is in the closing.. Because the shown boolean should be reverted to false johan On Tue, Apr 29, 2008 at 10:21 AM, Marieke Vandamme [EMAIL PROTECTED] wrote: The javascript debug window is printing no error. The server returns an empty response (?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response) I did some debugging and came to the function in ModalWindow public void show(AjaxRequestTarget target) there the boolean shown is tested. The content is only showed when shown=false, in my case shown=true... Can you please try the code from my first post? If you say you reuse the dialog, what am I doing wrong? How do you guys do it? Thanks ! Johan Compagner wrote: We reuse the dialog constantly, so i dont know what goes wrong for you. What does the javascript debug window tell you? Maybe the modal window some things that is is still shown On 4/29/08, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, Thanks for the reply. But isn't it possible to reuse the modalwindow? Because in my application the window needs to be opened many times, and I thought it would be better to reuse the same window multiple times. Or has that no affect to the memory-usage? Cristi Manole wrote: I am 99% certain that if you change your code from : *final MyChooser myChooser = new MyChooser(modal);* *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } } * to this : *modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return new MyChooser(modal); } } * it will work. Try it. Cristi Manole On Mon, Apr 28, 2008 at 1:07 PM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello, can't anyone help me with this problem? If I need to code it differently, please tell me. Thanks !! Marieke Vandamme wrote: Hello, i'm having problems with the modal window. It shows up fine when I click my link the first time, but after closing the window with the 'X', it won't open again. I don't know if I'm using it wrong or if it's a bug. Any help is welcome ! thanks. Marieke. My code : public class TestModalWindow extends WebPage { public TestModalWindow() { final ModalWindow modal = new ModalWindow(dataChooser); add(modal); final MyChooser myChooser = new MyChooser(modal); modal.setPageCreator(new ModalWindow.PageCreator() { public Page createPage() { return myChooser; } }); add(new AjaxLink(lnkOpen) { public void onClick(AjaxRequestTarget target) { myChooser.reload(target); } }); } public class MyChooser extends WebPage { private ModalWindow window; public MyChooser(ModalWindow w) { this.window = w; } public void reload(AjaxRequestTarget target) { this.window.show(target); } } } -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16935903.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16953499.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL
Re: loadStringResource(Component component, String key) - correct method to check if the component IS a Page?
I basically want the components Model. It's legitimate for it to be null. So, if I can see which component is a page, then i can easily call the getPage().getModel() Of course if it's TransparentWebMarkupContainer then getModel returns null even if the page has a model set. It appears to work with panels, just not page. Are there other conditions that will cause the component to come through as TransparentWebMarkupContainer? How can I determine it's a page :). Ugly hacks are not something i enjoy/advocate using. On Tue, Apr 29, 2008 at 6:56 PM, Michael Sparer [EMAIL PROTECTED] wrote: yepp, then the TransparentWebMarkupContainer gets passed in. And you're right, it's gonna be a filthy hack if you try to find out if its a Page. Unfortunately I've got no further suggestions but it'd be interesting to know why you want to distinguish between pages and other components anyway ... regards, Michael
Re: VOTE: Generics of IDataProvider
[ ] IDataProviderI,T [x] IteratorIModelT , drop model [ ] Leave as is. Leaving it as is just doesn't make sense as it doesn't support the use case on hand. Using IDataProviderI, T is OK too. For those whose I == T, we can always have a convenient base class: abstract class ModelProviderT implements IDataProviderT, T { IModelT model(T object) { return object; } } IteratorIModelT will make the interface simpler. For those who need to wrap domain objects as models, we can provide a wrapper iterator: abstract class ModelWrapperIteratorT implements IteratorT { ModelWrapperIterator(IteratorT source) { ... } abstract IModelT map(T sourceElement); } - -- Kent Tong Wicket tutorials freely available at http://www.agileskills2.org/EWDW Axis2 tutorials freely available at http://www.agileskills2.org/DWSAA -- View this message in context: http://www.nabble.com/VOTE%3A-Generics-of-IDataProvider-tp16871723p16957615.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: loadStringResource(Component component, String key) - correct method to check if the component IS a Page?
I did an elegantish... workaround. - the page instantiates a panel - the panel has the model. Basically my pages defer almost everything to panels - and I guess it also aids in their reuse/embeddability. I'm quite familiar with instanceof thanks ;) Michael Sparer wrote: well one (as said ugly ;-)) way that comes to my mind is to ask if component.getParent().getParent() instanceof Page (that should also work if you use nested subpages). regards, Michael -- View this message in context: http://www.nabble.com/loadStringResource%28Component-component%2C-String-key%29---correct-method-to-check-if-the-component-IS-a-Page--tp16930303p16957861.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: rendering the navigation toolbar
thanks, here's what I did. 1. I have a StyledAjaxNavigationToolbar that overrides: @Override protected PagingNavigator newPagingNavigator(String navigatorId, final DataTable table) { return new StyledAjaxPagingNavigator(navigatorId, table); } 2. Then my StyledAjaxPagingNavigator overrides: @Override protected PagingNavigation newNavigation(IPageable pageable, IPagingLabelProvider labelProvider) { return new StyledAjaxPagingNavigation(navigation, pageable, labelProvider); } 3. StyledAjaxPagingNavigation overrides: @Override protected Link newPagingNavigationLink(String id, IPageable pageable, int pageIndex) { Link link = super.newPagingNavigationLink(id, pageable, pageIndex); link.add(new AbstractBehavior() { private static final long serialVersionUID = 1L; @Override public void onComponentTag(Component component, ComponentTag tag) { super.onComponentTag(component, tag); if (!component.isEnabled()) { CharSequence oldClassName = tag.getString(class); if (oldClassName == null || oldClassName.equals()) { tag.put(class, disabledPagingLink); } else { tag.put(class, oldClassName + + disabledPagingLink); } } } }); return link; } And then, in the CSS file I do whatever I want... And now, is this the best way to access the PNL ? Was I able to get the newPagingNavigationLink with less overridden classes? And thanks for you help. I really enjoy this Wicket stuff!! It's so wicked ;) On Tue, Apr 29, 2008 at 12:43 PM, Gerolf Seitz [EMAIL PROTECTED] wrote: On Tue, Apr 29, 2008 at 11:00 AM, Eyal Golan [EMAIL PROTECTED] wrote: wow!! cool. That was so educational :) Thanks. np :) If I change this, it will change EVERYTHING, right? yes, this is the setting for all disabled links. What if I want to do something like: em style=color: green; only for this PNL ? Is there a way? there are numerous ;) you could add a SimpleAttributeModifier to the specific PNL: PNL link = new PNL(...); link.add(new SimpleAttributeModifier(class, green) { public boolean isEnabled() { return !getComponent().isEnabled(); } } you could easily achieve the same result with overriding PNL#onComponentTag ... Gerolf -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/
Re: rendering the navigation toolbar
instead of the custom AbstractBehavior, you could add an AttributeAppender like this: link.add(new AttributeAppender(class, true, new Model(disabledPaginLink), ) { public boolean isEnabled() { return !getComponent().isEnabled(); } }); Gerolf On Tue, Apr 29, 2008 at 1:09 PM, Eyal Golan [EMAIL PROTECTED] wrote: thanks, here's what I did. 1. I have a StyledAjaxNavigationToolbar that overrides: @Override protected PagingNavigator newPagingNavigator(String navigatorId, final DataTable table) { return new StyledAjaxPagingNavigator(navigatorId, table); } 2. Then my StyledAjaxPagingNavigator overrides: @Override protected PagingNavigation newNavigation(IPageable pageable, IPagingLabelProvider labelProvider) { return new StyledAjaxPagingNavigation(navigation, pageable, labelProvider); } 3. StyledAjaxPagingNavigation overrides: @Override protected Link newPagingNavigationLink(String id, IPageable pageable, int pageIndex) { Link link = super.newPagingNavigationLink(id, pageable, pageIndex); link.add(new AbstractBehavior() { private static final long serialVersionUID = 1L; @Override public void onComponentTag(Component component, ComponentTag tag) { super.onComponentTag(component, tag); if (!component.isEnabled()) { CharSequence oldClassName = tag.getString(class); if (oldClassName == null || oldClassName.equals()) { tag.put(class, disabledPagingLink); } else { tag.put(class, oldClassName + + disabledPagingLink); } } } }); return link; } And then, in the CSS file I do whatever I want... And now, is this the best way to access the PNL ? Was I able to get the newPagingNavigationLink with less overridden classes? And thanks for you help. I really enjoy this Wicket stuff!! It's so wicked ;) On Tue, Apr 29, 2008 at 12:43 PM, Gerolf Seitz [EMAIL PROTECTED] wrote: On Tue, Apr 29, 2008 at 11:00 AM, Eyal Golan [EMAIL PROTECTED] wrote: wow!! cool. That was so educational :) Thanks. np :) If I change this, it will change EVERYTHING, right? yes, this is the setting for all disabled links. What if I want to do something like: em style=color: green; only for this PNL ? Is there a way? there are numerous ;) you could add a SimpleAttributeModifier to the specific PNL: PNL link = new PNL(...); link.add(new SimpleAttributeModifier(class, green) { public boolean isEnabled() { return !getComponent().isEnabled(); } } you could easily achieve the same result with overriding PNL#onComponentTag ... Gerolf -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/
Re: rendering the navigation toolbar
hh, the isEnabled() of the AttributeAppender is a really cool tool. I used it in another place. I have a StyledDataTable that overridden onComponentTag: @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); if (dataProvider.size() == 0) { CharSequence oldClassName = tag.getString(class); if (oldClassName == null || oldClassName.equals()) { tag.put(class, emptyTable); } else { tag.put(class, oldClassName + + emptyTable); } } } And instead, I put in the constructor: add(new AttributeAppender(class, true, new Model(emptyTable), ) { private static final long serialVersionUID = 1L; @Override public boolean isEnabled(Component component) { return (EurekifyDataTable.this.dataProvider.size() == 0); } }); That is so much better .. On Tue, Apr 29, 2008 at 2:18 PM, Gerolf Seitz [EMAIL PROTECTED] wrote: instead of the custom AbstractBehavior, you could add an AttributeAppender like this: link.add(new AttributeAppender(class, true, new Model(disabledPaginLink), ) { public boolean isEnabled() { return !getComponent().isEnabled(); } }); Gerolf On Tue, Apr 29, 2008 at 1:09 PM, Eyal Golan [EMAIL PROTECTED] wrote: thanks, here's what I did. 1. I have a StyledAjaxNavigationToolbar that overrides: @Override protected PagingNavigator newPagingNavigator(String navigatorId, final DataTable table) { return new StyledAjaxPagingNavigator(navigatorId, table); } 2. Then my StyledAjaxPagingNavigator overrides: @Override protected PagingNavigation newNavigation(IPageable pageable, IPagingLabelProvider labelProvider) { return new StyledAjaxPagingNavigation(navigation, pageable, labelProvider); } 3. StyledAjaxPagingNavigation overrides: @Override protected Link newPagingNavigationLink(String id, IPageable pageable, int pageIndex) { Link link = super.newPagingNavigationLink(id, pageable, pageIndex); link.add(new AbstractBehavior() { private static final long serialVersionUID = 1L; @Override public void onComponentTag(Component component, ComponentTag tag) { super.onComponentTag(component, tag); if (!component.isEnabled()) { CharSequence oldClassName = tag.getString(class); if (oldClassName == null || oldClassName.equals()) { tag.put(class, disabledPagingLink); } else { tag.put(class, oldClassName + + disabledPagingLink); } } } }); return link; } And then, in the CSS file I do whatever I want... And now, is this the best way to access the PNL ? Was I able to get the newPagingNavigationLink with less overridden classes? And thanks for you help. I really enjoy this Wicket stuff!! It's so wicked ;) On Tue, Apr 29, 2008 at 12:43 PM, Gerolf Seitz [EMAIL PROTECTED] wrote: On Tue, Apr 29, 2008 at 11:00 AM, Eyal Golan [EMAIL PROTECTED] wrote: wow!! cool. That was so educational :) Thanks. np :) If I change this, it will change EVERYTHING, right? yes, this is the setting for all disabled links. What if I want to do something like: em style=color: green; only for this PNL ? Is there a way? there are numerous ;) you could add a SimpleAttributeModifier to the specific PNL: PNL link = new PNL(...); link.add(new SimpleAttributeModifier(class, green) { public boolean isEnabled() { return !getComponent().isEnabled(); } } you could easily achieve the same result with overriding PNL#onComponentTag ... Gerolf -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/
Remember last page before page expired
I have a Login page that is redirected if the session is expired (for example, if I shut of the server and put it on again). In the Login page, I redirect to my base page: PortalWebPage page = new PortalWebPage(pageParameters); setResponsePage(page); this happens in the submit. my question: I want to keep the last visited page (and the parameters it has) so I won't redirect to PortalWebPage but to this last page. Is it possible? -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/
Re: How to debug Back Button
Move to 1.3 now is not an option :( On Mon, Apr 28, 2008 at 5:55 PM, Johan Compagner [EMAIL PROTECTED] wrote: Dont know why it is different in ie compared to ff, but do upgrade to 1.3 because then page expired are pretty much none excistent. On 4/28/08, Marco Aurélio Silva [EMAIL PROTECTED] wrote: Hi All I'm using wicket 1.2.6 and I'm having problems with back button on IE. I can go back with back button of browser, but when I try to go forward, I get a Page Expired. The log is set to debug, but I can't find anything in log file to help me find out what is causing this. I don't know if there is a problem in my code because in Firefox I can navigate back and forward with browser buttons without any problem. My doubt is where should I look to found the problem? Thanks in advance! Marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Alternative method to initialise page
I think the key point is - if extending components by overriding methods is a supported (and encouraged) pattern in wicket there should be a *standard* way to do it. Sure it is possible for each user to hack a unique solution but this provides no common ground when people run into issues. If every user implements it in their own way (or ignores the problem - which, as we have seen, limits extensibility) then it will be harder to support and the learning curve will be steeper. One documented, supported approach makes sense. In my opinion, component extension by overriding methods is very powerful and should be made as simple as possible. Mr Mean wrote: Such an initialize method can easily be done by users them self with a simple factory pattern. Can you give an example of this? public class MyFactory { public SomeComponent getComponent(String id,someParams) { SomeComponent c=new MyCustomComponent(id,someParams); c.init(); return c; } } public class MyPage extends webPage { public MyPage() { add(factory.getComponent(id,foo); } } What a huge amount of bloat to simply give the *option* to customise components. Overridable methods area much more obvious way to make a component extendible and require less effort from the developer. I imagine that is why none of the core wicket components use such component factories. And, be honest... have you used this pattern in a real component? Mr Mean wrote: Building such extendable components seems to be a core feature of wicket and one of its major selling points. I have unwittingly built many components that suffer from this problem already and I imagine it is a fairly common situation. It only becomes obvious when your subclass needs to access constructor parameters that your component acts in bizarre ways when extended. Now that is confusing. I fully agree with you, however this is not a wicket limitation but something that cannot be done as expected in the java language. That is why people have to resort to using things like initialize methods or factory patterns. Java constructors work as expected. When users have to resort to using things like initiialize methods they should be helped by the framework to do it consistently. Mr Mean wrote: So while this is a problem that a significant amount of user could encounter at one time or another, forcing everyone to use factories for components like labels just to avoid problems with more complex components is not a good idea. that is what i meant with api bloat. As Igor said at the beginning of this discussion, it is preferable to use the constructor for most cases. So no one will be forced to use factories - but if you want to provide overridable factory methods there is a simple recommended way to do it. Mr Mean wrote: Is this issue even documented yet? I will create a page for it but waiting until this discussion closes Well this particular issue has been around on the mailing list a few times, so in a way it is self documented ;) I honestly have not looked if there is wiki page for this or if it is mentioned in the api doc. Is this feature of wicket useful? Damn yes. So it should be paraded about and Mr Mean wrote: But you have to be careful that the solution does not introduce other problems or more work for the more standard usecases or anti-patterns. Exactly why each use should not be left wondering how to approach the problem themselves - if they even recognise it as a problem. John -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16959612.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Alternative method to initialise page
I think the key point is - if extending components by overriding methods is a supported (and encouraged) pattern in wicket there should be a *standard* way to do it. Sure it is possible for each user to hack a unique solution but this provides no common ground when people run into issues. If every user implements it in their own way (or ignores the problem - which, as we have seen, limits extensibility) then it will be harder to support and the learning curve will be steeper. One documented, supported approach makes sense. In my opinion, component extension by overriding methods is very powerful and should be made as simple as possible. Mr Mean wrote: Such an initialize method can easily be done by users them self with a simple factory pattern. Can you give an example of this? public class MyFactory ... What a lot of bloat to simply give the *option* to customise components. Overridable methods area much more obvious way to make a component extendible and require less effort from the developer. I imagine that is why none of the core wicket components use such component factories. And, be honest... have you used this pattern in a real component? Mr Mean wrote: Building such extendable components seems to be a core feature of wicket and one of its major selling points. I have unwittingly built many components that suffer from this problem already and I imagine it is a fairly common situation. It only becomes obvious when your subclass needs to access constructor parameters that your component acts in bizarre ways when extended. Now that is confusing. I fully agree with you, however this is not a wicket limitation but something that cannot be done as expected in the java language. That is why people have to resort to using things like initialize methods or factory patterns. Java constructors work as expected. When users have to resort to using things like initiialize methods they should be helped by a framework or specification to do it consistently. Mr Mean wrote: So while this is a problem that a significant amount of user could encounter at one time or another, forcing everyone to use factories for components like labels just to avoid problems with more complex components is not a good idea. that is what i meant with api bloat. As Igor said at the beginning of this discussion, it is still preferable to use the constructor for most cases. So no one will be forced to use factories - but if you want to provide overridable factory methods there is a simple recommended place to do it. Mr Mean wrote: But you have to be careful that the solution does not introduce other problems or more work for the more standard usecases or anti-patterns. Exactly why each use should not be left wondering how to approach the problem themselves - if they even recognise it as a problem. John -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16959777.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Alternative method to initialise page
Would you like me to add something like this to the wiki? // The interface... public interface IBeforeFirstRenderListener { public void onBeforeFirstRender(); } // The invoking listener... public class BeforeFirstRenderListenerInvoker implements IComponentOnBeforeRenderListener { public static final MetaDataKey META_KEY = new MetaDataKey(IBeforeFirstRenderListener.class) { private static final long serialVersionUID = -1545274527459326785L; }; public void onBeforeRender(Component component) { if(component instanceof IBeforeFirstRenderListener component.getMetaData(META_KEY) == null) { ((IBeforeFirstRenderListener)component ).onBeforeFirstRender(); component.setMetaData(META_KEY, Boolean.TRUE); } } } On Tue, Apr 29, 2008 at 8:44 AM, John Patterson [EMAIL PROTECTED] wrote: I think the key point is - if extending components by overriding methods is a supported (and encouraged) pattern in wicket there should be a *standard* way to do it. Sure it is possible for each user to hack a unique solution but this provides no common ground when people run into issues. If every user implements it in their own way (or ignores the problem - which, as we have seen, limits extensibility) then it will be harder to support and the learning curve will be steeper. One documented, supported approach makes sense. In my opinion, component extension by overriding methods is very powerful and should be made as simple as possible. Mr Mean wrote: Such an initialize method can easily be done by users them self with a simple factory pattern. Can you give an example of this? public class MyFactory { public SomeComponent getComponent(String id,someParams) { SomeComponent c=new MyCustomComponent(id,someParams); c.init(); return c; } } public class MyPage extends webPage { public MyPage() { add(factory.getComponent(id,foo); } } What a huge amount of bloat to simply give the *option* to customise components. Overridable methods area much more obvious way to make a component extendible and require less effort from the developer. I imagine that is why none of the core wicket components use such component factories. And, be honest... have you used this pattern in a real component? Mr Mean wrote: Building such extendable components seems to be a core feature of wicket and one of its major selling points. I have unwittingly built many components that suffer from this problem already and I imagine it is a fairly common situation. It only becomes obvious when your subclass needs to access constructor parameters that your component acts in bizarre ways when extended. Now that is confusing. I fully agree with you, however this is not a wicket limitation but something that cannot be done as expected in the java language. That is why people have to resort to using things like initialize methods or factory patterns. Java constructors work as expected. When users have to resort to using things like initiialize methods they should be helped by the framework to do it consistently. Mr Mean wrote: So while this is a problem that a significant amount of user could encounter at one time or another, forcing everyone to use factories for components like labels just to avoid problems with more complex components is not a good idea. that is what i meant with api bloat. As Igor said at the beginning of this discussion, it is preferable to use the constructor for most cases. So no one will be forced to use factories - but if you want to provide overridable factory methods there is a simple recommended way to do it. Mr Mean wrote: Is this issue even documented yet? I will create a page for it but waiting until this discussion closes Well this particular issue has been around on the mailing list a few times, so in a way it is self documented ;) I honestly have not looked if there is wiki page for this or if it is mentioned in the api doc. Is this feature of wicket useful? Damn yes. So it should be paraded about and Mr Mean wrote: But you have to be careful that the solution does not introduce other problems or more work for the more standard usecases or anti-patterns. Exactly why each use should not be left wondering how to approach the problem themselves - if they even recognise it as a problem. John -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16959612.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Alternative method to initialise page
Sorry, type given to meta data key should be Boolean, not IBeforeFirstRenderListener. On Tue, Apr 29, 2008 at 8:55 AM, James Carman [EMAIL PROTECTED] wrote: Would you like me to add something like this to the wiki? // The interface... public interface IBeforeFirstRenderListener { public void onBeforeFirstRender(); } // The invoking listener... public class BeforeFirstRenderListenerInvoker implements IComponentOnBeforeRenderListener { public static final MetaDataKey META_KEY = new MetaDataKey(IBeforeFirstRenderListener.class) { private static final long serialVersionUID = -1545274527459326785L; }; public void onBeforeRender(Component component) { if(component instanceof IBeforeFirstRenderListener component.getMetaData(META_KEY) == null) { ((IBeforeFirstRenderListener)component ).onBeforeFirstRender(); component.setMetaData(META_KEY, Boolean.TRUE); } } } On Tue, Apr 29, 2008 at 8:44 AM, John Patterson [EMAIL PROTECTED] wrote: I think the key point is - if extending components by overriding methods is a supported (and encouraged) pattern in wicket there should be a *standard* way to do it. Sure it is possible for each user to hack a unique solution but this provides no common ground when people run into issues. If every user implements it in their own way (or ignores the problem - which, as we have seen, limits extensibility) then it will be harder to support and the learning curve will be steeper. One documented, supported approach makes sense. In my opinion, component extension by overriding methods is very powerful and should be made as simple as possible. Mr Mean wrote: Such an initialize method can easily be done by users them self with a simple factory pattern. Can you give an example of this? public class MyFactory { public SomeComponent getComponent(String id,someParams) { SomeComponent c=new MyCustomComponent(id,someParams); c.init(); return c; } } public class MyPage extends webPage { public MyPage() { add(factory.getComponent(id,foo); } } What a huge amount of bloat to simply give the *option* to customise components. Overridable methods area much more obvious way to make a component extendible and require less effort from the developer. I imagine that is why none of the core wicket components use such component factories. And, be honest... have you used this pattern in a real component? Mr Mean wrote: Building such extendable components seems to be a core feature of wicket and one of its major selling points. I have unwittingly built many components that suffer from this problem already and I imagine it is a fairly common situation. It only becomes obvious when your subclass needs to access constructor parameters that your component acts in bizarre ways when extended. Now that is confusing. I fully agree with you, however this is not a wicket limitation but something that cannot be done as expected in the java language. That is why people have to resort to using things like initialize methods or factory patterns. Java constructors work as expected. When users have to resort to using things like initiialize methods they should be helped by the framework to do it consistently. Mr Mean wrote: So while this is a problem that a significant amount of user could encounter at one time or another, forcing everyone to use factories for components like labels just to avoid problems with more complex components is not a good idea. that is what i meant with api bloat. As Igor said at the beginning of this discussion, it is preferable to use the constructor for most cases. So no one will be forced to use factories - but if you want to provide overridable factory methods there is a simple recommended way to do it. Mr Mean wrote: Is this issue even documented yet? I will create a page for it but waiting until this discussion closes Well this particular issue has been around on the mailing list a few times, so in a way it is self documented ;) I honestly have not looked if there is wiki page for this or if it is mentioned in the api doc. Is this feature of wicket useful? Damn yes. So it should be paraded about and Mr Mean wrote: But you have to be careful that the solution does not introduce other problems or more work for the more standard usecases or anti-patterns. Exactly why each use should not be left wondering how to
Re: How to debug Back Button
I put a breakpoint on Wicket.Session on method public final Page getPage(final String pageMapName, final String path, final int versionNumber) It seems Firefox is nothing making a request when I navigate with back and forward button. On IE the call to this line: Page page = pageMap.get(Integer.parseInt(id), versionNumber); the page returns null, that's why I got the page expired :/ Any suggestion? On Tue, Apr 29, 2008 at 9:35 AM, Marco Aurélio Silva [EMAIL PROTECTED] wrote: Move to 1.3 now is not an option :( On Mon, Apr 28, 2008 at 5:55 PM, Johan Compagner [EMAIL PROTECTED] wrote: Dont know why it is different in ie compared to ff, but do upgrade to 1.3 because then page expired are pretty much none excistent. On 4/28/08, Marco Aurélio Silva [EMAIL PROTECTED] wrote: Hi All I'm using wicket 1.2.6 and I'm having problems with back button on IE. I can go back with back button of browser, but when I try to go forward, I get a Page Expired. The log is set to debug, but I can't find anything in log file to help me find out what is causing this. I don't know if there is a problem in my code because in Firefox I can navigate back and forward with browser buttons without any problem. My doubt is where should I look to found the problem? Thanks in advance! Marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Modal window and height
Hi! I can't set initial height and width on my modal window. It's always the same height and width when opening it. final ModalWindow modal; add(modal = new ModalWindow(modal)); modal.setPageMapName(modal-4); modal.setCookieName(modal window 4); modal.setInitialWidth(350); modal.setInitialHeight(300); modal.setResizable(false); modal.setWidthUnit(px); modal.setHeightUnit(px); Any clues? -- View this message in context: http://www.nabble.com/Modal-window-and-height-tp16960447p16960447.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What is the best way to create layouts in Wicket?
Bother to give an example of what you mean? 2008/4/29 Johan Compagner [EMAIL PROTECTED]: no Scott just told you that you should create such initializers completely static. They should be 'static' without touching state of the current object/class itself. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Alternative method to initialise page
This approach breaks a components encapsulation because the listener must be installed in the application. Even if IInitializers can be used to do this once it ads an extra complication to creating reusable components. Point-in-case: Should PagingNavigation use this technique to call its factory methods? jwcarman wrote: Would you like me to add something like this to the wiki? // The interface... public interface IBeforeFirstRenderListener { public void onBeforeFirstRender(); } -- View this message in context: http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16961287.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Change to API between Wicket 1.2 releases?
I'm not sure what you mean by what part it really is? Are you asking me to find a simpler example exhibiting the problem? I mean, the panel class follows the RadioGroup component example quite closely: http://wicketstuff.org/wicket13/compref/;jsessionid=C6F7701B642660179563 84008732211C?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.compr ef.RadioGroupPage The only significant difference is that instead of using a submit button I override wantOnSelectionChangedNotification() to return true. public class MyPanel extends Panel { public MyPanel( String id, String caption, PropertyModel groupModel, ChoiceOption[] options ) { super(id, groupModel); add( new Label(caption, caption) ); final RadioGroup group = new RadioGroup(group, groupModel) { //THIS IS THE ONLY PART THAT CHANGED FROM THE COMPONENT EXAMPLE protected boolean wantOnSelectionChangedNotifications() { return true; } //IT POSTS BACK ON ANY SELECTION }; add(group); ListChoiceOption optionList = Arrays.asList( options ); ListView radios = new ListView(radios, optionList) { protected void populateItem(ListItem listItem) { listItem.add( new Radio(radio, new PropertyModel( listItem.getModel(), value) ) ); listItem.add( new Label(option, new PropertyModel( listItem.getModel(), label ) ) ); } }; group.add(radios); } Did I do something wrong, or is that feature of RadioGroup indeed broken in current releases of Wicket 1.2? I really don't know enough about the Wicket internals to debug Wicket. Can you suggest anything simpler that I could try to narrow down the location of the problem? Would it work in Wicket 1.3? -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 29, 2008 3:54 AM To: users@wicket.apache.org Subject: Re: Change to API between Wicket 1.2 releases? 1.2 is a long time ago I have no idea what change did break yours (and what did it fix) If you could figure out what part it really is? johan On Tue, Apr 29, 2008 at 12:09 AM, Frank Silbermann [EMAIL PROTECTED] wrote: I completed a Wicket 1.2 project a couple of years ago, and I've been maintaining it since then. I've been using Version 1.2.2 successfully, and figured I might as well use the lastest release of that version (1.2.7). Well, I'm trying to figure out why Wicket 1.2.7 broke my code. (I scrounged up a Wicket 1.2.6 release, and that also breaks it.) Am I using the Wicket 1.2 API incorrectly? When it works in Wicket 1.2.2, am I using it in an unintended way? Let me illustrate what I've been doing with a small example. This is a simplified version of a component for creating and displaying radio button groups without having to write HTML every time. I give the constructor: (1) a wicket-id, (2) a PropertyModel that initializes the component and keeps track of the current choice, and (3) an array of ChoiceOption. -- The array of choice options defines the set of values offered by the radio buttons, and the corresponding labels to be displayed. The component posts back immediately when a change is made to the radio button. (Think fast INTRAnet with a very small number of simulaneous users.) Here is my implementation: package common.play; import wicket.markup.html.basic.Label; import wicket.model.IModel; import wicket.markup.html.panel.Panel; import wicket.markup.html.form.Radio; import wicket.markup.html.form.RadioGroup; import wicket.markup.html.list.ListItem; import wicket.markup.html.list.ListView; import wicket.model.PropertyModel; import java.util.List; import java.util.Arrays; import common.play.ChoiceOption; public class MyPanel extends Panel { public MyPanel( String id, String caption, PropertyModel groupModel, ChoiceOption[] options) { super(id, groupModel); add( new Label(caption, caption) ); final RadioGroup group = new RadioGroup(group, groupModel) { protected boolean wantOnSelectionChangedNotifications() { return true; } }; add(group); ListChoiceOption optionList = Arrays.asList( options ); ListView radios = new ListView(radios, optionList) { protected void populateItem(ListItem listItem) { listItem.add( new Radio(radio, new PropertyModel( listItem.getModel(), value) ) ); listItem.add( new Label(option, new PropertyModel(
Re: Wicket 1.4 and Wicketstuff/Dojo/DragAndDrop
I got everything to compile and deploy but not to work. No drag. The DraggableBehavior added to a Markupcontainer leads to some javascript code [new Draggable(product_1, {})] but nothing happens when I klick on the MarkupContainer and move the mouse. I think I wait until you did the thin. Stefan. -Ursprüngliche Nachricht- Von: Ryan Sonnek [mailto:[EMAIL PROTECTED] Gesendet: Montag, 28. April 2008 14:55 An: users@wicket.apache.org Betreff: Re: Wicket 1.4 and Wicketstuff/Dojo/DragAndDrop Wichtigkeit: Hoch i'll try to create a 1.4 branch of the scriptaculous project sometime this week. of course patches are always welcome. =) On Mon, Apr 28, 2008 at 7:20 AM, Maurice Marrink [EMAIL PROTECTED] wrote: The source is located at sourceforge http://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wic ket-contrib-scriptaculous As for when it will be available for wicket 1.4?, i have no idea since i have nothing to do with that project. Perhaps Ryan Sonnek can answer that. Maurice On Mon, Apr 28, 2008 at 2:13 PM, Stefan Lindner [EMAIL PROTECTED] wrote: Dear Maurice, Can you give me a timeframe for the availability of WicketStuff Scriptaculous for wicket 1.4? The Drag and Drop will lnot work, becaus a component no langer has a public 'addBeahivor' method. This is now replaced by a simple 'add(Ibehavior...)' method. The 'DraggableTarget' class seems to internally make a call to 'addBeahivor' which no longer exists? As an alternativ way: Where can I find the source (subversion repository)? It's not on sourceforge. Kind Regards Stefan -Ursprüngliche Nachricht- Von: Maurice Marrink [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 25. April 2008 16:03 An: users@wicket.apache.org Betreff: Re: Wicket 1.4 and Wicketstuff/Dojo/DragAndDrop Wichtigkeit: Hoch snapshots should be available, And i think a 1.4-m1 should be available any time soon too. Maurice On Fri, Apr 25, 2008 at 3:49 PM, Ryan Sonnek [EMAIL PROTECTED] wrote: the wicketstuff-scriptaculous project has drag/drop support. I haven't updated it to reflect 1.4 changes yet. are 1.4 snapshots available for wicket yet on the bamboo snapshot repository? On Fri, Apr 25, 2008 at 5:38 AM, Stefan Lindner [EMAIL PROTECTED] wrote: Ok, before I lay ma hands on it: Is there another LIVING project, that deals with drag and drop for wicket? Are there other users of wicketstuff dojo out there, who want to migrate to wicket 1.4? Does it still make sense to investigate in wicketstuff/doho? Are there commercial solutions fprt drag and drop? Stefan -Ursprüngliche Nachricht- Von: Gerolf Seitz [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 25. April 2008 09:02 An: users@wicket.apache.org Betreff: Re: Wicket 1.4 and Wicketstuff/Dojo/DragAndDrop all of the mentioned project maintainers have been away for some time now. you might need to lay your own hands on it. i would guess nobody objects to such efforts. Gerolf On Thu, Apr 24, 2008 at 6:53 PM, Stefan Lindner [EMAIL PROTECTED] wrote: Is there a Wicketstuff/dojo version that works together with Wicket 1.4? Is Wicketstuff/Dojo still alive? The latest news on the webpage statethat Wicketstuff/Dojo is still based upon wicket 1.3 beta. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FileResourceStream
I end up using FileResourceStream to serve up static web pages from a Wicket page. But I am having issues with the fact that the page gets cached and - returning clients with different url params - keep getting served the original static page. Is there a way for me to force a refresh and make sure the newMarkupResourceStream() gets called each time. thanks! _ Make i'm yours. Create a custom banner to support your cause. http://im.live.com/Messenger/IM/Contribute/Default.aspx?source=TXT_TAGHM_MSN_Make_IM_Yours
Re: What is the best way to create layouts in Wicket?
The method just has to be stateless, particularly from the perspective of instantiation. public BasePage(...) { add(createFooPanel(fooId)); add(createBarPanel(barId)); } protected abstract Panel createFooPanel(String id); protected abstract Panel createFooPanel(String id); - public RedPage(...) { super(...); } @Override protected Panel createFooPanel(String id) { // do not reference anything that is instantiation dependent return new RedFooPanel(id); } @Override protected Panel createBarPanel(String id) { // do not reference anything that is instantiation dependent return new RedBarPanel(id); } On Tue, Apr 29, 2008 at 6:51 AM, Martin Makundi [EMAIL PROTECTED] wrote: Bother to give an example of what you mean? 2008/4/29 Johan Compagner [EMAIL PROTECTED]: no Scott just told you that you should create such initializers completely static. They should be 'static' without touching state of the current object/class itself. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What is the best way to create layouts in Wicket?
Where of course RedPage extends BasePage... On Tue, Apr 29, 2008 at 9:15 AM, Scott Swank [EMAIL PROTECTED] wrote: The method just has to be stateless, particularly from the perspective of instantiation. public BasePage(...) { add(createFooPanel(fooId)); add(createBarPanel(barId)); } protected abstract Panel createFooPanel(String id); protected abstract Panel createFooPanel(String id); - public RedPage(...) { super(...); } @Override protected Panel createFooPanel(String id) { // do not reference anything that is instantiation dependent return new RedFooPanel(id); } @Override protected Panel createBarPanel(String id) { // do not reference anything that is instantiation dependent return new RedBarPanel(id); } On Tue, Apr 29, 2008 at 6:51 AM, Martin Makundi [EMAIL PROTECTED] wrote: Bother to give an example of what you mean? 2008/4/29 Johan Compagner [EMAIL PROTECTED]: no Scott just told you that you should create such initializers completely static. They should be 'static' without touching state of the current object/class itself. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AjaxFormValidatingBehavior on a form with a fileuploadfield crashes
This is not something we can decide. It is a limitation of Ajax, HTML, Browsers. Martijn On 4/29/08, nanotech [EMAIL PROTECTED] wrote: Hi, Will there be support in future for Ajax + multipart forms? Thanks, RG igor.vaynberg wrote: it is a known limitation...you cannot mix ajax and multipart forms.. -igor On Tue, Feb 26, 2008 at 3:40 PM, Dan Kaplan [EMAIL PROTECTED] wrote: Hello, If I use: AjaxFormValidatingBehavior.addToAllFormComponents(form, onblur); On a form that has a fileuploadfield, it throws an exception when I blur another field. Is there a work around/solution to this (for now, I'd be happy to only validate the one field I want)? Here is the stack trace: java.lang.IllegalStateException: ServletRequest does not contain multipart content at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(Mu ltipartServletWebRequest.java:90) at org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest$M ultipartRequest.init(UploadWebRequest.java:97) at org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest.n ewMultipartWebRequest(UploadWebRequest.java:74) at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1414) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:740) at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBeh avior.java:127) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:161) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefault AjaxBehavior.java:288) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.pr ocessEvents(BehaviorRequestTarget.java:100) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Abstra ctRequestCycleProcessor.java:90) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:116 6) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/AjaxFormValidatingBehavior-on-a-form-with-a-fileuploadfield-crashes-tp15702794p16963149.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
color code options in drop down choice
hi I want to have a dropdown choice in which some of the choices are of different color based on the model. is there any existing implementation which i can use. OR how should i go about it please suggset. full toos ==
Re: loadStringResource(Component component, String key) - correct method to check if the component IS a Page?
Page page=component.getPage() ? -igor On Tue, Apr 29, 2008 at 3:53 AM, Michael Sparer [EMAIL PROTECTED] wrote: well one (as said ugly ;-)) way that comes to my mind is to ask if component.getParent().getParent() instanceof Page (that should also work if you use nested subpages). regards, Michael you could check if it's a transparentwebmarkupcontainer with instanceof. Ned Collyer wrote: I basically want the components Model. It's legitimate for it to be null. So, if I can see which component is a page, then i can easily call the getPage().getModel() Of course if it's TransparentWebMarkupContainer then getModel returns null even if the page has a model set. It appears to work with panels, just not page. Are there other conditions that will cause the component to come through as TransparentWebMarkupContainer? How can I determine it's a page :). Ugly hacks are not something i enjoy/advocate using. On Tue, Apr 29, 2008 at 6:56 PM, Michael Sparer [EMAIL PROTECTED] wrote: yepp, then the TransparentWebMarkupContainer gets passed in. And you're right, it's gonna be a filthy hack if you try to find out if its a Page. Unfortunately I've got no further suggestions but it'd be interesting to know why you want to distinguish between pages and other components anyway ... regards, Michael - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/loadStringResource%28Component-component%2C-String-key%29---correct-method-to-check-if-the-component-IS-a-Page--tp16930303p16957722.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: color code options in drop down choice
see Select/SelectOption/SelectOptions in wicket-extensions -igor On Tue, Apr 29, 2008 at 9:43 AM, Full-toos Geek [EMAIL PROTECTED] wrote: hi I want to have a dropdown choice in which some of the choices are of different color based on the model. is there any existing implementation which i can use. OR how should i go about it please suggset. full toos == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session.isNew - Check if a (permanent) session was created in the given request
Doesnt really give what i need (looking at the src), i want to know if a permanent session was created in a particular request, this would just tell me if the session reference is still temperary... public final boolean isTemporary() { return getId() == null; } Mr Mean wrote: Session.isTemporary(); Maurice On Tue, Apr 29, 2008 at 6:14 AM, mfs [EMAIL PROTECTED] wrote: Hello Everyone, Is there a way to check if a (permanent) session was created in the given request, in other words want to know if a JSESSIONID cookie is being set in the resulting response. I need to set another cookie alongside JSESSION id in the same request. Any pointers..? -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16952899.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16965541.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Change to API between Wicket 1.2 releases?
I dont know what this is, but 1.2 is pretty much end of life, so you should try to debug what it is and patch your version Or just use a 1.2 version that works for you On 4/29/08, Frank Silbermann [EMAIL PROTECTED] wrote: I'm not sure what you mean by what part it really is? Are you asking me to find a simpler example exhibiting the problem? I mean, the panel class follows the RadioGroup component example quite closely: http://wicketstuff.org/wicket13/compref/;jsessionid=C6F7701B642660179563 84008732211C?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.compr ef.RadioGroupPage The only significant difference is that instead of using a submit button I override wantOnSelectionChangedNotification() to return true. public class MyPanel extends Panel { public MyPanel( String id, String caption, PropertyModel groupModel, ChoiceOption[] options ) { super(id, groupModel); add( new Label(caption, caption) ); final RadioGroup group = new RadioGroup(group, groupModel) { //THIS IS THE ONLY PART THAT CHANGED FROM THE COMPONENT EXAMPLE protected boolean wantOnSelectionChangedNotifications() { return true; } //IT POSTS BACK ON ANY SELECTION }; add(group); ListChoiceOption optionList = Arrays.asList( options ); ListView radios = new ListView(radios, optionList) { protected void populateItem(ListItem listItem) { listItem.add( new Radio(radio, new PropertyModel( listItem.getModel(), value) ) ); listItem.add( new Label(option, new PropertyModel( listItem.getModel(), label ) ) ); } }; group.add(radios); } Did I do something wrong, or is that feature of RadioGroup indeed broken in current releases of Wicket 1.2? I really don't know enough about the Wicket internals to debug Wicket. Can you suggest anything simpler that I could try to narrow down the location of the problem? Would it work in Wicket 1.3? -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 29, 2008 3:54 AM To: users@wicket.apache.org Subject: Re: Change to API between Wicket 1.2 releases? 1.2 is a long time ago I have no idea what change did break yours (and what did it fix) If you could figure out what part it really is? johan On Tue, Apr 29, 2008 at 12:09 AM, Frank Silbermann [EMAIL PROTECTED] wrote: I completed a Wicket 1.2 project a couple of years ago, and I've been maintaining it since then. I've been using Version 1.2.2 successfully, and figured I might as well use the lastest release of that version (1.2.7). Well, I'm trying to figure out why Wicket 1.2.7 broke my code. (I scrounged up a Wicket 1.2.6 release, and that also breaks it.) Am I using the Wicket 1.2 API incorrectly? When it works in Wicket 1.2.2, am I using it in an unintended way? Let me illustrate what I've been doing with a small example. This is a simplified version of a component for creating and displaying radio button groups without having to write HTML every time. I give the constructor: (1) a wicket-id, (2) a PropertyModel that initializes the component and keeps track of the current choice, and (3) an array of ChoiceOption. -- The array of choice options defines the set of values offered by the radio buttons, and the corresponding labels to be displayed. The component posts back immediately when a change is made to the radio button. (Think fast INTRAnet with a very small number of simulaneous users.) Here is my implementation: package common.play; import wicket.markup.html.basic.Label; import wicket.model.IModel; import wicket.markup.html.panel.Panel; import wicket.markup.html.form.Radio; import wicket.markup.html.form.RadioGroup; import wicket.markup.html.list.ListItem; import wicket.markup.html.list.ListView; import wicket.model.PropertyModel; import java.util.List; import java.util.Arrays; import common.play.ChoiceOption; public class MyPanel extends Panel { public MyPanel( String id, String caption, PropertyModel groupModel, ChoiceOption[] options) { super(id, groupModel); add( new Label(caption, caption) ); final RadioGroup group = new RadioGroup(group, groupModel) { protected boolean wantOnSelectionChangedNotifications() { return true; } }; add(group); ListChoiceOption optionList =
PageParameter mysetry - need help
Hi, After spending quiet a few hours on PageParameter mystery I think its time to get experts help. I have a few Bookmarkable pages with MixedParamStrategy set - this means I have few fixed parameters and few optional params. What is happening is, somewhere in my code (digging as we speak) one of the optional parameters is getting a default value of false in the URL. Here is the discrete URL thats failing http://localhost:8080/mfg/Polycom/POLYCOM/133/?isAnd=false where mfg is the mount path, Polycom is mfg name, POLYCOM is mfg id and 133 is category id - all of these are obviously Fixed parameters for MixedParamStrategy and isAnd which is an optional param getting set to default false and is part of the URL. What seems to be happening is, somehow the parametermap is storing isAnd is an array of strings instead of just string and hence MixedParameterUrlCodingStrategy.appendParameter (line 153of wicket 1.3.X) fails with the ClassCastException and yet the length of the array is only 1 so there is no reason to convert an existing String param to String array - but somehow that is what is happening. I put some debugging statements in the ValueMap.java to see who is setting it as String array - and here is the stack trace I get (see below) This actually brings up multiple questions why cant mixedparamurlcodingstragy handle multiple values etc. but that is not important in my case - since I will always have 1 value for now. But just wondering what if I had multi select boxes etc. Will appreciate any pointers. java.lang.RuntimeException: = ValueMap.putall... putting isand with array at org.apache.wicket.util.value.ValueMap.putAll(ValueMap.java:494) at org.apache.wicket.request.target.coding.MixedParamUrlCodingStrategy.decodeParameters(MixedParamUrlCodingStrategy.java:189) at org.apache.wicket.request.target.coding.BookmarkablePageRequestTargetUrlCodingStrategy.decode(BookmarkablePageRequestTargetUrlCodingStrategy.java:76) at org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.targetForRequest(WebRequestCodingStrategy.java:475) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:175) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1227) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1347) at org.apache.wicket.RequestCycle.request(RequestCycle.java:496) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:375) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:199) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:542) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Thread.java:595) -- View this message in context: http://www.nabble.com/PageParameter-mysetry---need-help-tp16966154p16966154.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
getter called multiple times on PropertyModel with ListView
Hi, I have a page where I am using a PropertyModel to populate a ListView, so it will change when the underlying contents change: ListView newsDetails = new ListView(newsDetails, new PropertyModel(this, articles)) { protected void populateItem(ListItem item) { final NewsDetails nd = (NewsDetails) item.getModelObject(); item.add(new Label(articleDate, nd.getArticleDate())); item.add(new Label(articleTime, nd.getArticleTime())); item.add(new Label(newsShortDesc, nd.getNewsShortDesc())); newsUrlLink.add(new Label(newsTitle, nd.getNewsTitle())); item.add(newsUrlLink); } }; add(newsDetails); The page class, obviously, has a getter named getArticles(): public ListNewsDetails getArticles() { } However, this seems to get called multiple times when the listview is being populated, not just once at the beginning of each time the page is displayer. Why is this happening? It results in many more hits to the database than are necessary. Thanks, Andrew B ___ The information in this email or in any file attached hereto is intended only for the personal and confiden- tial use of the individual or entity to which it is addressed and may contain information that is propri- etary and confidential. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communica- tion is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product. Email trans- mission cannot be guaranteed to be secure or error- free. P6070214
Re: getter called multiple times on PropertyModel with ListView
ListView newsDetails = new ListView(newsDetails, new LoadableDetachableModel(new PropertyModel(this, articles))) -igor On Tue, Apr 29, 2008 at 10:46 AM, Andrew Broderick [EMAIL PROTECTED] wrote: Hi, I have a page where I am using a PropertyModel to populate a ListView, so it will change when the underlying contents change: ListView newsDetails = new ListView(newsDetails, new PropertyModel(this, articles)) { protected void populateItem(ListItem item) { final NewsDetails nd = (NewsDetails) item.getModelObject(); item.add(new Label(articleDate, nd.getArticleDate())); item.add(new Label(articleTime, nd.getArticleTime())); item.add(new Label(newsShortDesc, nd.getNewsShortDesc())); newsUrlLink.add(new Label(newsTitle, nd.getNewsTitle())); item.add(newsUrlLink); } }; add(newsDetails); The page class, obviously, has a getter named getArticles(): public ListNewsDetails getArticles() { } However, this seems to get called multiple times when the listview is being populated, not just once at the beginning of each time the page is displayer. Why is this happening? It results in many more hits to the database than are necessary. Thanks, Andrew B ___ The information in this email or in any file attached hereto is intended only for the personal and confiden- tial use of the individual or entity to which it is addressed and may contain information that is propri- etary and confidential. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communica- tion is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product. Email trans- mission cannot be guaranteed to be secure or error- free. P6070214 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AjaxFormValidatingBehavior on a form with a fileuploadfield crashes
there are however workarounds for this problem, didn't try it myself but here's a howto using a hidden iframe which might work: http://www.dooriented.com/blog/2008/04/23/wicket-ajax-like-file-upload-on-a-modal-window/ Martijn Dashorst wrote: This is not something we can decide. It is a limitation of Ajax, HTML, Browsers. Martijn On 4/29/08, nanotech [EMAIL PROTECTED] wrote: Hi, Will there be support in future for Ajax + multipart forms? Thanks, RG igor.vaynberg wrote: it is a known limitation...you cannot mix ajax and multipart forms.. -igor On Tue, Feb 26, 2008 at 3:40 PM, Dan Kaplan [EMAIL PROTECTED] wrote: Hello, If I use: AjaxFormValidatingBehavior.addToAllFormComponents(form, onblur); On a form that has a fileuploadfield, it throws an exception when I blur another field. Is there a work around/solution to this (for now, I'd be happy to only validate the one field I want)? Here is the stack trace: java.lang.IllegalStateException: ServletRequest does not contain multipart content at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(Mu ltipartServletWebRequest.java:90) at org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest$M ultipartRequest.init(UploadWebRequest.java:97) at org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest.n ewMultipartWebRequest(UploadWebRequest.java:74) at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1414) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:740) at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBeh avior.java:127) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:161) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefault AjaxBehavior.java:288) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.pr ocessEvents(BehaviorRequestTarget.java:100) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Abstra ctRequestCycleProcessor.java:90) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:116 6) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/AjaxFormValidatingBehavior-on-a-form-with-a-fileuploadfield-crashes-tp15702794p16963149.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/AjaxFormValidatingBehavior-on-a-form-with-a-fileuploadfield-crashes-tp15702794p16966578.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Int based PropertyModel throws convertion error
Thanks for your input, Johan. Alright, I changed the model to an Integer and that fixed it. So it does seem that this may be a bug - I'm opening a Jira issue for this. Thanks, Michael -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Monday, April 28, 2008 11:48 PM To: users@wicket.apache.org Subject: Re: Int based PropertyModel throws convertion error Thats weird somehow it translates 0 to null. Dont know where or why it would do that. Can you make a jira issue for this? On 4/29/08, Michael Mehrle [EMAIL PROTECTED] wrote: I've got a radio group that's tied to a propertymodel which is set to '0' by default: RadioGroup monthlyRadioGroup = new RadioGroup(eventSchedule.intervalOfMonth); When saving my form I get this error: org.apache.wicket.util.convert.ConversionException: Can't convert null value to a primitive class: int for setting it on [EMAIL PROTECTED]null] at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(Pr opertyResolver.java:1079) I can see the value of intervalOfMonth being '0' in the setter/getter. When I set the value to anything else but '0' it doesn't throw this. I'm must be missing something here, but '0' should be allowed, correct? Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session.isNew - Check if a (permanent) session was created in the given request
If(!session.isTemp() cookieNotSet) setCookie() On 4/29/08, mfs [EMAIL PROTECTED] wrote: Doesnt really give what i need (looking at the src), i want to know if a permanent session was created in a particular request, this would just tell me if the session reference is still temperary... public final boolean isTemporary() { return getId() == null; } Mr Mean wrote: Session.isTemporary(); Maurice On Tue, Apr 29, 2008 at 6:14 AM, mfs [EMAIL PROTECTED] wrote: Hello Everyone, Is there a way to check if a (permanent) session was created in the given request, in other words want to know if a JSESSIONID cookie is being set in the resulting response. I need to set another cookie alongside JSESSION id in the same request. Any pointers..? -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16952899.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16965541.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to debug Back Button
Just test the pagemap accessstack what exactly happens. Place a few breakpoints there, if you press the backbutton, then ie does a call to the server an ff doesnt? But that shouldnt be to much of a problem. That page just should be there. On 4/29/08, Marco Aurélio Silva [EMAIL PROTECTED] wrote: I put a breakpoint on Wicket.Session on method public final Page getPage(final String pageMapName, final String path, final int versionNumber) It seems Firefox is nothing making a request when I navigate with back and forward button. On IE the call to this line: Page page = pageMap.get(Integer.parseInt(id), versionNumber); the page returns null, that's why I got the page expired :/ Any suggestion? On Tue, Apr 29, 2008 at 9:35 AM, Marco Aurélio Silva [EMAIL PROTECTED] wrote: Move to 1.3 now is not an option :( On Mon, Apr 28, 2008 at 5:55 PM, Johan Compagner [EMAIL PROTECTED] wrote: Dont know why it is different in ie compared to ff, but do upgrade to 1.3 because then page expired are pretty much none excistent. On 4/28/08, Marco Aurélio Silva [EMAIL PROTECTED] wrote: Hi All I'm using wicket 1.2.6 and I'm having problems with back button on IE. I can go back with back button of browser, but when I try to go forward, I get a Page Expired. The log is set to debug, but I can't find anything in log file to help me find out what is causing this. I don't know if there is a problem in my code because in Firefox I can navigate back and forward with browser buttons without any problem. My doubt is where should I look to found the problem? Thanks in advance! Marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: getter called multiple times on PropertyModel with ListView
Cannot instantiate LoadableDetachableModel directly .. it is abstract. Besides, how does it help solve the problem? Thanks -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 29, 2008 12:49 PM To: users@wicket.apache.org Subject: Re: getter called multiple times on PropertyModel with ListView ListView newsDetails = new ListView(newsDetails, new LoadableDetachableModel(new PropertyModel(this, articles))) -igor On Tue, Apr 29, 2008 at 10:46 AM, Andrew Broderick [EMAIL PROTECTED] wrote: Hi, I have a page where I am using a PropertyModel to populate a ListView, so it will change when the underlying contents change: ListView newsDetails = new ListView(newsDetails, new PropertyModel(this, articles)) { protected void populateItem(ListItem item) { final NewsDetails nd = (NewsDetails) item.getModelObject(); item.add(new Label(articleDate, nd.getArticleDate())); item.add(new Label(articleTime, nd.getArticleTime())); item.add(new Label(newsShortDesc, nd.getNewsShortDesc())); newsUrlLink.add(new Label(newsTitle, nd.getNewsTitle())); item.add(newsUrlLink); } }; add(newsDetails); The page class, obviously, has a getter named getArticles(): public ListNewsDetails getArticles() { } However, this seems to get called multiple times when the listview is being populated, not just once at the beginning of each time the page is displayer. Why is this happening? It results in many more hits to the database than are necessary. Thanks, Andrew B ___ The information in this email or in any file attached hereto is intended only for the personal and confiden- tial use of the individual or entity to which it is addressed and may contain information that is propri- etary and confidential. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communica- tion is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product. Email trans- mission cannot be guaranteed to be secure or error- free. P6070214 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing around a component ref. (specifically BreadCrumbBar)
Access them only in onBeforeRender or whwn you need them in an call back method (onsubmit/onclick) On 4/29/08, gumnaam23 [EMAIL PROTECTED] wrote: I have a specific question and a generic question based on it. I have several Panels added to my BreadCrumbPanels, these panels themselves extend the Panel class, and will contain BreadCrumbPanelLinks , to navigate down the hierarchy. My question is how do I pass the BreadCrumbBar from a BreadCrumbPanel to the panels that get added to it ? Of course I can create constructors for these sub panels to take in a IBreadCrumbModel . But this is not an elegant solution, as I have to pass the BreadCrumbBar to each possible constructor of the Panel. The BreadCrumbBar is created in my BasePage, from which all my pages inherit. So I tried doing something like ((BasePage)getPage()).getBreadCrumbBar(), in the sub panels, but it turns out, that a component does not get a Page associated , to it, at Construction time. So what is the best way for a Page, to pass around certain components it initializes, to child panels , without having to have a constructor for the Panel that takes in those components ? I already use spring along with Wicket, so I was thinking of making certain Components, in to Spring Beans with a Custom scope, say a Page scope. i.e. the component gets initialized during the Page's construction and can then be injected to subsequent Components created by the Page's construction. Any thoughts ? -- View this message in context: http://www.nabble.com/Passing-around-a-component-ref.-%28specifically-BreadCrumbBar%29-tp16957263p16957263.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FileResourceStream
So through a Wicket Page impl you serve static pages? The wicket page self doesnt have any components? Dont know the exact api but you have to make sure that the cache key = null then nothing will be cached On 4/29/08, Ed _ [EMAIL PROTECTED] wrote: I end up using FileResourceStream to serve up static web pages from a Wicket page. But I am having issues with the fact that the page gets cached and - returning clients with different url params - keep getting served the original static page. Is there a way for me to force a refresh and make sure the newMarkupResourceStream() gets called each time. thanks! _ Make i'm yours. Create a custom banner to support your cause. http://im.live.com/Messenger/IM/Contribute/Default.aspx?source=TXT_TAGHM_MSN_Make_IM_Yours - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Inmethod-grid] column resize event?
Would it be possible to get a column resize event added? I am attempting to use a Dojo Combobox as the editable cell content. The grid has a css style defined for edited cells that forces the combobox text element to 100% of the column width. That has a cool effect when editting, but has the side effect of forcing the dropdown's button outside the viewport for the column. I was hoping to hook onto the column resize event to execute a javascript function that would intelligently resize the combobox according to the size of the column. Using percentages for the combobox width works, but at small and large column sizes, you can see the imperfection in that method. Is there another (non css expression) strategy I could use to apply a formula to the width attribute of the input element? Chuck -- View this message in context: http://www.nabble.com/-Inmethod-grid--column-resize-event--tp16968211p16968211.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Alternative method to initialise page
First i dont want a boolen in the components that onFirstRender() is called. I want a boolean that it is not called. So in the constructor of component we set the flag and clear it when first rendered. Do remember that in onBeforeRende components/panels and all can be created again but i think this will go ok. Johan On 4/29/08, James Carman [EMAIL PROTECTED] wrote: On Tue, Apr 29, 2008 at 10:24 AM, John Patterson [EMAIL PROTECTED] wrote: This approach breaks a components encapsulation because the listener must be installed in the application. Even if IInitializers can be used to do this once it ads an extra complication to creating reusable components. Perhaps this could be added to core since it's a common enough pattern? That way, you wouldn't have to worry about the requirement of making sure that you add the listener in. It would be there automatically. Or, you can do this manually in your own Component class and not rely upon the listener to call it. You just do it in onBeforeRender() and slap that meta tag on the component after you perform the initialization. Or, we make a new callback method on Component called onBeforeFirstRender() or something. I don't know. I'm just trying to help come up with ideas here. In our application, the IBeforeFirstRenderListener approach is working because I'm not creating re-usable components to be consumed outside my application. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageParameter mysetry - need help
Make a jira issue with a sample quickstart On 4/29/08, Ritz123 [EMAIL PROTECTED] wrote: Hi, After spending quiet a few hours on PageParameter mystery I think its time to get experts help. I have a few Bookmarkable pages with MixedParamStrategy set - this means I have few fixed parameters and few optional params. What is happening is, somewhere in my code (digging as we speak) one of the optional parameters is getting a default value of false in the URL. Here is the discrete URL thats failing http://localhost:8080/mfg/Polycom/POLYCOM/133/?isAnd=false where mfg is the mount path, Polycom is mfg name, POLYCOM is mfg id and 133 is category id - all of these are obviously Fixed parameters for MixedParamStrategy and isAnd which is an optional param getting set to default false and is part of the URL. What seems to be happening is, somehow the parametermap is storing isAnd is an array of strings instead of just string and hence MixedParameterUrlCodingStrategy.appendParameter (line 153of wicket 1.3.X) fails with the ClassCastException and yet the length of the array is only 1 so there is no reason to convert an existing String param to String array - but somehow that is what is happening. I put some debugging statements in the ValueMap.java to see who is setting it as String array - and here is the stack trace I get (see below) This actually brings up multiple questions why cant mixedparamurlcodingstragy handle multiple values etc. but that is not important in my case - since I will always have 1 value for now. But just wondering what if I had multi select boxes etc. Will appreciate any pointers. java.lang.RuntimeException: = ValueMap.putall... putting isand with array at org.apache.wicket.util.value.ValueMap.putAll(ValueMap.java:494) at org.apache.wicket.request.target.coding.MixedParamUrlCodingStrategy.decodeParameters(MixedParamUrlCodingStrategy.java:189) at org.apache.wicket.request.target.coding.BookmarkablePageRequestTargetUrlCodingStrategy.decode(BookmarkablePageRequestTargetUrlCodingStrategy.java:76) at org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.targetForRequest(WebRequestCodingStrategy.java:475) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:175) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1227) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1347) at org.apache.wicket.RequestCycle.request(RequestCycle.java:496) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:375) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:199) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:542) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Thread.java:595) -- View this message in context: http://www.nabble.com/PageParameter-mysetry---need-help-tp16966154p16966154.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: getter called multiple times on PropertyModel with ListView
// It solves your problem because the call to load will be made each time your view renders final LoadableDetachableModel articlesLoadableModel = new LoadableDetachableModel() { private static final long serialVersionUID = 1L; /** * [EMAIL PROTECTED] */ @Override protected final Object load() { return new PropertyModel(YourPage.this, articles); } }; final ListView newsDetails = new ListView(newsDetails, articlesLoadableModel){ private static final long serialVersionUID = 1L; /** * [EMAIL PROTECTED] */ @Override protected final void populateItem(final ListItem item) { ... } }; add(newsDetails); -Original Message- From: Andrew Broderick [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 29, 2008 2:19 PM To: 'users@wicket.apache.org' Subject: RE: getter called multiple times on PropertyModel with ListView Cannot instantiate LoadableDetachableModel directly .. it is abstract. Besides, how does it help solve the problem? Thanks -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 29, 2008 12:49 PM To: users@wicket.apache.org Subject: Re: getter called multiple times on PropertyModel with ListView ListView newsDetails = new ListView(newsDetails, new LoadableDetachableModel(new PropertyModel(this, articles))) -igor On Tue, Apr 29, 2008 at 10:46 AM, Andrew Broderick [EMAIL PROTECTED] wrote: Hi, I have a page where I am using a PropertyModel to populate a ListView, so it will change when the underlying contents change: ListView newsDetails = new ListView(newsDetails, new PropertyModel(this, articles)) { protected void populateItem(ListItem item) { final NewsDetails nd = (NewsDetails) item.getModelObject(); item.add(new Label(articleDate, nd.getArticleDate())); item.add(new Label(articleTime, nd.getArticleTime())); item.add(new Label(newsShortDesc, nd.getNewsShortDesc())); newsUrlLink.add(new Label(newsTitle, nd.getNewsTitle())); item.add(newsUrlLink); } }; add(newsDetails); The page class, obviously, has a getter named getArticles(): public ListNewsDetails getArticles() { } However, this seems to get called multiple times when the listview is being populated, not just once at the beginning of each time the page is displayer. Why is this happening? It results in many more hits to the database than are necessary. Thanks, Andrew B ___ The information in this email or in any file attached hereto is intended only for the personal and confiden- tial use of the individual or entity to which it is addressed and may contain information that is propri- etary and confidential. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communica- tion is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product. Email trans- mission cannot be guaranteed to be secure or error- free. P6070214 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with german error messages in feedback panel
You can also use xml for your properties On 4/28/08, Vit Rozkovec [EMAIL PROTECTED] wrote: Hi, try to convert the property file with native2ascii tool. greeklinux wrote: Hello, I am using IDEA as IDE. I configured it to use UTF-8. Did I forget something? In the property file it is not possible to write uuml instead of ü, because the will be escaped to amp. Timm Helbig wrote: Yes I had the same one. After switching my favourite IDE (Netbeans) to UTF-8 Encoding everything was fine. So, either you use Unicode Characters in your String literals, which is plain ugly, or use an editor which is capable of using UTF-8 Encodings. Am Sonntag, 27. April 2008 11:35:16 schrieb greeklinux: Hello, I have problems with german umlauts in a feedback panel. I define the error messages in a property file. It displays as follows: Bitte geben Sie eine gültige E-Mail ein In my HTML: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; ?xml version=1.0 encoding=UTF-8? meta http-equiv=Content-type content=text/html; charset=utf-8 / ... My editor is configured to use UTF-8 as encoding. I tried to initialize the Wicket Application with getRequestCycleSettings().setResponseRequestEncoding(UTF-8); but the error is still there. Has someone the same problem? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Inmethod-grid] column resize event?
see com.inmethod.grid.common.AbstractGrid.onColumnStateChanged() On Tue, 2008-04-29 at 12:24 -0700, ChuckDeal wrote: Would it be possible to get a column resize event added? I am attempting to use a Dojo Combobox as the editable cell content. The grid has a css style defined for edited cells that forces the combobox text element to 100% of the column width. That has a cool effect when editting, but has the side effect of forcing the dropdown's button outside the viewport for the column. I was hoping to hook onto the column resize event to execute a javascript function that would intelligently resize the combobox according to the size of the column. Using percentages for the combobox width works, but at small and large column sizes, you can see the imperfection in that method. Is there another (non css expression) strategy I could use to apply a formula to the width attribute of the input element? Chuck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Remember last page before page expired
See pagemap.redirectToResponsePage() and continueToXxxx method On 4/29/08, Eyal Golan [EMAIL PROTECTED] wrote: I have a Login page that is redirected if the session is expired (for example, if I shut of the server and put it on again). In the Login page, I redirect to my base page: PortalWebPage page = new PortalWebPage(pageParameters); setResponsePage(page); this happens in the submit. my question: I want to keep the last visited page (and the parameters it has) so I won't redirect to PortalWebPage but to this last page. Is it possible? -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unique identifying name in gridview
Use shared resources with an image param and then an Image with a resource reference. On 4/29/08, Martijn Lindhout [EMAIL PROTECTED] wrote: Hi all, I have a gridview, which in populateItem is filled with: new PhotoTile(tileContent, (PhotoCardModel) item.getModel()); In PhotoTile's constructor, I do: AjaxLink clickLink = clickLink.add(new Image(thumbnail, rs)); where 'rs' is a WebResource of which the getResourceStream returns a FileResourceStream pointing to the image location on disk. The HTML img tag of the first image on the first row is rendered as follows: img src=?wicket:interface=:0:rows:0:cols:0:tileContent:clickLink:thumbnail::IResourceListener border=0/ When I upload a new photo with my application, a new thumbnail appears on the grid, shifting the existing ones one position lower (I'm sorting descending). But because the image tag of the first thumbnail remains the same (rows:0:cols:0), I see the cached image of the thumbnail that was at that position just before. When I clear my browser cache, I see the right image. I fixed this a bit hacky by using NonCachingImage which add some random stuff to the img url, but that's not what I want, because these images could be cached without problems. I want the image url to be something like: img src=whatever prefix goes here/images/img name / How do I achieve this? -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Spring 2.5 and Wicket, our vision about integration (a few explanations)
anywho. why even talk about this? there is absolutely nothing stopping you from doing this is there? -igor On Tue, Apr 29, 2008 at 12:44 AM, Sergio García [EMAIL PROTECTED] wrote: Well, I appreciate all the comments, but i want to explain things about how we work here. In our vision about how a wicket + spring + hibernate should be, in 99% of cases only services are injected into controller layer. There are no reason to make reusable components that calls a service, because that's the model layer, and it's very unusual that you can reuse the model. There are no reason to make reusable jars that have dependencies with the model layer. Also, the services in our common applications would be, at the most, twenty services. Twenty services in a real very big application. Our common application has about ten services. I respect all your visions about how a right architecture must be, but our vision is different. -- View this message in context: http://www.nabble.com/Spring-2.5-and-Wicket%2C-our-vision-about-integration-tp16930960p16953853.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session.isNew - Check if a (permanent) session was created in the given request
and how i would check if the cookie is not set ? Johan Compagner wrote: If(!session.isTemp() cookieNotSet) setCookie() On 4/29/08, mfs [EMAIL PROTECTED] wrote: Doesnt really give what i need (looking at the src), i want to know if a permanent session was created in a particular request, this would just tell me if the session reference is still temperary... public final boolean isTemporary() { return getId() == null; } Mr Mean wrote: Session.isTemporary(); Maurice On Tue, Apr 29, 2008 at 6:14 AM, mfs [EMAIL PROTECTED] wrote: Hello Everyone, Is there a way to check if a (permanent) session was created in the given request, in other words want to know if a JSESSIONID cookie is being set in the resulting response. I need to set another cookie alongside JSESSION id in the same request. Any pointers..? -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16952899.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16965541.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16969659.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session.isNew - Check if a (permanent) session was created in the given request
Get the cookie from the request??? On 4/29/08, mfs [EMAIL PROTECTED] wrote: and how i would check if the cookie is not set ? Johan Compagner wrote: If(!session.isTemp() cookieNotSet) setCookie() On 4/29/08, mfs [EMAIL PROTECTED] wrote: Doesnt really give what i need (looking at the src), i want to know if a permanent session was created in a particular request, this would just tell me if the session reference is still temperary... public final boolean isTemporary() { return getId() == null; } Mr Mean wrote: Session.isTemporary(); Maurice On Tue, Apr 29, 2008 at 6:14 AM, mfs [EMAIL PROTECTED] wrote: Hello Everyone, Is there a way to check if a (permanent) session was created in the given request, in other words want to know if a JSESSIONID cookie is being set in the resulting response. I need to set another cookie alongside JSESSION id in the same request. Any pointers..? -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16952899.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16965541.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16969659.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageParameter mystery - need help
Just make an issue for the case you have below, that generates the stacktrace. And in your comments you can also say, that this or that could als be a problem for this url strategy On 4/29/08, Ritz123 [EMAIL PROTECTED] wrote: John, Thanks for the reply. As I mentioned, there seems to be multiple issues - what do I make an issue on? Also, will appreciate if you can share some thoughts on going about fixing it. Johan Compagner wrote: Make a jira issue with a sample quickstart On 4/29/08, Ritz123 [EMAIL PROTECTED] wrote: Hi, After spending quiet a few hours on PageParameter mystery I think its time to get experts help. I have a few Bookmarkable pages with MixedParamStrategy set - this means I have few fixed parameters and few optional params. What is happening is, somewhere in my code (digging as we speak) one of the optional parameters is getting a default value of false in the URL. Here is the discrete URL thats failing http://localhost:8080/mfg/Polycom/POLYCOM/133/?isAnd=false where mfg is the mount path, Polycom is mfg name, POLYCOM is mfg id and 133 is category id - all of these are obviously Fixed parameters for MixedParamStrategy and isAnd which is an optional param getting set to default false and is part of the URL. What seems to be happening is, somehow the parametermap is storing isAnd is an array of strings instead of just string and hence MixedParameterUrlCodingStrategy.appendParameter (line 153of wicket 1.3.X) fails with the ClassCastException and yet the length of the array is only 1 so there is no reason to convert an existing String param to String array - but somehow that is what is happening. I put some debugging statements in the ValueMap.java to see who is setting it as String array - and here is the stack trace I get (see below) This actually brings up multiple questions why cant mixedparamurlcodingstragy handle multiple values etc. but that is not important in my case - since I will always have 1 value for now. But just wondering what if I had multi select boxes etc. Will appreciate any pointers. java.lang.RuntimeException: = ValueMap.putall... putting isand with array at org.apache.wicket.util.value.ValueMap.putAll(ValueMap.java:494) at org.apache.wicket.request.target.coding.MixedParamUrlCodingStrategy.decodeParameters(MixedParamUrlCodingStrategy.java:189) at org.apache.wicket.request.target.coding.BookmarkablePageRequestTargetUrlCodingStrategy.decode(BookmarkablePageRequestTargetUrlCodingStrategy.java:76) at org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.targetForRequest(WebRequestCodingStrategy.java:475) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:175) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1227) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1347) at org.apache.wicket.RequestCycle.request(RequestCycle.java:496) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:375) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:199) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:542) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Thread.java:595) -- View this message in context: http://www.nabble.com/PageParameter-mysetry---need-help-tp16966154p16966154.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED]
Re: Session.isNew - Check if a (permanent) session was created in the given request
It wouldnt be there,remember i want to set the cookie in the same response as the JSESSIONID cookie.. Johan Compagner wrote: Get the cookie from the request??? On 4/29/08, mfs [EMAIL PROTECTED] wrote: and how i would check if the cookie is not set ? Johan Compagner wrote: If(!session.isTemp() cookieNotSet) setCookie() On 4/29/08, mfs [EMAIL PROTECTED] wrote: Doesnt really give what i need (looking at the src), i want to know if a permanent session was created in a particular request, this would just tell me if the session reference is still temperary... public final boolean isTemporary() { return getId() == null; } Mr Mean wrote: Session.isTemporary(); Maurice On Tue, Apr 29, 2008 at 6:14 AM, mfs [EMAIL PROTECTED] wrote: Hello Everyone, Is there a way to check if a (permanent) session was created in the given request, in other words want to know if a JSESSIONID cookie is being set in the resulting response. I need to set another cookie alongside JSESSION id in the same request. Any pointers..? -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16952899.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16965541.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16969659.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16969778.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session.isNew - Check if a (permanent) session was created in the given request
Look for once what i test!! You want this the first time a session is created set a cookie. So TEST the isTemp() method of the session. (in RequestCycle.onEndRequest()) then if that returns false then you know the session is created when you dont know yet, it could be this request but also a previos request because of that you then test if you find your cookie. If that isnt there you know it is the first time and set the cookie, the next time the cookie is set so nothing happens.. On 4/29/08, mfs [EMAIL PROTECTED] wrote: It wouldnt be there,remember i want to set the cookie in the same response as the JSESSIONID cookie.. Johan Compagner wrote: Get the cookie from the request??? On 4/29/08, mfs [EMAIL PROTECTED] wrote: and how i would check if the cookie is not set ? Johan Compagner wrote: If(!session.isTemp() cookieNotSet) setCookie() On 4/29/08, mfs [EMAIL PROTECTED] wrote: Doesnt really give what i need (looking at the src), i want to know if a permanent session was created in a particular request, this would just tell me if the session reference is still temperary... public final boolean isTemporary() { return getId() == null; } Mr Mean wrote: Session.isTemporary(); Maurice On Tue, Apr 29, 2008 at 6:14 AM, mfs [EMAIL PROTECTED] wrote: Hello Everyone, Is there a way to check if a (permanent) session was created in the given request, in other words want to know if a JSESSIONID cookie is being set in the resulting response. I need to set another cookie alongside JSESSION id in the same request. Any pointers..? -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16952899.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16965541.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16969659.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16969778.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Spring 2.5 and Wicket, our vision about integration (a few explanations)
I'd suggest that you prove out that your concept is better than the current solution by building out a competing solution and contributing it as an opensource project to let the community decide which solution is the best fit for them. i'm all for a little competing innovation! =) On Tue, Apr 29, 2008 at 12:44 AM, Sergio García [EMAIL PROTECTED] wrote: Well, I appreciate all the comments, but i want to explain things about how we work here. In our vision about how a wicket + spring + hibernate should be, in 99% of cases only services are injected into controller layer. There are no reason to make reusable components that calls a service, because that's the model layer, and it's very unusual that you can reuse the model. There are no reason to make reusable jars that have dependencies with the model layer. Also, the services in our common applications would be, at the most, twenty services. Twenty services in a real very big application. Our common application has about ten services. I respect all your visions about how a right architecture must be, but our vision is different. -- View this message in context: http://www.nabble.com/Spring-2.5-and-Wicket%2C-our-vision-about-integration-tp16930960p16953853.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session.isNew - Check if a (permanent) session was created in the given request
Sure it makes sense, but there is a reason that i want to set the cookie in exactly the same request/response cycle, the cookie i am setting would be used by this external mod_plsql application (i am integrating my wicket app with) to check if an http/wicket session exists, the external app bases some functionality on it (e.g. logout and giving a keep-alive signal to the wicket app) only if the cookie is there, now IF i dont set the cookie in the same response, the user might not send the next request to the wicket app, and instead trigger a use-case part of the external app, and its for this scenario where i want the cookie to be attached in the same response. Johan Compagner wrote: Look for once what i test!! You want this the first time a session is created set a cookie. So TEST the isTemp() method of the session. (in RequestCycle.onEndRequest()) then if that returns false then you know the session is created when you dont know yet, it could be this request but also a previos request because of that you then test if you find your cookie. If that isnt there you know it is the first time and set the cookie, the next time the cookie is set so nothing happens.. On 4/29/08, mfs [EMAIL PROTECTED] wrote: It wouldnt be there,remember i want to set the cookie in the same response as the JSESSIONID cookie.. Johan Compagner wrote: Get the cookie from the request??? On 4/29/08, mfs [EMAIL PROTECTED] wrote: and how i would check if the cookie is not set ? Johan Compagner wrote: If(!session.isTemp() cookieNotSet) setCookie() On 4/29/08, mfs [EMAIL PROTECTED] wrote: Doesnt really give what i need (looking at the src), i want to know if a permanent session was created in a particular request, this would just tell me if the session reference is still temperary... public final boolean isTemporary() { return getId() == null; } Mr Mean wrote: Session.isTemporary(); Maurice On Tue, Apr 29, 2008 at 6:14 AM, mfs [EMAIL PROTECTED] wrote: Hello Everyone, Is there a way to check if a (permanent) session was created in the given request, in other words want to know if a JSESSIONID cookie is being set in the resulting response. I need to set another cookie alongside JSESSION id in the same request. Any pointers..? -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16952899.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16965541.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16969659.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16969778.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context:
LoadableDetachableModel.detach() - should it be final?
Just an observation - should the detach() method in LoadableDetachableModel be final? It adds the onDetach() hook for subclasses to implement. Would there be a case where you want to override detach() and NOT let the LDM do it's detach (by not calling super / on purpose or accident)? Jeremy Thomerson
Re: Session.isNew - Check if a (permanent) session was created in the given request
Initially i had kind of a hack where i was checking the response headers using HttpResponse.containsHeader(Set-Cookie) in RequestCycle.onEndRequest() and set my cookie if it returns true, this worked perfectly fine in jetty but in oc4j for some odd reasons i dont have these response headers available onEndRequest(), i am not sure what the reason could be, may be oc4j hasn't set them till the control doesnt leave onEndRequest OR may be it does it right before the data is flushed, dont know...just guessing So anyways now i have to look for an alternative approach.. mfs wrote: Sure it makes sense, but there is a reason that i want to set the cookie in exactly the same request/response cycle, the cookie i am setting would be used by this external mod_plsql application (i am integrating my wicket app with) to check if an http/wicket session exists, the external app bases some functionality on it (e.g. logout and giving a keep-alive signal to the wicket app) only if the cookie is there, now IF i dont set the cookie in the same response, the user might not send the next request to the wicket app, and instead trigger a use-case part of the external app, and its for this scenario where i want the cookie to be attached in the same response. Johan Compagner wrote: Look for once what i test!! You want this the first time a session is created set a cookie. So TEST the isTemp() method of the session. (in RequestCycle.onEndRequest()) then if that returns false then you know the session is created when you dont know yet, it could be this request but also a previos request because of that you then test if you find your cookie. If that isnt there you know it is the first time and set the cookie, the next time the cookie is set so nothing happens.. On 4/29/08, mfs [EMAIL PROTECTED] wrote: It wouldnt be there,remember i want to set the cookie in the same response as the JSESSIONID cookie.. Johan Compagner wrote: Get the cookie from the request??? On 4/29/08, mfs [EMAIL PROTECTED] wrote: and how i would check if the cookie is not set ? Johan Compagner wrote: If(!session.isTemp() cookieNotSet) setCookie() On 4/29/08, mfs [EMAIL PROTECTED] wrote: Doesnt really give what i need (looking at the src), i want to know if a permanent session was created in a particular request, this would just tell me if the session reference is still temperary... public final boolean isTemporary() { return getId() == null; } Mr Mean wrote: Session.isTemporary(); Maurice On Tue, Apr 29, 2008 at 6:14 AM, mfs [EMAIL PROTECTED] wrote: Hello Everyone, Is there a way to check if a (permanent) session was created in the given request, in other words want to know if a JSESSIONID cookie is being set in the resulting response. I need to set another cookie alongside JSESSION id in the same request. Any pointers..? -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16952899.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16965541.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16969659.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context:
Re: Alternative method to initialise page
On Tue, Apr 29, 2008 at 3:59 PM, Johan Compagner [EMAIL PROTECTED] wrote: First i dont want a boolen in the components that onFirstRender() is called. I want a boolean that it is not called. So in the constructor of component we set the flag and clear it when first rendered. Are we thinking of adding this into core? You're talking about modifying the constructor of Component. Do remember that in onBeforeRende components/panels and all can be created again but i think this will go ok. Yes, each one of these components will each have to be rendered also, so they'd go through the same logic upon their first render, correct? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageParameter mystery - need help
I am in a very time crunched schedule and this is a show stopper for me - cant even render the page - hope you understand if I ask is there any timeline on the fix that I can expect? Again reiterating if anyone can give any pointers on fixing this(not sure if its a bug or if I am doing something wrong). I am digging into the wicket internals trying to figure out - seems like it happens both during encoding and decoding which leads me to think that there is something special about only one optional parameter (isAnd as mentioned above). Johan Compagner wrote: Just make an issue for the case you have below, that generates the stacktrace. And in your comments you can also say, that this or that could als be a problem for this url strategy On 4/29/08, Ritz123 [EMAIL PROTECTED] wrote: John, Thanks for the reply. As I mentioned, there seems to be multiple issues - what do I make an issue on? Also, will appreciate if you can share some thoughts on going about fixing it. Johan Compagner wrote: Make a jira issue with a sample quickstart On 4/29/08, Ritz123 [EMAIL PROTECTED] wrote: Hi, After spending quiet a few hours on PageParameter mystery I think its time to get experts help. I have a few Bookmarkable pages with MixedParamStrategy set - this means I have few fixed parameters and few optional params. What is happening is, somewhere in my code (digging as we speak) one of the optional parameters is getting a default value of false in the URL. Here is the discrete URL thats failing http://localhost:8080/mfg/Polycom/POLYCOM/133/?isAnd=false where mfg is the mount path, Polycom is mfg name, POLYCOM is mfg id and 133 is category id - all of these are obviously Fixed parameters for MixedParamStrategy and isAnd which is an optional param getting set to default false and is part of the URL. What seems to be happening is, somehow the parametermap is storing isAnd is an array of strings instead of just string and hence MixedParameterUrlCodingStrategy.appendParameter (line 153of wicket 1.3.X) fails with the ClassCastException and yet the length of the array is only 1 so there is no reason to convert an existing String param to String array - but somehow that is what is happening. I put some debugging statements in the ValueMap.java to see who is setting it as String array - and here is the stack trace I get (see below) This actually brings up multiple questions why cant mixedparamurlcodingstragy handle multiple values etc. but that is not important in my case - since I will always have 1 value for now. But just wondering what if I had multi select boxes etc. Will appreciate any pointers. java.lang.RuntimeException: = ValueMap.putall... putting isand with array at org.apache.wicket.util.value.ValueMap.putAll(ValueMap.java:494) at org.apache.wicket.request.target.coding.MixedParamUrlCodingStrategy.decodeParameters(MixedParamUrlCodingStrategy.java:189) at org.apache.wicket.request.target.coding.BookmarkablePageRequestTargetUrlCodingStrategy.decode(BookmarkablePageRequestTargetUrlCodingStrategy.java:76) at org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.targetForRequest(WebRequestCodingStrategy.java:475) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:175) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1227) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1347) at org.apache.wicket.RequestCycle.request(RequestCycle.java:496) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:375) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:199) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:542) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at
Is it possible to hide /?wicket:.. from the URLs
Hi, Was wondering if its possible to hide wicket name from the URLs (stateless and stateful). One might not want to show their end users that wicket is being used behind the scenes. Also I noticed even if page has bookmarkable links - the links show relative ../../../../mount/params!! Is there anyway to have complete(absolute urls) with the hostname? -- View this message in context: http://www.nabble.com/Is-it-possible-to-hide---wicket%3A..-from-the-URLs-tp16972147p16972147.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: loadStringResource(Component component, String key) - correct method to check if the component IS a Page?
sorry, but i dont really get what the problem is or why it matters what component stringresourceloader gets. it simply traverses up the hieararchy looking for .properties files -igor On Tue, Apr 29, 2008 at 4:55 PM, Ned Collyer [EMAIL PROTECTED] wrote: Do you know an elegant solution Igor? Detecting when the component IS a page - when something like wicket:message key=foobar/ is used in a page's markup, the component sent to the StringResourceLoader is MarkupInheritanceResolver$TransparentWebMarkupContainer and not Page. If the strings are resolved in java (ie, getString(foobar)) (according to michael) component instanceof Page == true if the strings are resolved in markup (ie, wicket:message key=foobar/) component instanceof Page == false Rgds Ned igor.vaynberg wrote: Page page=component.getPage() ? -igor -- View this message in context: http://www.nabble.com/loadStringResource%28Component-component%2C-String-key%29---correct-method-to-check-if-the-component-IS-a-Page--tp16930303p16973039.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session.isNew - Check if a (permanent) session was created in the given request
With the way i described it will happen in exactly the same response! On 4/29/08, mfs [EMAIL PROTECTED] wrote: Sure it makes sense, but there is a reason that i want to set the cookie in exactly the same request/response cycle, the cookie i am setting would be used by this external mod_plsql application (i am integrating my wicket app with) to check if an http/wicket session exists, the external app bases some functionality on it (e.g. logout and giving a keep-alive signal to the wicket app) only if the cookie is there, now IF i dont set the cookie in the same response, the user might not send the next request to the wicket app, and instead trigger a use-case part of the external app, and its for this scenario where i want the cookie to be attached in the same response. Johan Compagner wrote: Look for once what i test!! You want this the first time a session is created set a cookie. So TEST the isTemp() method of the session. (in RequestCycle.onEndRequest()) then if that returns false then you know the session is created when you dont know yet, it could be this request but also a previos request because of that you then test if you find your cookie. If that isnt there you know it is the first time and set the cookie, the next time the cookie is set so nothing happens.. On 4/29/08, mfs [EMAIL PROTECTED] wrote: It wouldnt be there,remember i want to set the cookie in the same response as the JSESSIONID cookie.. Johan Compagner wrote: Get the cookie from the request??? On 4/29/08, mfs [EMAIL PROTECTED] wrote: and how i would check if the cookie is not set ? Johan Compagner wrote: If(!session.isTemp() cookieNotSet) setCookie() On 4/29/08, mfs [EMAIL PROTECTED] wrote: Doesnt really give what i need (looking at the src), i want to know if a permanent session was created in a particular request, this would just tell me if the session reference is still temperary... public final boolean isTemporary() { return getId() == null; } Mr Mean wrote: Session.isTemporary(); Maurice On Tue, Apr 29, 2008 at 6:14 AM, mfs [EMAIL PROTECTED] wrote: Hello Everyone, Is there a way to check if a (permanent) session was created in the given request, in other words want to know if a JSESSIONID cookie is being set in the resulting response. I need to set another cookie alongside JSESSION id in the same request. Any pointers..? -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16952899.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16965541.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16969659.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Session.isNew---Check-if-a-%28permanent%29-session-was-created-in-the-given-request-tp16952899p16969778.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Re: Is it possible to hide /?wicket:.. from the URLs
Currently it is not easy to get wicket out of all the urls. This prefix is a static final that is used on many places, i want to make that configurable in a next release. By default wicket will generate relative paths. You can get a absolute one with i believe RequestUtils. But this is still without host/port i think, why do you want that? For generating emails or something like that? On 4/30/08, Ritz123 [EMAIL PROTECTED] wrote: Hi, Was wondering if its possible to hide wicket name from the URLs (stateless and stateful). One might not want to show their end users that wicket is being used behind the scenes. Also I noticed even if page has bookmarkable links - the links show relative ../../../../mount/params!! Is there anyway to have complete(absolute urls) with the hostname? -- View this message in context: http://www.nabble.com/Is-it-possible-to-hide---wicket%3A..-from-the-URLs-tp16972147p16972147.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LogoutPage - Responsible for invalidation and redirection to non-wicket page
Guys, I have a LogoutPage which does the following in its constructor LogoutPage() { getSession().invalidate(); // redirecting to the external app logout page RequestCycle.get().setRequestTarget( new RedirectRequestTarget(Host.getHttpsUrl() + xyz.getLogoutURL())); getRequestCycle().setRedirect(true); } Now, for some reasons the redirect to the specified external app page doesnt happen, infact i am taken to the session-expired page (which is because the request comes to wicket app, instead of redirection to this external app) . Let me add that i am using wiket-auth-roles for authorization... Also the reason i am doing this inside the Page itself (and not in the onClick or some other event as suggested in another other thread) is because i need to expose this LogoutPage to an external app as well, which will redirect to this page after invalidating the sessionThis part of Interoperability/SingleSignon Support. Thanks in advance. -- View this message in context: http://www.nabble.com/LogoutPage---Responsible-for-invalidation-and-redirection-to-non-wicket-page-tp16974119p16974119.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Alternative method to initialise page
I am just saying if we make such a thing, that i dont want state after the fact in a components. But i guess we can then better use a bit i think we have a few left. On 4/30/08, James Carman [EMAIL PROTECTED] wrote: On Tue, Apr 29, 2008 at 3:59 PM, Johan Compagner [EMAIL PROTECTED] wrote: First i dont want a boolen in the components that onFirstRender() is called. I want a boolean that it is not called. So in the constructor of component we set the flag and clear it when first rendered. Are we thinking of adding this into core? You're talking about modifying the constructor of Component. Do remember that in onBeforeRende components/panels and all can be created again but i think this will go ok. Yes, each one of these components will each have to be rendered also, so they'd go through the same logic upon their first render, correct? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LogoutPage - Responsible for invalidation and redirection to non-wicket page
I think this usecase should be supported but isnt the best way, you should throw an AbortException when you want to redirect in the constructor. Dont know from top of my head if we have one just for an url but that is easily made On 4/30/08, mfs [EMAIL PROTECTED] wrote: Guys, I have a LogoutPage which does the following in its constructor LogoutPage() { getSession().invalidate(); // redirecting to the external app logout page RequestCycle.get().setRequestTarget( new RedirectRequestTarget(Host.getHttpsUrl() + xyz.getLogoutURL())); getRequestCycle().setRedirect(true); } Now, for some reasons the redirect to the specified external app page doesnt happen, infact i am taken to the session-expired page (which is because the request comes to wicket app, instead of redirection to this external app) . Let me add that i am using wiket-auth-roles for authorization... Also the reason i am doing this inside the Page itself (and not in the onClick or some other event as suggested in another other thread) is because i need to expose this LogoutPage to an external app as well, which will redirect to this page after invalidating the sessionThis part of Interoperability/SingleSignon Support. Thanks in advance. -- View this message in context: http://www.nabble.com/LogoutPage---Responsible-for-invalidation-and-redirection-to-non-wicket-page-tp16974119p16974119.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: loadStringResource(Component component, String key) - correct method to check if the component IS a Page?
I'm writing my own It does this @Override public String loadStringResource(Component component, String key) { if (component == null) { return null; } String result = null; Locale locale = component.getLocale(); String style = component.getStyle(); IModel model = component.getInnermostModel(); if (model != null) { Object object = model.getObject(); if (object != null) { result = loadStringResource(object.getClass(), key, locale, style); } } return result; } Basically if does the translation lookup based on whatever object is set to the model of the component. It works fantastically except when the keys are in wicket:message key=foodbar/ - because component becomes an instance of MarkupInheritanceResolver$TransparentWebMarkupContainer and getModel returns null. Are there other circumstances where the component can be MarkupInheritanceResolver$TransparentWebMarkupContainer and it not be a page? igor.vaynberg wrote: sorry, but i dont really get what the problem is or why it matters what component stringresourceloader gets. it simply traverses up the hieararchy looking for .properties files -igor -- View this message in context: http://www.nabble.com/loadStringResource%28Component-component%2C-String-key%29---correct-method-to-check-if-the-component-IS-a-Page--tp16930303p16974123.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpServletRequest and Filter Class
Just output the complete url in the browser what do you get when you expect the params? On 4/29/08, andrea pantaleoni [EMAIL PROTECTED] wrote: This is the code we used PageParameters parameters = new PageParameters(); parameters.put(ApplicationConstants.REQUEST_USERNAME,userIdField.getModelObject().toString()); parameters.put(ApplicationConstants.REQUEST_PASSWORD,passField.getModelObject().toString()); setResponsePage(RegistrationPage.class,parameters); You can see we tried to add the values for the authentication as parameters as well as attribute but in the filter class we couldn't find it. If that is a redirect or not anyway I would expect to to find that parameters in the request in the filter class Johan Compagner wrote: Because its a redirect?? Then you have a new http request object without you attributes On 4/28/08, andrea pantaleoni [EMAIL PROTECTED] wrote: Hi, I and my colleagues decided to write a custom filter class to check authorization against a LDAP server Inside the Filter class we got some parameters or attributes such as netId and password from the HttpServletRequest object and we check that against the server. Our first page is a wicket page called LoginPage from this page we call another page adding in the HttpServletRequest two attributes (the netId and the password) WebRequest wRequest = (WebRequest)webpage.getRequest(); wRequest.getHttpServletRequest().setAttribute(...)... In this way before the other wicket page is loaded the filter class is invoked, then the request object inside the filter class is completely empty without any attributes or parameters. Anyway if we get a HttpSession inside the LoginPage from the request object and we add in the session the attributes we are able to access them from filter class(the session in not empty). Anyone of you has already faced a problem such that. Thanks in advance Andrea -- View this message in context: http://www.nabble.com/HttpRequest-and-Filter-class-tp16945908p16945908.html Sent from the Wicket - Dev mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/HttpServletRequest-and-Filter-Class-tp16953905p16953905.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Alternative method to initialise page
heh, even though we switched to int we are pretty close to running out of flag bits already :) but oh well :) -igor On Tue, Apr 29, 2008 at 7:07 PM, Johan Compagner [EMAIL PROTECTED] wrote: I am just saying if we make such a thing, that i dont want state after the fact in a components. But i guess we can then better use a bit i think we have a few left. On 4/30/08, James Carman [EMAIL PROTECTED] wrote: On Tue, Apr 29, 2008 at 3:59 PM, Johan Compagner [EMAIL PROTECTED] wrote: First i dont want a boolen in the components that onFirstRender() is called. I want a boolean that it is not called. So in the constructor of component we set the flag and clear it when first rendered. Are we thinking of adding this into core? You're talking about modifying the constructor of Component. Do remember that in onBeforeRende components/panels and all can be created again but i think this will go ok. Yes, each one of these components will each have to be rendered also, so they'd go through the same logic upon their first render, correct? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]