AW: signout and redirect
Depends on what your SSISignOutPage.class does. But why don't use setResponsePage(SSISignOutPage.class) ?? -Ursprüngliche Nachricht- Von: tubin gen [mailto:fachh...@gmail.com] Gesendet: Donnerstag, 25. März 2010 12:59 An: users Betreff: signout and redirect here is my code to signout link. add(new LinkVoid(signout){ @Override public void onClick() { ((AuditWebSession)(Session.get())).signout(); throw new RestartResponseException(SSISignOutPage.class); } }); when user clicks on signout I expect to go to SSISignOutPage. but I end up with a different page which is set in applicationsettings IApplicationSettings settings= super.getApplicationSettings(); settings.setPageExpiredErrorPage(SessionExpiredPage.class); the SessionExpiredPage . please tell me what could be causing this ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: signout and redirect
setResponsePage(SSISignOutPage.class) creates a new page that will go into pagemap. Is your Page class in a protected area? -Ursprüngliche Nachricht- Von: fachhoch [mailto:fachh...@gmail.com] Gesendet: Donnerstag, 25. März 2010 15:19 An: users@wicket.apache.org Betreff: Re: AW: signout and redirect I initially tried etResponsePage(SSISignOutPage.class) it did not worked , so used the new approach , regarding what my SSISignOutPage it does nothing except for showing a link , before to that the control never goes to the page constructor , I am assuming after a session is invalidated wicket removes all its pages from page map and its possible that it cannot find the page SSISignOutPage and for that reason do I get pageExpired error ? christian.giambalvo wrote: Depends on what your SSISignOutPage.class does. But why don't use setResponsePage(SSISignOutPage.class) ?? -Ursprüngliche Nachricht- Von: tubin gen [mailto:fachh...@gmail.com] Gesendet: Donnerstag, 25. März 2010 12:59 An: users Betreff: signout and redirect here is my code to signout link. add(new LinkVoid(signout){ @Override public void onClick() { ((AuditWebSession)(Session.get())).signout(); throw new RestartResponseException(SSISignOutPage.class); } }); when user clicks on signout I expect to go to SSISignOutPage. but I end up with a different page which is set in applicationsettings IApplicationSettings settings= super.getApplicationSettings(); settings.setPageExpiredErrorPage(SessionExpiredPage.class); the SessionExpiredPage . please tell me what could be causing this ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://old.nabble.com/signout-and-redirect-tp28027857p28029507.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: wiQuery components with server side state - live demo
Hi, i've found a bug at http://labs.jweekend.com/public/grid/GridDnDPage Click and hold on a column header and moving mouse around expands the header columnm, what i think is not intended. Greets Chris -Ursprüngliche Nachricht- Von: ce...@jweekend.com [mailto:ce...@jweekend.com] Im Auftrag von Cemal Bayramoglu Gesendet: Mittwoch, 3. März 2010 11:33 An: users@wicket.apache.org Betreff: Re: wiQuery components with server side state - live demo This is all useful feedback, thank you. Storing things like the user's selected columns, their order, row sort order, number of rows per page, preferred/selected themes etc ... are on our list of things to consider. I envisage persisting these user-specific setting (preferences/profiles/perspectives/views?) server-side, perhaps triggered by a user request to do so (eg hitting a Save A (Named) View Settings button). We've also talked about the less permanent persistence for page-refreshes, which could potentially be held on the client-side, in the Wicket page or session. Regards - Cemal jWeekend OO Java Technologies, Wicket Consulting, Development, Training http://jWeekend.com On 2 March 2010 23:10, Vladimir K koval...@gmail.com wrote: Looks great! One thing is missing - the components don't restore their state on refresh. I believe cookie, window name or dom storage can be used to keep the position and settings of components that are available for dragging/re-arrangement. Roman Ilin wrote: Great, ready for use components. On Tue, Mar 2, 2010 at 5:58 PM, Cemal A Bayramoglu ce...@jweekend.com wrote: We've been building a few wiQuery components [0], for clients' and internal projects. These wiQuery components typically maintain some of their state server-side, in the spirit of standard Wicket components. Here's a simple demo [1] to show some of them in action. Look carefully and you'll find lots of stuff to click on [2]. We could plan to open up the ones we may [3] if they look useful to you or you'd like to get involved with design/development/testing. Regards - Cemal jWeekend OO Java Technologies, Wicket Consulting, Development, Training http://jWeekend.com [0] includes components based on sortable portlet, jqGrid/Tree, jGrowl, jQuery UI: Accordian, Dialog, Tabs all integrated with Wicket using wiQuery (http://code.google.com/p/wiquery/) [1] http://labs.jWeekend.com/public/ [2] We'd naturally prefer if you didn't zap _all_ the records from our toy database! Yes, we know some of you will take this as an invitation to have a go! [3] No promises on dates just now, but it is something we'd like to do soon. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://old.nabble.com/wiQuery-components-with-server-side-state---live-demo-tp27758298p27762474.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: jdbc
http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html -Ursprüngliche Nachricht- Von: Ivan Dudko [mailto:ivan.du...@gmail.com] Gesendet: Donnerstag, 11. Februar 2010 15:47 An: users@wicket.apache.org Betreff: Re: jdbc I already have method that return my data from db as arraylist. And i use this in iterator() method of dataprovider. But which object (i think model) i must return? 2010/2/11 James Carman jcar...@carmanconsulting.com: You need to create a provider for your data. Look at what the constructor takes and then implement the interface. On Thu, Feb 11, 2010 at 8:26 AM, Ivan Dudko ivan.du...@gmail.com wrote: Hello! I can't understand how to populate data from a resultset object into datatable. Anyone have an example? Thank you! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: CryptedUrlWebRequestCodingStrategy + WebRequestCodingStrategy = resource URLs are not encrypted (bug?).
You're right, i just want a consistent url look. -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Donnerstag, 21. Januar 2010 16:52 An: users@wicket.apache.org Betreff: Re: CryptedUrlWebRequestCodingStrategy + WebRequestCodingStrategy = resource URLs are not encrypted (bug?). not sure that is possible currently. the aliasing only works on a per class level. see SharedResources.putClassAlias(). you can add an rfe to have it enhanced. seems like a quiet arbitrary requirement, especially when it comes to security. an fqn does not give anything away security-wise. -igor On Thu, Jan 21, 2010 at 1:18 AM, Antoine van Wel antoine.van@gmail.com wrote: What can you do if you need to enforce that no fqn's are ever generated in (resource) paths? Best I can think of now is putting a breakpoint in the resourceKey method where the fqn is retrieved, and then stepping through your full webapp - which is a rather poor solution. Any other ideas? Antoine On Mon, Jan 18, 2010 at 5:18 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: the original design goal of the crypted strategy was to only encrypt what the user sees in the url bar. since they never see resource urls there was no reason to encrypt those. re fqns, you can add class aliases into SharedResources to hide those. -igor 2010/1/18 Sergejs Olefirs sergejs.olef...@parex.lv: Hi, I started using Wicket rather recently. As part of our security considerations, we do not want immediately expose the underlying framework(s) we are using, so we went ahead with URL encryption. We used standard approach as described in examples: @Override protected IRequestCycleProcessor newRequestCycleProcessor() { return new WebRequestCycleProcessor(){ protected IRequestCodingStrategy newRequestCodingStrategy(){ return new CryptedUrlWebRequestCodingStrategy(new WebRequestCodingStrategy()); } }; } Unfortunately I later discovered that this approach doesn't encrypt resource URLs, e.g. from: CSSPackageResource.getHeaderContribution(..); or link.add(new Image(logoImage)); What's worse such resource references include FQN of related classes. After some investigation I found out that the problem is that CryptedUrlWebRequestCodingStrategy only encrypts arguments string of the URL and WebRequestCodingStrategy encodes resource references as path rather than as argument. I was able to get around this by subclassing WebRequestCodingStrategy and overriding methods: addResourceParameters(..); encode(RequestCycle requestCycle, ISharedResourceRequestTarget requestTarget); to use arguments rather than path as resource reference. However I'm unsure as to original reasoning behind original CryptedUrlWebRequestCodingStrategy and WebRequestCodingStrategy. Is the resource behaviour simply a bug? Or is it there for some reason that is going to bite me down the road if I use my own 'fix'? Best regards, Sergey - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- take your photos everywhere you go - https://www.memolio.com follow us on Twitter - http://twitter.com/Memolio - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: CryptedUrlWebRequestCodingStrategy + WebRequestCodingStrategy = resource URLs are not encrypted (bug?).
Ups, sorry. The post was not for me. -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Donnerstag, 21. Januar 2010 16:52 An: users@wicket.apache.org Betreff: Re: CryptedUrlWebRequestCodingStrategy + WebRequestCodingStrategy = resource URLs are not encrypted (bug?). not sure that is possible currently. the aliasing only works on a per class level. see SharedResources.putClassAlias(). you can add an rfe to have it enhanced. seems like a quiet arbitrary requirement, especially when it comes to security. an fqn does not give anything away security-wise. -igor On Thu, Jan 21, 2010 at 1:18 AM, Antoine van Wel antoine.van@gmail.com wrote: What can you do if you need to enforce that no fqn's are ever generated in (resource) paths? Best I can think of now is putting a breakpoint in the resourceKey method where the fqn is retrieved, and then stepping through your full webapp - which is a rather poor solution. Any other ideas? Antoine On Mon, Jan 18, 2010 at 5:18 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: the original design goal of the crypted strategy was to only encrypt what the user sees in the url bar. since they never see resource urls there was no reason to encrypt those. re fqns, you can add class aliases into SharedResources to hide those. -igor 2010/1/18 Sergejs Olefirs sergejs.olef...@parex.lv: Hi, I started using Wicket rather recently. As part of our security considerations, we do not want immediately expose the underlying framework(s) we are using, so we went ahead with URL encryption. We used standard approach as described in examples: @Override protected IRequestCycleProcessor newRequestCycleProcessor() { return new WebRequestCycleProcessor(){ protected IRequestCodingStrategy newRequestCodingStrategy(){ return new CryptedUrlWebRequestCodingStrategy(new WebRequestCodingStrategy()); } }; } Unfortunately I later discovered that this approach doesn't encrypt resource URLs, e.g. from: CSSPackageResource.getHeaderContribution(..); or link.add(new Image(logoImage)); What's worse such resource references include FQN of related classes. After some investigation I found out that the problem is that CryptedUrlWebRequestCodingStrategy only encrypts arguments string of the URL and WebRequestCodingStrategy encodes resource references as path rather than as argument. I was able to get around this by subclassing WebRequestCodingStrategy and overriding methods: addResourceParameters(..); encode(RequestCycle requestCycle, ISharedResourceRequestTarget requestTarget); to use arguments rather than path as resource reference. However I'm unsure as to original reasoning behind original CryptedUrlWebRequestCodingStrategy and WebRequestCodingStrategy. Is the resource behaviour simply a bug? Or is it there for some reason that is going to bite me down the road if I use my own 'fix'? Best regards, Sergey - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- take your photos everywhere you go - https://www.memolio.com follow us on Twitter - http://twitter.com/Memolio - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
CryptedUrlWebRequestCodingStrategy and setResponsePage
Hi all, just a question to url encryption. I added following section to my application class /** * @see org.apache.wicket.authentication.AuthenticatedWebApplication#newRequestC ycleProcessor() */ @Override protected IRequestCycleProcessor newRequestCycleProcessor() { return new WebRequestCycleProcessor() { @Override protected IRequestCodingStrategy newRequestCodingStrategy() { return new CryptedUrlWebRequestCodingStrategy(new WebRequestCodingStrategy()); } }; } And implemented ICryptFactory like this this.getSecuritySettings().setCryptFactory(new ICryptFactory() { @Override public ICrypt newCrypt() { return new AbstractCrypt() { @Override protected byte[] crypt(final byte[] input, final int mode) throws GeneralSecurityException { } }; } }); Urls are now crypted if using links. But if I use setResponsePage the url is in clearText. Am I missing something or why aren't they crypted? Greets Chris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: get set attribute wicket session
Hi, with getSession() you will always get the session attached to the current request. So yes it is session specific. Greets chris -Ursprüngliche Nachricht- Von: Martin Asenov [mailto:mase...@velti.com] Gesendet: Donnerstag, 21. Januar 2010 16:44 An: users@wicket.apache.org Betreff: get set attribute wicket session Hello, everyone! I would like to ask if: -I've got an AuthenticatedWebSession implementation and there I have the fields -field1 -field2 with getters and setters. After that somewhere in my code, no matter where I say ((MySessionImpl)getSession()).getField1() will I get session specific attribute, since there are no set/getAttribute() methods for the session. I want to save session specific attributes in that manner, is this the correct way to do so? Thanks, - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: get set attribute wicket session
Well, you have wrong dependency. Webapp shouldn't depend on UI. But UI on webapp. You have to reverse the dependency otherwise there is no possibility. -Ursprüngliche Nachricht- Von: Martin Asenov [mailto:mase...@velti.com] Gesendet: Donnerstag, 21. Januar 2010 17:04 An: users@wicket.apache.org Betreff: RE: get set attribute wicket session Well, here comes another issue... What should I do when I don't have the MySessionImpl class visible, because it's in the webapp module which is invisible for the UI module. Because webapp has a dependency to the UI and otherwise I'll have a cyclic reference and compile time error.? How could I get session specific attributes then? By using getMetaData()? Thanks, -Original Message- From: Martin Asenov [mailto:mase...@velti.com] Sent: Thursday, January 21, 2010 5:54 PM To: users@wicket.apache.org Subject: RE: get set attribute wicket session Thanks, Chris! Have a nice evening! Cheers, Martin -Original Message- From: Giambalvo, Christian [mailto:christian.giamba...@excelsisnet.com] Sent: Thursday, January 21, 2010 5:46 PM To: users@wicket.apache.org Subject: AW: get set attribute wicket session Hi, with getSession() you will always get the session attached to the current request. So yes it is session specific. Greets chris -Ursprüngliche Nachricht- Von: Martin Asenov [mailto:mase...@velti.com] Gesendet: Donnerstag, 21. Januar 2010 16:44 An: users@wicket.apache.org Betreff: get set attribute wicket session Hello, everyone! I would like to ask if: -I've got an AuthenticatedWebSession implementation and there I have the fields -field1 -field2 with getters and setters. After that somewhere in my code, no matter where I say ((MySessionImpl)getSession()).getField1() will I get session specific attribute, since there are no set/getAttribute() methods for the session. I want to save session specific attributes in that manner, is this the correct way to do so? Thanks, - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: get set attribute wicket session
Not possible cause What should I do when I don't have the MySessionImpl class visible. The class need to be visible to do that. -Ursprüngliche Nachricht- Von: Joseph Pachod [mailto:j...@thomas-daily.de] Gesendet: Donnerstag, 21. Januar 2010 17:26 An: users@wicket.apache.org Betreff: Re: AW: get set attribute wicket session Giambalvo, Christian wrote: Hi, with getSession() you will always get the session attached to the current request. So yes it is session specific. Greets chris I would add that, in order to save this nasty cast all over the place, you could create your own getMySessionImpl this way : class MySessionImpl public static MySessionImpl getMySessionImpl(){ return (MySessionImpl) get(); } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: get set attribute wicket session
Put them in its own jar and add it as dependency to both projects. (dirty but it does the job) -Ursprüngliche Nachricht- Von: Martin Asenov [mailto:mase...@velti.com] Gesendet: Donnerstag, 21. Januar 2010 17:38 An: users@wicket.apache.org Betreff: RE: AW: get set attribute wicket session Unfortunatelly I can't use this since the webapp module builds the core and UI modules in one and builds resources and stuff like this in the war. Maybe I should think of something else... Regards, -Original Message- From: Joseph Pachod [mailto:j...@thomas-daily.de] Sent: Thursday, January 21, 2010 6:26 PM To: users@wicket.apache.org Subject: Re: AW: get set attribute wicket session Giambalvo, Christian wrote: Hi, with getSession() you will always get the session attached to the current request. So yes it is session specific. Greets chris I would add that, in order to save this nasty cast all over the place, you could create your own getMySessionImpl this way : class MySessionImpl public static MySessionImpl getMySessionImpl(){ return (MySessionImpl) get(); } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Disabled Navigation if Action.ENABLE is restricted for page
Hi all, i have a litte problem. I have implemented an own AuthorizationStrategy where I check I a user is allowed to render/enable a component/page. Each page has a navigation. If I restrict enable for a page, then the navigation gets also disabled. I tried overwriting isEnabled() for the whole navigation and its childs, but doesn't work. So the main question is how to have a component on a page always be enabled even if the page is disabled? Greets chris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Disabled Navigation if Action.ENABLE is restricted for page
Well, i have implemented a different authorization model and don't use the annotation based. All restrictions are written in one onfig file to have them all in place. I there is a viewonly user I don't want to disable each panel/textfield ... one by one, so that’s why I disable the whole page. -Ursprüngliche Nachricht- Von: Marat Radchenko [mailto:slonopotamusor...@gmail.com] Gesendet: Freitag, 15. Januar 2010 15:20 An: users@wicket.apache.org Betreff: Re: Disabled Navigation if Action.ENABLE is restricted for page Why you're disabling whole page in first place? 2010/1/15 Giambalvo, Christian christian.giamba...@excelsisnet.com: Hi all, i have a litte problem. I have implemented an own AuthorizationStrategy where I check I a user is allowed to render/enable a component/page. Each page has a navigation. If I restrict enable for a page, then the navigation gets also disabled. I tried overwriting isEnabled() for the whole navigation and its childs, but doesn't work. So the main question is how to have a component on a page always be enabled even if the page is disabled? Greets chris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: How to write markup if type of component is not known yet...
Keep it simple and write 2 panels. -Ursprüngliche Nachricht- Von: Pieter Degraeuwe [mailto:pieter.degrae...@systemworks.be] Gesendet: Mittwoch, 2. Dezember 2009 09:55 An: users@wicket.apache.org Betreff: How to write markup if type of component is not known yet... Hi all, I want to write a panel which kan render in 2 modes: editable and read-only. In read-only mode all my components are just labels. In edit mode, are these labels replaced by input fields (e.g. Textfields, DropDowns, etc) The problem is now that I only want to write one markup (since all components are ordered in a quite complex hierarchy) Wicket complains now that tag type must be input instead of span... Is there any way around this. (Or am I doing bad practices...) regards, Pieter -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Session stealing with wicket-auth-roles
Hmm, for me it doesn't work. I mount the pages via: this.mount(/pages/secure, PackageName.forClass(this.getHomePage())); If I try to access the page from machine B with the same jessionid as machine A, then I get redirected to LoginPage. -Ursprüngliche Nachricht- Von: Andrew Turner [mailto:grim_toas...@hotmail.com] Gesendet: Mittwoch, 2. Dezember 2009 10:24 An: users@wicket.apache.org Betreff: Session stealing with wicket-auth-roles Good morning all, I'm hoping I've misconfigured something in my application, but we seem to be prone to session stealing in our wicket application. We're using wicket-auth-roles to provide the security, and if you are able to access the jsessionid you can get another machine to log straight into the application as the intercepted user. We're using HTTPS for the communication, so hopefully the likelihood of this occurring is quite small, but we are still being forced to contemplate rewriting the security layer (which I want to avoid if possible). So, my question, have I misconfigured something, or is it just not possible to prevent this sort of attack when using wicket-auth-roles? I've managed to create a completely stripped-down app that still has the problem, below is the AuthenticatedWhenSession implementation. public class HelloWorldWebSession extends AuthenticatedWebSession { public HelloWorldWebSession(Request request) { super(request); } public boolean authenticate(String username, String password) { return helloUser.equals(username) password.equals(password); } public Roles getRoles() { return isSignedIn() ? new Roles(Roles.USER) : null; } } And the simple page: @AuthorizeInstantiation(USER) public class HelloWorldHomePage extends WebPage { } And the application: public class HelloWorldApplication extends AuthenticatedWebApplication { protected void init() { super.init(); mountBookmarkablePage(home, HelloWorldHomePage.class); mountBookmarkablePage(signin, SignInPage.class); } protected Class? extends WebPage getSignInPageClass() { return SignInPage.class; } protected Class? extends AuthenticatedWebSession getWebSessionClass() { return HelloWorldWebSession.class; } public Class? extends Page getHomePage() { return HelloWorldHomePage.class; } } The URL below, once logged in on one machine, could then be used on multiple machines to bypass the security layer. http://localhost:9090/HelloWorld/home;jsessionid=SESSION_ID_TAKEN_FROM_URL/COOKIE Many Thanks Andy _ Add your Gmail and Yahoo! Mail email accounts into Hotmail - it's easy http://clk.atdmt.com/UKM/go/186394592/direct/01/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: PropertyModels *without* strings
Lombok looks preety cool. I think i will use it cause it saves a lot of typing and holds equals and hashcode in sync. -Ursprüngliche Nachricht- Von: Gerolf Seitz [mailto:gerolf.se...@gmail.com] Gesendet: Donnerstag, 26. November 2009 19:36 An: users@wicket.apache.org Betreff: Re: PropertyModels *without* strings that's why i was wondering about a lombok based bindgen implementation, since lombok is available as apt processor and eclipse plugin :) On Thu, Nov 26, 2009 at 5:13 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: you guys are missing the point. Bindgen is a *standard apt processor*. it is not an eclipse plugin. all major IDEs have support for annotation processors baked in. refactoring support is definetely *possible*, but it would require an actual IDE pliugin. -igor On Thu, Nov 26, 2009 at 5:20 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Ah.. the next big thing, (in) refactoring (bindings?)!!! All glory to the person that does it. ** Martin 2009/11/26 Johan Compagner jcompag...@gmail.com: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ltk/core/refactoring/participants/package-summary.html On Thu, Nov 26, 2009 at 13:52, James Carman jcar...@carmanconsulting.comwrote: Refactoring could definitely be supported in IDEA. With the Hibernate support, when you change a property name it will change your mapping hbm.xml (yes, we still use them) files for you automatically. Same thing happens with the Spring support. The configuration files are changed for you. I don't know how eclipse works with this kind of stuff, but IDEA definitely has hooks for this kind of stuff. On Thu, Nov 26, 2009 at 2:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: PropertyModels *without* strings
Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: PropertyModels *without* strings
Ok thanks. -Ursprüngliche Nachricht- Von: Gerolf Seitz [mailto:gerolf.se...@gmail.com] Gesendet: Donnerstag, 26. November 2009 08:19 An: users@wicket.apache.org Betreff: Re: PropertyModels *without* strings as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: PropertyModels *without* strings
You're right, it's an improvment. And will use it. I just wanted to know is refactoring is supported. Anyway it's a nice thing. Thanks for that :) Greets -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Donnerstag, 26. November 2009 08:44 An: users@wicket.apache.org Betreff: Re: PropertyModels *without* strings the whole point is that strings brake, whether they are constants or not. eg add(new Label(parentName, new PropertyModel(person, parent.name))); suppose you rename Person.getName() to Person.getFullName(). now you have to find all places in your code where you have referenced name as part of a string property expression and change it to fullName. if you miss somewhere you wont know until runtime. in my projects a lot of objects have a name field, so the process of identifying all the places that need to be updated involves sifting through a bunch of strings and figuring out if what is before the .name is of type Person. tedious and error-prone. although bindgen does not support refactoring, as soon as the change is made all the places that need to be updated will be reported by the compiler. that is an *enormous* improvement in non-trivial applications. another big advantage is that bindings carry type information, eg: add(new TextFieldInteger(age, new PropertyModel(person, age))); there is no way to verify that age expression is of type Integer and not a value object or a string, but bindgen bindings are typesafe and a non-Integer binding would cause a compilation error. i am actually somewhat shocked that someone can look at this and not see the value. this fills in a huge gap in java until methods and fields become first-class citizens. but, maybe im just weird. -igor On Wed, Nov 25, 2009 at 11:28 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: If refactoring is not supported it is just easier to use string constants, which do not break. ** Martin 2009/11/26 Gerolf Seitz gerolf.se...@gmail.com: as far as i have read, the binding methods aren't automatically refactored (eg. renamed), but you get compiler errors in the code where you use the old names. so it should be fairly easy to fix your own code (in contrast to some strings) On Thu, Nov 26, 2009 at 8:04 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Is refactoring available for bindgen? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mittwoch, 25. November 2009 22:56 An: users@wicket.apache.org; d...@wicket.apache.org Betreff: PropertyModels *without* strings http://wicketinaction.com/2009/11/removing-fragile-string-expressions-from-wicket-code/ -igor - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
JWeekend
i just wanna say sorry for not comming to the jweekend. But i am ill. I spewed the whole weekend. I tried to push myself with coffe at sturbucks next to foyles but it didn't helped much. So i decided to go back home. I regret this very much. Is there any recording of the jweekend available? Thanks in advance. Chris
AW: bindgen release
This sounds pretty cool. Keep working Stephen. Greets Chris -Ursprüngliche Nachricht- Von: Stephen Haberman [mailto:step...@exigencecorp.com] Gesendet: Donnerstag, 12. November 2009 06:24 An: Jeremy Thomerson Cc: users@wicket.apache.org Betreff: Re: bindgen release Have you done any more work with using Bindgen with Wicket? It looks interesting to me. No, but coincidentally I got an email from Igor about bindgen a few days ago. He's been putting some work into a maven apt plugin and then submitting a hand full of bindgen bugs that I've fixed. Igor's current concern is that bindgen recursively generates bindings...e.g. if you have @Bindable FooPage with an Employee field/method that has a first name string, bindgen will generate FooPageBinding, EmployeeBinding, and StringBinding, allowing you to do: foo().employee().name() Which is cool. Except that it doesn't know when to stop, so you'll end up with `XxxBinding` classes for a lot of classes you probably won't ever actually use. So, Igor is thinking about how to trim this back. It hasn't been a problem on my non-wicket projects, but I get what he's saying. Earlier this evening I released bindgen 2.3 to the http://repo.joist.ws maven repo with a fix for one of Igor's bugs, so you can try that out. Please do let me know how it goes. Fair warning, the bindgen docs are light-to-non-existent, but since people are starting to express interest in it, I'll get some in to place. Thanks! - Stephen - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket Eclipse 3.5 Plugin
Hi all, which is your favorite eclipse plugin? I only know Wicketbench, but it doesn't work correctly with eclipse 3.5. Greets Chris
AbstractAjaxTimerBehavior causes exception
Hi all, maybe i found a bug. Don't know if I'm doing something wrong. But it's a simple usecase. Following code produces an exception: public class HomePage extends WebPage { private static final long serialVersionUID = 1L; private static int testCounter = 0; public HomePage(final PageParameters parameters) { // Add the simplest type of label final Label test = new Label(message, If you see this message wicket is properly configured and running); test.add(new AbstractAjaxTimerBehavior(Duration.seconds(1)) { @Override protected void onTimer(AjaxRequestTarget target) { Label t2 = new Label(message, Test + testCounter); test.replaceWith(t2); testCounter++; target.addComponent(test); } }); add(test); } } Exception: Root cause: java.lang.IllegalStateException: No Page found for component [Component id = message] at org.apache.wicket.Component.getPage(Component.java:1754) at org.apache.wicket.RequestCycle.urlFor(RequestCycle.java:872) at org.apache.wicket.Component.urlFor(Component.java:3286) at org.apache.wicket.behavior.AbstractAjaxBehavior.getCallbackUrl(AbstractA jaxBehavior.java:124) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.getCallbackScript(Abstr actAjaxTimerBehavior.java:127) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.getJsTimeoutCall(Abstra ctAjaxTimerBehavior.java:120) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.respond(AbstractAjaxTim erBehavior.java:163) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDef aultAjaxBehavior.java:299) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarge t.processEvents(BehaviorRequestTarget.java:119) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Ab stractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java :1250) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:468 ) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java: 301) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHan dler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:2 16) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandler Collection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.jav a:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConne ction.java:915) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java :582) Greets Chris
AW: AbstractAjaxTimerBehavior causes exception
Hi Ernesto, the label was just an example. In my app i try to replace the navigation (you remember your suggestion with a timer?) The navigation is a panel. So recreate the whole panel and then try to replace it with the new one. This is where the AbstractAjaxTimerBehavior comes in. Greets Chris -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Mittwoch, 11. November 2009 09:35 An: users@wicket.apache.org Betreff: Re: AbstractAjaxTimerBehavior causes exception Hi Chris, Maybe it is because you are adding the timer to the label and later on replacing it is another component. Then the second AJAX round trip to the page will look for the AbstractAjaxTimerBehavior associated to the message component, but the new one does not have associated such a behavior. And you do not need to replace the label component (just udpate it via AJAX): just write a model that displays If you see this message wicket is properly configured and running if count =0 and Test + testCounter if 0. Best, Ernesto On Wed, Nov 11, 2009 at 9:21 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Hi all, maybe i found a bug. Don't know if I'm doing something wrong. But it's a simple usecase. Following code produces an exception: public class HomePage extends WebPage { private static final long serialVersionUID = 1L; private static int testCounter = 0; public HomePage(final PageParameters parameters) { // Add the simplest type of label final Label test = new Label(message, If you see this message wicket is properly configured and running); test.add(new AbstractAjaxTimerBehavior(Duration.seconds(1)) { @Override protected void onTimer(AjaxRequestTarget target) { Label t2 = new Label(message, Test + testCounter); test.replaceWith(t2); testCounter++; target.addComponent(test); } }); add(test); } } Exception: Root cause: java.lang.IllegalStateException: No Page found for component [Component id = message] at org.apache.wicket.Component.getPage(Component.java:1754) at org.apache.wicket.RequestCycle.urlFor(RequestCycle.java:872) at org.apache.wicket.Component.urlFor(Component.java:3286) at org.apache.wicket.behavior.AbstractAjaxBehavior.getCallbackUrl(AbstractA jaxBehavior.java:124) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.getCallbackScript(Abstr actAjaxTimerBehavior.java:127) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.getJsTimeoutCall(Abstra ctAjaxTimerBehavior.java:120) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.respond(AbstractAjaxTim erBehavior.java:163) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDef aultAjaxBehavior.java:299) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarge t.processEvents(BehaviorRequestTarget.java:119) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Ab stractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java :1250) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:468 ) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java: 301) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHan dler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:2 16) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandler Collection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.jav a:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConne ction.java:915) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java
AW: AbstractAjaxTimerBehavior causes exception
Btw, the exception is thrown on first call not on second round trip. -Ursprüngliche Nachricht- Von: Giambalvo, Christian [mailto:christian.giamba...@excelsisnet.com] Gesendet: Mittwoch, 11. November 2009 09:39 An: users@wicket.apache.org Betreff: AW: AbstractAjaxTimerBehavior causes exception Hi Ernesto, the label was just an example. In my app i try to replace the navigation (you remember your suggestion with a timer?) The navigation is a panel. So recreate the whole panel and then try to replace it with the new one. This is where the AbstractAjaxTimerBehavior comes in. Greets Chris -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Mittwoch, 11. November 2009 09:35 An: users@wicket.apache.org Betreff: Re: AbstractAjaxTimerBehavior causes exception Hi Chris, Maybe it is because you are adding the timer to the label and later on replacing it is another component. Then the second AJAX round trip to the page will look for the AbstractAjaxTimerBehavior associated to the message component, but the new one does not have associated such a behavior. And you do not need to replace the label component (just udpate it via AJAX): just write a model that displays If you see this message wicket is properly configured and running if count =0 and Test + testCounter if 0. Best, Ernesto On Wed, Nov 11, 2009 at 9:21 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Hi all, maybe i found a bug. Don't know if I'm doing something wrong. But it's a simple usecase. Following code produces an exception: public class HomePage extends WebPage { private static final long serialVersionUID = 1L; private static int testCounter = 0; public HomePage(final PageParameters parameters) { // Add the simplest type of label final Label test = new Label(message, If you see this message wicket is properly configured and running); test.add(new AbstractAjaxTimerBehavior(Duration.seconds(1)) { @Override protected void onTimer(AjaxRequestTarget target) { Label t2 = new Label(message, Test + testCounter); test.replaceWith(t2); testCounter++; target.addComponent(test); } }); add(test); } } Exception: Root cause: java.lang.IllegalStateException: No Page found for component [Component id = message] at org.apache.wicket.Component.getPage(Component.java:1754) at org.apache.wicket.RequestCycle.urlFor(RequestCycle.java:872) at org.apache.wicket.Component.urlFor(Component.java:3286) at org.apache.wicket.behavior.AbstractAjaxBehavior.getCallbackUrl(AbstractA jaxBehavior.java:124) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.getCallbackScript(Abstr actAjaxTimerBehavior.java:127) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.getJsTimeoutCall(Abstra ctAjaxTimerBehavior.java:120) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.respond(AbstractAjaxTim erBehavior.java:163) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDef aultAjaxBehavior.java:299) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarge t.processEvents(BehaviorRequestTarget.java:119) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Ab stractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java :1250) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:468 ) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java: 301) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHan dler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:2 16) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandler Collection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.jav a:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConne
AW: AbstractAjaxTimerBehavior causes exception
Hi Martin, this doesn't work. @Override protected void onTimer(AjaxRequestTarget target) { Label t2 = new Label(message, Test + testCounter); t2.setOutputMarkupId(true); test = t2; testCounter++; target.addComponent(test); } It doesn't throw an exception, but the t2 didn't show up. I think this is because t2 isn't added to the page. That’s why there is Component#replaceWith(Component). Greets -Ursprüngliche Nachricht- Von: Martin Grigorov [mailto:mcgreg...@e-card.bg] Gesendet: Mittwoch, 11. November 2009 09:59 An: users@wicket.apache.org Betreff: Re: AbstractAjaxTimerBehavior causes exception On Wed, 2009-11-11 at 09:21 +0100, Giambalvo, Christian wrote: Hi all, maybe i found a bug. Don't know if I'm doing something wrong. But it's a simple usecase. Following code produces an exception: public class HomePage extends WebPage { private static final long serialVersionUID = 1L; private static int testCounter = 0; public HomePage(final PageParameters parameters) { // Add the simplest type of label final Label test = new Label(message, If you see this message wicket is properly configured and running); test.add(new AbstractAjaxTimerBehavior(Duration.seconds(1)) { @Override protected void onTimer(AjaxRequestTarget target) { Label t2 = new Label(message, Test + testCounter); test.replaceWith(t2); here you need to make : test = t2; testCounter++; target.addComponent(test); } }); add(test); } } Exception: Root cause: java.lang.IllegalStateException: No Page found for component [Component id = message] at org.apache.wicket.Component.getPage(Component.java:1754) at org.apache.wicket.RequestCycle.urlFor(RequestCycle.java:872) at org.apache.wicket.Component.urlFor(Component.java:3286) at org.apache.wicket.behavior.AbstractAjaxBehavior.getCallbackUrl(AbstractA jaxBehavior.java:124) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.getCallbackScript(Abstr actAjaxTimerBehavior.java:127) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.getJsTimeoutCall(Abstra ctAjaxTimerBehavior.java:120) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.respond(AbstractAjaxTim erBehavior.java:163) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDef aultAjaxBehavior.java:299) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarge t.processEvents(BehaviorRequestTarget.java:119) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Ab stractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java :1250) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:468 ) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java: 301) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHan dler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:2 16) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandler Collection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.jav a:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConne ction.java:915) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java :582) Greets Chris - To unsubscribe, e-mail
AW: AbstractAjaxTimerBehavior causes exception
You're right Ernesto, your example works, but what if I want to replace a whole panel and not just the model of a label? -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Mittwoch, 11. November 2009 10:15 An: users@wicket.apache.org Betreff: Re: AbstractAjaxTimerBehavior causes exception Well I think it all boils down to the explanation a gave on my first e-mail: if you replace the component with a new one that does not have the behavior then you will get an exception (the same will happend if you remove the behavior during a round trip). I guess Martin was just trying to say that you should use the same label...? Did you try the code I posted? It does work ;-) Cheers, Ernesto On Wed, Nov 11, 2009 at 10:06 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Hi Martin, this doesn't work. @Override protected void onTimer(AjaxRequestTarget target) { Label t2 = new Label(message, Test + testCounter); t2.setOutputMarkupId(true); test = t2; testCounter++; target.addComponent(test); } It doesn't throw an exception, but the t2 didn't show up. I think this is because t2 isn't added to the page. That's why there is Component#replaceWith(Component). Greets -Ursprüngliche Nachricht- Von: Martin Grigorov [mailto:mcgreg...@e-card.bg] Gesendet: Mittwoch, 11. November 2009 09:59 An: users@wicket.apache.org Betreff: Re: AbstractAjaxTimerBehavior causes exception On Wed, 2009-11-11 at 09:21 +0100, Giambalvo, Christian wrote: Hi all, maybe i found a bug. Don't know if I'm doing something wrong. But it's a simple usecase. Following code produces an exception: public class HomePage extends WebPage { private static final long serialVersionUID = 1L; private static int testCounter = 0; public HomePage(final PageParameters parameters) { // Add the simplest type of label final Label test = new Label(message, If you see this message wicket is properly configured and running); test.add(new AbstractAjaxTimerBehavior(Duration.seconds(1)) { @Override protected void onTimer(AjaxRequestTarget target) { Label t2 = new Label(message, Test + testCounter); test.replaceWith(t2); here you need to make : test = t2; testCounter++; target.addComponent(test); } }); add(test); } } Exception: Root cause: java.lang.IllegalStateException: No Page found for component [Component id = message] at org.apache.wicket.Component.getPage(Component.java:1754) at org.apache.wicket.RequestCycle.urlFor(RequestCycle.java:872) at org.apache.wicket.Component.urlFor(Component.java:3286) at org.apache.wicket.behavior.AbstractAjaxBehavior.getCallbackUrl(AbstractA jaxBehavior.java:124) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.getCallbackScript(Abstr actAjaxTimerBehavior.java:127) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.getJsTimeoutCall(Abstra ctAjaxTimerBehavior.java:120) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.respond(AbstractAjaxTim erBehavior.java:163) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDef aultAjaxBehavior.java:299) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarge t.processEvents(BehaviorRequestTarget.java:119) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Ab stractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java :1250) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:468 ) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java: 301) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHan dler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:2 16) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandler Collection.java
AW: AbstractAjaxTimerBehavior causes exception
Works great with a Container. Thanks Ernesto, you're the best :) Saludo Chris -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Mittwoch, 11. November 2009 10:28 An: users@wicket.apache.org Betreff: Re: AbstractAjaxTimerBehavior causes exception Put a container (WebMarkupContainer?) around components you want to update, atatch the behavior to that container and make sure the comapoent you want to update are dynamic: meaning that theirs state should change every time they are rendered. Best, Ernesto On Wed, Nov 11, 2009 at 10:24 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: You're right Ernesto, your example works, but what if I want to replace a whole panel and not just the model of a label? -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Mittwoch, 11. November 2009 10:15 An: users@wicket.apache.org Betreff: Re: AbstractAjaxTimerBehavior causes exception Well I think it all boils down to the explanation a gave on my first e-mail: if you replace the component with a new one that does not have the behavior then you will get an exception (the same will happend if you remove the behavior during a round trip). I guess Martin was just trying to say that you should use the same label...? Did you try the code I posted? It does work ;-) Cheers, Ernesto On Wed, Nov 11, 2009 at 10:06 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Hi Martin, this doesn't work. @Override protected void onTimer(AjaxRequestTarget target) { Label t2 = new Label(message, Test + testCounter); t2.setOutputMarkupId(true); test = t2; testCounter++; target.addComponent(test); } It doesn't throw an exception, but the t2 didn't show up. I think this is because t2 isn't added to the page. That's why there is Component#replaceWith(Component). Greets -Ursprüngliche Nachricht- Von: Martin Grigorov [mailto:mcgreg...@e-card.bg] Gesendet: Mittwoch, 11. November 2009 09:59 An: users@wicket.apache.org Betreff: Re: AbstractAjaxTimerBehavior causes exception On Wed, 2009-11-11 at 09:21 +0100, Giambalvo, Christian wrote: Hi all, maybe i found a bug. Don't know if I'm doing something wrong. But it's a simple usecase. Following code produces an exception: public class HomePage extends WebPage { private static final long serialVersionUID = 1L; private static int testCounter = 0; public HomePage(final PageParameters parameters) { // Add the simplest type of label final Label test = new Label(message, If you see this message wicket is properly configured and running); test.add(new AbstractAjaxTimerBehavior(Duration.seconds(1)) { @Override protected void onTimer(AjaxRequestTarget target) { Label t2 = new Label(message, Test + testCounter); test.replaceWith(t2); here you need to make : test = t2; testCounter++; target.addComponent(test); } }); add(test); } } Exception: Root cause: java.lang.IllegalStateException: No Page found for component [Component id = message] at org.apache.wicket.Component.getPage(Component.java:1754) at org.apache.wicket.RequestCycle.urlFor(RequestCycle.java:872) at org.apache.wicket.Component.urlFor(Component.java:3286) at org.apache.wicket.behavior.AbstractAjaxBehavior.getCallbackUrl(AbstractA jaxBehavior.java:124) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.getCallbackScript(Abstr actAjaxTimerBehavior.java:127) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.getJsTimeoutCall(Abstra ctAjaxTimerBehavior.java:120) at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.respond(AbstractAjaxTim erBehavior.java:163) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDef aultAjaxBehavior.java:299) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarge t.processEvents(BehaviorRequestTarget.java:119) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Ab stractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java :1250) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java
AW: Iterate over Pages in Pagemap
Well, i don't want a timer in the page. This causes unneeded checks. That's why I thought of the simplest solution. The basepage gets its navigation from session (which gets rebuild upon changes to stay up2date). Now I need a way to notify the page that navigation changed. So I implemented following method in basepage. ... public void refreshNavigation() { this.navigation.replaceWith(AuthenticatedWebSession.get().getNavi()); AjaxRequestTarget.get().addComponent(this.navigation); } ... Now all I have to do is call this method for each active page to refresh navigation (or am I wrong?). Can you tell me a bit more about reverse ajax? Greets Chris -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Dienstag, 10. November 2009 09:21 An: users@wicket.apache.org Betreff: Re: Iterate over Pages in Pagemap Why not make your pages consult some kind of service that builds the navigation? And then have some a timer that get back to the server and looks for a flag newEntriesAdded and then repaint part of the page via AJAX? Another possibility is get changes pushed to your pages using reverse AJAX, but this might be a bit trickier to implement... if you want to use this last approach, I think, there is a project at wicket-stuff that targets those use cases (I think is DOJO based?)... I have used plain DWR, in combination with Wicket, for implementing similar functionalities Cheers, Ernesto On Tue, Nov 10, 2009 at 8:54 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Hi all, how to iterate over latest version of all pages in pagemap? All my Pages have the ability to reload the navigation, but to accomplish this, I need to tell the page to reload the navigation. So my first idea was to iterate over latest version of all pages in pagemap and call the needed method on it. But Session#getPageMaps returns a list of IPageMap which doesn't offer an iterator. How can a accomplish this? Greets Chris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Iterate over Pages in Pagemap
So, your Application object will act as a factory of components? I wouldn't follow that approach myself. At most the application would contain the data for the navigation and then the navigation component will fetch that data and rebuild itself. Well, no. The session holds the navigation and triggers a method on it, so the navigation rebuilds itself. I need to hold it in session cause the available navigationentries depend on user roles. But your right with reverse ajax, I think I need it. Wicket is so Swing, so I totally forgot I'm working with a webapp :) I will read more about reverse ajax. Btw, cant find any wicketstuff-push svn or project description. Greets Chris -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Dienstag, 10. November 2009 09:54 An: users@wicket.apache.org Betreff: Re: Iterate over Pages in Pagemap Hi, On Tue, Nov 10, 2009 at 9:36 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Well, i don't want a timer in the page. This causes unneeded checks. That's why I thought of the simplest solution. The basepage gets its navigation from session (which gets rebuild upon changes to stay up2date). Now I need a way to notify the page that navigation changed. So I implemented following method in basepage. ... public void refreshNavigation() { this.navigation.replaceWith(AuthenticatedWebSession.get().getNavi()); AjaxRequestTarget.get().addComponent(this.navigation); } ... So, your Application object will act as a factory of components? I wouldn't follow that approach myself. At most the application would contain the data for the navigation and then the navigation component will fetch that data and rebuild itself. Now all I have to do is call this method for each active page to refresh navigation (or am I wrong?). Just one question? How would a remote page know that it has to reload itself? Do you plan to do that next time user get backs to the server with an AJAX request? If so, then you don't need anything else (I guess.) But if you want this to happen even if the user do not interact with the page. Then either you need a timer or use reverse AJAX. Can you tell me a bit more about reverse ajax? Just google for reverse AJAX, comet, server push, etc and you will have enough to read... Regards, Ernesto - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Iterate over Pages in Pagemap
I agree that i should be carefully. But, back to the timer, let's assume I have 16 versions of one page in pagemap and each of 16 versions has a timer. Then there are 16 timers polling information from server, well if there are only 16 versions of one page, the traffic is low, but if the page count increase I have much unneeded traffic. You know I mean? I will look at push but I hold timer in mind. Btw, do you come to London on 21.11 (Jweekend)? Greets Chris -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Dienstag, 10. November 2009 11:44 An: users@wicket.apache.org Betreff: Re: Iterate over Pages in Pagemap I haven't used wicketstuff-push myself so I can't be of much help there. I once had to implement some push functionality and I used DWR in combination with Wicket. Going the reverse AJAX can complicate things a lot (or so I believe). Thus, think carefully if what you want to achieve cannot be accomplished using other means. e.g. an AJAX timer that polls the server from time to time and if new navigation is available updates what you need to update (maybe asking the user if they want to do so;-). Regards, Ernesto On Tue, Nov 10, 2009 at 10:25 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: So, your Application object will act as a factory of components? I wouldn't follow that approach myself. At most the application would contain the data for the navigation and then the navigation component will fetch that data and rebuild itself. Well, no. The session holds the navigation and triggers a method on it, so the navigation rebuilds itself. I need to hold it in session cause the available navigationentries depend on user roles. But your right with reverse ajax, I think I need it. Wicket is so Swing, so I totally forgot I'm working with a webapp :) I will read more about reverse ajax. Btw, cant find any wicketstuff-push svn or project description. Greets Chris -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Dienstag, 10. November 2009 09:54 An: users@wicket.apache.org Betreff: Re: Iterate over Pages in Pagemap Hi, On Tue, Nov 10, 2009 at 9:36 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Well, i don't want a timer in the page. This causes unneeded checks. That's why I thought of the simplest solution. The basepage gets its navigation from session (which gets rebuild upon changes to stay up2date). Now I need a way to notify the page that navigation changed. So I implemented following method in basepage. ... public void refreshNavigation() { this.navigation.replaceWith(AuthenticatedWebSession.get().getNavi()); AjaxRequestTarget.get().addComponent(this.navigation); } ... So, your Application object will act as a factory of components? I wouldn't follow that approach myself. At most the application would contain the data for the navigation and then the navigation component will fetch that data and rebuild itself. Now all I have to do is call this method for each active page to refresh navigation (or am I wrong?). Just one question? How would a remote page know that it has to reload itself? Do you plan to do that next time user get backs to the server with an AJAX request? If so, then you don't need anything else (I guess.) But if you want this to happen even if the user do not interact with the page. Then either you need a timer or use reverse AJAX. Can you tell me a bit more about reverse ajax? Just google for reverse AJAX, comet, server push, etc and you will have enough to read... Regards, Ernesto - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Iterate over Pages in Pagemap
Hi all, how to iterate over latest version of all pages in pagemap? All my Pages have the ability to reload the navigation, but to accomplish this, I need to tell the page to reload the navigation. So my first idea was to iterate over latest version of all pages in pagemap and call the needed method on it. But Session#getPageMaps returns a list of IPageMap which doesn't offer an iterator. How can a accomplish this? Greets Chris
Get all active session objects
Hi all, how do I get all active session objects. I need the real session object cause i need to call a method on it. I already searched the mailing list but without success. Thanks in advance. Chris
Get all active session objects
Hi all, how do I get all active session objects. I need the real session object cause i need to call a method on it. I already searched the mailing list but without success. Thanks in advance. Chris
AW: Get all active session objects
And what about newSession and sessionDestroyed in AuthenticatedWebApplication? Isn't this equal to an Implementation of HttpSessionListener. -Ursprüngliche Nachricht- Von: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] Gesendet: Freitag, 6. November 2009 10:59 An: users@wicket.apache.org Betreff: Re: Get all active session objects And we have a memory leak... See HttpSessionListener instead... Martijn On Fri, Nov 6, 2009 at 10:55 AM, Pedro Santos pedros...@gmail.com wrote: CustomSession{ static List sessions; public CustomSession(){ sessions.add(this); } } On Fri, Nov 6, 2009 at 7:40 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Hi all, how do I get all active session objects. I need the real session object cause i need to call a method on it. I already searched the mailing list but without success. Thanks in advance. Chris -- Pedro Henrique Oliveira dos Santos -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: LinkTree
Hi, i did another way an that way worked. Replace markupContainer.add(new Label(DETAILS_PANEL_ID,label).setOutputMarkupId(true)); with private final Label labelToReplace = new Label(DETAILS_PANEL_ID,label).setOutputMarkupId(true); markupContainer.add(labelToReplace); ... And in onNodeLinkClicked create your panel and then do: labelToReplace.replaceWith(targetPanel); Hope this helps. -Ursprüngliche Nachricht- Von: jahid [mailto:ja...@outscore.se] Gesendet: Mittwoch, 4. November 2009 15:13 An: users@wicket.apache.org Betreff: Re: LinkTree Guys, thanks a lot for quick reply. I have changed my code according to your mentioned way, but seems like i am doing something wrong. Below are my code, markup and stacktrace - 1. private WebMarkupContainer markupContainer; 2. final String DETAILS_PANEL_ID =detailsPanel; 3. public ListContractsPage() { 4. markupContainer =new WebMarkupContainer(markupContainer); 5. markupContainer.setOutputMarkupId(true); 6. markupContainer.add(new Label(DETAILS_PANEL_ID,label).setOutputMarkupId(true)); 7. add(prepareTree()); 8. add(markupContainer); 9. } 10. private BaseTree prepareTree() { 11. DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(Contracts); 12. TreeModel treeModel = new DefaultTreeModel(rootNode); 13. assembleContracts(rootNode); 14. final LinkTree linkTree=new LinkTree(tree, treeModel){ 15. @Override 16. protected void onNodeLinkClicked(Object node, BaseTree tree, AjaxRequestTarget target) { 17. //markupContainer.remove(DETAILS_PANEL_ID); 18. Object userObject = ((DefaultMutableTreeNode) node).getUserObject(); 19. Panel targetPanel; 20. if (userObject instanceof ServiceHandle) { 21. targetPanel = new ServiceDetailsPanelServiceHandle(DETAILS_PANEL_ID, (ServiceHandle) userObject); 22. } else if (userObject instanceof ContractHandle) { 23. targetPanel = new ContractDetailsPanelContractHandle(DETAILS_PANEL_ID, (ContractHandle) userObject); 24. } else { 25. throw new AssertionError(Expected: master, sub or service handle, but found: + userObject.getClass().getSimpleName()); 26. } 27. targetPanel.setOutputMarkupId(true); 28. ListContractsPage.this.addOrReplace(targetPanel); 29. target.addComponent(targetPanel); 30. } 31. }; 32. linkTree.setOutputMarkupId(true); 33. linkTree.getTreeState().expandNode(rootNode); 34. return linkTree; 35. } 1. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 2. http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; 3. html xmlns=http://www.w3.org/1999/xhtml; 4. xmlns:wicket=http://wicket.apache.org/; xml:lang=en lang=en 5. body 6. wicket:extend 7. h4Contracts:/h4 8. table 9. tr 10. td 11. span wicket:id=tree[tree will be here]/span 12. /td 13. /tr 14. tr 15. td 16. span wicket:id=markupContainer 17. span wicket:id=detailsPanel/span 18. /span 19. /td 20. /tr 21. /table 22. /wicket:extend 23. /body 24. /html WicketMessage: Unable to find the markup for the component. That may be due to transparent containers or components implementing IComponentResolver: [MarkupContainer [Component id = detailsPanel]] Root cause: org.apache.wicket.WicketRuntimeException: Unable to find the markup for the component. That may be due to transparent containers or components implementing IComponentResolver: [MarkupContainer [Component id = detailsPanel]] at org.apache.wicket.MarkupFragmentFinder.find(MarkupFragmentFinder.java:125) at org.apache.wicket.Component.locateMarkupStream(Component.java:3820) at org.apache.wicket.Component.renderComponent(Component.java:2557) at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:793) at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:667) at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:579) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1249) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1320) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at
AW: OSGi Wicket
Thanks for all answers. I think OSGi is to much overhead for my needs. Joint fits more my needs, but includes unneeded overhead (for my project). I think I will implement my own mechanism with using a custom ClassResolver, cause I just need to search in new added jars (URLClassloader), Authorizationstrategy for security and a class the recursivly mounts a whole package on a given basepath which is extended with the package structur of the plugin (this structur includes a unique path so no collision will happen). But thanks anyway for ideas! Chris -Ursprüngliche Nachricht- Von: Ben Tilford [mailto:bentilf...@gmail.com] Gesendet: Montag, 2. November 2009 16:45 An: users@wicket.apache.org Betreff: Re: OSGi Wicket You might want to check out http://kenai.com/projects/joint the wicket example builds a menu system based of pages / links that are on the classpath which implement a Navigatable interface and have the @Navigation annotation. Still very early in development but it still might do what you need. On Mon, Nov 2, 2009 at 2:29 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Maybe OSGi ist o much overhead for my needs. I just want to be able to load WicketPages from a jar during runtime. Lets say i have a wicket app with just the wicketapplication and a homepage (extendable through plugins (jar)). Then during runtime i dropin a jar containing some Pages and i want wicket to be able to reach them. My idea is to to just add the jars to the classloader searchpath and let wicket do the rest. Is this a naive idea or whats the wicket way? Igor wrote (some time ago): what we have in wicket is a IClassResolver which we use to allow for pluggable class resolution. How can this pluggable resolution be accomplished? Greetz and thanks -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Sonntag, 1. November 2009 06:40 An: users@wicket.apache.org Betreff: Re: OSGi Wicket I do agree Eclipse buddy system in not proper OSGi, but it makes a lot easier to develop applications because 1- Your application, components, etc, will be same as in any normal Wicket application (no changes to are needed) 2- If you find out OSGi is not suitable at the end, you can always build the same application dropping OSGi and using the same (component) factory services. You will loose hot pluggability and that's it. I never hit serialization limitation myself. On the other hand, I do know from experience that integrating with certain application servers (using bridge approach) can be challenging. This is also something to take into account before deciding to use osgi. I think Igor is totally right about the things you should weight in deciding whether to use OSGi or not for a project. OSGi is a way to achieve pluggability but not the only one. Best, Ernesto On Sun, Nov 1, 2009 at 2:27 AM, David Leangen wic...@leangen.net wrote: If you do go with OSGi, you will have problems with classloaders and deserialization. To my knowledge, nobody has yet solved this (i.e. implemented a good solution) in a decent way. The Eclipse buddy system is not proper OSGi, IMO. pax-wicket does solve this problem (using proper OSGi), but I have never used their approach much even though I use the framework. Here is a post about this by me with some interesting comments from Igor: http://bioscene.blogspot.com/2009/03/serialization-in-osgi.html Good luck to you! =David On Nov 1, 2009, at 3:26 AM, Igor Vaynberg wrote: it is easy to create a pluggable application in wicket. all you need is a registry of component providers, whether it be something like spring [1], a custom registry like brix uses [2] or something more advanced like osgi. the choice should be based on the featureset you need. eg, if you need hot updating, classloader separation, etc, then osgi is good. if not, there are simpler ways to achieve modularity [1] [2]. the great news is that wicket lends itself easily to modularization. [1] http://wicketinaction.com/2008/10/creating-pluggable-applications-with-wicket-and-spring/ [2] http://code.google.com/p/brix-cms/source/browse/#svn/trunk/brix- core/src/main/java/brix/registry -igor 2009/10/29 Tomáš Mihok tomas.mi...@cnl.tuke.sk: Hello, I'm currently designing a new application. One of the requests is to make it modular. I found out that one of the possibilities to enable loading of modules while application is running is OSGi. Is there a tool/plugin/guide to accomplish this or are there any other possibilities of accomplishing same goal? Tom - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
mount recursive
Hi all, is it possible to mount a package recursivly? Let's assume following classes: com.test.pages.TestClass1 com.test.pages.TestClass2 com.test.pages.subpackage.TestClass3 com.test.pages.subpackage.TestClass4 now i'd like to do mount(/pages, PackageName.forClass(TestClass1.class)); to make all Pages under com.test.pages available under /pages/ and pages/subpackage. Kind regards. Chris
AW: OSGi Wicket
Maybe OSGi ist o much overhead for my needs. I just want to be able to load WicketPages from a jar during runtime. Lets say i have a wicket app with just the wicketapplication and a homepage (extendable through plugins (jar)). Then during runtime i dropin a jar containing some Pages and i want wicket to be able to reach them. My idea is to to just add the jars to the classloader searchpath and let wicket do the rest. Is this a naive idea or whats the wicket way? Igor wrote (some time ago): what we have in wicket is a IClassResolver which we use to allow for pluggable class resolution. How can this pluggable resolution be accomplished? Greetz and thanks -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Sonntag, 1. November 2009 06:40 An: users@wicket.apache.org Betreff: Re: OSGi Wicket I do agree Eclipse buddy system in not proper OSGi, but it makes a lot easier to develop applications because 1- Your application, components, etc, will be same as in any normal Wicket application (no changes to are needed) 2- If you find out OSGi is not suitable at the end, you can always build the same application dropping OSGi and using the same (component) factory services. You will loose hot pluggability and that's it. I never hit serialization limitation myself. On the other hand, I do know from experience that integrating with certain application servers (using bridge approach) can be challenging. This is also something to take into account before deciding to use osgi. I think Igor is totally right about the things you should weight in deciding whether to use OSGi or not for a project. OSGi is a way to achieve pluggability but not the only one. Best, Ernesto On Sun, Nov 1, 2009 at 2:27 AM, David Leangen wic...@leangen.net wrote: If you do go with OSGi, you will have problems with classloaders and deserialization. To my knowledge, nobody has yet solved this (i.e. implemented a good solution) in a decent way. The Eclipse buddy system is not proper OSGi, IMO. pax-wicket does solve this problem (using proper OSGi), but I have never used their approach much even though I use the framework. Here is a post about this by me with some interesting comments from Igor: http://bioscene.blogspot.com/2009/03/serialization-in-osgi.html Good luck to you! =David On Nov 1, 2009, at 3:26 AM, Igor Vaynberg wrote: it is easy to create a pluggable application in wicket. all you need is a registry of component providers, whether it be something like spring [1], a custom registry like brix uses [2] or something more advanced like osgi. the choice should be based on the featureset you need. eg, if you need hot updating, classloader separation, etc, then osgi is good. if not, there are simpler ways to achieve modularity [1] [2]. the great news is that wicket lends itself easily to modularization. [1] http://wicketinaction.com/2008/10/creating-pluggable-applications-with-wicket-and-spring/ [2] http://code.google.com/p/brix-cms/source/browse/#svn/trunk/brix- core/src/main/java/brix/registry -igor 2009/10/29 Tomáš Mihok tomas.mi...@cnl.tuke.sk: Hello, I'm currently designing a new application. One of the requests is to make it modular. I found out that one of the possibilities to enable loading of modules while application is running is OSGi. Is there a tool/plugin/guide to accomplish this or are there any other possibilities of accomplishing same goal? Tom - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: OSGi Wicket
Hi, i'm also interested in making a modular, during runtime extensible wicket appliaction. Meaning a Wicketapplication which can be extended by plugins during runtime. Can OSGi accomplish this? Could you please explain the wstarter a little bit more in detail. I only developed normal wicket web applications and the wstarter demo doesn't look clear to me. Regards, Chris -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Freitag, 30. Oktober 2009 06:22 An: users@wicket.apache.org Betreff: Re: OSGi Wicket If you don't mind tying yourself to equinox these two projects http://code.google.com/p/antilia/source/browse/#svn/com.antilia.wstarter http://code.google.com/p/antilia/source/browse/#svn/com.antilia.wstarter.demo might be of some help. The launcher inlcuded with the demo http://code.google.com/p/antilia/source/browse/com.antilia.wstarter.demo/wicket-app.launch Is for eclipse 3.4. If you are using 3.5 just tell me and I'll add one. Regards, Ernesto http://code.google.com/p/antilia/source/browse/#svn/com.antilia.wstarter 2009/10/30 Tomáš Mihok tomas.mi...@cnl.tuke.sk Hello, I'm currently designing a new application. One of the requests is to make it modular. I found out that one of the possibilities to enable loading of modules while application is running is OSGi. Is there a tool/plugin/guide to accomplish this or are there any other possibilities of accomplishing same goal? Tom - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: How to do Button onclick() and Input onchange()
Hi, case 1: if i'm not wrong you have to place a submit button inside a form otherwise this button doesn't work. Case 2: look at AjaxEventBehavior for on change Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com www.twitter.com/excelsis_info excelsisnet.blogspot.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Lester Chua [mailto:cicowic...@gmail.com] Gesendet: Donnerstag, 29. Oktober 2009 08:23 An: users@wicket.apache.org Betreff: How to do Button onclick() and Input onchange() Hi, I need some help in trying to get onclick() and onchange() working. Case 1: I'm trying to add an onclick behaviour to my button. Java: Button cancelButton = new Button(cancelButton) { @Override public void onSubmit() { System.out.println(Cancel Pressed); } }; add(cancelButton); Html: form wicket:id=form input type=submit value=Confirm /input input wicket:id=cancelButton type=button value=Cancel/input /form Problem is that when I click on the Cancel button, nothings happens. The Confirm button works as expected. Just that the cancel button does not seem to work at all. When I look at the source of the generated HTML, there is no onclick code generated. Is this expected? What am I doing wrong in this case? Case 2: What should I override when I want to do an onchange on an Input text box? Thanks in advance! Lester - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
wickstuff-dojo-1.1 maintainer
Hi all, who ist he actuall maintainer of wicketstuff-dojo-1.1 ? Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com mailto:christian.giamba...@excelsisnet.com www.excelsisnet.com http://www.excelsisnet.com/ www.twitter.com/excelsis_info http://www.twitter.com/excelsis_info excelsisnet.blogspot.com http://excelsisnet.blogspot.com/ Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf
AW: input filed mask
Look at http://wicket.apache.org/docs/1.4/org/apache/wicket/util/convert/package -summary.html. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: file download using ajaxLink
Updated http://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com www.twitter.com/excelsis_info Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Mittwoch, 21. Oktober 2009 09:40 An: users@wicket.apache.org Betreff: Re: file download using ajaxLink Maybe this might help http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html Ernesto On Tue, Oct 20, 2009 at 10:12 PM, tubin gen fachh...@gmail.com wrote: I do download in traditional way here is the code public void download(String filename, byte[] filedata){ setRedirect(false); WebResponse response = (WebResponse) getResponse(); response.setAttachmentHeader(filename); response.setLastModifiedTime(Time.now()); response.setContentType(application/octet-stream); response.write( new ByteArrayInputStream(filedata)); response.close(); } item.add(new LinkVoid(download){ { add(new Label(filename, eaAuditProgramAttachment.getFileName())); } @Override public void onClick() { ((BasePage)getPage()).download(eaAuditProgramAttachment.getFileName(), eaAuditProgramAttachment.getEaBlob().getBlobData()); } }); If I replace this link with AjaxLink it will not work and I must use an ajaxlinkplease tell me how can I use ajaxLink for download - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Send file to client via Ajax
Yes it would be usefull. But where does DocumentResourceListener came from? I'm using wicket 1.3.6 and DocumentResourceListener is not available. Thanks Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Dienstag, 6. Oktober 2009 09:54 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax Hi Cristian, I've got it working! Just place all the following files at the same package and you will get a working example (I tested them with FF35 and IE7). import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.model.AbstractReadOnlyModel; /** * @author Ernesto Reinaldo Barreiro (reier...@gmail.com) * */ public class TestPage extends WebPage{ private Label text; private String labelText = Hi!; private DocumentResourceListener documentResourceListener; /** * */ public TestPage() { AjaxLinkVoid link = new AjaxLinkVoid(link) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { TestPage.this.labelText = Hi! and donwload image!; if(target!= null) { target.addComponent(TestPage.this.text); String url = documentResourceListener.getURL().toString(); target.appendJavascript(;alert('Hi');window.location.href='+url+';); } } }; add(link); text = new Label(text, new AbstractReadOnlyModelString() { private static final long serialVersionUID = 1L; @Override public String getObject() { return TestPage.this.labelText; } }); text.setOutputMarkupId(true); add(text); documentResourceListener = new DocumentResourceListener(listener, new MyPdfResource()); add(documentResourceListener); } } --- !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns:wicket=org.apache.wicket head /head body a wicket:id=linkClick Me/a span wicket:id=text/span div wicket:id=listener/div /body /html - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import org.apache.wicket.markup.html.DynamicWebResource; import org.apache.wicket.protocol.http.WebResponse; /** * @author Ernesto Reinaldo Barreiro (reier...@gmail.com) * */ public class MyPdfResource extends DynamicWebResource { private static final long serialVersionUID = 1L; static int BUFFER_SIZE = 10*1024; /** * */ public MyPdfResource() { } /* (non-Javadoc) * @see org.apache.wicket.markup.html.DynamicWebResource#getResourceState() */ @Override protected ResourceState getResourceState() { return new ResourceState() { @Override public String getContentType() { return application/pdf; } @Override public byte[] getData() { try { return bytes(MyPdfResource.class.getResourceAsStream(jta-1_1-spec.pdf)); } catch (Exception e) { return null; } } }; } public static byte[] bytes(InputStream is) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); copy(is, out); return out.toByteArray(); } @Override protected void setHeaders(WebResponse response) { super.setHeaders(response); response.setAttachmentHeader(jta-1_1-spec.pdf); } public static void copy(InputStream is, OutputStream os) throws IOException { byte[] buf = new byte[BUFFER_SIZE]; while (true) { int tam = is.read(buf); if (tam == -1) { return; } os.write(buf, 0, tam); } } } Just replace jta-1_1-spec.pdf with your own PDF file on MyPdfResource and the exampel should work. An important bit here if @Override protected void setHeaders(WebResponse response) { response.setAttachmentHeader(jta-1_1-spec.pdf); } which makes the file to treated as an attachment instead of replacing the current page. Best, Ernesto P.S. Would it useful to add this to Wicket's wiki? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Send file to client via Ajax
Works like a charm. I think i've learned something about resource download via ajax. Thanks for hat. Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com www.twitter.com/excelsis_info Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Dienstag, 6. Oktober 2009 11:31 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax Just sent it on my last e-mail! Here it is again! import org.apache.wicket.IResourceListener; import org.apache.wicket.markup.html.WebMarkupContainer; /** * @author Ernesto Reinaldo Barreiro (reier...@gmail.com) * */ public class DocumentResourceListener extends WebMarkupContainer implements IResourceListener { private static final long serialVersionUID = 1L; private IResourceListener resourceListener; /** * Constructor receiving an IResourceListener.. * * @param id * @param resourceListener */ public DocumentResourceListener(final String id, IResourceListener resourceListener) { super(id); this.resourceListener = resourceListener; } /** * Gets the url to use for this link. * * @return The URL that this link links to */ protected CharSequence getURL() { return urlFor(IResourceListener.INTERFACE); } @Override protected boolean getStatelessHint() { return false; } public void onResourceRequested() { this.resourceListener.onResourceRequested(); } } This is just a trick to have component that generates file contents on the same page! I think you could used mounted resources as well, or just a dedicated servlet if you want to get file generation out of wicket! Best, Ernesto On Tue, Oct 6, 2009 at 11:24 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Yes it would be usefull. But where does DocumentResourceListener came from? I'm using wicket 1.3.6 and DocumentResourceListener is not available. Thanks Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Dienstag, 6. Oktober 2009 09:54 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax Hi Cristian, I've got it working! Just place all the following files at the same package and you will get a working example (I tested them with FF35 and IE7). import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.model.AbstractReadOnlyModel; /** * @author Ernesto Reinaldo Barreiro (reier...@gmail.com) * */ public class TestPage extends WebPage{ private Label text; private String labelText = Hi!; private DocumentResourceListener documentResourceListener; /** * */ public TestPage() { AjaxLinkVoid link = new AjaxLinkVoid(link) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { TestPage.this.labelText = Hi! and donwload image!; if(target!= null) { target.addComponent(TestPage.this.text); String url = documentResourceListener.getURL().toString(); target.appendJavascript(;alert('Hi');window.location.href='+url+';); } } }; add(link); text = new Label(text, new AbstractReadOnlyModelString() { private static final long serialVersionUID = 1L; @Override public String getObject() { return TestPage.this.labelText; } }); text.setOutputMarkupId(true); add(text); documentResourceListener = new DocumentResourceListener(listener, new MyPdfResource()); add(documentResourceListener); } } --- !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns:wicket=org.apache.wicket head /head body a wicket:id=linkClick Me/a span wicket:id=text/span div wicket:id=listener/div /body /html - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import org.apache.wicket.markup.html.DynamicWebResource; import org.apache.wicket.protocol.http.WebResponse; /** * @author Ernesto Reinaldo Barreiro (reier...@gmail.com) * */ public class MyPdfResource extends DynamicWebResource
AW: Send file to client via Ajax
Yes, please add it. Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com www.twitter.com/excelsis_info Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Dienstag, 6. Oktober 2009 11:48 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax Nice to hear it was of some help! I have learned a bit too while doing it:-) Cheers, Ernesto P.S. Shall I add this to a Wiki page?... when I find the time;-) On Tue, Oct 6, 2009 at 11:39 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Works like a charm. I think i've learned something about resource download via ajax. Thanks for hat. Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com www.twitter.com/excelsis_info Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Dienstag, 6. Oktober 2009 11:31 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax Just sent it on my last e-mail! Here it is again! import org.apache.wicket.IResourceListener; import org.apache.wicket.markup.html.WebMarkupContainer; /** * @author Ernesto Reinaldo Barreiro (reier...@gmail.com) * */ public class DocumentResourceListener extends WebMarkupContainer implements IResourceListener { private static final long serialVersionUID = 1L; private IResourceListener resourceListener; /** * Constructor receiving an IResourceListener.. * * @param id * @param resourceListener */ public DocumentResourceListener(final String id, IResourceListener resourceListener) { super(id); this.resourceListener = resourceListener; } /** * Gets the url to use for this link. * * @return The URL that this link links to */ protected CharSequence getURL() { return urlFor(IResourceListener.INTERFACE); } @Override protected boolean getStatelessHint() { return false; } public void onResourceRequested() { this.resourceListener.onResourceRequested(); } } This is just a trick to have component that generates file contents on the same page! I think you could used mounted resources as well, or just a dedicated servlet if you want to get file generation out of wicket! Best, Ernesto On Tue, Oct 6, 2009 at 11:24 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Yes it would be usefull. But where does DocumentResourceListener came from? I'm using wicket 1.3.6 and DocumentResourceListener is not available. Thanks Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Dienstag, 6. Oktober 2009 09:54 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax Hi Cristian, I've got it working! Just place all the following files at the same package and you will get a working example (I tested them with FF35 and IE7). import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.model.AbstractReadOnlyModel; /** * @author Ernesto Reinaldo Barreiro (reier...@gmail.com) * */ public class TestPage extends WebPage{ private Label text; private String labelText = Hi!; private DocumentResourceListener documentResourceListener; /** * */ public TestPage() { AjaxLinkVoid link = new AjaxLinkVoid(link) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { TestPage.this.labelText = Hi! and donwload image!; if(target!= null) { target.addComponent(TestPage.this.text); String url = documentResourceListener.getURL().toString(); target.appendJavascript(;alert('Hi');window.location.href='+url+';); } } }; add(link); text = new Label(text, new
AW: Send file to client via Ajax
By the way, i changed it a bit and now i repaint the link instead of repainting the label, so the label isn't needed. private final DocumentResourceListener documentResourceListener; private final MyPdfResource pdf; .. final AjaxFallbackLink link = new AjaxFallbackLink(componentId) { private static final long serialVersionUID = 8947164550163497764L; @Override public void onClick(final AjaxRequestTarget target) { if (target != null) { target.addComponent(this); } final BillItem item = (BillItem) model.getObject(); try { pdf.setAttachmentname(item.getBillNumber() + .pdf); pdf.setContent(PdfHelper.generatePdf(item)); final String url = BillDataviewPanel.this.documentResourceListener.getURL().toString(); target.appendJavascript(window.location.href=' + url + ';); } catch (final Exception e) { Logger.error(e); } } }; .. this.documentResourceListener = new DocumentResourceListener(listener, this.pdf); this.add(this.documentResourceListener); And i changed MyPdfResource tob e more flexible; public class MyPdfResource extends DynamicWebResource { private byte[] content = null; private String attachmentname = null; public String getAttachmentname() { return this.attachmentname; } @Override protected ResourceState getResourceState() { return new ResourceState() { @Override public String getContentType() { return application/pdf; } @Override public byte[] getData() { try { return MyPdfResource.this.content; } catch (final Exception e) { return null; } } }; } public void setAttachmentname(final String name) { this.attachmentname = name; } public void setContent(final byte[] content) { this.content = content; } @Override protected void setHeaders(final WebResponse response) { super.setHeaders(response); response.setAttachmentHeader(this.attachmentname); } } Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com www.twitter.com/excelsis_info Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Dienstag, 6. Oktober 2009 13:18 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax Done! http://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow http://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow Ernesto On Tue, Oct 6, 2009 at 12:15 PM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Yes, please add it. Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com www.twitter.com/excelsis_info Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Dienstag, 6. Oktober 2009 11:48 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax Nice to hear it was of some help! I have learned a bit too while doing it:-) Cheers, Ernesto P.S. Shall I add this to a Wiki page?... when I find the time;-) On Tue, Oct 6, 2009 at 11:39 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Works like a charm. I think i've learned something about resource download via ajax. Thanks for hat. Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com www.twitter.com/excelsis_info Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr
Send file to client via Ajax
Hi all, simple question :) how to send a dynamicly generated file (as byte array) through an ajaxfallbackbutton tot he client? Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf
AW: Send file to client via Ajax
It's more general question. Maybe i need to repaint some parts and send a file. Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Martin Grigorov [mailto:mcgreg...@e-card.bg] Gesendet: Montag, 5. Oktober 2009 15:56 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax why do you want to use AjaxFallbackButton ? you will not re-paint part of the page use ResourceLink to download the file El lun, 05-10-2009 a las 15:36 +0200, Giambalvo, Christian escribió: Hi all, simple question :) how to send a dynamicly generated file (as byte array) through an ajaxfallbackbutton tot he client? Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Send file to client via Ajax
Could you give me an example? Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Montag, 5. Oktober 2009 16:22 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax Maybe you could repaint via AJAX and then use target.appendJavascript(window.location.href=´URL´); Where the URL is the URL of an ILinkListener generating you file... There was someone asking something similar not long ago. Best, Ernesto On Mon, Oct 5, 2009 at 4:10 PM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: It's more general question. Maybe i need to repaint some parts and send a file. Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Martin Grigorov [mailto:mcgreg...@e-card.bg] Gesendet: Montag, 5. Oktober 2009 15:56 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax why do you want to use AjaxFallbackButton ? you will not re-paint part of the page use ResourceLink to download the file El lun, 05-10-2009 a las 15:36 +0200, Giambalvo, Christian escribió: Hi all, simple question :) how to send a dynamicly generated file (as byte array) through an ajaxfallbackbutton tot he client? Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Send file to client via Ajax
How do i get the url for the ILinkListener? There is no corresponding urlFor() method. Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] Gesendet: Montag, 5. Oktober 2009 16:22 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax Maybe you could repaint via AJAX and then use target.appendJavascript(window.location.href=´URL´); Where the URL is the URL of an ILinkListener generating you file... There was someone asking something similar not long ago. Best, Ernesto On Mon, Oct 5, 2009 at 4:10 PM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: It's more general question. Maybe i need to repaint some parts and send a file. Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Martin Grigorov [mailto:mcgreg...@e-card.bg] Gesendet: Montag, 5. Oktober 2009 15:56 An: users@wicket.apache.org Betreff: Re: Send file to client via Ajax why do you want to use AjaxFallbackButton ? you will not re-paint part of the page use ResourceLink to download the file El lun, 05-10-2009 a las 15:36 +0200, Giambalvo, Christian escribió: Hi all, simple question :) how to send a dynamicly generated file (as byte array) through an ajaxfallbackbutton tot he client? Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Date validation in a form
What about org.apache.wicket.validation.validator.PatternValidator Mit freundlichen Grüßen Christian Giambalvo -- Fachinformatiker für Anwendungsentwicklung EXCELSIS Informationssysteme GmbH Wilhelmsplatz 8 - 70182 Stuttgart Mobile +49 176 196 32 406 Office +49 711 6 20 30 406 christian.giamba...@excelsisnet.com www.excelsisnet.com Sitz Stuttgart Amtsgericht Stuttgart, HRB 21104 Geschäftsführer: Christian Sauter, Dr. Nils Herda, Frank Wolf -Ursprüngliche Nachricht- Von: Charles Moulliard [mailto:cmoulli...@gmail.com] Gesendet: Donnerstag, 24. September 2009 10:10 An: users@wicket.apache.org Betreff: Date validation in a form I would like to know How I can validate the string date inputted by a user in a textfield of my form ? e.g : The SimpleDateformat to be used to create a java Date is : dd/MM/ So I would like to check that the user has well introduced its date using this format Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
Hi all, ich have a component (textfield) with an FXValidationAjaxHandler. If i set this component in pageconstructor to visible(false) then the needed javascript code for validation is not contributed to pageheader. if set to visible(true) all is fine. does anyone had the same problem and if so, is there a workaround available? greets chris snippet: ... pComponent.add(new FXValidationAjaxHandler(pFXJavascriptEvent)); this.pComponent.setOutputMarkupPlaceholderTag(true); this.pComponent.setOutputMarkupId(true) this.pComponent.setVisible(false); // no javascript is added //this.pComponent.setVisible(true); // javascript is added form.add(this.pComponent); ... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
Hi, first thanks for reply. Well, it's not possible to add it to a visible component. Let me explain. I have 2 custom panels and depending on the selection in a dropdownchoice the corresponding panel gets visible or hidden. Because one of these panels need to be invisible on page construction (so not both are showing up) i need to set it invisible. If i then select it in the dropdownchoice i gets visible. And now the problem begins. Cause of the initial invisibility the needed javascript code for validation of the panel fields isn't injected. How can i workaround this? Thanks in advance chris -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mi 23.09.2009 19:20 An: users@wicket.apache.org Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor javascript contributions do not show up for components that are not visible, add it to a visible component instead. -igor On Wed, Sep 23, 2009 at 7:15 AM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Hi all, ich have a component (textfield) with an FXValidationAjaxHandler. If i set this component in pageconstructor to visible(false) then the needed javascript code for validation is not contributed to pageheader. if set to visible(true) all is fine. does anyone had the same problem and if so, is there a workaround available? greets chris snippet: ... pComponent.add(new FXValidationAjaxHandler(pFXJavascriptEvent)); this.pComponent.setOutputMarkupPlaceholderTag(true); this.pComponent.setOutputMarkupId(true) this.pComponent.setVisible(false); // no javascript is added //this.pComponent.setVisible(true); // javascript is added form.add(this.pComponent); ... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
i'm sorry, but doesn't work. i attached a simple project. i added the needed components to a webmarkupcontainer. instead of panels this time i used requiredtextfields to keep it as simple as possible. one textfield is visible the other invisible. here is the generated markup: ?xml version=1.0 encoding=UTF-8? html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd; head meta http-equiv=Content-Type content=text/html; charset=UTF-8/ titleWicket Demo/title link rel=stylesheet type=text/css href=/css/style.css/ 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 id=org.wicketstuff.dojo.AbstractDefaultDojoBehavior/debug!--/*--![CDATA[/*!--*/ var djConfig = {}; djConfig.isDebug = true; djConfig.parseWidgets = false; djConfig.searchIds = [] /*--]]*//script script type=text/javascript src=resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior/dojo-0.4/dojo.js/script script type=text/javascript src=resources/org.wicketstuff.dojo.AbstractRequireDojoBehavior/dojo-wicket/dojoWicket.js/script script type=text/javascript id=org.wicketstuff.dojo.AbstractDefaultDojoBehavior/namespaces/wicketstuff!--/*--![CDATA[/*!--*/ dojo.registerModulePath(wicketstuff, ../../../resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior); /*--]]*//script script type=text/javascript id=org.wicketstuff.dojo.AbstractDefaultDojoBehavior/consoleDebug!--/*--![CDATA[/*!--*/ dojo.require(dojo.debug.console); dojo.require(dojo.widget.Tree); /*--]]*//script script type=text/javascript id=org.wicketstuff.dojo.AbstractRequireDojoBehavior!--/*--![CDATA[/*!--*/ dojo.require(dojo.lfx.*); dojo.require(dojo.gfx.*); dojo.require(dojo.html.*); /*--]]*//script script type=text/javascript id=txt11DojoParse!--/*--![CDATA[/*!--*/ djConfig.searchIds.push(txt11); /*--]]*//script script language='JavaScript' type='text/javascript' var txt11_first = false; function txt11_validate(type) { with(dojo.byId('txt11').style){backgroundColor = '#FFF';} if (type=='valid'){ dojo.lfx.html.highlight('txt11', dojo.gfx.color.hex2rgb('#98c27d'), 200).play(0) dojo.lfx.html.unhighlight('txt11', dojo.gfx.color.hex2rgb('#98c27d'), 200).play(200) }else{ dojo.lfx.html.highlight('txt11', dojo.gfx.color.hex2rgb('#fc8682'), 200).play(0) ; dojo.lfx.html.unhighlight('txt11', dojo.gfx.color.hex2rgb('#fc8682'), 200).play(200) ; } } /script /head body span wicket:id=container input id=txt11 onblur=javascript:var wcall=wicketAjaxGet('?wicket:interface=:0:container:txt1::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=trueamp;container:txt1=' + this.value, function() { }, function() { });return !wcall; name=container:txt1 widgetId=txt11 value= type=text wicket:id=txt1/ input id=txt22 style=display:none/input /span /body /html -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Do 24.09.2009 00:06 An: users@wicket.apache.org Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor put the two panels into a parent container that is always visible. -igor On Wed, Sep 23, 2009 at 1:37 PM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Hi, first thanks for reply. Well, it's not possible to add it to a visible component. Let me explain. I have 2 custom panels and depending on the selection in a dropdownchoice the corresponding panel gets visible or hidden. Because one of these panels need to be invisible on page construction (so not both are showing up) i need to set it invisible. If i then select it in the dropdownchoice i gets visible. And now the problem begins. Cause of the initial invisibility the needed javascript code for validation of the panel fields isn't injected. How can i workaround this? Thanks in advance chris -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Mi 23.09.2009 19:20 An: users@wicket.apache.org Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor javascript contributions do not show up for components that are not visible, add it to a visible component instead. -igor On Wed, Sep 23, 2009 at 7
AW: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
well, it makes no sense to add the javascript to another container. how should i validate the textfields if the javascript points to a different component? or could you give me an example? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Do 24.09.2009 02:32 An: users@wicket.apache.org Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor i meant add the javascript to a container that is visible. components that are not visible do not render their javascript, it wouldnt make any sense for them to do otherwise. -igor On Wed, Sep 23, 2009 at 5:16 PM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: i'm sorry, but doesn't work. i attached a simple project. i added the needed components to a webmarkupcontainer. instead of panels this time i used requiredtextfields to keep it as simple as possible. one textfield is visible the other invisible. here is the generated markup: ?xml version=1.0 encoding=UTF-8? html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd; head meta http-equiv=Content-Type content=text/html; charset=UTF-8/ titleWicket Demo/title link rel=stylesheet type=text/css href=/css/style.css/ 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 id=org.wicketstuff.dojo.AbstractDefaultDojoBehavior/debug!--/*--![CDATA[/*!--*/ var djConfig = {}; djConfig.isDebug = true; djConfig.parseWidgets = false; djConfig.searchIds = [] /*--]]*//script script type=text/javascript src=resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior/dojo-0.4/dojo.js/script script type=text/javascript src=resources/org.wicketstuff.dojo.AbstractRequireDojoBehavior/dojo-wicket/dojoWicket.js/script script type=text/javascript id=org.wicketstuff.dojo.AbstractDefaultDojoBehavior/namespaces/wicketstuff!--/*--![CDATA[/*!--*/ dojo.registerModulePath(wicketstuff, ../../../resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior); /*--]]*//script script type=text/javascript id=org.wicketstuff.dojo.AbstractDefaultDojoBehavior/consoleDebug!--/*--![CDATA[/*!--*/ dojo.require(dojo.debug.console); dojo.require(dojo.widget.Tree); /*--]]*//script script type=text/javascript id=org.wicketstuff.dojo.AbstractRequireDojoBehavior!--/*--![CDATA[/*!--*/ dojo.require(dojo.lfx.*); dojo.require(dojo.gfx.*); dojo.require(dojo.html.*); /*--]]*//script script type=text/javascript id=txt11DojoParse!--/*--![CDATA[/*!--*/ djConfig.searchIds.push(txt11); /*--]]*//script script language='JavaScript' type='text/javascript' var txt11_first = false; function txt11_validate(type) { with(dojo.byId('txt11').style){backgroundColor = '#FFF';} if (type=='valid'){ dojo.lfx.html.highlight('txt11', dojo.gfx.color.hex2rgb('#98c27d'), 200).play(0) dojo.lfx.html.unhighlight('txt11', dojo.gfx.color.hex2rgb('#98c27d'), 200).play(200) }else{ dojo.lfx.html.highlight('txt11', dojo.gfx.color.hex2rgb('#fc8682'), 200).play(0) ; dojo.lfx.html.unhighlight('txt11', dojo.gfx.color.hex2rgb('#fc8682'), 200).play(200) ; } } /script /head body span wicket:id=container input id=txt11 onblur=javascript:var wcall=wicketAjaxGet('?wicket:interface=:0:container:txt1::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=trueamp;container:txt1=' + this.value, function() { }, function() { });return !wcall; name=container:txt1 widgetId=txt11 value= type=text wicket:id=txt1/ input id=txt22 style=display:none/input /span /body /html -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Do 24.09.2009 00:06 An: users@wicket.apache.org Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor put the two panels into a parent container that is always visible. -igor On Wed, Sep 23, 2009 at 1:37 PM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: Hi, first thanks for reply. Well, it's not possible to add it to a visible component. Let me explain. I have 2 custom panels and depending on the selection in a dropdownchoice the corresponding panel gets visible or hidden. Because
AW: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor
maybe i'm to stupid to understand what you mean. so please provide an example. thx -Ursprüngliche Nachricht- Von: Giambalvo, Christian [mailto:christian.giamba...@excelsisnet.com] Gesendet: Do 24.09.2009 02:45 An: users@wicket.apache.org Betreff: AW: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor well, it makes no sense to add the javascript to another container. how should i validate the textfields if the javascript points to a different component? or could you give me an example? -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Do 24.09.2009 02:32 An: users@wicket.apache.org Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor i meant add the javascript to a container that is visible. components that are not visible do not render their javascript, it wouldnt make any sense for them to do otherwise. -igor On Wed, Sep 23, 2009 at 5:16 PM, Giambalvo, Christian christian.giamba...@excelsisnet.com wrote: i'm sorry, but doesn't work. i attached a simple project. i added the needed components to a webmarkupcontainer. instead of panels this time i used requiredtextfields to keep it as simple as possible. one textfield is visible the other invisible. here is the generated markup: ?xml version=1.0 encoding=UTF-8? html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd; head meta http-equiv=Content-Type content=text/html; charset=UTF-8/ titleWicket Demo/title link rel=stylesheet type=text/css href=/css/style.css/ 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 id=org.wicketstuff.dojo.AbstractDefaultDojoBehavior/debug!--/*--![CDATA[/*!--*/ var djConfig = {}; djConfig.isDebug = true; djConfig.parseWidgets = false; djConfig.searchIds = [] /*--]]*//script script type=text/javascript src=resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior/dojo-0.4/dojo.js/script script type=text/javascript src=resources/org.wicketstuff.dojo.AbstractRequireDojoBehavior/dojo-wicket/dojoWicket.js/script script type=text/javascript id=org.wicketstuff.dojo.AbstractDefaultDojoBehavior/namespaces/wicketstuff!--/*--![CDATA[/*!--*/ dojo.registerModulePath(wicketstuff, ../../../resources/org.wicketstuff.dojo.AbstractDefaultDojoBehavior); /*--]]*//script script type=text/javascript id=org.wicketstuff.dojo.AbstractDefaultDojoBehavior/consoleDebug!--/*--![CDATA[/*!--*/ dojo.require(dojo.debug.console); dojo.require(dojo.widget.Tree); /*--]]*//script script type=text/javascript id=org.wicketstuff.dojo.AbstractRequireDojoBehavior!--/*--![CDATA[/*!--*/ dojo.require(dojo.lfx.*); dojo.require(dojo.gfx.*); dojo.require(dojo.html.*); /*--]]*//script script type=text/javascript id=txt11DojoParse!--/*--![CDATA[/*!--*/ djConfig.searchIds.push(txt11); /*--]]*//script script language='JavaScript' type='text/javascript' var txt11_first = false; function txt11_validate(type) { with(dojo.byId('txt11').style){backgroundColor = '#FFF';} if (type=='valid'){ dojo.lfx.html.highlight('txt11', dojo.gfx.color.hex2rgb('#98c27d'), 200).play(0) dojo.lfx.html.unhighlight('txt11', dojo.gfx.color.hex2rgb('#98c27d'), 200).play(200) }else{ dojo.lfx.html.highlight('txt11', dojo.gfx.color.hex2rgb('#fc8682'), 200).play(0) ; dojo.lfx.html.unhighlight('txt11', dojo.gfx.color.hex2rgb('#fc8682'), 200).play(200) ; } } /script /head body span wicket:id=container input id=txt11 onblur=javascript:var wcall=wicketAjaxGet('?wicket:interface=:0:container:txt1::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=trueamp;container:txt1=' + this.value, function() { }, function() { });return !wcall; name=container:txt1 widgetId=txt11 value= type=text wicket:id=txt1/ input id=txt22 style=display:none/input /span /body /html -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Do 24.09.2009 00:06 An: users@wicket.apache.org Betreff: Re: FXValidationAjaxHandler - Javascript not added if component is set visible(false) in page constructor put the two panels into a parent container