DropDownChoice and generics
Hello, the generics solution for the DropdownChoice is weird in my opinion. I want to write like this: ListGender genders = getGenderList(); DropdownChoicePerson new DropDownChoicePerson(fieldId, new PropertyModelPerson(currentPerson, gender), genders); But the compilation fails because of the mismatch between generics. Actually how to solve such situations? Wicket's generic's are quite weird in my opinion and I cannot understand them probably correctly... I want to assign object(in my case Gender to Person) from the list via PropertyModel to my object but cannot understand, how to do it. Did not find even any examples from the manual. Sigmar - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scripting language
It depends, what do you want to do. If you want to develop your site in some scripting language, then use php or rails instead. I have seen groovy in some projects build scripts. Sigmar On Wed, Sep 1, 2010 at 2:10 PM, james yong i_yon...@yahoo.com.sg wrote: Hi all, Can anyone recommends a scripting language that can be used with Wicket for productivity? Regards, James -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Scripting-language-tp2402957p2402957.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
Expire session
Hello! Does anybody know, which is the best way to expire wicket session? I have these lines in web.xml and they seem to affecft nothing: session-config session-timeout10/session-timeout /session-config Best regards, Sigmar - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Expire session
Got problem solved. Also made it configurable per-user: http://www.weask.us/entry/page-expiration-wicket Still wondering, how to disable concurrent logins with wicket-auth-roles... On Sun, Aug 29, 2010 at 11:22 PM, Sigmar Muuga meedi...@gmail.com wrote: Hello! Does anybody know, which is the best way to expire wicket session? I have these lines in web.xml and they seem to affecft nothing: session-config session-timeout10/session-timeout /session-config Best regards, Sigmar - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Displaying labels instead of field keynames in error messages
Thanks, it works. On Tue, Jul 6, 2010 at 8:25 AM, Jeremy Thomerson jer...@wickettraining.comwrote: No, don't rename. Call setLabel on the component. Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jul 6, 2010 12:11 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Or I have to rename all my forms fields to the same values as their labels are? Yes, rename. ** Martin 2010/7/6 Sigmar Muuga meedi...@gmail.com: Hello, when I validate my form, wicket gives me errors like this: 'someFieldCode is mandator... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
java.lang.IllegalArgumentException: Parameter modelObject cannot be null
Hello, I am creating a form, my form has an instance variable: private Organization organisation; Also, organisation is initialized in constructor with new Organisation(). Now I am creating a TextField, that uses the propertyModel: IModelOrganization m1 = new PropertyModelOrganization(organisation, entity.name); TextFieldOrganization organisationName = new TextFieldOrganization(organisationName, m1); organisationName.setRequired(true); add(organisationName); But when I load the page, I get: java.lang.IllegalArgumentException: Parameter modelObject cannot be null I have read the docs and manuals about models etc, but this thing here is really weird..
Re: java.lang.IllegalArgumentException: Parameter modelObject cannot be null
Also entity is initalized for that organisation object. On Mon, Jul 5, 2010 at 10:36 AM, Sigmar Muuga meedi...@gmail.com wrote: Hello, I am creating a form, my form has an instance variable: private Organization organisation; Also, organisation is initialized in constructor with new Organisation(). Now I am creating a TextField, that uses the propertyModel: IModelOrganization m1 = new PropertyModelOrganization(organisation, entity.name); TextFieldOrganization organisationName = new TextFieldOrganization(organisationName, m1); organisationName.setRequired(true); add(organisationName); But when I load the page, I get: java.lang.IllegalArgumentException: Parameter modelObject cannot be null I have read the docs and manuals about models etc, but this thing here is really weird..
Re: java.lang.IllegalArgumentException: Parameter modelObject cannot be null
Ok, sorry, my bad. I did the initialization afterwards :( Sometimes such mistakes just happen... On Mon, Jul 5, 2010 at 10:45 AM, Wilhelmsen Tor Iver toriv...@arrive.nowrote: Also, organisation is initialized in constructor with new Organisation(). Does this initialization happen before or after you create the model? java.lang.IllegalArgumentException: Parameter modelObject cannot be null This error message indicates it happens after. - Tor Iver
Displaying labels instead of field keynames in error messages
Hello, when I validate my form, wicket gives me errors like this: 'someFieldCode is mandatory' etc. But how to use it like 'Some field is mandatory'? Is it only the default behaviour of replacing placeholders in wicket-messages and can be customized? Or I have to rename all my forms fields to the same values as their labels are? Sigmar
Re: Correct way of setting charset
Don't know that if is it the most correct way or not, but it works. My dotted letters are now working. But this option applies only to markup? What about other content(like JSON)? Sigmar On Sun, Jul 4, 2010 at 7:31 PM, Antoine van Wel antoine.van@gmail.comwrote: Maybe this is what you need, in your WebApplication's init method : getMarkupSettings().setDefaultMarkupEncoding(UTF-8); On Fri, Jul 2, 2010 at 9:29 AM, Sigmar Muuga meedi...@gmail.com wrote: Hello, what is the correct way of setting my pages charset? I did something like this and it didnt have any effect: @Override protected void configureResponse() { super.configureResponse(); final String encoding = text/ + getMarkupType() + ; charset=UTF-8; getResponse().setContentType(encoding); } I want to set everything in UTF-8. Also, when I did something like this(like it is said in docs, I got error: final String encoding = text/ + getMarkupType() + ; charset= + CharSetUtil.getEncoding(getRequestCycle()); getResponse().setContentType(encoding); And the error: java.lang.IndexOutOfBoundsException: Index: 4, Size: 0 at java.util.ArrayList.add(ArrayList.java:367) at org.apache.wicket.extensions.util.encoding.CharSetMap.init(CharSetMap.java:238) at org.apache.wicket.extensions.util.encoding.CharSetUtil.initialize(CharSetUtil.java:72) at org.apache.wicket.extensions.util.encoding.CharSetUtil.getEncoding(CharSetUtil.java:102) Sigmar
Correct way of setting charset
Hello, what is the correct way of setting my pages charset? I did something like this and it didnt have any effect: @Override protected void configureResponse() { super.configureResponse(); final String encoding = text/ + getMarkupType() + ; charset=UTF-8; getResponse().setContentType(encoding); } I want to set everything in UTF-8. Also, when I did something like this(like it is said in docs, I got error: final String encoding = text/ + getMarkupType() + ; charset= + CharSetUtil.getEncoding(getRequestCycle()); getResponse().setContentType(encoding); And the error: java.lang.IndexOutOfBoundsException: Index: 4, Size: 0 at java.util.ArrayList.add(ArrayList.java:367) at org.apache.wicket.extensions.util.encoding.CharSetMap.init(CharSetMap.java:238) at org.apache.wicket.extensions.util.encoding.CharSetUtil.initialize(CharSetUtil.java:72) at org.apache.wicket.extensions.util.encoding.CharSetUtil.getEncoding(CharSetUtil.java:102) Sigmar
Re: static or nonstatic inner classes
Actually not. I was thinking that maybe I have missed something from the docs. Such issues are sometimes hard to find :) On Wed, Jun 30, 2010 at 8:59 AM, Jeremy Thomerson jer...@wickettraining.com wrote: Use the same decision making process you would for any other java class Do you need access to any private variables of the containing class? Jeremy Thomerson -- sent from my smartphone - please excuse formatting and spelling errors On Jun 30, 2010 12:56 AM, Sigmar Muuga meedi...@gmail.com wrote: Hello, while designing pages for my app, I was thinking, if there is some difference, when I use static or nonstatic classes in my page classes? For example: public class MyPage extends Page { some code private /** Should it be static or not? */ class MyForm extends Form { } } Best regards, Sigmar
static or nonstatic inner classes
Hello, while designing pages for my app, I was thinking, if there is some difference, when I use static or nonstatic classes in my page classes? For example: public class MyPage extends Page { some code private /** Should it be static or not? */ class MyForm extends Form { } } Best regards, Sigmar
Re: Convention for classes name
*Page, *Form and *Panel are the best choices out there! You are on the right way, good luck! Sigmar On Sat, Jun 5, 2010 at 11:52 PM, James Carman ja...@carmanconsulting.comwrote: Are you Hungarian? On Sat, Jun 5, 2010 at 4:06 PM, Erdinc kocam...@yahoo.com wrote: I add PG prefix to page classes, e.g PGCustomerEditor, and RC to custom components, e.g RCDateTimeEditor. From: Gustavo Henrique gustavo...@gmail.com To: users@wicket.apache.org Sent: Sat, June 5, 2010 10:46:17 PM Subject: Convention for classes name Hi! Is there any name convention for classes using wicket? I'm using that model: CustomerPage, OrderPanel, ProductAddForm. What you think about? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: resources folder / package
You can define packages and put all CSS / JS files into them. Note that there must be some class also along with them, it may be an empty class. Then you can reference these resources using that class declaration. Note that if your css uses images, then you have to put correct paths into that css. Sigmar On Thu, Apr 15, 2010 at 2:43 PM, Eyal Golan egola...@gmail.com wrote: Hello to you all, it's been a very long time since I wrote here. I have a question regarding folder locations. I am working with WiQuery and it is unbelievable great. Also the support there (thanks indiana ;) ) In WiQuery there are 'themes' and the location of the CSS and images is in a separate folder called 'resources' , which has the same structure as of the Java classes themselves. I wanted to do the same in my project without success. Should I configure something other than just put the same hierarchy? thanks for the help. My question is Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary
Re: Wicket + Spring 3 + Hibernate
What error? Next time post the stack :) On Thu, Apr 15, 2010 at 5:47 PM, Steven Haines lyg...@yahoo.com wrote: Hi, I am at a point where I need to upgrade my application from Spring 2.5.6 to Spring 3.0.1.RELEASE. I have a working application and when I update Spring, I see the following exception on deployment: Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sessionFactory': FactoryBean which is currently in creation returned null from getObject at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:157) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:109) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1387) I've simplified my Hibernate configuration to: bean id=sessionFactory class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean property name=dataSource ref=dataSource / property name=hibernateProperties props prop key=hibernate.dialectorg.hibernate.dialect.Oracle10gDialect/prop prop key=hibernate.hbm2ddl.autovalidate/prop /props /property property name=packagesToScan list valuecom.mycompany.model/value /list /property /bean Finally, here is the dependency list in Maven for my Spring and Hibernate libraries with wicket.version=1.4.7 and spring.version=3.0.1.RELEASE: dependency groupIdorg.apache.wicket/groupId artifactIdwicket-spring/artifactId version${wicket.version}/version /dependency dependency groupIdorg.springframework/groupId artifactIdorg.springframework.context/artifactId version${spring.version}/version /dependency dependency groupIdorg.springframework/groupId artifactIdorg.springframework.core/artifactId version${spring.version}/version /dependency dependency groupIdorg.springframework/groupId artifactIdorg.springframework.web/artifactId version${spring.version}/version /dependency dependency groupIdorg.springframework/groupId artifactIdorg.springframework.web.servlet/artifactId version${spring.version}/version /dependency dependency groupIdorg.springframework/groupId artifactIdorg.springframework.beans/artifactId version${spring.version}/version /dependency dependency groupIdorg.springframework/groupId artifactIdorg.springframework.oxm/artifactId version${spring.version}/version /dependency dependency groupIdorg.springframework/groupId artifactIdorg.springframework.orm/artifactId version${spring.version}/version /dependency dependency groupIdjavax.servlet/groupId artifactIdservlet-api/artifactId version${servlet-api.version}/version scopeprovided/scope /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-core/artifactId version3.3.2.GA/version /dependency dependency groupIdjavax.persistence/groupId artifactIdpersistence-api/artifactId version1.0/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-annotations/artifactId version3.4.0.GA/version /dependency I have successfully integrated Spring 3 and Hibernate in a RESTful web service and I have successfully integrated Wicket 1.4.7 with Spring 2.5.6 and Hibernate, but I am seeing errors specifically with Wicket and Spring 3 with Hibernate. Has anyone successfully integrated the three technologies? Any suggestions? Thanks! Steve - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Checkboxes and defaultdatatable
Hello, can anybody say, which is the most hazzle-free way to do default datatable with multiple selectboxes? I created FilterForm with DefaultDatatable. In that table I have a checkbox column to select items. I followed the PhoneBook example but now I it is acting weirdly and I dont understand, what is the problem. I added submit button and when I click it, the selected items are not added to the list like in phonebook example. But when I select something from the filter-row selectbox, the form is automatically submitted and also items with checked selectboxes are added to my list... What may I have missing here? Sigmar
Re: http://cwiki.apache.org/WICKET is down
Yeah, same here. Google cache helped me out too :) Sigmar On Thu, Apr 15, 2010 at 2:45 AM, l yeung lenming.ye...@gmail.com wrote: I wasn't able to access the wiki pages since sunday. I had to look at google cached pages instead On Apr 15, 2010 8:27 AM, Carl Sziebert car...@gmail.com wrote: Any updates on when the reference site will be available again? On Sat, Apr 10, 2010 at 11:02 AM, Brian Topping topp...@codehaus.org wrote: Yes, I saw that to...
Memory usage
Hello, my app is about 3-4 pages and its running with spring. It has database connection and it uses basic authentication. What should be the maximum memory usage for this? At the moment it takes 422megabytes and this is definately too much for application without any load and traffic. Are there any checklist for running wicket appliction with minimal memory? Sigmar
Re: Memory usage
yeah, I have about 20megs of them :) On Mon, Mar 29, 2010 at 5:03 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Do you have a lots of libraries? ** Martin 2010/3/29 Sigmar Muuga meedi...@gmail.com: Hello, my app is about 3-4 pages and its running with spring. It has database connection and it uses basic authentication. What should be the maximum memory usage for this? At the moment it takes 422megabytes and this is definately too much for application without any load and traffic. Are there any checklist for running wicket appliction with minimal memory? Sigmar - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Memory usage
Seems that it loads all the stuff into the memory from jars.. On Mon, Mar 29, 2010 at 5:14 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: So your jit loader is very optimal ;) ** Martin 2010/3/29 Sigmar Muuga meedi...@gmail.com: yeah, I have about 20megs of them :) On Mon, Mar 29, 2010 at 5:03 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Do you have a lots of libraries? ** Martin 2010/3/29 Sigmar Muuga meedi...@gmail.com: Hello, my app is about 3-4 pages and its running with spring. It has database connection and it uses basic authentication. What should be the maximum memory usage for this? At the moment it takes 422megabytes and this is definately too much for application without any load and traffic. Are there any checklist for running wicket appliction with minimal memory? Sigmar - 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
Column filter customize
Hello, I have the following code in FilterToolbar for my DefaultDatatable: LoadableDetachableModelList? extends String choices = new LoadableDetachableModelList? extends String() { private static final long serialVersionUID = 1L; @Override protected ListString load() { ListString choices = new ArrayListString(); choices.add(t(yes)); choices.add(t(no)); return choices; } }; columns.add(new ChoiceFilteredPropertyColumnUser, String(new ModelString(t(Locked)), isLocked, choices)); Now I have a problem. As the property isLocked is integer, It gives me decimal conversion error when I filter (and thats correct). The real issue is that I have to convert these yes/no-s to a 1 or 0. Ideally, I would like to use map or something. Maybe somebody knows a reasonable solution here?
Weird feedback message formats
Hello, how to customize error / feedback messages in wicket? At the moment wicket displays quite stupidly password errors: mysecret is too short and so on. I would like to use translated field labels in feedback messages instead of field names, that are not so user friendly. Sigmar
Re: Dynamic javascript generation
It cannot be done like this, I got the error: WicketMessage: Cannot modify component hierarchy after render phase has started (page version cant change then anymore) On Sun, Mar 21, 2010 at 10:38 PM, Stefan Lindner lind...@visionet.dewrote: Add them in the needed order response.renderJavascript(first, firstUniqueID); response.renderJavascript(second, firstUniqueID); -Ursprüngliche Nachricht- Von: Sigmar Muuga [mailto:meedi...@gmail.com] Gesendet: Sonntag, 21. März 2010 21:36 An: users@wicket.apache.org Betreff: Re: Dynamic javascript generation My script tags are all in specific order, so how can I put this script right after some certain script tag there? Sigmar On Sun, Mar 21, 2010 at 10:31 PM, Stefan Lindner lind...@visionet.de wrote: Ok, try this add(new AbstractBehavior() { @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.renderJavascript(some dynamically generated JS, uniqueID); } } ); Every time the component (to that the AbstractBehaivor is added) is redrawn (eg. Initally or after an AjaxUpodate) the dynamically generated javascript is renderedinto HEAD. If you want to make sure that it is not rendered twice from another component with thie AbstractBehavior, just add some uniqueID in the renderJavascript call. -Ursprüngliche Nachricht- Von: Sigmar Muuga [mailto:meedi...@gmail.com] Gesendet: Sonntag, 21. März 2010 21:22 An: users@wicket.apache.org Betreff: Re: Dynamic javascript generation I need to include this dynamic js in my header with script tag like this in gmail: script src=?view=pageamp;name=browseramp;ver=zpwhtygjntrz view-source: https://mail.google.com/mail/?view=pagename=browserver=zpwhtygjntrz /script Some behaviour of that script depends on my session data on server side. I think that its not very complicated But I dont want to hardcode it to my html page, because urls and paths my changes. Dealing with resources provides more reliable configuration etc.. Sigmar On Sun, Mar 21, 2010 at 9:19 PM, Stefan Lindner lind...@visionet.de wrote: Generate some Javasript in response to e.g. a button klick? Or generate JavaScript when the page is rendered? -Ursprüngliche Nachricht- Von: Sigmar Muuga [mailto:meedi...@gmail.com] Gesendet: Sonntag, 21. März 2010 19:53 An: users@wicket.apache.org Betreff: Dynamic javascript generation Hello, I have to generate some javascript on the server side and then include it into my page. Which is the best way to do this with current stable wicket release? A the moment I am thinking about extending WebResource Sigmar
Re: Dynamic javascript generation
But I got my problem solved with response.renderJavascript( second, firstUniqueID); AbstractBehaviour didnt help me out... Thanks! On Mon, Mar 22, 2010 at 8:54 AM, Sigmar Muuga meedi...@gmail.com wrote: It cannot be done like this, I got the error: WicketMessage: Cannot modify component hierarchy after render phase has started (page version cant change then anymore) On Sun, Mar 21, 2010 at 10:38 PM, Stefan Lindner lind...@visionet.dewrote: Add them in the needed order response.renderJavascript(first, firstUniqueID); response.renderJavascript(second, firstUniqueID); -Ursprüngliche Nachricht- Von: Sigmar Muuga [mailto:meedi...@gmail.com] Gesendet: Sonntag, 21. März 2010 21:36 An: users@wicket.apache.org Betreff: Re: Dynamic javascript generation My script tags are all in specific order, so how can I put this script right after some certain script tag there? Sigmar On Sun, Mar 21, 2010 at 10:31 PM, Stefan Lindner lind...@visionet.de wrote: Ok, try this add(new AbstractBehavior() { @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.renderJavascript(some dynamically generated JS, uniqueID); } } ); Every time the component (to that the AbstractBehaivor is added) is redrawn (eg. Initally or after an AjaxUpodate) the dynamically generated javascript is renderedinto HEAD. If you want to make sure that it is not rendered twice from another component with thie AbstractBehavior, just add some uniqueID in the renderJavascript call. -Ursprüngliche Nachricht- Von: Sigmar Muuga [mailto:meedi...@gmail.com] Gesendet: Sonntag, 21. März 2010 21:22 An: users@wicket.apache.org Betreff: Re: Dynamic javascript generation I need to include this dynamic js in my header with script tag like this in gmail: script src=?view=pageamp;name=browseramp;ver=zpwhtygjntrz view-source: https://mail.google.com/mail/?view=pagename=browserver=zpwhtygjntrz /script Some behaviour of that script depends on my session data on server side. I think that its not very complicated But I dont want to hardcode it to my html page, because urls and paths my changes. Dealing with resources provides more reliable configuration etc.. Sigmar On Sun, Mar 21, 2010 at 9:19 PM, Stefan Lindner lind...@visionet.de wrote: Generate some Javasript in response to e.g. a button klick? Or generate JavaScript when the page is rendered? -Ursprüngliche Nachricht- Von: Sigmar Muuga [mailto:meedi...@gmail.com] Gesendet: Sonntag, 21. März 2010 19:53 An: users@wicket.apache.org Betreff: Dynamic javascript generation Hello, I have to generate some javascript on the server side and then include it into my page. Which is the best way to do this with current stable wicket release? A the moment I am thinking about extending WebResource Sigmar
Re: Links and labels
I think that the last sample is too complicated. Wicket is meant to be simple, I dont want to write 100 lines of code because of one simple link. On Mon, Mar 22, 2010 at 1:26 AM, Steve Mactaggart steve.mactagg...@gmail.com wrote: The other way I have implemented that in our local code is to create a LabeledBookmakableLink. This link takes a 4th parameter that is the label to display. Then override the onComponentTagBody to rewrite the contents of the a tag to put in the content. Code looks like: public LabeledBookmarkableLink(String id, Class pageClass, PageParameters parameters, IModelString label) { super(id, pageClass, parameters); this.label = label; } protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { if (label != null label.getObject() != null) { replaceComponentTagBody(markupStream, openTag, label.getObject()); } else { super.onComponentTagBody(markupStream, openTag); } } Cheers, Steve On Mon, Mar 22, 2010 at 3:37 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Try this: a href=# wicket:id=link1span wicket:id=id/span/a ** Martin 2010/3/21 Sigmar Muuga meedi...@gmail.com: Hello, does anybody know, how to add label to links? I have markup like this: a href=# wicket:id=link1[link label goes here]/a Now in java I want to do something like this: LinkObject link = new BookmarkablePageLinkObject(link1, HomePage.class, regParams); link.add(new Label(id, Register here!)); // this must be so, because I want to change this label runtime Sigmar - 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
Remove pageparameters
Hello, another issue with wicket: how to remove page parameters? Lets say I set parameter like this: ?do=something Now I navigate through my site and when I call setResponsePage for that particular page, all these parameters appear also on the address bar. I dont want them there and does anybody know, how to remve them or set them not stored?
Re: Remove pageparameters
Actually it makes the same. I am using them too, but I dont want them to be restorded into cache. At the moment I think it depends on session cookies, wicket stores them into cookies(I proved it by removing all cookies and then revisiting my app). On Mon, Mar 22, 2010 at 11:42 AM, Jens Alenius jens.alen...@megasol.sewrote: Sigmar Muuga skrev: Hello, another issue with wicket: how to remove page parameters? Lets say I set parameter like this: ?do=something Now I navigate through my site and when I call setResponsePage for that particular page, all these parameters appear also on the address bar. I dont want them there and does anybody know, how to remve them or set them not stored? I dont use pageparameters. I'm using parameters on in the page constructor instead. Jens - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Text replace with component
Hello, lets say I have something like this: String label = You may click %destinationLink% to visit our store of %destinationLabel%; Now I want to replace %destinationLink% with new BookmarkableLink(...); I am using GNU Gettext translations(.po files), thats why such solution... Is it possible or is there any reasonable way to do this? Sigmar
Links and labels
Hello, does anybody know, how to add label to links? I have markup like this: a href=# wicket:id=link1[link label goes here]/a Now in java I want to do something like this: LinkObject link = new BookmarkablePageLinkObject(link1, HomePage.class, regParams); link.add(new Label(id, Register here!)); // this must be so, because I want to change this label runtime Sigmar
Dynamic javascript generation
Hello, I have to generate some javascript on the server side and then include it into my page. Which is the best way to do this with current stable wicket release? A the moment I am thinking about extending WebResource Sigmar
Re: Dynamic javascript generation
I need to include this dynamic js in my header with script tag like this in gmail: script src=?view=pageamp;name=browseramp;ver=zpwhtygjntrz view-source:https://mail.google.com/mail/?view=pagename=browserver=zpwhtygjntrz/script Some behaviour of that script depends on my session data on server side. I think that its not very complicated But I dont want to hardcode it to my html page, because urls and paths my changes. Dealing with resources provides more reliable configuration etc.. Sigmar On Sun, Mar 21, 2010 at 9:19 PM, Stefan Lindner lind...@visionet.de wrote: Generate some Javasript in response to e.g. a button klick? Or generate JavaScript when the page is rendered? -Ursprüngliche Nachricht- Von: Sigmar Muuga [mailto:meedi...@gmail.com] Gesendet: Sonntag, 21. März 2010 19:53 An: users@wicket.apache.org Betreff: Dynamic javascript generation Hello, I have to generate some javascript on the server side and then include it into my page. Which is the best way to do this with current stable wicket release? A the moment I am thinking about extending WebResource Sigmar
Re: Dynamic javascript generation
My script tags are all in specific order, so how can I put this script right after some certain script tag there? Sigmar On Sun, Mar 21, 2010 at 10:31 PM, Stefan Lindner lind...@visionet.dewrote: Ok, try this add(new AbstractBehavior() { @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.renderJavascript(some dynamically generated JS, uniqueID); } } ); Every time the component (to that the AbstractBehaivor is added) is redrawn (eg. Initally or after an AjaxUpodate) the dynamically generated javascript is renderedinto HEAD. If you want to make sure that it is not rendered twice from another component with thie AbstractBehavior, just add some uniqueID in the renderJavascript call. -Ursprüngliche Nachricht- Von: Sigmar Muuga [mailto:meedi...@gmail.com] Gesendet: Sonntag, 21. März 2010 21:22 An: users@wicket.apache.org Betreff: Re: Dynamic javascript generation I need to include this dynamic js in my header with script tag like this in gmail: script src=?view=pageamp;name=browseramp;ver=zpwhtygjntrz view-source: https://mail.google.com/mail/?view=pagename=browserver=zpwhtygjntrz /script Some behaviour of that script depends on my session data on server side. I think that its not very complicated But I dont want to hardcode it to my html page, because urls and paths my changes. Dealing with resources provides more reliable configuration etc.. Sigmar On Sun, Mar 21, 2010 at 9:19 PM, Stefan Lindner lind...@visionet.de wrote: Generate some Javasript in response to e.g. a button klick? Or generate JavaScript when the page is rendered? -Ursprüngliche Nachricht- Von: Sigmar Muuga [mailto:meedi...@gmail.com] Gesendet: Sonntag, 21. März 2010 19:53 An: users@wicket.apache.org Betreff: Dynamic javascript generation Hello, I have to generate some javascript on the server side and then include it into my page. Which is the best way to do this with current stable wicket release? A the moment I am thinking about extending WebResource Sigmar
Easies way to set custom HTML
Hello, which is the easiest way to set custom HTML page for a Page or Panel? For example I have panel called HelloPanel, conventinally Wicket wants to pair it with HelloPanel.html in the same package, but I want to use HelloMyDearFriends.html with that panel... Sigmar
Re: Wicket and GNU Gettext
Actually I am using .class files as translation resources(gettext-commons generates them). I use lib called gettext-commons with ant ( http://code.google.com/p/gettext-commons/). I translate all translations with poEdit. Sigmar On Wed, Mar 17, 2010 at 8:13 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Just one idea: 1-implement your own IStringResourceLoader that reads messages from where you need 2-register it on Application.init(). e.g. getResourceSettings().addStringResourceLoader(GetTextResourceLoader.getInstance()); I see no reason why wicket:message should not work as expected if you do the above. Ernesto On Wed, Mar 17, 2010 at 6:18 AM, Sigmar Muuga meedi...@gmail.com wrote: Hello, just wanted to ask, if anybody has experiences with combining GNU Gettext and Wicket? Actually I am figuring how to get my project work best with it... what should I do r what should I do not Is it possible to use it also with wicket:message? Sigmar
Wicket and GNU Gettext
Hello, just wanted to ask, if anybody has experiences with combining GNU Gettext and Wicket? Actually I am figuring how to get my project work best with it... what should I do r what should I do not Is it possible to use it also with wicket:message? Sigmar
Re: Session expired drives me mad!
I have had no problems with @SpringBean Also try to use them like this: @SpringBean(name=yourBeanName) This way you can avoid some mess that may occur in the future :) On Mon, Mar 8, 2010 at 5:46 PM, James Carman jcar...@carmanconsulting.comwrote: No, you need to use the @SpringBean annotation: http://cwiki.apache.org/WICKET/spring.html#Spring-AnnotationbasedApproach 2010/3/8 Martin Asenov mase...@velti.com: Hello, Well, I do use Spring Beans, and as shown in the stack trace, there is a field relation to the beans themselves. I don't think I can avoid it, do I? I create the beans by casting from the ApplicationContext. Thank you, Martin -Original Message- From: ce...@jweekend.com [mailto:ce...@jweekend.com] On Behalf Of Cemal Bayramoglu Sent: Monday, March 08, 2010 5:39 PM To: users Subject: Re: Session expired drives me mad! Martin, It looks like your page is holding on to Spring benas. Are you using @SpringBean to inject Spring beans into your pages? That way you would get a proxy to the beans so you don't need to worry about them being serialisable. Regards - Cemal jWeekend OO Java Technologies, Wicket Consulting, Development, Training http://jWeekend.com 2010/3/8 Martin Asenov mase...@velti.com: Hello everyone! The session expired problem really drives me mad, because it's been couple of months or so since it started bothering me. Please advice me on what to do, because I'm despaired. Wicket tries to serialize every single class in my opinion. I enabled the DEBUG of Wicket and messages like the following one are flooding the log. Here it is: 08-03-2010 17:30:03,445 ERROR org.apache.wicket.util.lang.Objects.objectToByteArray:1134 - Error serializing object class com.mycompany.myapp.ui.users.Users [object=[Page class = com.mycompany.myapp.ui.users.Users, id = 21, version = 0]] org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: org.springframework.orm.jpa.AbstractEntityManagerFactoryBean$ManagedEntityManagerFactoryInvocationHandler Field hierarchy is: 21 [class=com.mycompany.myapp.ui.users.Users, path=21] private java.lang.Object org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;] protected java.lang.Object com.mycompany.myapp.ui.MyFormPanel.model[15] [class=org.apache.wicket.markup.html.WebMarkupContainer, path=21:holder] private java.lang.Object org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;] private java.lang.Object org.apache.wicket.MarkupContainer.children[0] [class=com.mycompany.myapp.ui.users.Users$2, path=21:holder:view] private java.lang.Object org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;] private java.lang.Object org.apache.wicket.MarkupContainer.children[0] [class=org.apache.wicket.markup.repeater.Item, path=21:holder:view:1] private java.lang.Object org.apache.wicket.MarkupContainer.children [class=org.apache.wicket.markup.repeater.RepeatingView, path=21:holder:view:1:cols] private java.lang.Object org.apache.wicket.MarkupContainer.children [class=org.apache.wicket.markup.repeater.Item, path=21:holder:view:1:cols:2] java.lang.Object org.apache.wicket.Component.data [class=com.mycompany.myapp.ui.users.SortedUsersProvider$1] final com.mycompany.myapp.ui.users.SortedUsersProvider com.mycompany.myapp.ui.users.SortedUsersProvider$1.this$0 [class=com.mycompany.myapp.ui.users.SortedUsersProvider] private com.mycompany.myapp.session.UserContext com.mycompany.myapp.ui.users.SortedUsersProvider.context [class=com.mycompany.myapp.session.UserContext] private com.mycompany.myapp.ui.util.Utilities com.mycompany.myapp.session.UserContext.utilities [class=com.mycompany.myapp.ui.util.Utilities] private com.mycompany.myapp.admin.ManagementBean com.mycompany.myapp.ui.util.Utilities.domainAndUsersManagement [class=com.mycompany.myapp.admin.ManagementBean$$EnhancerByCGLIB$$b016b4a] private net.sf.cglib.proxy.MethodInterceptor com.mycompany.myapp.admin.ManagementBean$$EnhancerByCGLIB$$b016b4a.CGLIB$CALLBACK_0 [class=org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor] private org.springframework.aop.framework.AdvisedSupport org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.advised [class=org.springframework.aop.framework.ProxyFactory] private org.springframework.aop.Advisor[] org.springframework.aop.framework.AdvisedSupport.advisorArray [class=[Lorg.springframework.aop.Advisor;] private org.springframework.aop.Advisor[]
Re: How to dynamically create wicket label and TextField Component?
Just make a div or whatever element and add childs to it in page. On Tue, Mar 9, 2010 at 5:53 AM, sravan g sravangs...@gmail.com wrote: Hi all, Any one have idea about How to dynamically create wicket label and TextField Component based on other TextField value from Database? Thanks, Sravan.
Setting selected value for DropDownChoice
Hello, I am trying to use one of the hardest part in Wicket: DropDownChoice the code looks like this: ListCountry countryList = generalDAO.findAllCountries(); Country country = getSelectedCountryByISO3(141, countryList); final DropDownChoice countryId = new DropDownChoice(countryId, new PropertyModel(country, id), countryList); add(countryId); I want to select an item, and set it selected on my dropdown, but its not selected. How to set the selected value for it? Sigmar
Re: Setting selected value for DropDownChoice
Still not working actually, got another problem. When I select the item with ID 241, I get item with ID 239. My country pojo is like this: import lombok.Data; @Data public class Country extends BaseModel { private static final long serialVersionUID = 1L; private long id; private String iso2; private String iso3; private String nameShort; private String nameLong; @Override public String toString() { return nameShort; } @Override public boolean equals(Object o) { if (o != null) { if (o instanceof Country) { return id == ((Country) o).getId(); } } return false; } } Weird. On Sun, Mar 7, 2010 at 7:05 PM, Vit Rozkovec rozkovec...@email.cz wrote: Hallo, try something like this: ListCountry countryList = generalDAO.findAllCountries(); Country country = getSelectedCountryByISO3(141, countryList); inal DropDownChoiceCointry countryId = new DropDownChoiceCountry(countryId, new ModelCountry(country), countryList); add(countryId); You must pass the model, which contains the element you want to select. Vitek Sigmar Muuga wrote: Hello, I am trying to use one of the hardest part in Wicket: DropDownChoice the code looks like this: ListCountry countryList = generalDAO.findAllCountries(); Country country = getSelectedCountryByISO3(141, countryList); final DropDownChoice countryId = new DropDownChoice(countryId, new PropertyModel(country, id), countryList); add(countryId); I want to select an item, and set it selected on my dropdown, but its not selected. How to set the selected value for it? Sigmar - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Setting selected value for DropDownChoice
Actually it works even randomly now, when I change the values:S I've read docs and books and still have no idea with that :S DropDownChoice has hard API design problems IMHO... On Sun, Mar 7, 2010 at 7:18 PM, Sigmar Muuga meedi...@gmail.com wrote: Still not working actually, got another problem. When I select the item with ID 241, I get item with ID 239. My country pojo is like this: import lombok.Data; @Data public class Country extends BaseModel { private static final long serialVersionUID = 1L; private long id; private String iso2; private String iso3; private String nameShort; private String nameLong; @Override public String toString() { return nameShort; } @Override public boolean equals(Object o) { if (o != null) { if (o instanceof Country) { return id == ((Country) o).getId(); } } return false; } } Weird. On Sun, Mar 7, 2010 at 7:05 PM, Vit Rozkovec rozkovec...@email.cz wrote: Hallo, try something like this: ListCountry countryList = generalDAO.findAllCountries(); Country country = getSelectedCountryByISO3(141, countryList); inal DropDownChoiceCointry countryId = new DropDownChoiceCountry(countryId, new ModelCountry(country), countryList); add(countryId); You must pass the model, which contains the element you want to select. Vitek Sigmar Muuga wrote: Hello, I am trying to use one of the hardest part in Wicket: DropDownChoice the code looks like this: ListCountry countryList = generalDAO.findAllCountries(); Country country = getSelectedCountryByISO3(141, countryList); final DropDownChoice countryId = new DropDownChoice(countryId, new PropertyModel(country, id), countryList); add(countryId); I want to select an item, and set it selected on my dropdown, but its not selected. How to set the selected value for it? Sigmar - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Setting selected value for DropDownChoice
I got it working with ISO2. Thanks Vit, I got your idea, I'll investigate later, why it didnt work with ID. On Sun, Mar 7, 2010 at 7:35 PM, Sigmar Muuga meedi...@gmail.com wrote: Actually it works even randomly now, when I change the values:S I've read docs and books and still have no idea with that :S DropDownChoice has hard API design problems IMHO... On Sun, Mar 7, 2010 at 7:18 PM, Sigmar Muuga meedi...@gmail.com wrote: Still not working actually, got another problem. When I select the item with ID 241, I get item with ID 239. My country pojo is like this: import lombok.Data; @Data public class Country extends BaseModel { private static final long serialVersionUID = 1L; private long id; private String iso2; private String iso3; private String nameShort; private String nameLong; @Override public String toString() { return nameShort; } @Override public boolean equals(Object o) { if (o != null) { if (o instanceof Country) { return id == ((Country) o).getId(); } } return false; } } Weird. On Sun, Mar 7, 2010 at 7:05 PM, Vit Rozkovec rozkovec...@email.czwrote: Hallo, try something like this: ListCountry countryList = generalDAO.findAllCountries(); Country country = getSelectedCountryByISO3(141, countryList); inal DropDownChoiceCointry countryId = new DropDownChoiceCountry(countryId, new ModelCountry(country), countryList); add(countryId); You must pass the model, which contains the element you want to select. Vitek Sigmar Muuga wrote: Hello, I am trying to use one of the hardest part in Wicket: DropDownChoice the code looks like this: ListCountry countryList = generalDAO.findAllCountries(); Country country = getSelectedCountryByISO3(141, countryList); final DropDownChoice countryId = new DropDownChoice(countryId, new PropertyModel(country, id), countryList); add(countryId); I want to select an item, and set it selected on my dropdown, but its not selected. How to set the selected value for it? Sigmar - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org