Embedding a Wicket Page inside a DIV
I have a page built in SpringMVC. I have a iFrame in this page that loads a Wicket Page. I want to replace the iFrame with a DIV and load the Wicket page inside the DIV using Ajax. I used Prototype to load the wicket page. The page loads but the wicket javascript does not work anymore. I guess this is because the tag from the wicket response is not processed. I then tried Wicket Ajax, but the call returns a SendRedirect. I guess we cannot load wicket Pages using Wicket Ajax. How do I get this to work ? Thanks Avinash P
Re: "at least one"-validation?
Thank you, Vineet. That worked so much better than my attempt. But I still don't quite understand why... :-[ Anyway, now I get a nice error message when I expect one, and none when I don't. :) /Stefan On 2009-08-25 21:02, vineet semwal wrote: what is attribute search panel and how are you actually creating the list of form components? following is the easiest way .. 1. create a list of formcomponent say a arraylist 2)in popolulate method of your listview,add the textfields or any other fc to list. so by the end of method you have a list of form components. 3)in your custom validator ,you can simply return list.toArray(new FormComponent[list.size()]) and do validations/checking for formcomponents in validate method. and finally clear the list at appropiate time .. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
FileUploadField bug in Chrome with ajax?
I haven't confirmed this is really a bug yet, but it looks like there may be a problem using Ajax form submit with FileUploadField in Chrome. I'm using Wicket 1.4.1. Using an ajaxbutton submitted form, I get this error in wicket-ajax-debug: ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could not find root element If i take the FileUploadField out of my form, it works fine. Add it back, it fails. The form works fine in FF with or without the FileUploadField. Is anyone else experiencing this? Tauren - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Quick model/user/session question
Good point. Now that I've switched to c3p0, I'm getting more debug info, i.e.: DEBUG - BasicResourcePool - [managed: 3, unused: 1, excluded: 0] DEBUG - BasicResourcePool - [managed: 3, unused: 0, excluded: 0] DEBUG - BasicResourcePool - [managed: 4, unused: 1, excluded: 0] DEBUG - BasicResourcePool - [managed: 4, unused: 0, excluded: 0] ... DEBUG - BasicResourcePool - [managed: 15, unused: 0, excluded: 0] DEBUG - BasicResourcePool - acquire test -- pool is already maxed out. [managed: 15; max: 15] It turns out that the problem has nothing to do with clicking really fast. After 15 clicks on any of the links in the app, it will freeze. I'm using wicket-auth for security, so the EntityModel is inflating the UserInfo object on every page to check for permissions, and the connections are not being released. This was not an issue before I moved my UserInfo into the detachable EntityModel. I'll do some more research. Dane On Tue, Aug 25, 2009 at 3:34 PM, Edward Zarecor wrote: > There's no connection pool size defined. Is the default pool size for dbcp > 1? > > Ed. > > On Aug 25, 2009 5:29 PM, "Dane Laverty" wrote: > > I'm using dbcp, as per below. I'll try switching over to c3p0 and see if > that helps. > >class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> > > > > > > > > On Tue, Aug 25, 2009 at 2:25 PM, Martijn Dashorst < > > martijn.dasho...@gmail.com> wrote: > Do you use a connection pool? e.g. > datasource definition in yo... >
Re: Quick model/user/session question
There's no connection pool size defined. Is the default pool size for dbcp 1? Ed. On Aug 25, 2009 5:29 PM, "Dane Laverty" wrote: I'm using dbcp, as per below. I'll try switching over to c3p0 and see if that helps. On Tue, Aug 25, 2009 at 2:25 PM, Martijn Dashorst < martijn.dasho...@gmail.com> wrote: > Do you use a connection pool? e.g. datasource definition in yo...
Re: Quick model/user/session question
I'm using dbcp, as per below. I'll try switching over to c3p0 and see if that helps. On Tue, Aug 25, 2009 at 2:25 PM, Martijn Dashorst < martijn.dasho...@gmail.com> wrote: > Do you use a connection pool? e.g. datasource definition in your > container, dbcp or c3p0? If not, use one. > > Martijn > > On Tue, Aug 25, 2009 at 11:10 PM, Dane Laverty > wrote: > > I think I've discovered the source of the problem, but not the solution. > On > > a normal page request, the console output says: > > > > DEBUG - log- REQUEST /post-job on > > org.mortbay.jetty.httpconnect...@1b9db06 ... > > DEBUG - ConnectionManager - opening JDBC connection > > DEBUG - SQL- select > > jobcategor0_.job_category_id... > > > > And everything goes normally from there. But on double-clicking the link, > > the console says: > > > > DEBUG - log- REQUEST /post-job on > > org.mortbay.jetty.httpconnect...@1b9db06 ... > > DEBUG - ConnectionManager - opening JDBC connection > > DEBUG - log- REQUEST /post-job on > > org.mortbay.jetty.httpconnect...@a78af0 ... > > DEBUG - ConnectionManager - opening JDBC connection > > > > And then the application freezes. Apparently it is trying to open a > second > > JDBC connection before the first one closed, and something doesn't like > > that. I'm not sure where to start looking to solve this -- any > suggestions? > > > > thanks again, > > > > Dane > > > > > > > > On Tue, Aug 25, 2009 at 1:22 PM, Dane Laverty > wrote: > > > >> Progress is being made. Thanks again for your suggestion, Martijn. I > >> discovered this thread ( > >> > http://www.nabble.com/Storing-user-entity-in-session--td22113666.html#a22113666) > where you discussed putting the user in the RequestCycle in some more > >> detail. That helped me rebuild my RequestCycle [1]. > >> > >> The new RequestCycle solved the LazyInitializationException, but created > a > >> new problem. The application runs fine, but if I click a link twice in > rapid > >> succession, the application hangs for all users until I restart the > server. > >> This is kind of a major problem :) I've pasted the server output below > [2]. > >> The console stops on the line "DEBUG - ConnectionManager - opening JDBC > >> connection" for a couple minutes, then throws the > "java.net.SocketException: > >> Connection reset" stack trace. > >> > >> Googling "java.net.SocketException: Connection reset" shows that the > error > >> is connected to a wide array of issues. Has anyone here run into the > problem > >> before? And if so, how did you solve it? > >> > >> thanks, > >> > >> Dane > >> > >> --- > >> > >> [1] - public class WicketRequestCycle extends WebRequestCycle implements > >> Serializable { > >> > >> EntityModel userInfoModel; > >> ... > >> public UserInfo getUserInfo() { > >> if (userInfoModel != null) return userInfoModel.getObject(); > >> UserInfo userInfo = WicketSession.get().generateUserInfo(); > >> if (userInfo == null) return null; > >> userInfoModel = new EntityModel(userInfo); > >> return userInfoModel.getObject(); > >> } > >> > >> @Override > >> public void detach() { > >> super.detach(); > >> if (userInfoModel != null) > >> userInfoModel.detach(); > >> } > >> } > >> > >> > >> [2] - TRACE - SessionImpl- closing session > >> TRACE - ConnectionManager - connection already null in cleanup > : > >> no action > >> DEBUG - log- RESPONSE /images/lotus.png 200 > >> DEBUG - log- REQUEST /login on > >> org.mortbay.jetty.httpconnect...@7d0f44 > >> DEBUG - log- Got Session ID 1haooq2s24av1 from > >> cookie > >> DEBUG - log- > >> sessionmanager=org.mortbay.jetty.servlet.hashsessionmana...@3411a > >> DEBUG - log- > >> > session=org.mortbay.jetty.servlet.HashSessionManager$Session:1haooq2s24...@18296160 > >> DEBUG - log- servlet=default > >> DEBUG - log- > >> chain=open.hibernate.session.in.view->wicket.careerconnect->default > >> DEBUG - log- servelet holder=default > >> DEBUG - log- call filter > >> open.hibernate.session.in.view > >> DEBUG - OpenSessionInViewFilter- Using SessionFactory > 'sessionFactory' > >> for OpenSessionInViewFilter > >> DEBUG - DefaultListableBeanFactory - Returning cached instance of > singleton > >> bean 'sessionFactory' > >> DEBUG - OpenSessionInViewFilter- Opening single Hibernate Session in > >> OpenSessionInViewFilter > >> DEBUG - SessionFactoryUtils- Opening Hibernate Session > >> DEBUG - SessionImpl- opened session at timestamp: > >> 5125043523203072 > >> TRACE - SessionImpl- setting
Re: Quick model/user/session question
Do you use a connection pool? e.g. datasource definition in your container, dbcp or c3p0? If not, use one. Martijn On Tue, Aug 25, 2009 at 11:10 PM, Dane Laverty wrote: > I think I've discovered the source of the problem, but not the solution. On > a normal page request, the console output says: > > DEBUG - log - REQUEST /post-job on > org.mortbay.jetty.httpconnect...@1b9db06 ... > DEBUG - ConnectionManager - opening JDBC connection > DEBUG - SQL - select > jobcategor0_.job_category_id... > > And everything goes normally from there. But on double-clicking the link, > the console says: > > DEBUG - log - REQUEST /post-job on > org.mortbay.jetty.httpconnect...@1b9db06 ... > DEBUG - ConnectionManager - opening JDBC connection > DEBUG - log - REQUEST /post-job on > org.mortbay.jetty.httpconnect...@a78af0 ... > DEBUG - ConnectionManager - opening JDBC connection > > And then the application freezes. Apparently it is trying to open a second > JDBC connection before the first one closed, and something doesn't like > that. I'm not sure where to start looking to solve this -- any suggestions? > > thanks again, > > Dane > > > > On Tue, Aug 25, 2009 at 1:22 PM, Dane Laverty wrote: > >> Progress is being made. Thanks again for your suggestion, Martijn. I >> discovered this thread ( >> http://www.nabble.com/Storing-user-entity-in-session--td22113666.html#a22113666) >> where you discussed putting the user in the RequestCycle in some more >> detail. That helped me rebuild my RequestCycle [1]. >> >> The new RequestCycle solved the LazyInitializationException, but created a >> new problem. The application runs fine, but if I click a link twice in rapid >> succession, the application hangs for all users until I restart the server. >> This is kind of a major problem :) I've pasted the server output below [2]. >> The console stops on the line "DEBUG - ConnectionManager - opening JDBC >> connection" for a couple minutes, then throws the "java.net.SocketException: >> Connection reset" stack trace. >> >> Googling "java.net.SocketException: Connection reset" shows that the error >> is connected to a wide array of issues. Has anyone here run into the problem >> before? And if so, how did you solve it? >> >> thanks, >> >> Dane >> >> --- >> >> [1] - public class WicketRequestCycle extends WebRequestCycle implements >> Serializable { >> >> EntityModel userInfoModel; >> ... >> public UserInfo getUserInfo() { >> if (userInfoModel != null) return userInfoModel.getObject(); >> UserInfo userInfo = WicketSession.get().generateUserInfo(); >> if (userInfo == null) return null; >> userInfoModel = new EntityModel(userInfo); >> return userInfoModel.getObject(); >> } >> >> @Override >> public void detach() { >> super.detach(); >> if (userInfoModel != null) >> userInfoModel.detach(); >> } >> } >> >> >> [2] - TRACE - SessionImpl - closing session >> TRACE - ConnectionManager - connection already null in cleanup : >> no action >> DEBUG - log - RESPONSE /images/lotus.png 200 >> DEBUG - log - REQUEST /login on >> org.mortbay.jetty.httpconnect...@7d0f44 >> DEBUG - log - Got Session ID 1haooq2s24av1 from >> cookie >> DEBUG - log - >> sessionmanager=org.mortbay.jetty.servlet.hashsessionmana...@3411a >> DEBUG - log - >> session=org.mortbay.jetty.servlet.HashSessionManager$Session:1haooq2s24...@18296160 >> DEBUG - log - servlet=default >> DEBUG - log - >> chain=open.hibernate.session.in.view->wicket.careerconnect->default >> DEBUG - log - servelet holder=default >> DEBUG - log - call filter >> open.hibernate.session.in.view >> DEBUG - OpenSessionInViewFilter - Using SessionFactory 'sessionFactory' >> for OpenSessionInViewFilter >> DEBUG - DefaultListableBeanFactory - Returning cached instance of singleton >> bean 'sessionFactory' >> DEBUG - OpenSessionInViewFilter - Opening single Hibernate Session in >> OpenSessionInViewFilter >> DEBUG - SessionFactoryUtils - Opening Hibernate Session >> DEBUG - SessionImpl - opened session at timestamp: >> 5125043523203072 >> TRACE - SessionImpl - setting flush mode to: NEVER >> DEBUG - tionSynchronizationManager - Bound value >> [org.springframework.orm.hibernate3.sessionhol...@117a49c] for key >> [org.hibernate.impl.sessionfactoryi...@737f58] to thread [btpool0-4 - >> /login;jsessionid=1haooq2s24av1?wicket:interface=:0:loginForm::IFormSubmitListener::] >> DEBUG - log - call filter wicket.careerconnect >> DEBUG - SessionFactoryUtils - Opening Hibernate Session >> DEBUG - SessionImpl
Re: Quick model/user/session question
I think I've discovered the source of the problem, but not the solution. On a normal page request, the console output says: DEBUG - log- REQUEST /post-job on org.mortbay.jetty.httpconnect...@1b9db06 ... DEBUG - ConnectionManager - opening JDBC connection DEBUG - SQL- select jobcategor0_.job_category_id... And everything goes normally from there. But on double-clicking the link, the console says: DEBUG - log- REQUEST /post-job on org.mortbay.jetty.httpconnect...@1b9db06 ... DEBUG - ConnectionManager - opening JDBC connection DEBUG - log- REQUEST /post-job on org.mortbay.jetty.httpconnect...@a78af0 ... DEBUG - ConnectionManager - opening JDBC connection And then the application freezes. Apparently it is trying to open a second JDBC connection before the first one closed, and something doesn't like that. I'm not sure where to start looking to solve this -- any suggestions? thanks again, Dane On Tue, Aug 25, 2009 at 1:22 PM, Dane Laverty wrote: > Progress is being made. Thanks again for your suggestion, Martijn. I > discovered this thread ( > http://www.nabble.com/Storing-user-entity-in-session--td22113666.html#a22113666) > where you discussed putting the user in the RequestCycle in some more > detail. That helped me rebuild my RequestCycle [1]. > > The new RequestCycle solved the LazyInitializationException, but created a > new problem. The application runs fine, but if I click a link twice in rapid > succession, the application hangs for all users until I restart the server. > This is kind of a major problem :) I've pasted the server output below [2]. > The console stops on the line "DEBUG - ConnectionManager - opening JDBC > connection" for a couple minutes, then throws the "java.net.SocketException: > Connection reset" stack trace. > > Googling "java.net.SocketException: Connection reset" shows that the error > is connected to a wide array of issues. Has anyone here run into the problem > before? And if so, how did you solve it? > > thanks, > > Dane > > --- > > [1] - public class WicketRequestCycle extends WebRequestCycle implements > Serializable { > > EntityModel userInfoModel; > ... > public UserInfo getUserInfo() { > if (userInfoModel != null) return userInfoModel.getObject(); > UserInfo userInfo = WicketSession.get().generateUserInfo(); > if (userInfo == null) return null; > userInfoModel = new EntityModel(userInfo); > return userInfoModel.getObject(); > } > > @Override > public void detach() { > super.detach(); > if (userInfoModel != null) > userInfoModel.detach(); > } > } > > > [2] - TRACE - SessionImpl- closing session > TRACE - ConnectionManager - connection already null in cleanup : > no action > DEBUG - log- RESPONSE /images/lotus.png 200 > DEBUG - log- REQUEST /login on > org.mortbay.jetty.httpconnect...@7d0f44 > DEBUG - log- Got Session ID 1haooq2s24av1 from > cookie > DEBUG - log- > sessionmanager=org.mortbay.jetty.servlet.hashsessionmana...@3411a > DEBUG - log- > session=org.mortbay.jetty.servlet.HashSessionManager$Session:1haooq2s24...@18296160 > DEBUG - log- servlet=default > DEBUG - log- > chain=open.hibernate.session.in.view->wicket.careerconnect->default > DEBUG - log- servelet holder=default > DEBUG - log- call filter > open.hibernate.session.in.view > DEBUG - OpenSessionInViewFilter- Using SessionFactory 'sessionFactory' > for OpenSessionInViewFilter > DEBUG - DefaultListableBeanFactory - Returning cached instance of singleton > bean 'sessionFactory' > DEBUG - OpenSessionInViewFilter- Opening single Hibernate Session in > OpenSessionInViewFilter > DEBUG - SessionFactoryUtils- Opening Hibernate Session > DEBUG - SessionImpl- opened session at timestamp: > 5125043523203072 > TRACE - SessionImpl- setting flush mode to: NEVER > DEBUG - tionSynchronizationManager - Bound value > [org.springframework.orm.hibernate3.sessionhol...@117a49c] for key > [org.hibernate.impl.sessionfactoryi...@737f58] to thread [btpool0-4 - > /login;jsessionid=1haooq2s24av1?wicket:interface=:0:loginForm::IFormSubmitListener::] > DEBUG - log- call filter wicket.careerconnect > DEBUG - SessionFactoryUtils- Opening Hibernate Session > DEBUG - SessionImpl- opened session at timestamp: > 5125043523203073 > TRACE - QueryPlanCache - located HQL query plan in cache ( > select employerInfo from EmployerInfo as employerInfo inner join > employerInfo.contactPoints as contactPoints where contactPoints.contactInfo > = ? and emplo
Re: Quick model/user/session question
Progress is being made. Thanks again for your suggestion, Martijn. I discovered this thread ( http://www.nabble.com/Storing-user-entity-in-session--td22113666.html#a22113666) where you discussed putting the user in the RequestCycle in some more detail. That helped me rebuild my RequestCycle [1]. The new RequestCycle solved the LazyInitializationException, but created a new problem. The application runs fine, but if I click a link twice in rapid succession, the application hangs for all users until I restart the server. This is kind of a major problem :) I've pasted the server output below [2]. The console stops on the line "DEBUG - ConnectionManager - opening JDBC connection" for a couple minutes, then throws the "java.net.SocketException: Connection reset" stack trace. Googling "java.net.SocketException: Connection reset" shows that the error is connected to a wide array of issues. Has anyone here run into the problem before? And if so, how did you solve it? thanks, Dane --- [1] - public class WicketRequestCycle extends WebRequestCycle implements Serializable { EntityModel userInfoModel; ... public UserInfo getUserInfo() { if (userInfoModel != null) return userInfoModel.getObject(); UserInfo userInfo = WicketSession.get().generateUserInfo(); if (userInfo == null) return null; userInfoModel = new EntityModel(userInfo); return userInfoModel.getObject(); } @Override public void detach() { super.detach(); if (userInfoModel != null) userInfoModel.detach(); } } [2] - TRACE - SessionImpl- closing session TRACE - ConnectionManager - connection already null in cleanup : no action DEBUG - log- RESPONSE /images/lotus.png 200 DEBUG - log- REQUEST /login on org.mortbay.jetty.httpconnect...@7d0f44 DEBUG - log- Got Session ID 1haooq2s24av1 from cookie DEBUG - log- sessionmanager=org.mortbay.jetty.servlet.hashsessionmana...@3411a DEBUG - log- session=org.mortbay.jetty.servlet.HashSessionManager$Session:1haooq2s24...@18296160 DEBUG - log- servlet=default DEBUG - log- chain=open.hibernate.session.in.view->wicket.careerconnect->default DEBUG - log- servelet holder=default DEBUG - log- call filter open.hibernate.session.in.view DEBUG - OpenSessionInViewFilter- Using SessionFactory 'sessionFactory' for OpenSessionInViewFilter DEBUG - DefaultListableBeanFactory - Returning cached instance of singleton bean 'sessionFactory' DEBUG - OpenSessionInViewFilter- Opening single Hibernate Session in OpenSessionInViewFilter DEBUG - SessionFactoryUtils- Opening Hibernate Session DEBUG - SessionImpl- opened session at timestamp: 5125043523203072 TRACE - SessionImpl- setting flush mode to: NEVER DEBUG - tionSynchronizationManager - Bound value [org.springframework.orm.hibernate3.sessionhol...@117a49c] for key [org.hibernate.impl.sessionfactoryi...@737f58] to thread [btpool0-4 - /login;jsessionid=1haooq2s24av1?wicket:interface=:0:loginForm::IFormSubmitListener::] DEBUG - log- call filter wicket.careerconnect DEBUG - SessionFactoryUtils- Opening Hibernate Session DEBUG - SessionImpl- opened session at timestamp: 5125043523203073 TRACE - QueryPlanCache - located HQL query plan in cache ( select employerInfo from EmployerInfo as employerInfo inner join employerInfo.contactPoints as contactPoints where contactPoints.contactInfo = ? and employerInfo.password = md5_digest(?)) TRACE - QueryPlanCache - located HQL query plan in cache ( select employerInfo from EmployerInfo as employerInfo inner join employerInfo.contactPoints as contactPoints where contactPoints.contactInfo = ? and employerInfo.password = md5_digest(?)) TRACE - HQLQueryPlan - find: select employerInfo from EmployerInfo as employerInfo inner join employerInfo.contactPoints as contactPoints where contactPoints.contactInfo = ? and employerInfo.password = md5_digest(?) TRACE - QueryParameters- parameters: [dane, asdf] TRACE - QueryParameters- named parameters: {} DEBUG - AbstractBatcher- about to open PreparedStatement (open PreparedStatements: 0, globally: 4) DEBUG - ConnectionManager - opening JDBC connection DEBUG - log- EXCEPTION java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at org.mortbay.io.ByteArrayBuffer.readFrom(ByteArrayBuffer.java:172) at org.mortbay.io.bio.StreamEndPoint.fill(StreamEndPoint.java:107) at org.mortbay.jetty.bio.SocketConnector$Connection.fill(SocketConnector.java:196) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java
Re: "at least one"-validation?
what is attribute search panel and how are you actually creating the list of form components? following is the easiest way .. 1. create a list of formcomponent say a arraylist 2)in popolulate method of your listview,add the textfields or any other fc to list. so by the end of method you have a list of form components. 3)in your custom validator ,you can simply return list.toArray(new FormComponent[list.size()]) and do validations/checking for formcomponents in validate method. and finally clear the list at appropiate time .. -- regards, Vineet Semwal 2009/8/25 Stefan Malmesjö > Yeah, I got that part. Easy in theory, a bit more complicated in real life > :) > > I'm doing something wrong, and I can't figure out what. > > My IFormValidator doesn't seem to get the request params correctly. If, in > validate(), I use getInput() on the FormComponents, then I get null no > matter what the user enters, and if I use getValue() instead, I get whatever > the user inputed the last time the form was submitted. > > According to the javadoc: "Gets current value for a form component, which > can be either input data entered by the user, or the component's model > object if no input was provided." > > So, this seems to be the case for me, but why is there no input available > to me? > > Don't know if my code helps... but maybe someone can spot something stupid > in there :) > > private class NotAllEmptyValidator implements >IFormValidator { > >public FormComponent[] getDependentFormComponents() { >List panels = > searchConditionPanelsModel.getObject(); >FormComponent[] components = new > FormComponent[panels.size()]; >int i = 0; >for (AttributeSearchPanel panel : panels) { >components[i++] = panel.getFormComponent(); >} > >return components; >} > >public void validate(Form form) { >FormComponent[] formComponents = > getDependentFormComponents(); >boolean isOk = false; >for (int i = 0; i < formComponents.length; i++) { >String value = formComponents[i].getInput(); >if (!StringUtils.isEmpty(value)) { >isOk = true; >break; >} >} >if (!isOk) { >error("Minst ett sökkriterie måste anges"); >} >} > >}; > > > > On 2009-08-24 17:45, vineet semwal wrote: > >> It's simple to write a custom form validator for that purpose >> 1)create a list of form components, >> 2)add those form components to list which need validation, >> 3)in your custom form validator ,do validation of those form components. >> >> >> > >
Re: Replacing content in a ModalWindow issue
Off the top of my head, you do not need anything special. Just show the same modal window again after the callback. Unless the modal window is cleaned up only after callbakc. BTW: Why close the modal window in the first place? Why not just replace the content while the modal window is open? Just call setContent again and target.addComponent(contentPanel); ** Martin 2009/8/25 Doug Leeper : > I have looked at the ModalWindow javadoc, searched through Nabble, and tried > several different approaches but I cannot do the following. > > I have a ModalWindow showing a Panel A. This panel has a link that when > selected, it is to show a ModalWindow with another Panel B. Ideally, > ModalWindow/Panel A should go away and a ModalWindow/Panel B should only be > displayed. > > I have tried to reuse the current ModalWindow and call through various > combinations of setContent()/addOrReplaceComponent(). What results is that I > have a ModalWindow showing Panel A and another ModalWindow showing Panel B. > I have even tried to Panel A.setVisible()/target.addComponent(modalWindow). > > Does anyone know what I need to do to replace the content on a ModalWindow > and only have one ModalWindow show? > > Thanks in advance! > > - Doug > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Replacing content in a ModalWindow issue
I have looked at the ModalWindow javadoc, searched through Nabble, and tried several different approaches but I cannot do the following. I have a ModalWindow showing a Panel A. This panel has a link that when selected, it is to show a ModalWindow with another Panel B. Ideally, ModalWindow/Panel A should go away and a ModalWindow/Panel B should only be displayed. I have tried to reuse the current ModalWindow and call through various combinations of setContent()/addOrReplaceComponent(). What results is that I have a ModalWindow showing Panel A and another ModalWindow showing Panel B. I have even tried to Panel A.setVisible()/target.addComponent(modalWindow). Does anyone know what I need to do to replace the content on a ModalWindow and only have one ModalWindow show? Thanks in advance! - Doug
Re: Hide component when instantiating component not authorized to
you can use oncomponentaction(action) { if action==component.render return false; } to hide any components that should not be visible. -igor On Tue, Aug 25, 2009 at 12:42 AM, Kees van Dieren wrote: > Hi all, > > We would like to hide a Panel marked with > @AuthorizeInstantiation("RoleNotAuthorizedTo"); > > The default behaviour is that wicket sends AccessDeniedPage. > > We are using wicket 1.3.7. > > I implemented the desired solution by duplicating the complete > org.apache.wicket.authentication.AuthenticatedWebApplication class in our > source tree, and changing the onUnauthorizedInstantiation method to: > > public final void onUnauthorizedInstantiation(final Component component) > { > // If there is a sign in page class declared, and the unauthorized > // component is a page, but it's not the sign in page > if (component instanceof Page) > { > if (!AuthenticatedWebSession.get().isSignedIn()) > { > // Redirect to intercept page to let the user sign in > throw new > RestartResponseAtInterceptPageException(getSignInPageClass()); > } > else > { > onUnauthorizedPage((Page)component); > } > } > else > { > // Kees / IOO change: delegate to new onUnAuthorizedComponent > onUnautorizedComponent(component); > } > } > > /** > * Kees / IOO change: created delegate method > * @param component > * a (non-page) component that user is not authorized to to > construct. > */ > protected void onUnautorizedComponent(final Component component) { > // The component was not a page, so throw an exception > throw new UnauthorizedInstantiationException(component.getClass()); > } > > Our WicketApplication subclass overrides the onUnautorizedComponent with: > protected void onUnautorizedComponent(final Component component) { > component.setVisible(false); > } > > Is this the only way to achieve this? I'd like to not duplicate the complete > class, but some kind of hook where I can implement this in. > > Is that possible? > > Thanks in advance! > > Best regards, > > Kees van Dieren > -- > Squins | IT, Honestly > Oranjestraat 23 > 2983 HL Ridderkerk > The Netherlands > Phone: +31 (0)180 414520 > Mobile: +31 (0)6 30413841 > www.squins.com > Chamber of commerce Rotterdam: 22048547 > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Regarding datepicker popup when inputfield pressed
Hi, A very nice solution to the this problem could be as Michael Mosmann suggested: initStart3 = function() { Wicket.DateTime.init( { you should extend the input tag with -- onfocus="initStart3.showCalendar()" The problem is that in the wicket-date.js the showCalendar function is private. It can be found under the section where the datepicker is initialized: Wicket.DateTime.init = function(cfg) { ... function showCalendar() {} Because the javascript function is private and not made public, the calendar popup can not be triggered from other fields by adding code like: onfocus="initStart3.showCalendar()" I must recommend that the showCalendar function is made public for the future so the users easily can trigger the calendar. Right now i made a ugly hack to make it work. Best Regards Cemil On Mon, Aug 24, 2009 at 1:49 PM, copenhag copenhagen wrote: > Hi > > Thanks for the tip... > > I looked at wiquery and it looks good. > > And i may use some nice features from WiQuery later on. > > The problem is that my datepicker is integrated with the default Wicket > datepicker, so > it would be to heavy a job to use the WiQuery datepicker. > > But appearently there is no easy way of doing this. > > Best Regards > Cemil > > > > > On Fri, Aug 21, 2009 at 4:24 PM, sander v F wrote: > >> There is a JQuery plugin capable of doing this, see: >> >> http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerClickInput.html >> >> You should have a look at WiQuery ( http://code.google.com/p/wiquery/ ), >> a >> Wicket JQuery component. I don't know if they already implemented this >> datepicker, but it should be easy to make a plugin. >> >> >> >> 2009/8/21 Michael Mosmann >> >> > Am Freitag, den 21.08.2009, 14:33 +0200 schrieb copenhag copenhagen: >> > > Has no one really needed the calendar popup when the input field is >> > > selected/pressed ? >> > >> > sorry.. (btw. IMHO it is annoying ..) >> > >> > i searched for some solution.. but i think you have to >> > a) take a look into this yui magic >> > b) ask on dev list for some infos about an extension of the current >> > datepicker >> > c) choose some different.. >> > d) ..? >> > >> > mm:) >> > >> > >> > - >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> > For additional commands, e-mail: users-h...@wicket.apache.org >> > >> > >> > >
Re: "at least one"-validation?
Yeah, I got that part. Easy in theory, a bit more complicated in real life :) I'm doing something wrong, and I can't figure out what. My IFormValidator doesn't seem to get the request params correctly. If, in validate(), I use getInput() on the FormComponents, then I get null no matter what the user enters, and if I use getValue() instead, I get whatever the user inputed the last time the form was submitted. According to the javadoc: "Gets current value for a form component, which can be either input data entered by the user, or the component's model object if no input was provided." So, this seems to be the case for me, but why is there no input available to me? Don't know if my code helps... but maybe someone can spot something stupid in there :) private class NotAllEmptyValidator implements IFormValidator { public FormComponent[] getDependentFormComponents() { List panels = searchConditionPanelsModel.getObject(); FormComponent[] components = new FormComponent[panels.size()]; int i = 0; for (AttributeSearchPanel panel : panels) { components[i++] = panel.getFormComponent(); } return components; } public void validate(Form form) { FormComponent[] formComponents = getDependentFormComponents(); boolean isOk = false; for (int i = 0; i < formComponents.length; i++) { String value = formComponents[i].getInput(); if (!StringUtils.isEmpty(value)) { isOk = true; break; } } if (!isOk) { error("Minst ett sökkriterie måste anges"); } } }; On 2009-08-24 17:45, vineet semwal wrote: It's simple to write a custom form validator for that purpose 1)create a list of form components, 2)add those form components to list which need validation, 3)in your custom form validator ,do validation of those form components.
Re: Absolute urls in forms
Thanks 2009/8/25 Erik van Oosten : > > I added a patch in Jira. > > Regards, > Erik. > > > > Erik van Oosten wrote: >> >> Anyways, you can make all URLs absolute by following the hints in >> https://issues.apache.org/jira/browse/WICKET-1974. >> >> You'll need to patch Wicket as the issue is not yet solved. (I really >> should make the patch, its soo easy, just have to find time.) >> > > -- > Erik van Oosten > http://www.day-to-day-stuff.blogspot.com/ > > -- > View this message in context: > http://www.nabble.com/Absolute-urls-in-forms-tp25075543p25132710.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nial Darbey: ClassCast exception when invoking MySession.get() from Maven test phase
Igor,thanks for that. Yes, the solution was in passing the DummyApplication to the WicketTester constructor. Nial 2009/8/20 Igor Vaynberg > are you making wicket tester instantiate your own application class? > > -igor > > On Thu, Aug 20, 2009 at 3:09 AM, Nial Darbey wrote: > > Hi everyone,I have subclassed the WebSession class as recommended in > Wicket > > in Action and I override the public static get() method to return > > Session.get() cast to MyWebSession as follows: > > public static MyWebSession get() { return (MyWebSession) Session.get(); } > > > > This of course works as expected but when I run my tests from maven > against > > code which uses this I get a ClassCastException > > (org.apache.wicket.protocol.http.WebSession cannot be cast to > > org.my.MyWebSession) > > I'm guessing this must be a classloader issue. > > Has anyone come across this? > > Best regards, > > Nial Darbey > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Absolute urls in forms
I added a patch in Jira. Regards, Erik. Erik van Oosten wrote: > > Anyways, you can make all URLs absolute by following the hints in > https://issues.apache.org/jira/browse/WICKET-1974. > > You'll need to patch Wicket as the issue is not yet solved. (I really > should make the patch, its soo easy, just have to find time.) > -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ -- View this message in context: http://www.nabble.com/Absolute-urls-in-forms-tp25075543p25132710.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Truncating DataTable content
Just in case anybody is interested in the solution. I've extended ChoiceFilteredPropertyColumn (as that was the type of column I was using for my AjaxFallbackDefaultDataTable) and have overridden populateItem (which was originally implemented in PropertyColumn). In that method I both truncate the table data and add the PrototipBehavior that shows the tooltip. Regards, Linda Iain Reddick wrote: Like this (for a basic html tooltip): cellItem.add( new SimpleAttributeModifier("title", maximalStringModel) ); Or use one of the js-library wrappers from Wicket Stuff for something slicker? Linda van der Pal wrote: Thanks for the ideas, but the truncating itself is not the main problem. (I could easily truncate the data in the SortableDataProvider.) The main problem that requires met to dive deeply into the code is my requirement to also show the full data in a tooltip. Regards, Linda Iain Reddick wrote: Create some kind of generic StringTruncatingModel that does the "..." truncation on getObject(). In DataTable.populateItem(), wrap the row model in a StringTruncatingModel, before passing to the Label being used to show the string? Linda van der Pal wrote: I thought it would be a cool idea to truncate the data in my table, so the data isn't spread over several lines in the table row. It should then be possible to read the complete content in a tooltip. After digging into the code of the AjaxFallbackDefaultDataTable I found that to do this I would have to alter/copy the entire structure, as it seemed the code I need to alter is inside AbstractDataGridView. This seems like an aweful lot of work for such a relatively small feature. So my question is, has anybody ever tried this before? And even if not, do you have a better idea how to tackle this? So I want the content of a single field to go from this: Struts: the complete reference to Struts: the... (with a tooltip listing the whole title) Regards, Linda - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.65/2322 - Release Date: 08/23/09 18:03:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.65/2323 - Release Date: 08/24/09 06:05:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Updating DIV with Wicket Response
Hi! Are you trying to do a server side include? ** Martin 2009/8/25 : > I have a page built in SpringMVC. I have a iFrame in this page that > renders a Wicket Page. I want to replace the iFrame with a DIV and load > the Wicket page inside the DIV using Ajax. > > I used Prototype to load the wicket page. The page loads but the wicket > javascript does not work anymore. I guess this is because the tag > from the wicket response is not processed. > > I then tried Wicket Ajax, but the call returns a SendRedirect. I guess we > cannot load wicket Pages using Wicket Ajax. > > How do I get this to work ? > > Thanks > Avinash P > > > > > ** > > This message and any attachments contain information from Union Pacific which > may be confidential and/or privileged. If you are not the intended > recipient, be aware that any disclosure, copying, distribution or use of the > contents of this message is strictly prohibited by law. If you receive this > message in error, please contact the sender immediately and delete the > message and any attachments. > > ** - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Updating DIV with Wicket Response
I have a page built in SpringMVC. I have a iFrame in this page that renders a Wicket Page. I want to replace the iFrame with a DIV and load the Wicket page inside the DIV using Ajax. I used Prototype to load the wicket page. The page loads but the wicket javascript does not work anymore. I guess this is because the tag from the wicket response is not processed. I then tried Wicket Ajax, but the call returns a SendRedirect. I guess we cannot load wicket Pages using Wicket Ajax. How do I get this to work ? Thanks Avinash P ** This message and any attachments contain information from Union Pacific which may be confidential and/or privileged. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited by law. If you receive this message in error, please contact the sender immediately and delete the message and any attachments. **
Re: RequestCycle bug at urlFor?
Hi Francisco. It's certainly the same location in code, but the issues are a bit different. I've filed the bug at https://issues.apache.org/jira/browse/WICKET-2434 Vytautas francisco treacy wrote: > Hi Vytautas, > > Honestly I don't know if it's the same problem but I did went through > lots of debugging due to urlFor a couple of months ago. I posted an > issue but actually haven't followed its progress (it's still open). > > https://issues.apache.org/jira/browse/WICKET-2204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel > > Just thought it would be relevant mentioning. > > Francisco > > > 2009/8/24 Vytautas Čivilis : >> Hi. >> >> I'm using RequestCycle urlFor method for building my link in this >> fashion: getRequestCycle().urlFor(this, ILinkListener.INTERFACE, >> parameters). >> >> The idea is to have link with default behavior (implement onclick), but >> with the explicitly set parameters too. The parameters are being asked >> by 3rd party library (in particular - thickbox). >> >> at RequestCycle 947: >> AppendingStringBuffer buff = new AppendingStringBuffer(url); >> WebRequestEncoder encoder = new WebRequestEncoder(buff); >> >> This WebRequestEncoder doesn't check, if the parameters are already >> present in the url provided. >> >> In my case, the url from CharSequence url = encodeUrlFor(target); is >> already like that >> ?wicket:interface=:2:admin:container:tabbedPanel:panel:apartments:0:apartmentAddressEditLink:1:ILinkListener:: >> >> What WebRequestEncoder does when appending parameters provided >> explicitly - it simply appends "?" mark and then the parameters list. >> >> So resulting url is incorrect and doesn't work: >> ?wicket:interface=:2:admin:container:tabbedPanel:panel:apartments:0:apartmentAddressEditLink:1:ILinkListener::?height=300&width=300 >> >> (notice leading ?height=300&width=300). >> >> Wicket 1.4.0. >> >> Am I doing something wrong here? What could be possible solutions to >> overcome this? >> >> Vytautas >> >> - >> 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 and FindBugs
It seems that our developers frequently mistakenly forget to use "item.add()" and end up writing "add()" in ListView sublasses and the like. This sounds like a job for FindBugs, do anyone know of any existing FindBugs plugin that deals with common mistakes in Wicket code? Med vennlig hilsen TOR IVER WILHELMSEN Senior systemutvikler Arrive AS T (+47) 48 16 06 18 E-post: toriv...@arrive.no http://www.arrive.no http://servicedesk.arrive.no
SV: Hide component when instantiating component not authorized to
> What was wrong with implementing > IAuthorizationStrategy.isActionAuthorized() and adding > getSecuritySettings().setAuthorizationStrategy(new > YourParticularImplementation()); in your Application.init()? The action > to test for is Component.RENDER. Ah, perhaps the other method is more to your question (isInstantiationAuthorized()), and also set the IUnauthorizedComponentInstantiationListener in the security settings to an implementation that sets the component invisible, or throws a RuntimeException you probably need to handle in the code that tries to instantiate the component. - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Hide component when instantiating component not authorized to
> I implemented the desired solution by duplicating the complete > org.apache.wicket.authentication.AuthenticatedWebApplication class in > our > source tree, What was wrong with implementing IAuthorizationStrategy.isActionAuthorized() and adding getSecuritySettings().setAuthorizationStrategy(new YourParticularImplementation()); in your Application.init()? The action to test for is Component.RENDER. - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Hide component when instantiating component not authorized to
Hi all, We would like to hide a Panel marked with @AuthorizeInstantiation("RoleNotAuthorizedTo"); The default behaviour is that wicket sends AccessDeniedPage. We are using wicket 1.3.7. I implemented the desired solution by duplicating the complete org.apache.wicket.authentication.AuthenticatedWebApplication class in our source tree, and changing the onUnauthorizedInstantiation method to: public final void onUnauthorizedInstantiation(final Component component) { // If there is a sign in page class declared, and the unauthorized // component is a page, but it's not the sign in page if (component instanceof Page) { if (!AuthenticatedWebSession.get().isSignedIn()) { // Redirect to intercept page to let the user sign in throw new RestartResponseAtInterceptPageException(getSignInPageClass()); } else { onUnauthorizedPage((Page)component); } } else { // Kees / IOO change: delegate to new onUnAuthorizedComponent onUnautorizedComponent(component); } } /** * Kees / IOO change: created delegate method * @param component *a (non-page) component that user is not authorized to to construct. */ protected void onUnautorizedComponent(final Component component) { // The component was not a page, so throw an exception throw new UnauthorizedInstantiationException(component.getClass()); } Our WicketApplication subclass overrides the onUnautorizedComponent with: protected void onUnautorizedComponent(final Component component) { component.setVisible(false); } Is this the only way to achieve this? I'd like to not duplicate the complete class, but some kind of hook where I can implement this in. Is that possible? Thanks in advance! Best regards, Kees van Dieren -- Squins | IT, Honestly Oranjestraat 23 2983 HL Ridderkerk The Netherlands Phone: +31 (0)180 414520 Mobile: +31 (0)6 30413841 www.squins.com Chamber of commerce Rotterdam: 22048547
Re: Sending data to a wicket form through a POST from an external site
I guess it would be possible with a stateless form? ** Martin 2009/8/25 Igor Vaynberg : > and why would they need that? what is the advantage of that vs simply > using pageparameters? > > -igor > > On Mon, Aug 24, 2009 at 9:24 PM, Anton > Veretennikov wrote: >> They mean "trigger a form submit" somehow as if it was a wicket form >> as I understood. >> >> -- Tony >> >> On Tue, Aug 25, 2009 at 12:07 PM, Igor Vaynberg >> wrote: >>> give paypal a url to a bookmarkable page, you can retrieve the post >>> params from PageParameters. >>> >>> -igor >>> >>> On Wed, Jan 7, 2009 at 11:19 AM, Rahul Pilani wrote: I need to get data from an external site via a POST. Is there a way that wicket will trigger a form submit on the posted data? Otherwise I have to handle the params myself. I looked through the forum archives, and previous posts on a similar topic went unreplied. Any answer is appreciated. - R >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Sending data to a wicket form through a POST from an external site
and why would they need that? what is the advantage of that vs simply using pageparameters? -igor On Mon, Aug 24, 2009 at 9:24 PM, Anton Veretennikov wrote: > They mean "trigger a form submit" somehow as if it was a wicket form > as I understood. > > -- Tony > > On Tue, Aug 25, 2009 at 12:07 PM, Igor Vaynberg > wrote: >> give paypal a url to a bookmarkable page, you can retrieve the post >> params from PageParameters. >> >> -igor >> >> On Wed, Jan 7, 2009 at 11:19 AM, Rahul Pilani wrote: >>> I need to get data from an external site via a POST. Is there a way that >>> wicket will trigger a form submit on the posted data? Otherwise I have to >>> handle the params myself. I looked through the forum archives, and previous >>> posts on a similar topic went unreplied. >>> >>> Any answer is appreciated. >>> >>> - R >>> >> >> - >> 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