Re: focus locked in place
Hi Tom, Wicket keeps track of the last focused element only for Ajax requests. I.e. Wicket sends a header in the ajax requests with the id of the focused element when the Ajax call starter and later when the Ajax response is processed it re-focuses this element. Additionally there is AjaxRequestTarget#focusComponent(Component) method which may be used to focus another element. If you replace the focused element in the Ajax response then lastFocusedId will be obsolete and Wicket wont be able to find the old component. I hope this helps you find out what causes the jumps in the focused elements. On Fri, Apr 13, 2012 at 5:49 PM, Tom Eugelink t...@tbee.org wrote: On 2012-04-13 11:58, Tom Eugelink wrote: The cursor can be placed in the date fields, but not in any of the textfield in the listview. To add some additional information; the cursor can be placed in the textfields by using the TAB key. A mouse click will always jump to the first field. So it seems to be a RefreshingView in combination with a mouse click problem. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Access Denied Page
Hi, AccessDeniedPage is being shown only when either org.apache.wicket.authorization.AuthorizationException or org.apache.wicket.request.handler.ListenerInvocationNotAllowedException is thrown. I think the latter is cause in your case. But I have no idea why there is nothing in the log files. Make sure you have enabled INFO level logging for org.apache.wicket.RequestListenerInterface On Fri, Apr 13, 2012 at 6:02 PM, Satrix satrix...@gmail.com wrote: Hello, I'm facing really strange behaviour and I can't find out what's causing this. Let me describe this scenario: 1. We have an external hosting and the wicket app is running out there. 2. There is a form to upload a file to FTP. 3. When I try to upload a file I get Access Denied Page. However I dont use any authorize strategies etc. My logs are clear and there are no exceptions in the logs. The interesting thing is that on my local machine it's working like a charm but on the external hosting sometimes it's working and sometimes it's not. So any idea what can cause such a problem ? Regards, Satrix -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Access-Denied-Page-tp4555096p4555096.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Unable to find error during hello World
Hi, The code looks perfectly fine. I just copy/pasted it and it prints the label without any error. On Sun, Apr 15, 2012 at 9:47 AM, Marc Marc marc.m...@mail.be wrote: Hello, I am a new user. I succeeded the quickstart but can not run the Hello World example. I get the following error: Unable to find component with id 'message' in [Page class = com.modelandgo.HomePage, id = 0, render count = 1] Expected: '.message'. I searched in the mailing list but did not found the solution. I add my simple code hereunder. Thanks! Marc __ my application: public class WicketApplication extends WebApplication { @Override public ClassHomePage getHomePage() { return HomePage.class; } } my page: public class HomePage extends WebPage { private static final long serialVersionUID = 1L; public HomePage(final PageParameters parameters) { add(new Label(message, I am a newbie)); } } my html: !DOCTYPE html html xmlns:wicket=http://wicket.apache.org; body span wicket:id=messageMessage goes here/span /body /html - Mail.be, WebMail and Virtual Office http://www.mail.be - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Access Denied Page
Hi, Yeah, the INFO logging is ON so that's not the case. I've resolved the problem... but I don't know what was causing it. Two reasons: 1. Multipart set to true on form 2. Nested form But the problem is that it was only occuring on external hosting. Locally it was working like a charm. Regards, Satrix -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Access-Denied-Page-tp4555096p4560780.html Sent from the Users forum 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: Header contribution from externally loaded markup
Hi, I'm not 100% certain but I think the reason to not contribute to the header is that you use IComponentResolver. Check BrixCms's [1] source to see how they did it. 1. http://brix-cms.org On Sun, Apr 15, 2012 at 6:01 PM, Ashoka Upadhya aupad...@art.com wrote: I have panel components that gets its markup from external source (CMS). Component implements IMarkupResourceStreamProvider. These components are nested and are resolved through component resolver. Below is the structure of dependency. In below, assume each element (masterPage, page.. ) as component. ** ** masterPage page path=”” contentBlocks path=”” contentBlocks path=”” contentBlocks path=”” /page /masterPage ** ** Markup for each content block component above has “wicket:head” section. Issue is during page rendering these header section are not processed. During rendering, HtmlHeaderContainer doesn’t process content blocks at all. Is it because components are not added during the construction of the component? (For example page adds content block component during the rendering phase through component resolver) . Is there a way to make this work? ** ** Regards, Ashoka Upadhya Principal Software Engineer Art.com Phone: (510) 879-4858 Fax: (510) 588-3930 [image: art.com, inc] ** ** [image: art.com] http://www.art.com/ [image: allposters.com] http://www.allposters.com/ [image: artist] http://www.artistrising.com/ If you have received this e-mail in error, please immediately notify the sender by reply e-mail and destroy the original e-mail and its attachments without reading or saving them. This e-mail and any documents, files or previous e-mail messages attached to it, may contain confidential or privileged information that is prohibited from disclosure under confidentiality agreement or applicable law. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail or any of the information contained in or attached to this e-mail is STRICTLY PROHIBITED. Thank you. -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: focus locked in place
Thanks for the feedback. So to check if this is the cause, I could simply remove the ajax code. Tom On 2012-04-16 08:54, Martin Grigorov wrote: Hi Tom, Wicket keeps track of the last focused element only for Ajax requests. I.e. Wicket sends a header in the ajax requests with the id of the focused element when the Ajax call starter and later when the Ajax response is processed it re-focuses this element. Additionally there is AjaxRequestTarget#focusComponent(Component) method which may be used to focus another element. If you replace the focused element in the Ajax response then lastFocusedId will be obsolete and Wicket wont be able to find the old component. I hope this helps you find out what causes the jumps in the focused elements. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: LoadableDetachableModel loading twice with dataprovider?
Hi, #iterator() method loads the raw entities (MyClass), later #model() method wraps an entity in a IModel impl. By calling new DetachableMyClassModel(anInstance) you give the model a live instance to work with. Until the call to model#detach() this model will use this live instance and #load() wont be called at all. After detaching the model it will keep just the primary key and next #getObject() will call #load(). Check why #detach() is called between #iterator() and #populate(). On Sun, Apr 15, 2012 at 8:32 PM, DanielSantos daniel.santos-fernan...@hp.com wrote: Hi, I have a SortableDataProvider that loads a list of objects from de database with the following code: public IModelMyClass model(final MyClassarg0) { return new DetachableMyClassModel(arg0); } The DetachableMyClassModel is a loadabledetachablemodel. When I want to populate the dataview, for every record, the application calls the load method of the DetachableMyClassModel, calling again the database to load the MyClass object. I guess this is not right, since all the records are already loaded by the databaprovider iterator(int first, int count). Any ideas? (I used the same code as in the repeaters in the wicket examples) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/LoadableDetachableModel-loading-twice-with-dataprovider-tp4559510p4559510.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: focus locked in place
Check with Firebug or Dev tools which component is focused before the Ajax call (see the request headers) and later after the processing of the Ajax response check whether there is an element with such id in the DOM tree. On Mon, Apr 16, 2012 at 10:36 AM, Tom Eugelink t...@tbee.org wrote: Thanks for the feedback. So to check if this is the cause, I could simply remove the ajax code. Tom On 2012-04-16 08:54, Martin Grigorov wrote: Hi Tom, Wicket keeps track of the last focused element only for Ajax requests. I.e. Wicket sends a header in the ajax requests with the id of the focused element when the Ajax call starter and later when the Ajax response is processed it re-focuses this element. Additionally there is AjaxRequestTarget#focusComponent(Component) method which may be used to focus another element. If you replace the focused element in the Ajax response then lastFocusedId will be obsolete and Wicket wont be able to find the old component. I hope this helps you find out what causes the jumps in the focused elements. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
ContinueToOriginalDestination does not clear destination after continue
We have a scenario where single person can log in under different accounts on the same website. Different user types will typically go to different page types. A single person using different accounts is not normally required but we are demonstrating to corporate clients how the system will be used by different user types. In the demonstration we need to log in as an 'admin' user to demo the admin aspects and then we need to log in as a 'standard' user to demonstrate the aspects that will apply to a standard user. The admin page uses RedirectToInterceptException to authentication page if no one is logged in. The standard page uses the home page to authenticate and throws new RestartResponseException(new AuthenticatePage(parameters)) if no one is authenticated (i.e. no intercept) After authentication we either continue or go to the 'default' page for a standard user. Code looks like this: If ( authenicationSucceeded ) { if ( !continueToOriginalDestination() ) { // Was not redirected to this authentication page so go to default destination for the home page // Find default page for standard users and go to that page } } What we find is that after an admin log on (with intercept/continue sequence) a subsequent standard user log on will not execute the above body because continueToOriginalDestination returns 'true' even though this page was not an intercept page. It looks like after an intercept/continue has occurred it does not clear the 'original destination' attribute and so a subsequent call to continueToOriginalDestination will return true when it should really return false. Is the attribute that stores 'original destination' cleared after continueToOriginalDestination? Should it be? Yours sincerely, Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together Sydney: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au mailto://chr...@stepahead.com.au Website: http://www.pagebloom.com blocked::http://www.pagebloom.com/ http://develop.stepaheadsoftware.com blocked::http://develop.stepaheadsoftware.com/
Re: ContinueToOriginalDestination does not clear destination after continue
Hi Chris, Check the code at org.apache.wicket.RestartResponseAtInterceptPageException#continueToOriginalDestination() This method indeed returns 'true' without cleaning the stored data but later when the redirect is processed the data is cleaned - see MAPPER#mapRequest(Request) method few lines below. Additionally this data is stored as meta data in the Session object, so changing users implies invalidation of the old (Admin) session and creation of a new (normal user) session. Do you degrade the Admin user to a user with less permissions without a real logout ? On Mon, Apr 16, 2012 at 11:53 AM, Chris Colman chr...@stepaheadsoftware.com wrote: ** ** We have a scenario where single person can log in under different accounts on the same website. Different user types will typically go to different page types. ** ** A single person using different accounts is not normally required but we are demonstrating to corporate clients how the system will be used by different user types. In the demonstration we need to log in as an ‘admin’ user to demo the admin aspects and then we need to log in as a ‘standard’ user to demonstrate the aspects that will apply to a standard user. ** ** The admin page uses RedirectToInterceptException to authentication page if no one is logged in. ** ** The standard page uses the home page to authenticate and throws new RestartResponseException(new AuthenticatePage(parameters)) if no one is authenticated (i.e. no intercept) ** ** After authentication we either continue or go to the ‘default’ page for a standard user. ** ** Code looks like this: ** ** If ( authenicationSucceeded ) { if ( !continueToOriginalDestination() ) { // Was not redirected to this authentication page so go to default destination for the home page*** * // Find default page for standard users and go to that page } } ** ** What we find is that after an admin log on (with intercept/continue sequence) a subsequent standard user log on will not execute the above body because continueToOriginalDestination returns ‘true’ even though this page was not an intercept page. ** ** It looks like after an intercept/continue has occurred it does not clear the ‘original destination’ attribute and so a subsequent call to continueToOriginalDestination will return true when it should really return false. ** ** Is the attribute that stores ‘original destination’ cleared after continueToOriginalDestination? Should it be? ** ** ** ** Yours sincerely, ** ** Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together ** ** **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au //chr...@stepahead.com.au Website: http://www.pagebloom.com http://develop.stepaheadsoftware.com ** ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
RE: ContinueToOriginalDestination does not clear destination after continue
Additionally this data is stored as meta data in the Session object, so changing users implies invalidation of the old (Admin) session and creation of a new (normal user) session. Do you degrade the Admin user to a user with less permissions without a real logout ? By a 'real logout' do you mean invalidating the session? Can we do that if we change users? Don't we still need a valid session for the new user? On Mon, Apr 16, 2012 at 11:53 AM, Chris Colman chr...@stepaheadsoftware.com wrote: ** ** We have a scenario where single person can log in under different accounts on the same website. Different user types will typically go to different page types. ** ** A single person using different accounts is not normally required but we are demonstrating to corporate clients how the system will be used by different user types. In the demonstration we need to log in as an 'admin' user to demo the admin aspects and then we need to log in as a 'standard' user to demonstrate the aspects that will apply to a standard user. ** ** The admin page uses RedirectToInterceptException to authentication page if no one is logged in. ** ** The standard page uses the home page to authenticate and throws new RestartResponseException(new AuthenticatePage(parameters)) if no one is authenticated (i.e. no intercept) ** ** After authentication we either continue or go to the 'default' page for a standard user. ** ** Code looks like this: ** ** If ( authenicationSucceeded ) { if ( !continueToOriginalDestination() ) { // Was not redirected to this authentication page so go to default destination for the home page*** * // Find default page for standard users and go to that page } } ** ** What we find is that after an admin log on (with intercept/continue sequence) a subsequent standard user log on will not execute the above body because continueToOriginalDestination returns 'true' even though this page was not an intercept page. ** ** It looks like after an intercept/continue has occurred it does not clear the 'original destination' attribute and so a subsequent call to continueToOriginalDestination will return true when it should really return false. ** ** Is the attribute that stores 'original destination' cleared after continueToOriginalDestination? Should it be? ** ** ** ** Yours sincerely, ** ** Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together ** ** **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au //chr...@stepahead.com.au Website: http://www.pagebloom.com http://develop.stepaheadsoftware.com ** ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: ContinueToOriginalDestination does not clear destination after continue
Hi Chris, Check the code at org.apache.wicket.RestartResponseAtInterceptPageException#continueToOri gina lDestination() This method indeed returns 'true' without cleaning the stored data but later when the redirect is processed the data is cleaned - see MAPPER#mapRequest(Request) method few lines below. I just ran the code in the debugger and after successful authentication I never see MAPPER#mapRequest getting called. I set a breakpoint on both continueToOriginalDestination and Mapper#mapRequest Execution hits continueToOriginalDestination but I never see it hit Mapper#mapRequest - which means InterceptData.clear() never gets called - that would explain what I'm seeing. Additionally this data is stored as meta data in the Session object, so changing users implies invalidation of the old (Admin) session and creation of a new (normal user) session. Do you degrade the Admin user to a user with less permissions without a real logout ? On Mon, Apr 16, 2012 at 11:53 AM, Chris Colman chr...@stepaheadsoftware.com wrote: ** ** We have a scenario where single person can log in under different accounts on the same website. Different user types will typically go to different page types. ** ** A single person using different accounts is not normally required but we are demonstrating to corporate clients how the system will be used by different user types. In the demonstration we need to log in as an 'admin' user to demo the admin aspects and then we need to log in as a 'standard' user to demonstrate the aspects that will apply to a standard user. ** ** The admin page uses RedirectToInterceptException to authentication page if no one is logged in. ** ** The standard page uses the home page to authenticate and throws new RestartResponseException(new AuthenticatePage(parameters)) if no one is authenticated (i.e. no intercept) ** ** After authentication we either continue or go to the 'default' page for a standard user. ** ** Code looks like this: ** ** If ( authenicationSucceeded ) { if ( !continueToOriginalDestination() ) { // Was not redirected to this authentication page so go to default destination for the home page*** * // Find default page for standard users and go to that page } } ** ** What we find is that after an admin log on (with intercept/continue sequence) a subsequent standard user log on will not execute the above body because continueToOriginalDestination returns 'true' even though this page was not an intercept page. ** ** It looks like after an intercept/continue has occurred it does not clear the 'original destination' attribute and so a subsequent call to continueToOriginalDestination will return true when it should really return false. ** ** Is the attribute that stores 'original destination' cleared after continueToOriginalDestination? Should it be? ** ** ** ** Yours sincerely, ** ** Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together ** ** **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au //chr...@stepahead.com.au Website: http://www.pagebloom.com http://develop.stepaheadsoftware.com ** ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: ContinueToOriginalDestination does not clear destination after continue
BTW that clear never gets called in the simple process of the Admin user going to admin page redirected and then 'continued' after authentication. I have not attempted to do anything with the standard user at this point so the clear not getting called seems to be a problem in a single user scenario. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, 16 April 2012 7:02 PM To: users@wicket.apache.org Subject: Re: ContinueToOriginalDestination does not clear destination after continue Hi Chris, Check the code at org.apache.wicket.RestartResponseAtInterceptPageException#continueToOri gina lDestination() This method indeed returns 'true' without cleaning the stored data but later when the redirect is processed the data is cleaned - see MAPPER#mapRequest(Request) method few lines below. Additionally this data is stored as meta data in the Session object, so changing users implies invalidation of the old (Admin) session and creation of a new (normal user) session. Do you degrade the Admin user to a user with less permissions without a real logout ? On Mon, Apr 16, 2012 at 11:53 AM, Chris Colman chr...@stepaheadsoftware.com wrote: ** ** We have a scenario where single person can log in under different accounts on the same website. Different user types will typically go to different page types. ** ** A single person using different accounts is not normally required but we are demonstrating to corporate clients how the system will be used by different user types. In the demonstration we need to log in as an 'admin' user to demo the admin aspects and then we need to log in as a 'standard' user to demonstrate the aspects that will apply to a standard user. ** ** The admin page uses RedirectToInterceptException to authentication page if no one is logged in. ** ** The standard page uses the home page to authenticate and throws new RestartResponseException(new AuthenticatePage(parameters)) if no one is authenticated (i.e. no intercept) ** ** After authentication we either continue or go to the 'default' page for a standard user. ** ** Code looks like this: ** ** If ( authenicationSucceeded ) { if ( !continueToOriginalDestination() ) { // Was not redirected to this authentication page so go to default destination for the home page*** * // Find default page for standard users and go to that page } } ** ** What we find is that after an admin log on (with intercept/continue sequence) a subsequent standard user log on will not execute the above body because continueToOriginalDestination returns 'true' even though this page was not an intercept page. ** ** It looks like after an intercept/continue has occurred it does not clear the 'original destination' attribute and so a subsequent call to continueToOriginalDestination will return true when it should really return false. ** ** Is the attribute that stores 'original destination' cleared after continueToOriginalDestination? Should it be? ** ** ** ** Yours sincerely, ** ** Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together ** ** **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au //chr...@stepahead.com.au Website: http://www.pagebloom.com http://develop.stepaheadsoftware.com ** ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ContinueToOriginalDestination does not clear destination after continue
Then this is a bug. On Mon, Apr 16, 2012 at 1:18 PM, Chris Colman chr...@stepaheadsoftware.com wrote: BTW that clear never gets called in the simple process of the Admin user going to admin page redirected and then 'continued' after authentication. I have not attempted to do anything with the standard user at this point so the clear not getting called seems to be a problem in a single user scenario. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, 16 April 2012 7:02 PM To: users@wicket.apache.org Subject: Re: ContinueToOriginalDestination does not clear destination after continue Hi Chris, Check the code at org.apache.wicket.RestartResponseAtInterceptPageException#continueToOri gina lDestination() This method indeed returns 'true' without cleaning the stored data but later when the redirect is processed the data is cleaned - see MAPPER#mapRequest(Request) method few lines below. Additionally this data is stored as meta data in the Session object, so changing users implies invalidation of the old (Admin) session and creation of a new (normal user) session. Do you degrade the Admin user to a user with less permissions without a real logout ? On Mon, Apr 16, 2012 at 11:53 AM, Chris Colman chr...@stepaheadsoftware.com wrote: ** ** We have a scenario where single person can log in under different accounts on the same website. Different user types will typically go to different page types. ** ** A single person using different accounts is not normally required but we are demonstrating to corporate clients how the system will be used by different user types. In the demonstration we need to log in as an 'admin' user to demo the admin aspects and then we need to log in as a 'standard' user to demonstrate the aspects that will apply to a standard user. ** ** The admin page uses RedirectToInterceptException to authentication page if no one is logged in. ** ** The standard page uses the home page to authenticate and throws new RestartResponseException(new AuthenticatePage(parameters)) if no one is authenticated (i.e. no intercept) ** ** After authentication we either continue or go to the 'default' page for a standard user. ** ** Code looks like this: ** ** If ( authenicationSucceeded ) { if ( !continueToOriginalDestination() ) { // Was not redirected to this authentication page so go to default destination for the home page*** * // Find default page for standard users and go to that page } } ** ** What we find is that after an admin log on (with intercept/continue sequence) a subsequent standard user log on will not execute the above body because continueToOriginalDestination returns 'true' even though this page was not an intercept page. ** ** It looks like after an intercept/continue has occurred it does not clear the 'original destination' attribute and so a subsequent call to continueToOriginalDestination will return true when it should really return false. ** ** Is the attribute that stores 'original destination' cleared after continueToOriginalDestination? Should it be? ** ** ** ** Yours sincerely, ** ** Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together ** ** **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au //chr...@stepahead.com.au Website: http://www.pagebloom.com http://develop.stepaheadsoftware.com ** ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: dynamic vertical menu creating-reg
Hi, Wicket just generates the markup of the page. So find a menu implementation in the internet that fits your needs and see what html and css it uses, then use some Wicket repeater to generate such html for your page. On Mon, Apr 16, 2012 at 12:58 PM, lenin lening...@gmail.com wrote: Dear, i am new in the wicket1.5.5 framework , how to create dynamic vertical menu(with sub menu) i want to display the page within the menu page. i am trying past one week but till not able to find the solution can any one help to resolve the problem... thanks in advance -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/dynamic-vertical-menu-creating-reg-tp4561036p4561036.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: ContinueToOriginalDestination does not clear destination after continue
Then this is a bug. https://issues.apache.org/jira/browse/WICKET-4500 Complete with quickstart. Regards, Chris On Mon, Apr 16, 2012 at 1:18 PM, Chris Colman chr...@stepaheadsoftware.com wrote: BTW that clear never gets called in the simple process of the Admin user going to admin page redirected and then 'continued' after authentication. I have not attempted to do anything with the standard user at this point so the clear not getting called seems to be a problem in a single user scenario. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, 16 April 2012 7:02 PM To: users@wicket.apache.org Subject: Re: ContinueToOriginalDestination does not clear destination after continue Hi Chris, Check the code at org.apache.wicket.RestartResponseAtInterceptPageException#continueToOri gina lDestination() This method indeed returns 'true' without cleaning the stored data but later when the redirect is processed the data is cleaned - see MAPPER#mapRequest(Request) method few lines below. Additionally this data is stored as meta data in the Session object, so changing users implies invalidation of the old (Admin) session and creation of a new (normal user) session. Do you degrade the Admin user to a user with less permissions without a real logout ? On Mon, Apr 16, 2012 at 11:53 AM, Chris Colman chr...@stepaheadsoftware.com wrote: ** ** We have a scenario where single person can log in under different accounts on the same website. Different user types will typically go to different page types. ** ** A single person using different accounts is not normally required but we are demonstrating to corporate clients how the system will be used by different user types. In the demonstration we need to log in as an 'admin' user to demo the admin aspects and then we need to log in as a 'standard' user to demonstrate the aspects that will apply to a standard user. ** ** The admin page uses RedirectToInterceptException to authentication page if no one is logged in. ** ** The standard page uses the home page to authenticate and throws new RestartResponseException(new AuthenticatePage(parameters)) if no one is authenticated (i.e. no intercept) ** ** After authentication we either continue or go to the 'default' page for a standard user. ** ** Code looks like this: ** ** If ( authenicationSucceeded ) { if ( !continueToOriginalDestination() ) { // Was not redirected to this authentication page so go to default destination for the home page*** * // Find default page for standard users and go to that page } } ** ** What we find is that after an admin log on (with intercept/continue sequence) a subsequent standard user log on will not execute the above body because continueToOriginalDestination returns 'true' even though this page was not an intercept page. ** ** It looks like after an intercept/continue has occurred it does not clear the 'original destination' attribute and so a subsequent call to continueToOriginalDestination will return true when it should really return false. ** ** Is the attribute that stores 'original destination' cleared after continueToOriginalDestination? Should it be? ** ** ** ** Yours sincerely, ** ** Chris Colman Pagebloom Team Leader, Step Ahead Software pagebloom - your business your website growing together ** ** **Sydney**: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 Email: chr...@stepahead.com.au //chr...@stepahead.com.au Website: http://www.pagebloom.com http://develop.stepaheadsoftware.com ** ** -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.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: 1.5 Stared blind patterndateconverter
Maybe because computers started care about time since Jan 1 1970 ? :-) On Mon, Apr 16, 2012 at 4:42 PM, nino martinez wael nino.martinez.w...@gmail.com wrote: I've been looking at this for too long, why does this test fail, why does result becomes 23:09 ? @Test public void testPatternConverter(){ PatternDateConverter converter=new PatternDateConverter( , false); Calendar instance = Calendar.getInstance(); instance.set(1900, 0, 1, 0, 0,0); Date dateModified=instance.getTime(); String result=converter.convertToString(dateModified, Locale.ENGLISH); Assert.assertTrue(00:00.equalsIgnoreCase(result)); } -- Best regards / Med venlig hilsen Nino Martinez -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: 1.5 Stared blind patterndateconverter
Hi, if I run your test, the result is just a space. If I change the Date-Pattern to HH:mm, the test goes green May be you are in the wrong time-zone... :-) - -- Regards, Hans http://cantaa.de -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/1-5-Stared-blind-patterndateconverter-tp4561565p4561641.html Sent from the Users forum 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
SimpleFormComponentLabel with page link in label
I am using SimpleFormComponentLabel for getting a clickable label for=... html tag for a input field (checkbox). In the text of the translated component label I want embed two links. How can this be done? (wicket:message with embedded components is not the solution as it creates no label for... to the associated text field...) I need something like this: input id=id9 type=checkbox name=acceptCheckbox label for=id9I am 18 years old and agree with the ${terms} and ${conditions}./label I tried: final CheckBox acceptedTerms = new CheckBox(acceptCheckbox, userModel.bind(userAccount.memberships[0].acceptedTerms)); form.add(acceptedTerms); acceptedTerms.setLabel(new ResourceModel(termsAndConditionsCheckLabel)); acceptedTerms.setRequired(true); final SimpleFormComponentLabel termsAndConditionsCheckLabel = new SimpleFormComponentLabel( termsAndConditionsCheckLabel, acceptedTerms); form.add(termsAndConditionsCheckLabel); final Link terms = new Link(terms, new ResourceModel(terms_of_use)) { private static final long serialVersionUID = 1L; @Override public void onClick() { setResponsePage(TermsOfUsePage.class); } }; termsAndConditionsCheckLabel.add(terms); but did not work (result: I am 18 years old and agree with the ${terms} and conditions.) Messages: entry key=termsAndConditionsCheckLabelI am 18 years old and agree with the ${terms} and conditions./entry entry key=terms_of_useTerms of Use/entry -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/SimpleFormComponentLabel-with-page-link-in-label-tp4562036p4562036.html Sent from the Users forum 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: Wicket cannot find id in inner enclosure...but has no problem in outer one!!!
Hi, can anyone tell me any other alternative of enclosure if the above problem cant be bugged out?? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-cannot-find-id-in-inner-enclosure-but-has-no-problem-in-outer-one-tp4559666p4562050.html Sent from the Users forum 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: SimpleFormComponentLabel with page link in label
Found the solution! Not using SimpleFormComponentLabel as it is replacing it's content, but using FormComponentLabel (to get for=... attribute) in combination with the wicket:message solution: final FormComponentLabel termsAndConditionsCheckLabel = new FormComponentLabel(termsAndConditionsCheckLabel, acceptedTerms); form.add(termsAndConditionsCheckLabel); final Link terms = new Link(terms) { private static final long serialVersionUID = 1L; @Override public void onClick() { setResponsePage(TermsOfUsePage.class); } }; termsAndConditionsCheckLabel.add(terms); final Label termsOfUse = new Label(terms_of_use, new ResourceModel(terms_of_use)); termsOfUse.setRenderBodyOnly(true); terms.add(termsOfUse); Markup: label wicket:id=termsAndConditionsCheckLabel wicket:message key=termsAndConditionsCheckLabelIch bin mindestens 18 Jahre alt und mit den lt;a href=# wicket:id=termsgt;lt;span wicket:id=terms_of_usegt;AGB'slt;/spangt;lt;/agt; und den Datenschutzbestimmungen einverstanden./wicket:message/label Messages: entry key=termsAndConditionsCheckLabelI am 18 years old and agree with the ${terms} and conditions./entry entry key=terms_of_useTerms of Use/entry I will add this solution to the Wiki! ;-) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/SimpleFormComponentLabel-with-page-link-in-label-tp4562036p4562365.html Sent from the Users forum 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
It is a better practice to push changes to state rather than pull
In the Javadoc for the Component#onConfigure() method, it states (in a paragraph dealing with setting whether a component is visible and/or enabled): It is a better practice to push changes to state rather than pull. [ http://wicket.apache.org/apidocs/1.5/org/apache/wicket/Component.html#onConfigure() ]. My reading of this sentence is that it is contrasting state change, where changes should be pushed to the component, with data change, where changes are pulled by the component from the model (i.e, change the model, not the component). Does that sound correct? Are there state changes other than being visible and being enabled that should be done in onConfigure? Thanks Andrew
Re: Page Expired with Google Analytics Tracking Code
Hi, I tried with super.renderHead..., but the result is the same. The PageableListView is empty after clicking on one of links in the PagingNavigator. Additinally, I fodun out that the elements (listItem) are empty when I click on one of the links in the PagingNavigator. They are filled, when the PageableListView is build. Any idea why how that could happen? Andre On Fri, 13 Apr 2012 10:29:41 +0200 Bas Gooren b...@iswd.nl wrote: Hi, What happens if you change that to: @Override public void renderHead(HeaderResponse response) { super.renderHead(response); String script = var _gaq = _gaq || ...; response.renderJavaScript(script, null); } ? (note that I added a call to super.renderHead()); Bas Op 11-4-2012 23:08, schreef Andre Schütz: Hi, I implemented your version but still I get the same error, if I have the Google Analytics Code in the head. Could it be an error with the way I insert the Google Analytics Code? I do it in the following way. In my WebPage class I overwrite the following method: @Override public void renderHead(HeaderResponse response) { String script = var _gaq = _gaq || ...; response.renderJavaScript(script, null); } Andre On Wed, 11 Apr 2012 11:38:52 +0200 Bas Goorenb...@iswd.nl wrote: Well, for starters I wonder why you are using multiple LoadableDetachableModels in a Vector? What we do 99% of the time is this: - Wrap the entire resultset in a LDM - Feed that LDM to a ListView or a variant (we have a custom RepeatingView for paged database listings) - Use PropertyModels inside the repeater item(s) (or not, since the ListView will refresh itself anyway) I'm pretty sure you don't need setReuseItems(true) in this case; The only reason I've seen where it's required on a ListView is when you use it inside a form and need form validation to work. Since I don't see any form fields inside your listview I guess this is not the case. I also wonder why you had datacontainer.setVersioned(false)? E.g.: private void displayResults(IModelListDefaultSearchResult results, int entriesPerPage) { WebMarkupContainer datacontainer = new WebMarkupContainer(listviewContainer); datacontainer.setOutputMarkupId(true); add(datacontainer); PageableListViewDefaultSearchResult listview = new PageableListViewDefaultSearchResult(listview, results, entriesPerPage) { StringBuilder sb; @Override protected void populateItem(ListItemDefaultSearchResult item) { DefaultSearchResult s = item.getModelObject(); // Either (A) item.add(new ExternalLink(title, new PropertyModel(item.getModel(), title)); // Or (B) item.add(new ExternalLink(title, s.getTitle()); item.add(new Label(description, new PropertyModel(item.getModel(), description))); item.add(new Label(time, s.getTime()).setEscapeModelStrings(false)); } }; datacontainer.add(listview); AjaxPagingNavigator apn = new AjaxPagingNavigator(navigator, listview){ @Override protected void onAjaxEvent(AjaxRequestTarget target) { super.onAjaxEvent(target); target.appendJavaScript(scrollTo(0,0)); } }; datacontainer.add(apn); } Op 11-4-2012 11:22, schreef wic...@faustas.de: Hi, thank you for the answer. The they are not completely empty means the following. My results variable is a Vector that contains LoadableDetachableModel's in the form of the LoaableListingEntryModel. This model contains a class that has two variables that I access with getResults() and getTime(). The content of the getResults() variable is a class that implements the Serializable interface. The getTime() variable just has a Vector with time strings. Now comes the interesting part. When I click on one of the links from the PagingNavigator, the content of the getTime() variable is displayed in each single ListItem. The getResults() class is empty. The content of the getResults() class is only shown after a page reload and once again empty after clicking on one of the links from the PagingNavigator. That's the reason why I said it is not completely empty. I know that there are 60 results to display. The PagingNavigator shows 6 links for 10 entries per page. But after clicking on one of the links, the objects from the getResults() class are empty. Any idea? Andre - Original Message - From: b...@iswd.nl To: users@wicket.apache.org Date: 11.04.2012 00:51:38 Subject: Re: Page Expired with Google Analytics Tracking Code Hi, It sounds a lot like you are not using models properly. E.g. your results method parameter has a length which
Re: It is a better practice to push changes to state rather than pull
I'm no Wicket expert, but as a general rule it's almost always better to be notified of an event or state change than to constantly poll for it (think of the child in the back seat on a long trip constantly asking Are we there yet?) From: Andrew Geery andrew.ge...@gmail.com To: users@wicket.apache.org Date: 04/16/2012 01:45 PM Subject:It is a better practice to push changes to state rather than pull In the Javadoc for the Component#onConfigure() method, it states (in a paragraph dealing with setting whether a component is visible and/or enabled): It is a better practice to push changes to state rather than pull. [ http://wicket.apache.org/apidocs/1.5/org/apache/wicket/Component.html#onConfigure() ]. My reading of this sentence is that it is contrasting state change, where changes should be pushed to the component, with data change, where changes are pulled by the component from the model (i.e, change the model, not the component). Does that sound correct? Are there state changes other than being visible and being enabled that should be done in onConfigure? Thanks Andrew ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: It is a better practice to push changes to state rather than pull
correct. an instance of a component can live through multiple iterations of data. lets say we override isVisible(). there are two problems: 1) the implementation MUST return consistent data, not only during processing of the same request, but also during the processing of the next callback. example: during render link's isVisible() returns TRUE. user clicks a link, during the processing of the callback request isVisible() now returns FALSE. this inconsistency causes wicket to think that there is a security violation since the user somehow managed to click an invisible link. by pushing the value in onConfigure() via setVisible() the value remains consistent until the next render. 2) these kinds of methods are called many times during request processing so the code inside must be simple. if visibility depends on a database query and you put this into isVisible() that query may run twenty times during the request. not very performant. by putting the query into onConfigure() you are guaranteed it will only be executed once per request. so this is component state. data, on the other hand, is different. lifecycle of a component and data doesnt match. components can live longer then data is valid, so it is necessary to always pull fresh data. -igor so for component state it is better to push using setters then overriding getters (since wicket can call getters many times during a request and running the logic that produces On Mon, Apr 16, 2012 at 11:44 AM, Andrew Geery andrew.ge...@gmail.com wrote: In the Javadoc for the Component#onConfigure() method, it states (in a paragraph dealing with setting whether a component is visible and/or enabled): It is a better practice to push changes to state rather than pull. [ http://wicket.apache.org/apidocs/1.5/org/apache/wicket/Component.html#onConfigure() ]. My reading of this sentence is that it is contrasting state change, where changes should be pushed to the component, with data change, where changes are pulled by the component from the model (i.e, change the model, not the component). Does that sound correct? Are there state changes other than being visible and being enabled that should be done in onConfigure? Thanks Andrew - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Page Expired with Google Analytics Tracking Code
Hi, Can you build a small quickstart so I can have a look at things when they are not working? So just the bare minimum where it's not working: your page that is not working with a dummy model (e.g. with hardcoded results). Bas Op 16-4-2012 20:50, schreef Andre Schütz: Hi, I tried with super.renderHead..., but the result is the same. The PageableListView is empty after clicking on one of links in the PagingNavigator. Additinally, I fodun out that the elements (listItem) are empty when I click on one of the links in the PagingNavigator. They are filled, when the PageableListView is build. Any idea why how that could happen? Andre On Fri, 13 Apr 2012 10:29:41 +0200 Bas Goorenb...@iswd.nl wrote: Hi, What happens if you change that to: @Override public void renderHead(HeaderResponse response) { super.renderHead(response); String script = var _gaq = _gaq || ...; response.renderJavaScript(script, null); } ? (note that I added a call to super.renderHead()); Bas Op 11-4-2012 23:08, schreef Andre Schütz: Hi, I implemented your version but still I get the same error, if I have the Google Analytics Code in the head. Could it be an error with the way I insert the Google Analytics Code? I do it in the following way. In my WebPage class I overwrite the following method: @Override public void renderHead(HeaderResponse response) { String script = var _gaq = _gaq || ...; response.renderJavaScript(script, null); } Andre On Wed, 11 Apr 2012 11:38:52 +0200 Bas Goorenb...@iswd.nl wrote: Well, for starters I wonder why you are using multiple LoadableDetachableModels in a Vector? What we do 99% of the time is this: - Wrap the entire resultset in a LDM - Feed that LDM to a ListView or a variant (we have a custom RepeatingView for paged database listings) - Use PropertyModels inside the repeater item(s) (or not, since the ListView will refresh itself anyway) I'm pretty sure you don't need setReuseItems(true) in this case; The only reason I've seen where it's required on a ListView is when you use it inside a form and need form validation to work. Since I don't see any form fields inside your listview I guess this is not the case. I also wonder why you had datacontainer.setVersioned(false)? E.g.: private void displayResults(IModelListDefaultSearchResultresults, int entriesPerPage) { WebMarkupContainer datacontainer = new WebMarkupContainer(listviewContainer); datacontainer.setOutputMarkupId(true); add(datacontainer); PageableListViewDefaultSearchResultlistview = new PageableListViewDefaultSearchResult(listview, results, entriesPerPage) { StringBuilder sb; @Override protected void populateItem(ListItemDefaultSearchResultitem) { DefaultSearchResult s = item.getModelObject(); // Either (A) item.add(new ExternalLink(title, new PropertyModel(item.getModel(), title)); // Or (B) item.add(new ExternalLink(title, s.getTitle()); item.add(new Label(description, new PropertyModel(item.getModel(), description))); item.add(new Label(time, s.getTime()).setEscapeModelStrings(false)); } }; datacontainer.add(listview); AjaxPagingNavigator apn = new AjaxPagingNavigator(navigator, listview){ @Override protected void onAjaxEvent(AjaxRequestTarget target) { super.onAjaxEvent(target); target.appendJavaScript(scrollTo(0,0)); } }; datacontainer.add(apn); } Op 11-4-2012 11:22, schreef wic...@faustas.de: Hi, thank you for the answer. The they are not completely empty means the following. My results variable is a Vector that contains LoadableDetachableModel's in the form of the LoaableListingEntryModel. This model contains a class that has two variables that I access with getResults() and getTime(). The content of the getResults() variable is a class that implements the Serializable interface. The getTime() variable just has a Vector with time strings. Now comes the interesting part. When I click on one of the links from the PagingNavigator, the content of the getTime() variable is displayed in each single ListItem. The getResults() class is empty. The content of the getResults() class is only shown after a page reload and once again empty after clicking on one of the links from the PagingNavigator. That's the reason why I said it is not completely empty. I know that there are 60 results to display. The PagingNavigator shows 6 links for 10 entries per page. But after clicking on one of the links, the objects from the getResults() class are empty. Any idea? Andre - Original Message - From: b...@iswd.nl To: users@wicket.apache.org Date: 11.04.2012 00:51:38 Subject: Re: Page Expired with Google Analytics Tracking Code Hi, It sounds a lot like you are not using
Re: 1.5 Stared blind patterndateconverter
I could be something with the time zone: this fails aswell: PatternDateConverter converter=new PatternDateConverter(HH:mm, false); Calendar instance = Calendar.getInstance(); instance.set(1900, 0, 1, 0, 0,0); Date dateModified=instance.getTime(); String result=converter.convertToString(dateModified, new Locale(da_DK)); Assert.assertTrue(00:00.equalsIgnoreCase(result)); pretty strange. BUT this does not: @Test public void testSimpleDateformatter(){ SimpleDateFormat sdf=new SimpleDateFormat(HH:mm); Calendar instance = Calendar.getInstance(); instance.set(1900, 0, 1, 0, 0,0); Date dateModified=instance.getTime(); String result=sdf.format(dateModified); Assert.assertTrue(00:00.equalsIgnoreCase(result)); } 2012/4/16 Hans Lesmeister 2 hans.lesmeis...@lessy-software.de Hi, if I run your test, the result is just a space. If I change the Date-Pattern to HH:mm, the test goes green May be you are in the wrong time-zone... :-) - -- Regards, Hans http://cantaa.de -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/1-5-Stared-blind-patterndateconverter-tp4561565p4561641.html Sent from the Users forum 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 -- Best regards / Med venlig hilsen Nino Martinez