Palette problem
Hello, I have a problem about palette. here is the scenario: if there is already values in selected side and when I add values from available side there is only n-1 values get. If there is currently 2 values in the selected side then i add 2 values from available side, i only get 3 values. The last one is not included in the result. Any idea? Thanks a lot. Cheers.
Re: CheckboxMultipleChoice in Ajax style
Mathias, I changed a bit of code and now it works without problems. I even can't reproduce what was the problem. Thank's a lot for your help Philipp When I try this code it works. Can you please post some code for us -- Averbis GmbH c/o Klinikum der Albert-Ludwigs-Universität Stefan-Meier-Strasse 26 D-79104 Freiburg Fon: +49 (0) 761 - 203 6707 Fax: +49 (0) 761 - 203 6800 E-Mail: dau...@averbis.de Geschäftsführer: Dr. med. Philipp Daumke, Kornél Markó Sitz der Gesellschaft: Freiburg i. Br. AG Freiburg i. Br., HRB 701080 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ModalWindow not appearing in IE
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; i just add that in my basepage to works on IE7...i couldn't have imagine that this line of code saves me a lot. NHSoft.YHW wrote: ModalWindow can not appear in IE 6.x, but Firefox 3.x has no problem. In IE 6.x, when click show ModalWindow link, the server side code invoke, but the browser not show the modalwindow. ajax debug message detail as follow: INFO: focus removed from wicket-generated-id-120 INFO: focus set on showModal233 INFO: INFO: Initiating Ajax GET request on ?wicket:interface=:2:homeTabs:panel:shopDetailPanel:wmcModalWindow:showModal2::IBehaviorListener:0:-1random=0.702769703404648 INFO: Invoking pre-call handler(s)... INFO: Received ajax response (6568 characters) INFO: ?xml version=1.0 encoding=UTF-8?ajax-responseheader-contribution encoding=wicket1 ![CDATA[head xmlns:wicket=http://wicket.apache.org;script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js/script script type=text/javascript id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/ wicketAjaxDebugEnable=true; /*--]^]^*//script script type=text/javascript src=resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.js/script link rel=stylesheet type=text/css href=resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.css / script type=text/javascript src=resources/org.apache.wicket.extensions.yui.YuiLib/yuiloader-beta.js/script script type=text/javascript !--/*--![CDATA[/*!--*/ var e = Wicket.$('date44Dp'); if (e != null typeof(e.parentNode) != 'undefined' typeof(e.parentNode.parentNode != 'undefined')) e.parentNode.parentNode.removeChild(e.parentNode); /*--]^]^*//script /head]]/header-contributioncomponent id=modal231 ![CDATA[div id=modal231 style=display:none div id=content32 div style=margin: 1em This is panel content! p Date text field to demonstrate AJAX header contribution input id=date44 name=homeTabs:panel:shopDetailPanel:wmcModalWindow:modal2:content:dateTimeField:date value= type=text size=8/ nbsp; resources/org.apache.wicket.extensions.yui.calendar.DatePicker/icon1.gif input name=homeTabs:panel:shopDetailPanel:wmcModalWindow:modal2:content:dateTimeField:hours value= type=text size=2/nbsp;: input name=homeTabs:panel:shopDetailPanel:wmcModalWindow:modal2:content:dateTimeField:minutes value= type=text size=2/ select name=homeTabs:panel:shopDetailPanel:wmcModalWindow:modal2:content:dateTimeField:amOrPmChoice option selected=selected value=0AM/option option value=1PM/option /select /p /div /div /div]]/componentevaluate encoding=wicket1![CDATA[/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the License); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ if (typeof wicketCalendarInits == 'undefined') { wicketCalendarInits = new Array(); wicketCalendarInitFinished = false; } initdate44 = function() { Wicket.DateTime.init( { widgetId: date44, componentId: date44, calendarInit: { MONTHS_SHORT:[\u4E00\u6708,\u4E8C\u6708,\u4E09\u6708,\u56DB\u6708,\u4E94\u6708,\u516D\u6708,\u4E03\u6708,\u516B\u6708,\u4E5D\u6708,\u5341\u6708,\u5341\u4E00\u6708,\u5341\u4E8C\u6708]^,START_WEEKDAY:0,MONTHS_LONG:[\u4E00\u6708,\u4E8C\u6708,\u4E09\u6708,\u56DB\u6708,\u4E94\u6708,\u516D\u6708,\u4E03\u6708,\u516B\u6708,\u4E5D\u6708,\u5341\u6708,\u5341\u4E00\u6708,\u5341\u4E8C\u6708]^,iframe:false,WEEKDAYS_MEDIUM:[\u65E5,\u4E00,\u4E8C,\u4E09,\u56DB,\u4E94,\u516D]^,WEEKDAYS_1CHAR:[\u65E5,\u4E00,\u4E8C,\u4E09,\u56DB,\u4E94,\u516D]^,WEEKDAYS_LONG:[\u661F\u671F\u65E5,\u661F\u671F\u4E00,\u661F\u671F\u4E8C,\u661F\u671F\u4E09,\u661F\u671F\u56DB,\u661F\u671F\u4E94,\u661F\u671F\u516D]^,close:true,WEEKDAYS_SHORT:[\u65E5,\u4E00,\u4E8C,\u4E09,\u56DB,\u4E94,\u516D]^
Re: ModalWindow not appearing in IE
Am Thu, 14 May 2009 01:06:13 -0700 (PDT) schrieb freak182 eman.noll...@gmail.com: i just add that in my basepage to works on IE7...i couldn't have imagine that this line of code saves me a lot. FYI http://en.wikipedia.org/wiki/Quirks_mode - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
FileUploadFile FileNotFoundException (Wicket 1.3.5)
Hi all, Currently I want to upload a file via FileUploadField. However when I select a file and press upload I get a FileNotFoundException (System cannot find the file specified). File.getCanonicalPath and file.getAbsolutePath both returns the wrong location. Somebody a clue why? Regards, Stefan Java: final FileUploadField fileUploadField = new FileUploadField(fileInput2); Form form = new Form(ajax-simpleUpload2){ private static final long serialVersionUID = -2623469756422643826L; @Override protected void onSubmit() { final FileUpload upload = fileUploadField.getFileUpload(); File file = new File(upload.getClientFileName()); try { file.getCanonicalPath(); //Returns wrong path file.getAbsolutePath(); //Returns wrong path InputStream in = new FileInputStream(file); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } super.onSubmit(); }}; form.setMultiPart(true); form.add(fileUploadField); add(form); HTML: form wicket:id=ajax-simpleUpload2 fieldset legendUpload form/legend p label for=uploadFile/label input wicket:id=fileInput2 id=upload type=file/ /p input type=submit value=Upload!/ /fieldset /form The information contained in this communication is confidential, intended solely for the use of the individual or entity to whom it is addressed and may be legally privileged and protected by professional secrecy. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. This email does not constitute any commitment from Cordys Holding BV or any of its subsidiaries except when expressly agreed in a written agreement between the intended recipient and Cordys Holding BV or its subsidiaries. Cordys is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. Cordys does not guarantee that the integrity of this communication has been maintained nor that the communication is free of viruses, interceptions or interference. If you are not the intended recipient of this communication please return the communication to the sender and delete and destroy all copies.
Re: FileUploadFile FileNotFoundException (Wicket 1.3.5)
Why are you looking up the client filename? Do you have access the the remote computer your user is on? Martijn On Thu, May 14, 2009 at 10:53 AM, Stefan Droog sdr...@educator.eu wrote: Hi all, Currently I want to upload a file via FileUploadField. However when I select a file and press upload I get a FileNotFoundException (System cannot find the file specified). File.getCanonicalPath and file.getAbsolutePath both returns the wrong location. Somebody a clue why? Regards, Stefan Java: final FileUploadField fileUploadField = new FileUploadField(fileInput2); Form form = new Form(ajax-simpleUpload2){ private static final long serialVersionUID = -2623469756422643826L; �...@override protected void onSubmit() { final FileUpload upload = fileUploadField.getFileUpload(); File file = new File(upload.getClientFileName()); try { file.getCanonicalPath(); //Returns wrong path file.getAbsolutePath(); //Returns wrong path InputStream in = new FileInputStream(file); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } super.onSubmit(); }}; form.setMultiPart(true); form.add(fileUploadField); add(form); HTML: form wicket:id=ajax-simpleUpload2 fieldset legendUpload form/legend p label for=uploadFile/label input wicket:id=fileInput2 id=upload type=file/ /p input type=submit value=Upload!/ /fieldset /form The information contained in this communication is confidential, intended solely for the use of the individual or entity to whom it is addressed and may be legally privileged and protected by professional secrecy. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. This email does not constitute any commitment from Cordys Holding BV or any of its subsidiaries except when expressly agreed in a written agreement between the intended recipient and Cordys Holding BV or its subsidiaries. Cordys is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. Cordys does not guarantee that the integrity of this communication has been maintained nor that the communication is free of viruses, interceptions or interference. If you are not the intended recipient of this communication please return the communication to the sender and delete and destroy all copies. -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: FileUploadFile FileNotFoundException (Wicket 1.3.5)
Martijn, Thanks for your quick answer. I missed some crucial parts ;) Folder flr = new Folder(d:\\testUpload); File file = new File(flr, upload.getClientFileName()); ... file.createNewFile(); upload.writeTo(file); ... Now it is working properly. Stefan -Original Message- From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] Sent: Thursday, May 14, 2009 10:59 AM To: users@wicket.apache.org Subject: Re: FileUploadFile FileNotFoundException (Wicket 1.3.5) Why are you looking up the client filename? Do you have access the the remote computer your user is on? Martijn On Thu, May 14, 2009 at 10:53 AM, Stefan Droog sdr...@educator.eu wrote: Hi all, Currently I want to upload a file via FileUploadField. However when I select a file and press upload I get a FileNotFoundException (System cannot find the file specified). File.getCanonicalPath and file.getAbsolutePath both returns the wrong location. Somebody a clue why? Regards, Stefan Java: final FileUploadField fileUploadField = new FileUploadField(fileInput2); Form form = new Form(ajax-simpleUpload2){ private static final long serialVersionUID = -2623469756422643826L; �...@override protected void onSubmit() { final FileUpload upload = fileUploadField.getFileUpload(); File file = new File(upload.getClientFileName()); try { file.getCanonicalPath(); //Returns wrong path file.getAbsolutePath(); //Returns wrong path InputStream in = new FileInputStream(file); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } super.onSubmit(); }}; form.setMultiPart(true); form.add(fileUploadField); add(form); HTML: form wicket:id=ajax-simpleUpload2 fieldset legendUpload form/legend p label for=uploadFile/label input wicket:id=fileInput2 id=upload type=file/ /p input type=submit value=Upload!/ /fieldset /form The information contained in this communication is confidential, intended solely for the use of the individual or entity to whom it is addressed and may be legally privileged and protected by professional secrecy. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. This email does not constitute any commitment from Cordys Holding BV or any of its subsidiaries except when expressly agreed in a written agreement between the intended recipient and Cordys Holding BV or its subsidiaries. Cordys is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. Cordys does not guarantee that the integrity of this communication has been maintained nor that the communication is free of viruses, interceptions or interference. If you are not the intended recipient of this communication please return the communication to the sender and delete and destroy all copies. -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now:
Re: Palette problem
What type of values are you using? What type of collection are you putting them in? On Thu, May 14, 2009 at 2:39 AM, Eman Nollase eman.noll...@gmail.com wrote: Hello, I have a problem about palette. here is the scenario: if there is already values in selected side and when I add values from available side there is only n-1 values get. If there is currently 2 values in the selected side then i add 2 values from available side, i only get 3 values. The last one is not included in the result. Any idea? Thanks a lot. Cheers. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Newbie-Problem: Wicket/Maven/Jetty: FileNotFoundException?
I am very new to the Java-World and want to make a web project using Java/Maven2/Wicket. I tried to install Wicket with these instructions: http://cwiki.apache.org/WICKET/windows-guide-to-installing-wicket-on-eclipse-with-maven.html Everything went fine up to the point of running a project. I tried Wicket version 1.4 rc4 and 1.3.6. Trying to reach localhost:8080 displays an 503-Error... The console told me the following: INFO - log- Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP INFO - log- jetty-6.1.4 INFO - log- NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet WARN - log- Failed startup of context org.mortbay.jetty.webapp.webappcont...@137c60d{/,src/main/webapp} java.io.FileNotFoundException: \\ROSSV01\ROSSV01\Users\mypersonalusername\.m2\repository\log4j\log4j\1.2.14\log4j-1.2.14.jar (Access denied) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.init(ZipFile.java:114) at java.util.jar.JarFile.init(JarFile.java:133) [...] ROSSV01 is the name of the networkserver where my userdata is stored. I have no clue why Maven(?) chose that directory... However the URL is false: Right URL: \\ROSSV01\Users\mypersonalusername\.m2\... Wrong URL: \\ROSSV01\ROSSV01\Users\mypersonalusername\.m2\... So I'm pretty stuck here. Is it a Wicket error? Is it a Maven error? Jetty error? Where could I change the URL using eclipse? Right now I am pretty confused here... Would be great if somebody can help me out... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: System test for a Wicket based web application. Do you do it? How?
To be honest, there's nothing wicket-specific about it. Testing AJAX is pretty easy, just use waitFor* assertions to delay until the AJAX component is loaded. One slight irritation is that Wicket munges the id of its components, making element identification a bit tedious, so I eventually wrote a custom element locator. Best thing is to just get in and install it, try it, take over one of the provided stubs and modify it to drive your own application. It won't take you long to get into the groove. The documentation is pretty good too. Cheers, Günther Newgro wrote: stiq looks very promising. Can you please provide some small snippets howto use it in correlation with wicket? -- View this message in context: http://www.nabble.com/System-test-for-a-Wicket-based-web-application.-Do-you-do-it--How--tp23513449p23539242.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: StatelessForm in Bookmarkable Page problem
I'm having the same problem with wicket-1.4-rc4. Does anybody have a clue why this is happening? FakeBoy wrote: Hi everyone, I try to work with StatelessForm, but I have strange problem. When I fill in form fields first time everything works good. But If I have some validation in some field (in my example field: first name is required) and if the walidation failed, and i try to click submit button some strange character (;,:) appear in form fields and it is not possible to submit form. I thing that problem is in URL, because it looks strange and i can see a lot of duplicated values for the same field. I discovered , if I didnt call super constructor with page parameters it works fine. (bu there are other problems with page parameters) pre public StatelessFormPage(PageParameters pageParameters) { //PROBLEM - when I delete this everything works but if not it works strange super(pageParameters); //FEEDBACK PANEL FeedbackPanel feedbackPanel = new FeedbackPanel(feedbackPanel); add(feedbackPanel); //STATELESS FORM StatelessFormVoid form = new StatelessFormVoid(form); add(form); //FORMS FIELDS form.add(new TextFieldString(firstName, new PropertyModelString(this, firstName)).setRequired(true)); form.add(new TextFieldString(lastName, new PropertyModelString(this, lastName))); //SUBMIT BUTTON Button submit = new Button(submit) { @Override public void onSubmit() { System.out.println(Button:onSubmit()); System.out.println(First name: + firstName); System.out.println(Last name: + lastName); } }; form.add(submit); } /pre Wicket version: 1.4 m3 br / Source code: br / java - http://www.nabble.com/file/p19430608/StatelessFormPage.java StatelessFormPage.java br / html - http://www.nabble.com/file/p19430608/StatelessFormPage.html StatelessFormPage.html br / br / Thanks a lot, Dave -- View this message in context: http://www.nabble.com/StatelessForm-in-Bookmarkable-Page-problem-tp19430608p23539798.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
Tree Table - Update Model
Hi every one, I tried the tree table example and get stuck with two problems. How can I avoid links in the tree leavlets? How can I update the tree on a new model. I've generated the tree information on a database query with a search field. When I press the search button, I expected the tree to be updated with the new model, but it doesn't work. suchform.add(new AjaxButton(search) { private static final long serialVersionUID = 1L; @Override protected void onSubmit(AjaxRequestTarget target, Form form) { suchliste = new SucheDao().search(suchfeld); log.debug(#Treffer: + suchliste.size());; tm = createTreeModel(suchliste); tree.updateTree(); target.addComponent(tree); } }); tm = createTreeModel(suchliste); tree = new Tree(tree, tm); tree.setRootLess(true); tree.getTreeState().collapseAll();); add(tree.setOutputMarkupId(true));); Wicket Version 1.3.6 Thanx. PETER DIEFENTHÄLER CSC Sandstr. 7, 80335 München, Germany CIS Payments Integration | office: +49 89 5908 6441 | mobile: +49 172 886 5632 | fax: +49 89 5908 6499 | pdief...@csc.com | www.csc.com CSC • This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose • CSC Deutschland Solutions GmbH • Registered Office: Abraham-Lincoln-Park 1, 65189 Wiesbaden, Germany • Board of Directors: Gerhard Fercho (Chairman), Thomas Nebe, Peter Schmidt • Chairman of the Supervisory Board: Guy Hains • Registered in Germany: HRB 22374
Ajax Tree Table
Hi every one, I tried the tree table example and get stuck with two problems. How can I avoid links in the tree leavlets? How can I update the tree on a new model. I've generated the tree information on a database query with a search field. When I press the search button, I expected the tree to be updated with the new model, but it doesn't work. suchform.add(new AjaxButton(search) { private static final long serialVersionUID = 1L; @Override protected void onSubmit(AjaxRequestTarget target, Form form) { suchliste = new SucheDao().search(suchfeld); log.debug(#Treffer: + suchliste.size());; tm = createTreeModel(suchliste); tree.updateTree(); target.addComponent(tree); } }); tm = createTreeModel(suchliste); tree = new Tree(tree, tm); tree.setRootLess(true); tree.getTreeState().collapseAll();); add(tree.setOutputMarkupId(true));); Wicket Version 1.3.6 Thanx. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Apache Tomcat CSS
Nice, I didn't know you could use negatives there. Erik. James Carman wrote: You can set up IntelliJ to not exclude them. Just go to the compiler properties for your project and set the exclude to something like !?*.java. 2009/5/13 Erik van Oosten e.vanoos...@grons.nl: I always get this for a new app when I run/build it from Eclipse or IntelliJ. Both default to exclude resources from the java packages. Build with Maven (change the pom or use quickstart to start with a correct pom) and the file should be there. Regards, Erik. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket/Jackrabbit stream PDF file to client
I want to send e.g. a PDF file to the client. It does work for JPG and Html but not for e.g PDF / PNG / TXT files. When I try to open the file I get Adobe Reader could not open FILENAME because it is either not a supported file type or because the file has been damaged(for example, it was sent as an email attachment and wasn't correctly decoded). Content type is application/pdf. Regards, Stefan Store the data in jackrabbit: FileUpload upload = fileUploadField.getFileUpload(); Node resNode = fileNode.addNode(jcr:content, nt:resource); resNode.setProperty(jcr:data, upload.getInputStream()); resNode.setProperty(jcr:mimeType, upload.getContentType()); Stream data Link: Link exportCsv = new Link(downloadLink) { @Override public void onClick() { IResourceStream stream = getResourceStream(); getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(stream).setFileName(m_fileName)); } }; add(exportCsv); getResourceStream returns stream IResourceStream stream = new AbstractResourceStream() { private InputStream m_in; private String m_mime; @Override public void close() throws IOException { m_in.close(); } @Override public InputStream getInputStream() throws ResourceStreamNotFoundException { Session session = null; try { . //Get the inputstream from Jackrabbit repository m_in = content.getProperty(jcr:data).getStream(); m_mime = content.getProperty(jcr:mimeType).getString(); } catch (Some exceptions) } finally { session.logout(); } return m_in; } @Override public String getContentType() { return m_mime; } }; The information contained in this communication is confidential, intended solely for the use of the individual or entity to whom it is addressed and may be legally privileged and protected by professional secrecy. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. This email does not constitute any commitment from Cordys Holding BV or any of its subsidiaries except when expressly agreed in a written agreement between the intended recipient and Cordys Holding BV or its subsidiaries. Cordys is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. Cordys does not guarantee that the integrity of this communication has been maintained nor that the communication is free of viruses, interceptions or interference. If you are not the intended recipient of this communication please return the communication to the sender and delete and destroy all copies.
Re: Illegal State Exception on DefaultTeeModel.removeNodeFromParent
Any resolution on this? Or may be some workaround? +Leena skatz wrote: I have the same problem using 1.3.5, but not when using 1.3.3. I spent some time tracing the source code and it seems related to the addition of this line: getTreeState().selectNode((TreeNode)item.getModelObject(), false); at the very end of the function (line 835): AbstractTree.treeNodesRemoved() This line results (eventually) in a call to AbstractTree.invalidateNode() which on line 1295 calls: item.remove() which alters the state of item such that the call to item.remove() in AbstractTree.treeNodesRemoved() fails with the exception mentioned previously. I note that the IItemCallback() code, immediately above, calls two identical lines in the reverse order. I wonder reversing the later two would fix the problem? -- View this message in context: http://www.nabble.com/Illegal-State-Exception-on-DefaultTeeModel.removeNodeFromParent-tp20185042p23541664.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Palette problem
Hello, I just found the problem. I modified the palette.js. Wicket.Palette.update if( i+1 selected.lenght) ... changed to: if ( i selected.lenght) ..this works fine but we are testing it. James Carman-3 wrote: What type of values are you using? What type of collection are you putting them in? On Thu, May 14, 2009 at 2:39 AM, Eman Nollase eman.noll...@gmail.com wrote: Hello, I have a problem about palette. here is the scenario: if there is already values in selected side and when I add values from available side there is only n-1 values get. If there is currently 2 values in the selected side then i add 2 values from available side, i only get 3 values. The last one is not included in the result. Any idea? Thanks a lot. Cheers. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Palette-problem-tp23535231p23541749.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: StatelessForm in Bookmarkable Page problem
try with trunk. this was fixed yesterday afaik. -igor On Thu, May 14, 2009 at 5:42 AM, Alex Objelean alex_objel...@yahoo.com wrote: I'm having the same problem with wicket-1.4-rc4. Does anybody have a clue why this is happening? FakeBoy wrote: Hi everyone, I try to work with StatelessForm, but I have strange problem. When I fill in form fields first time everything works good. But If I have some validation in some field (in my example field: first name is required) and if the walidation failed, and i try to click submit button some strange character (;,:) appear in form fields and it is not possible to submit form. I thing that problem is in URL, because it looks strange and i can see a lot of duplicated values for the same field. I discovered , if I didnt call super constructor with page parameters it works fine. (bu there are other problems with page parameters) pre public StatelessFormPage(PageParameters pageParameters) { //PROBLEM - when I delete this everything works but if not it works strange super(pageParameters); //FEEDBACK PANEL FeedbackPanel feedbackPanel = new FeedbackPanel(feedbackPanel); add(feedbackPanel); //STATELESS FORM StatelessFormVoid form = new StatelessFormVoid(form); add(form); //FORMS FIELDS form.add(new TextFieldString(firstName, new PropertyModelString(this, firstName)).setRequired(true)); form.add(new TextFieldString(lastName, new PropertyModelString(this, lastName))); //SUBMIT BUTTON Button submit = new Button(submit) { @Override public void onSubmit() { System.out.println(Button:onSubmit()); System.out.println(First name: + firstName); System.out.println(Last name: + lastName); } }; form.add(submit); } /pre Wicket version: 1.4 m3 br / Source code: br / java - http://www.nabble.com/file/p19430608/StatelessFormPage.java StatelessFormPage.java br / html - http://www.nabble.com/file/p19430608/StatelessFormPage.html StatelessFormPage.html br / br / Thanks a lot, Dave -- View this message in context: http://www.nabble.com/StatelessForm-in-Bookmarkable-Page-problem-tp19430608p23539798.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Apache Tomcat CSS
On Thu, May 14, 2009 at 9:55 AM, Erik van Oosten e.vanoos...@grons.nl wrote: Nice, I didn't know you could use negatives there. Yeah, I figured that out a while back (no idea how) and it was a big help. I just have to remember to do it for each new Wicket project (or figure out how to set default project properties again) I start (and that's a lot of them). - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Palette problem
You're saying you modified the JS that comes with Wicket and it caused the problem or you modified it and it fixed it? On Thu, May 14, 2009 at 10:27 AM, freak182 eman.noll...@gmail.com wrote: Hello, I just found the problem. I modified the palette.js. Wicket.Palette.update if( i+1 selected.lenght) ... changed to: if ( i selected.lenght) ..this works fine but we are testing it. James Carman-3 wrote: What type of values are you using? What type of collection are you putting them in? On Thu, May 14, 2009 at 2:39 AM, Eman Nollase eman.noll...@gmail.com wrote: Hello, I have a problem about palette. here is the scenario: if there is already values in selected side and when I add values from available side there is only n-1 values get. If there is currently 2 values in the selected side then i add 2 values from available side, i only get 3 values. The last one is not included in the result. Any idea? Thanks a lot. Cheers. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Palette-problem-tp23535231p23541749.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Form Components With Built In Feedback
textfield.add(new FieldBorder()) doesn't work. -jim igor.vaynberg wrote: use IComponentBorder and then simply add it to each form component or subclass formcomponents and add it in the constructor, eg textfield.add(new fieldborder()); -igor public class FieldBorder implements IComponentBorder { public static final IComponentBorder INSTANCE = new FieldBorder(); public void renderAfter(Component component) { final Response out = component.getResponse(); ListFeedbackMessage errors = component.getSession().getFeedbackMessages().messages( new ErrorsFilter(component)); if (errors.size() 0) { out.write(ul class=\errors\); for (FeedbackMessage error : errors) { out.write(li); out.write(error.getMessage().toString()); out.write(/li); } out.write(/ul); } } public void renderBefore(Component component) { component.setOutputMarkupId(true); final Response out = component.getResponse(); final boolean required = isRequired(component); out.write(label for=\); out.write(component.getMarkupId()); out.write(\); if (required) { out.write(strongem*/em); } String label = null; if (component instanceof LabeledWebMarkupContainer) { IModel labelModel = ((LabeledWebMarkupContainer)component).getLabel(); if (labelModel != null) { label = labelModel.getObject().toString(); } } if (label == null) { label = component.getString(component.getId()); } if (!Strings.isEmpty(label)) { out.write(label); if (separator) { out.write(getSeparator()); } } if (required) { out.write(/strong); } out.write(/label); } protected String getSeparator() { return :; } private boolean isRequired(Component component) { if (component instanceof FormComponent) { return ((FormComponent)component).isRequired(); } return false; } private static class ErrorsFilter implements IFeedbackMessageFilter { private final Component target; public ErrorsFilter(Component target) { this.target = target; } public boolean accept(FeedbackMessage message) { if (message.isError() message.getReporter() != null) { if (target == message.getReporter()) { return true; } if (target instanceof MarkupContainer) { if (((MarkupContainer)target).contains(message.getReporter(), true)) { return true; } } } return false; } } } On Tue, Jan 13, 2009 at 12:20 PM, walnutmon justin.m.boy...@gmail.com wrote: All, I have a page with many form components, nearly all of them have some kind of validation associated with them. I have a feedback panel at the top, I'd like to move feedback next to each component. I have thought of some ways to do this without changing a ton of code, however none really work in the end because I would still need to add some kind of HTML in order to display messages. Also, nearly everything like this that I have developed in wicket is usually accompanied by the discovery that wicket already has the functionality I'm looking for out of the box. Searching has given me surprisingly little with regard to this topic though. Can someone point me in the right direction? -- View this message in context: http://www.nabble.com/Form-Components-With-Built-In-Feedback-tp21443674p21443674.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 -- View this message in context: http://www.nabble.com/Form-Components-With-Built-In-Feedback-tp21443674p23544681.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail:
Re: Form Components With Built In Feedback
textfield.setcomponentborder(new fieldborder()); IDEs are good at helping you... -igor On Thu, May 14, 2009 at 9:56 AM, jobiwankanobi jobr...@spinnphr.com wrote: textfield.add(new FieldBorder()) doesn't work. -jim igor.vaynberg wrote: use IComponentBorder and then simply add it to each form component or subclass formcomponents and add it in the constructor, eg textfield.add(new fieldborder()); -igor public class FieldBorder implements IComponentBorder { public static final IComponentBorder INSTANCE = new FieldBorder(); public void renderAfter(Component component) { final Response out = component.getResponse(); ListFeedbackMessage errors = component.getSession().getFeedbackMessages().messages( new ErrorsFilter(component)); if (errors.size() 0) { out.write(ul class=\errors\); for (FeedbackMessage error : errors) { out.write(li); out.write(error.getMessage().toString()); out.write(/li); } out.write(/ul); } } public void renderBefore(Component component) { component.setOutputMarkupId(true); final Response out = component.getResponse(); final boolean required = isRequired(component); out.write(label for=\); out.write(component.getMarkupId()); out.write(\); if (required) { out.write(strongem*/em); } String label = null; if (component instanceof LabeledWebMarkupContainer) { IModel labelModel = ((LabeledWebMarkupContainer)component).getLabel(); if (labelModel != null) { label = labelModel.getObject().toString(); } } if (label == null) { label = component.getString(component.getId()); } if (!Strings.isEmpty(label)) { out.write(label); if (separator) { out.write(getSeparator()); } } if (required) { out.write(/strong); } out.write(/label); } protected String getSeparator() { return :; } private boolean isRequired(Component component) { if (component instanceof FormComponent) { return ((FormComponent)component).isRequired(); } return false; } private static class ErrorsFilter implements IFeedbackMessageFilter { private final Component target; public ErrorsFilter(Component target) { this.target = target; } public boolean accept(FeedbackMessage message) { if (message.isError() message.getReporter() != null) { if (target == message.getReporter()) { return true; } if (target instanceof MarkupContainer) { if (((MarkupContainer)target).contains(message.getReporter(), true)) { return true; } } } return false; } } } On Tue, Jan 13, 2009 at 12:20 PM, walnutmon justin.m.boy...@gmail.com wrote: All, I have a page with many form components, nearly all of them have some kind of validation associated with them. I have a feedback panel at the top, I'd like to move feedback next to each component. I have thought of some ways to do this without changing a ton of code, however none really work in the end because I would still need to add some kind of HTML in order to display messages. Also, nearly everything like this that I have developed in wicket is usually accompanied by the discovery that wicket already has the functionality I'm looking for out of the box. Searching has given me surprisingly little with regard to this topic though. Can someone point me in the right direction? -- View this message in context: http://www.nabble.com/Form-Components-With-Built-In-Feedback-tp21443674p21443674.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 -- View this message in context: http://www.nabble.com/Form-Components-With-Built-In-Feedback-tp21443674p23544681.html Sent from the Wicket - User mailing list archive at
Re: Spring Security's method security and Wicket
Hi James, Thank you for example! Although I can't find any secured methods in there. Not in your beans.xml and not by grepping for Secured on all your files. So correct me if I'm wrong, but I don't think you are using the method security option in Spring Security? In any case I'm greatful for you showing me how you solved the integration and I'll be looking more into it soon. My current problem is with method security, while URL security works. If I secure an URL using Spring Security it works as it should (I get re-directed to the login page if I'm not logged in, or to the access denied page if I am logged in). I think it works because the Spring filter comes before the Wicket filter. When the AuthenticationCredentialsNotFoundException (from Spring) is thrown from Spring's code it will also be processed by the Spring code. On the other hand. If the call reaches Wicket's filter and gets processed by Wicket and my own code and a AuthenticationCredentialsNotFoundException (from Spring) is thrown then Wicket will also deal with it and the Spring filter will never know what happened. I currently have two questions: 1. I would like any AuthenticationCredentialsNotFoundException to pass through Wicket's filter so it may be processed by the Spring filter. Any ideas? I suspect it might be doable by creating and using my own request cycle [ by extending WebRequestCycle) and overriding onRuntimeException(..) ] but as I'm quite new to Wicket I'm a bit unsure of how that is done. 2. In these cases (when a AuthenticationCredentialsNotFoundException) is raised it will result in the method call failing and transaction rollback. As Spring has recorded the request it will replay it when the user has authenticated. Any thoughts about this and how it will work with: bookmarkable pages, session relative pages and back button functionality? Best regards, Kent On Fri, May 8, 2009 at 12:53 PM, James Carman jcar...@carmanconsulting.com wrote: You can check out my wicket-advanced application that I wrote for a talk I gave to our local Java users group. In there, I implemented a Spring Security-based implementation. Here's my session class: http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/common/session/SpringSecuritySession.java and here's my application class: http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/common/application/WicketApplication.java and here's my web configuration: http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/webapp/WEB-INF/web.xml and here's my spring configuration: http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/resources/META-INF/beans.xml It works, but I believe someone pointed out a little bit of a bug in my code at one point. I don't think I fixed it yet. I can't remember who it was. Anyone? Perhaps it was something about not catching the authentication exception in the login and returning false? I can't remember. :( On Fri, May 8, 2009 at 5:51 AM, Kent Larsson kent.lars...@gmail.com wrote: Hello, Reference for this post: http://forum.springsource.org/showthread.php?p=239559#post239559 (the related Spring Security thread) It actually seems my interpretation about how it might work was correct below (though my original interpretation was wrong, but let's not talk about that one ;-) ). Luke Tayler mentions it might be Wicket swallowing the exception which Spring Security creates and shows it to the user. That way Spring Security will never know that the exception was thrown and it can't redirect the user to the log in page. What Spring Security seems to like doing is: 1. Spring Security records the request data. 2. When a @Secured(SOME_ROLE) annotated method is found it throws a AuthenticationException or a AuthorizationException 3. This exception is cought by Spring Security which redirect the user to the log in page. 4. When the user has logged on, the recorded request data is used again to simulate the original request. At step 2 above any transaction is rolled back. Between step 2 and 3, at step 2.5 it seems Wicket catches the AuthenticationException or AuthorizationException and (at least in development mode) shows the exception to the user. That way step 3 and 4 will never be executed. Between step 1 and 2, at step 1.5 above Wicket will do its stuff (page, models, etc). If the same (recorded) request arrives again (after user log in) how will Wicket react? Is it possible to get this working with Wicket? Should I? Any tips? I'm new to both Wicket and Spring Security, this might be a bit over my head. It would be really nice to get it working though. Thank you for reading! Have a nice weekend! Best regards, Kent On Wed, May 6, 2009 at 10:22 PM, Kent Larsson kent.lars...@gmail.com wrote: I don't know. I guess something like: 1. Record
Re: Spring Security's method security and Wicket
On Thu, May 14, 2009 at 1:38 PM, Kent Larsson kent.lars...@gmail.com wrote: Hi James, Thank you for example! Although I can't find any secured methods in there. Not in your beans.xml and not by grepping for Secured on all your files. So correct me if I'm wrong, but I don't think you are using the method security option in Spring Security? In any case I'm greatful for you showing me how you solved the integration and I'll be looking more into it soon. My current problem is with method security, while URL security works. You're very welcome. Sorry I didn't fix the problem in the code (I should do that while I'm thinking about it), but it's not that difficult to catch AuthenticationException and return false. You're correct, I am not using method-level security. I can imagine that you can try a custom error catcher to redirect to your login page if a spring security exception is found (or tell them they're not allowed to do what they tried to do)? I'd have to play with it. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Component creation and initialization
Hi all, Is there a way in wicket for separate the object's instantiation phase from the inner component's creation phase? Just like the init() method in application, but for my components. Another way to see it, just in case it's not clear: Is there an already defined contract for component creation, that allows me to create the components I will use in some panel/page, but not to do it in the Java constructor? Thanks in advance! Juan
Re: Component creation and initialization
You could probably do it in onBeforeRender - but you would need to keep a boolean flag to check if it's the first render so that you don't recreate them on a second render There was talking of adding an onBeforeFirstRender method, but I don't think it's happened yet - you could look for the method to see if I'm wrong. -- Jeremy Thomerson http://www.wickettraining.com On Thu, May 14, 2009 at 12:51 PM, Juan G. Arias juangar...@gmail.com wrote: Hi all, Is there a way in wicket for separate the object's instantiation phase from the inner component's creation phase? Just like the init() method in application, but for my components. Another way to see it, just in case it's not clear: Is there an already defined contract for component creation, that allows me to create the components I will use in some panel/page, but not to do it in the Java constructor? Thanks in advance! Juan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component creation and initialization
I think you can use hasBeenRendered() method instead of custom boolean flag. -- Daniel On 2009-05-14, at 20:15, Jeremy Thomerson wrote: You could probably do it in onBeforeRender - but you would need to keep a boolean flag to check if it's the first render so that you don't recreate them on a second render There was talking of adding an onBeforeFirstRender method, but I don't think it's happened yet - you could look for the method to see if I'm wrong. -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
error because of log4j from org.apache.wicket.Application
bean wicketApplication' is my web-application's org.apache.wicket.Application this is the error message I get starting my application org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wicketApplication' defined in class path resource [applicationContext-web.xml]: Instantiation of bean failed; nested exception is java.lang.NoSuchFieldError: name root cause Caused by: java.lang.NoSuchFieldError: name at org.slf4j.impl.Log4jLoggerAdapter.init(Log4jLoggerAdapter.java:75) at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:75) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:103) at org.apache.wicket.Application.clinit(Application.java:143) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877) please suggest what am I missing , My project is built by maven and this is a project with sub-projects jar,war, and ear and its uses spring , hibernate , and wicket 1.4, I specified the dependency for org.slf4j dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.5.5/version /dependency please suggest what version should I use ?
Re: error because of log4j from org.apache.wicket.Application
Can we see your log4j.properties file? On Thu, May 14, 2009 at 3:39 PM, tubin gen fachh...@gmail.com wrote: bean wicketApplication' is my web-application's org.apache.wicket.Application this is the error message I get starting my application org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wicketApplication' defined in class path resource [applicationContext-web.xml]: Instantiation of bean failed; nested exception is java.lang.NoSuchFieldError: name root cause Caused by: java.lang.NoSuchFieldError: name at org.slf4j.impl.Log4jLoggerAdapter.init(Log4jLoggerAdapter.java:75) at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:75) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:103) at org.apache.wicket.Application.clinit(Application.java:143) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877) please suggest what am I missing , My project is built by maven and this is a project with sub-projects jar,war, and ear and its uses spring , hibernate , and wicket 1.4, I specified the dependency for org.slf4j dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.5.5/version /dependency please suggest what version should I use ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: error because of log4j from org.apache.wicket.Application
I using log4j.xml http://www.nabble.com/file/p23547818/log4j.xml log4j.xml attached is my log4j.xml James Carman-3 wrote: Can we see your log4j.properties file? On Thu, May 14, 2009 at 3:39 PM, tubin gen fachh...@gmail.com wrote: bean wicketApplication' is my web-application's org.apache.wicket.Application this is the error message I get starting my application org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wicketApplication' defined in class path resource [applicationContext-web.xml]: Instantiation of bean failed; nested exception is java.lang.NoSuchFieldError: name root cause Caused by: java.lang.NoSuchFieldError: name at org.slf4j.impl.Log4jLoggerAdapter.init(Log4jLoggerAdapter.java:75) at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:75) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:103) at org.apache.wicket.Application.clinit(Application.java:143) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877) please suggest what am I missing , My project is built by maven and this is a project with sub-projects jar,war, and ear and its uses spring , hibernate , and wicket 1.4, I specified the dependency for org.slf4j dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.5.5/version /dependency please suggest what version should I use ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/error-because-of-log4j-from-org.apache.wicket.Application-tp23547592p23547818.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: error because of log4j from org.apache.wicket.Application
You should also check your dependencies using the maven dependency plugin. Are there conflicting slf4j-log4j12 versions in there? Are there conflicting log4j versions? On Thu, May 14, 2009 at 9:54 PM, fachhoch fachh...@gmail.com wrote: I using log4j.xml http://www.nabble.com/file/p23547818/log4j.xml log4j.xml attached is my log4j.xml James Carman-3 wrote: Can we see your log4j.properties file? On Thu, May 14, 2009 at 3:39 PM, tubin gen fachh...@gmail.com wrote: bean wicketApplication' is my web-application's org.apache.wicket.Application this is the error message I get starting my application org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wicketApplication' defined in class path resource [applicationContext-web.xml]: Instantiation of bean failed; nested exception is java.lang.NoSuchFieldError: name root cause Caused by: java.lang.NoSuchFieldError: name at org.slf4j.impl.Log4jLoggerAdapter.init(Log4jLoggerAdapter.java:75) at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:75) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:103) at org.apache.wicket.Application.clinit(Application.java:143) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877) please suggest what am I missing , My project is built by maven and this is a project with sub-projects jar,war, and ear and its uses spring , hibernate , and wicket 1.4, I specified the dependency for org.slf4j dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.5.5/version /dependency please suggest what version should I use ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/error-because-of-log4j-from-org.apache.wicket.Application-tp23547592p23547818.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Tree Table - Update Model
What worked for me is replacing the tree component via replaceWith() with a new instance of the tree. It's definitely not nice but at least it worked. Kaspar On 14.05.2009, at 14:55, Peter Diefenthaeler wrote: Hi every one, I tried the tree table example and get stuck with two problems. How can I avoid links in the tree leavlets? How can I update the tree on a new model. I've generated the tree information on a database query with a search field. When I press the search button, I expected the tree to be updated with the new model, but it doesn't work. suchform.add(new AjaxButton(search) { private static final long serialVersionUID = 1L; @Override protected void onSubmit(AjaxRequestTarget target, Form form) { suchliste = new SucheDao().search(suchfeld); log.debug(#Treffer: + suchliste.size());; tm = createTreeModel(suchliste); tree.updateTree(); target.addComponent(tree); } }); tm = createTreeModel(suchliste); tree = new Tree(tree, tm); tree.setRootLess(true); tree.getTreeState().collapseAll();); add(tree.setOutputMarkupId(true));); Wicket Version 1.3.6 Thanx. PETER DIEFENTHÄLER CSC Sandstr. 7, 80335 München, Germany CIS Payments Integration | office: +49 89 5908 6441 | mobile: +49 172 886 5632 | fax: +49 89 5908 6499 | pdief...@csc.com | www.csc.com CSC • This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e- mail for such purpose • CSC Deutschland Solutions GmbH • Registered Office: Abraham-Lincoln- Park 1, 65189 Wiesbaden, Germany • Board of Directors: Gerhard Fercho (Chairman), Thomas Nebe, Peter Schmidt • Chairman of the Supervisory Board: Guy Hains • Registered in Germany: HRB 22374 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Form Components With Built In Feedback
Why would you use IComponentBorder instead of IBehaviour? igor.vaynberg wrote: use IComponentBorder and then simply add it to each form component or subclass formcomponents and add it in the constructor, eg textfield.add(new fieldborder()); -igor public class FieldBorder implements IComponentBorder { public static final IComponentBorder INSTANCE = new FieldBorder(); public void renderAfter(Component component) { final Response out = component.getResponse(); ListFeedbackMessage errors = component.getSession().getFeedbackMessages().messages( new ErrorsFilter(component)); if (errors.size() 0) { out.write(ul class=\errors\); for (FeedbackMessage error : errors) { out.write(li); out.write(error.getMessage().toString()); out.write(/li); } out.write(/ul); } } public void renderBefore(Component component) { component.setOutputMarkupId(true); final Response out = component.getResponse(); final boolean required = isRequired(component); out.write(label for=\); out.write(component.getMarkupId()); out.write(\); if (required) { out.write(strongem*/em); } String label = null; if (component instanceof LabeledWebMarkupContainer) { IModel labelModel = ((LabeledWebMarkupContainer)component).getLabel(); if (labelModel != null) { label = labelModel.getObject().toString(); } } if (label == null) { label = component.getString(component.getId()); } if (!Strings.isEmpty(label)) { out.write(label); if (separator) { out.write(getSeparator()); } } if (required) { out.write(/strong); } out.write(/label); } protected String getSeparator() { return :; } private boolean isRequired(Component component) { if (component instanceof FormComponent) { return ((FormComponent)component).isRequired(); } return false; } private static class ErrorsFilter implements IFeedbackMessageFilter { private final Component target; public ErrorsFilter(Component target) { this.target = target; } public boolean accept(FeedbackMessage message) { if (message.isError() message.getReporter() != null) { if (target == message.getReporter()) { return true; } if (target instanceof MarkupContainer) { if (((MarkupContainer)target).contains(message.getReporter(), true)) { return true; } } } return false; } } } On Tue, Jan 13, 2009 at 12:20 PM, walnutmon justin.m.boy...@gmail.com wrote: All, I have a page with many form components, nearly all of them have some kind of validation associated with them. I have a feedback panel at the top, I'd like to move feedback next to each component. I have thought of some ways to do this without changing a ton of code, however none really work in the end because I would still need to add some kind of HTML in order to display messages. Also, nearly everything like this that I have developed in wicket is usually accompanied by the discovery that wicket already has the functionality I'm looking for out of the box. Searching has given me surprisingly little with regard to this topic though. Can someone point me in the right direction? -- View this message in context: http://www.nabble.com/Form-Components-With-Built-In-Feedback-tp21443674p21443674.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 -- View this message in context: http://www.nabble.com/Form-Components-With-Built-In-Feedback-tp21443674p23549947.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail:
Re: Palette problem
i modified the JS that comes with wicket and fixed my problem. James Carman-3 wrote: You're saying you modified the JS that comes with Wicket and it caused the problem or you modified it and it fixed it? On Thu, May 14, 2009 at 10:27 AM, freak182 eman.noll...@gmail.com wrote: Hello, I just found the problem. I modified the palette.js. Wicket.Palette.update if( i+1 selected.lenght) ... changed to: if ( i selected.lenght) ..this works fine but we are testing it. James Carman-3 wrote: What type of values are you using? What type of collection are you putting them in? On Thu, May 14, 2009 at 2:39 AM, Eman Nollase eman.noll...@gmail.com wrote: Hello, I have a problem about palette. here is the scenario: if there is already values in selected side and when I add values from available side there is only n-1 values get. If there is currently 2 values in the selected side then i add 2 values from available side, i only get 3 values. The last one is not included in the result. Any idea? Thanks a lot. Cheers. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Palette-problem-tp23535231p23541749.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 -- View this message in context: http://www.nabble.com/Palette-problem-tp23535231p23550012.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Palette problem
What i do is extends the Palette and override the renderHead to implement the mdified palette.js. James Carman-3 wrote: You're saying you modified the JS that comes with Wicket and it caused the problem or you modified it and it fixed it? On Thu, May 14, 2009 at 10:27 AM, freak182 eman.noll...@gmail.com wrote: Hello, I just found the problem. I modified the palette.js. Wicket.Palette.update if( i+1 selected.lenght) ... changed to: if ( i selected.lenght) ..this works fine but we are testing it. James Carman-3 wrote: What type of values are you using? What type of collection are you putting them in? On Thu, May 14, 2009 at 2:39 AM, Eman Nollase eman.noll...@gmail.com wrote: Hello, I have a problem about palette. here is the scenario: if there is already values in selected side and when I add values from available side there is only n-1 values get. If there is currently 2 values in the selected side then i add 2 values from available side, i only get 3 values. The last one is not included in the result. Any idea? Thanks a lot. Cheers. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Palette-problem-tp23535231p23541749.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 -- View this message in context: http://www.nabble.com/Palette-problem-tp23535231p23550139.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: CheckGroup and back Button problem
I am having the same problem. Does anyone solve it? Thanks in advance. On Thu, May 8, 2008 at 7:59 AM, Steen Larsen steen...@gmail.com wrote: If I instead of item.getModel() for the Check, uses some PropertyModel that evaluates to a String identifier it works fine, but then only the identifier is saved, and not the object, which as I understand it should be the purpose. I haven't looked at the code, but I wander what uuid is exactly as the equals apparently fail on non basic types. Will have a look when I get the time. Thanks for the hint. /Steen 2008/5/8 Thomas Mäder tomlist0...@gmail.com: We seem to have a similar problem with a wizard page. We came across the following code in Check.onComponentTag(..) if (group.hasRawInput()) { final String[] input = group.getInputAsArray(); if (input != null) { for (int i = 0; i input.length; i++) { if (uuid.equals(input[i])) { tag.put(checked, checked); It looks like the Check component is checking for the existence of raw input, but then using the input from the current request (via getInputAsArray()) to render. Sounds fishy! I figure this could be related? Thomas On Wed, May 7, 2008 at 5:27 PM, Steen Larsen steen...@gmail.com wrote: Hi, I have made a CheckGroup vith a ListView of Check's than works fine, except that when it is submitted and I'm on the next page and want to go back through a Wicket Button (not the browsers back button), all the checks are empty even thouch the model behind still contains the selected obejcts. Here is the example code of the first page: public HomePage() { Order order = ((WicketSession) (Session.get())).getOrder(); if (order.getDigitalPackets() == null) order.setDigitalPackets(new ArrayListProduct()); System.err.println(LIST1 = + order.getDigitalPackets()); Form form = new DigitalOrderForm(digitalOrderForm); form.setModel(new CompoundPropertyModel(order)); add(form); ListProduct allProducts = new ArrayListProduct(); for (int i = 0; i 10; i++) { Product p = new Product(); p.setProductKey(i + ); p.setTotalPrice(new BigDecimal(100 + i)); p.setProductName(Product + i); allProducts.add(p); } CheckGroup group = new CheckGroup(digitalPackets); form.add(group); ListView products = new ListView(products, allProducts) { protected void populateItem(ListItem item) { item.add(new Check(check, item.getModel()).setEscapeModelStrings(false)); item.add(new Label(productName, new PropertyModel(item.getModel(), productName))); item.add(new Label(totalPrice, new PropertyModel(item.getModel(), totalPrice))); } }; group.add(products.setReuseItems(true)); } class DigitalOrderForm extends Form { DigitalOrderForm(String s) { super(s); } protected void onSubmit() { Order order = (Order) getModelObject(); System.err.println(LIST2 = + order.getDigitalPackets()); setResponsePage(PageTwo.class); } } The second page is just a back button like this: public PageTwo() { add(new Button(back) { public void onSubmit() { setResponsePage(HomePage.class); } }); } Anybody knows how to get the selected objects shown when you go back like that ? /Steen -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Re: Component creation and initialization
It would be very nice to add a new phase for component creation, like I said, an init() or createContent(). Is there a JIRA issue for that? If yes, I will vote for it and suggest to change the name to something _not_ related to the rendre phase. Thanks! Juan On Thu, May 14, 2009 at 3:31 PM, Daniel Stoch daniel.st...@gmail.comwrote: I think you can use hasBeenRendered() method instead of custom boolean flag. -- Daniel On 2009-05-14, at 20:15, Jeremy Thomerson wrote: You could probably do it in onBeforeRender - but you would need to keep a boolean flag to check if it's the first render so that you don't recreate them on a second render There was talking of adding an onBeforeFirstRender method, but I don't think it's happened yet - you could look for the method to see if I'm wrong. -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Form Components With Built In Feedback
why not? -igor On Thu, May 14, 2009 at 3:11 PM, John Patterson jdp2...@gmail.com wrote: Why would you use IComponentBorder instead of IBehaviour? igor.vaynberg wrote: use IComponentBorder and then simply add it to each form component or subclass formcomponents and add it in the constructor, eg textfield.add(new fieldborder()); -igor public class FieldBorder implements IComponentBorder { public static final IComponentBorder INSTANCE = new FieldBorder(); public void renderAfter(Component component) { final Response out = component.getResponse(); ListFeedbackMessage errors = component.getSession().getFeedbackMessages().messages( new ErrorsFilter(component)); if (errors.size() 0) { out.write(ul class=\errors\); for (FeedbackMessage error : errors) { out.write(li); out.write(error.getMessage().toString()); out.write(/li); } out.write(/ul); } } public void renderBefore(Component component) { component.setOutputMarkupId(true); final Response out = component.getResponse(); final boolean required = isRequired(component); out.write(label for=\); out.write(component.getMarkupId()); out.write(\); if (required) { out.write(strongem*/em); } String label = null; if (component instanceof LabeledWebMarkupContainer) { IModel labelModel = ((LabeledWebMarkupContainer)component).getLabel(); if (labelModel != null) { label = labelModel.getObject().toString(); } } if (label == null) { label = component.getString(component.getId()); } if (!Strings.isEmpty(label)) { out.write(label); if (separator) { out.write(getSeparator()); } } if (required) { out.write(/strong); } out.write(/label); } protected String getSeparator() { return :; } private boolean isRequired(Component component) { if (component instanceof FormComponent) { return ((FormComponent)component).isRequired(); } return false; } private static class ErrorsFilter implements IFeedbackMessageFilter { private final Component target; public ErrorsFilter(Component target) { this.target = target; } public boolean accept(FeedbackMessage message) { if (message.isError() message.getReporter() != null) { if (target == message.getReporter()) { return true; } if (target instanceof MarkupContainer) { if (((MarkupContainer)target).contains(message.getReporter(), true)) { return true; } } } return false; } } } On Tue, Jan 13, 2009 at 12:20 PM, walnutmon justin.m.boy...@gmail.com wrote: All, I have a page with many form components, nearly all of them have some kind of validation associated with them. I have a feedback panel at the top, I'd like to move feedback next to each component. I have thought of some ways to do this without changing a ton of code, however none really work in the end because I would still need to add some kind of HTML in order to display messages. Also, nearly everything like this that I have developed in wicket is usually accompanied by the discovery that wicket already has the functionality I'm looking for out of the box. Searching has given me surprisingly little with regard to this topic though. Can someone point me in the right direction? -- View this message in context: http://www.nabble.com/Form-Components-With-Built-In-Feedback-tp21443674p21443674.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 -- View this message in context: http://www.nabble.com/Form-Components-With-Built-In-Feedback-tp21443674p23549947.html Sent from the Wicket - User mailing list archive at Nabble.com.
Re: Form Components With Built In Feedback
Good point! I had never seen IComponentBorder before so was just poking around and saw that to me it seems to do the same thing as IBehaviour... but less. So I thought I am probably missing some key difference. igor.vaynberg wrote: why not? -igor -- View this message in context: http://www.nabble.com/Form-Components-With-Built-In-Feedback-tp21443674p23550337.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Spring Security's method security and Wicket
Hi James, Can you share your wicket-spring-security project or there is already in wicketstuff? Thanks a lot. Cheers. James Carman-3 wrote: On Thu, May 14, 2009 at 1:38 PM, Kent Larsson kent.lars...@gmail.com wrote: Hi James, Thank you for example! Although I can't find any secured methods in there. Not in your beans.xml and not by grepping for Secured on all your files. So correct me if I'm wrong, but I don't think you are using the method security option in Spring Security? In any case I'm greatful for you showing me how you solved the integration and I'll be looking more into it soon. My current problem is with method security, while URL security works. You're very welcome. Sorry I didn't fix the problem in the code (I should do that while I'm thinking about it), but it's not that difficult to catch AuthenticationException and return false. You're correct, I am not using method-level security. I can imagine that you can try a custom error catcher to redirect to your login page if a spring security exception is found (or tell them they're not allowed to do what they tried to do)? I'd have to play with it. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Spring-Security%27s-method-security-and-Wicket-tp23411667p23550461.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Tree Table - Update Model
In order for tree to update items your model must fire treeNodesChanged event. -Matej On Thu, May 14, 2009 at 2:55 PM, Peter Diefenthaeler pdief...@csc.com wrote: Hi every one, I tried the tree table example and get stuck with two problems. How can I avoid links in the tree leavlets? How can I update the tree on a new model. I've generated the tree information on a database query with a search field. When I press the search button, I expected the tree to be updated with the new model, but it doesn't work. suchform.add(new AjaxButton(search) { private static final long serialVersionUID = 1L; �...@override protected void onSubmit(AjaxRequestTarget target, Form form) { suchliste = new SucheDao().search(suchfeld); log.debug(#Treffer: + suchliste.size());; tm = createTreeModel(suchliste); tree.updateTree(); target.addComponent(tree); } }); tm = createTreeModel(suchliste); tree = new Tree(tree, tm); tree.setRootLess(true); tree.getTreeState().collapseAll();); add(tree.setOutputMarkupId(true));); Wicket Version 1.3.6 Thanx. PETER DIEFENTHÄLER CSC Sandstr. 7, 80335 München, Germany CIS Payments Integration | office: +49 89 5908 6441 | mobile: +49 172 886 5632 | fax: +49 89 5908 6499 | pdief...@csc.com | www.csc.com CSC • This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose • CSC Deutschland Solutions GmbH • Registered Office: Abraham-Lincoln-Park 1, 65189 Wiesbaden, Germany • Board of Directors: Gerhard Fercho (Chairman), Thomas Nebe, Peter Schmidt • Chairman of the Supervisory Board: Guy Hains • Registered in Germany: HRB 22374 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component creation and initialization
This has been discussed till death previously and we have excluded it from our roadmap. We will never have an init() method for components. Gossling gave us a Constructor to initialize your Objects. Search and read the archives if you want more information on the subject. Martijn On Fri, May 15, 2009 at 12:36 AM, Juan G. Arias juangar...@gmail.com wrote: It would be very nice to add a new phase for component creation, like I said, an init() or createContent(). Is there a JIRA issue for that? If yes, I will vote for it and suggest to change the name to something _not_ related to the rendre phase. Thanks! Juan On Thu, May 14, 2009 at 3:31 PM, Daniel Stoch daniel.st...@gmail.comwrote: I think you can use hasBeenRendered() method instead of custom boolean flag. -- Daniel On 2009-05-14, at 20:15, Jeremy Thomerson wrote: You could probably do it in onBeforeRender - but you would need to keep a boolean flag to check if it's the first render so that you don't recreate them on a second render There was talking of adding an onBeforeFirstRender method, but I don't think it's happened yet - you could look for the method to see if I'm wrong. -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wizard, checkGroup and check
if you care to submit a quickstart that demonstrates this in a jira issue im sure someone will fix it relatively quickly. of course patches are applied even quicker :) -igor On Thu, May 14, 2009 at 4:02 PM, Fernando Wermus fernando.wer...@gmail.com wrote: Hi!, I am facing a problem that I don't know how to face. I have a wizard several steps. One of them has a checkGroup and several check. If I go to a step back and then a step foward, the checked boxes are lost. The same happens when a required field is not completed. I verified several times if there was a problem between models and It is not the case. What I found is that the checkgroup is raw, according to check impl, and it doesn't compare the second elseif. I don't know how to manage this situation and I looked up in Google and I saw some people asking about the same problem. I am using wicket 1.3.0. (check.class) if (group.hasRawInput()) { final String[] input = group.getInputAsArray(); if (input != null) { for (int i = 0; i input.length; i++) { if (uuid.equals(input[i])) { tag.put(checked, checked); } } } } else if (collection.contains(getModelObject())) { tag.put(checked, checked); } Thanks in advance. -- Fernando Wermus. www.linkedin.com/in/fernandowermus - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wizard, checkGroup and check
Igor, I can move to a newer wicket version. Do you know if this is a known bug? On Thu, May 14, 2009 at 4:05 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: if you care to submit a quickstart that demonstrates this in a jira issue im sure someone will fix it relatively quickly. of course patches are applied even quicker :) -igor On Thu, May 14, 2009 at 4:02 PM, Fernando Wermus fernando.wer...@gmail.com wrote: Hi!, I am facing a problem that I don't know how to face. I have a wizard several steps. One of them has a checkGroup and several check. If I go to a step back and then a step foward, the checked boxes are lost. The same happens when a required field is not completed. I verified several times if there was a problem between models and It is not the case. What I found is that the checkgroup is raw, according to check impl, and it doesn't compare the second elseif. I don't know how to manage this situation and I looked up in Google and I saw some people asking about the same problem. I am using wicket 1.3.0. (check.class) if (group.hasRawInput()) { final String[] input = group.getInputAsArray(); if (input != null) { for (int i = 0; i input.length; i++) { if (uuid.equals(input[i])) { tag.put(checked, checked); } } } } else if (collection.contains(getModelObject())) { tag.put(checked, checked); } Thanks in advance. -- Fernando Wermus. www.linkedin.com/in/fernandowermus - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Re: Wizard, checkGroup and check
you can search jira for all known issues, i dont remember all of them from the top of my head :) -igor On Thu, May 14, 2009 at 4:09 PM, Fernando Wermus fernando.wer...@gmail.com wrote: Igor, I can move to a newer wicket version. Do you know if this is a known bug? On Thu, May 14, 2009 at 4:05 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: if you care to submit a quickstart that demonstrates this in a jira issue im sure someone will fix it relatively quickly. of course patches are applied even quicker :) -igor On Thu, May 14, 2009 at 4:02 PM, Fernando Wermus fernando.wer...@gmail.com wrote: Hi!, I am facing a problem that I don't know how to face. I have a wizard several steps. One of them has a checkGroup and several check. If I go to a step back and then a step foward, the checked boxes are lost. The same happens when a required field is not completed. I verified several times if there was a problem between models and It is not the case. What I found is that the checkgroup is raw, according to check impl, and it doesn't compare the second elseif. I don't know how to manage this situation and I looked up in Google and I saw some people asking about the same problem. I am using wicket 1.3.0. (check.class) if (group.hasRawInput()) { final String[] input = group.getInputAsArray(); if (input != null) { for (int i = 0; i input.length; i++) { if (uuid.equals(input[i])) { tag.put(checked, checked); } } } } else if (collection.contains(getModelObject())) { tag.put(checked, checked); } Thanks in advance. -- Fernando Wermus. www.linkedin.com/in/fernandowermus - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Fernando Wermus. www.linkedin.com/in/fernandowermus - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wizard, checkGroup and check
upgrading to a newer version is always preferred as a first measure. Martijn On Fri, May 15, 2009 at 1:12 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote: you can search jira for all known issues, i dont remember all of them from the top of my head :) -igor On Thu, May 14, 2009 at 4:09 PM, Fernando Wermus fernando.wer...@gmail.com wrote: Igor, I can move to a newer wicket version. Do you know if this is a known bug? On Thu, May 14, 2009 at 4:05 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: if you care to submit a quickstart that demonstrates this in a jira issue im sure someone will fix it relatively quickly. of course patches are applied even quicker :) -igor On Thu, May 14, 2009 at 4:02 PM, Fernando Wermus fernando.wer...@gmail.com wrote: Hi!, I am facing a problem that I don't know how to face. I have a wizard several steps. One of them has a checkGroup and several check. If I go to a step back and then a step foward, the checked boxes are lost. The same happens when a required field is not completed. I verified several times if there was a problem between models and It is not the case. What I found is that the checkgroup is raw, according to check impl, and it doesn't compare the second elseif. I don't know how to manage this situation and I looked up in Google and I saw some people asking about the same problem. I am using wicket 1.3.0. (check.class) if (group.hasRawInput()) { final String[] input = group.getInputAsArray(); if (input != null) { for (int i = 0; i input.length; i++) { if (uuid.equals(input[i])) { tag.put(checked, checked); } } } } else if (collection.contains(getModelObject())) { tag.put(checked, checked); } Thanks in advance. -- Fernando Wermus. www.linkedin.com/in/fernandowermus - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Fernando Wermus. www.linkedin.com/in/fernandowermus - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Form Components With Built In Feedback
textfield.setcomponentborder(new fieldborder()); I didn't see FieldBorder in the javadocs. What is the full class name? Thanks! =David - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wizard, checkGroup and check
Hi all, I moved to wicket 1.3.6, the lastest before 1.4, without any luck. What I did next, it was to cut the code that was bother me and It is working now. Of course, I am afraid that this could have colateral effects. This is the code, if (group.hasRawInput()) { final String[] input = group.getInputAsArray(); if (input != null) { for (int i = 0; i input.length; i++) { if (uuid.equals(input[i])) { tag.put(checked, checked); } } } } If I liked to write a Jira with an example, What would I do? I've never done this before. On Thu, May 14, 2009 at 4:13 PM, Martijn Dashorst martijn.dasho...@gmail.com wrote: upgrading to a newer version is always preferred as a first measure. Martijn On Fri, May 15, 2009 at 1:12 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote: you can search jira for all known issues, i dont remember all of them from the top of my head :) -igor On Thu, May 14, 2009 at 4:09 PM, Fernando Wermus fernando.wer...@gmail.com wrote: Igor, I can move to a newer wicket version. Do you know if this is a known bug? On Thu, May 14, 2009 at 4:05 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: if you care to submit a quickstart that demonstrates this in a jira issue im sure someone will fix it relatively quickly. of course patches are applied even quicker :) -igor On Thu, May 14, 2009 at 4:02 PM, Fernando Wermus fernando.wer...@gmail.com wrote: Hi!, I am facing a problem that I don't know how to face. I have a wizard several steps. One of them has a checkGroup and several check. If I go to a step back and then a step foward, the checked boxes are lost. The same happens when a required field is not completed. I verified several times if there was a problem between models and It is not the case. What I found is that the checkgroup is raw, according to check impl, and it doesn't compare the second elseif. I don't know how to manage this situation and I looked up in Google and I saw some people asking about the same problem. I am using wicket 1.3.0. (check.class) if (group.hasRawInput()) { final String[] input = group.getInputAsArray(); if (input != null) { for (int i = 0; i input.length; i++) { if (uuid.equals(input[i])) { tag.put(checked, checked); } } } } else if (collection.contains(getModelObject())) { tag.put(checked, checked); } Thanks in advance. -- Fernando Wermus. www.linkedin.com/in/fernandowermus - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Fernando Wermus. www.linkedin.com/in/fernandowermus - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Re: Spring Security's method security and Wicket
That example should be self-contained. I'm going to play around with method-level stuff tonight hopefully. I'm curious myself. On May 14, 2009 6:51 PM, freak182 eman.noll...@gmail.com wrote: Hi James, Can you share your wicket-spring-security project or there is already in wicketstuff? Thanks a lot. Cheers. James Carman-3 wrote: On Thu, May 14, 2009 at 1:38 PM, Kent Larsson kent.lars...@gmail.com... - To unsubscribe, e-mail: us... View this message in context: http://www.nabble.com/Spring-Security%27s-method-security-and-Wicket-tp23411667p23550461.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user...
Re: DateTextField Runtime Exception on loading textfield that doesn't match format
Is there a way to make it more lenient? I have data coming in from different sources - I want the form to load, give them a chance to change the format. --jim igor.vaynberg wrote: your format should match what you have in your model. otherwise you will get the same error when you try to stick the submitted value back into your model - but the error will be on the model site. -igor On Thu, May 14, 2009 at 4:26 PM, james o'brien jobr...@spinnphr.com wrote: I have the following: DateTextField when = new DateTextField(when, newPropertyModel(bloodPressure, when), M/d/); when.setOutputMarkupId(true); when.add(new DatePicker()); When the form loads with pre-existing date of this format: 5/1/09, I get the following error: java.lang.IllegalArgumentException: Cannot format given Object as a Date at java.text.DateFormat.format(DateFormat.java:279) at java.text.Format.format(Format.java:133) at org.apache.wicket.util.convert.converters.DateConverter.convertToString(DateConverter.java:57) at org.apache.wicket.Component.getModelObjectAsString(Component.java:1605) at org.apache.wicket.Component.getModelObjectAsString(Component.java:1580) TextField doesn't puke but I have been unable to set the date format for DatePicker without using DateTextField. Any suggestions? Thanks, --jim - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/DateTextField-Runtime-Exception-on-loading-textfield-that-doesn%27t--match-format-tp23550902p23552883.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wizard, checkGroup and check
Please file a JIRA at the URL below [1]. The most effective issues are ones that are submitted with a patch. To make it even more effective, please run all tests against the patched codebase (run mvn clean test) and notate that you did so when you submit your patch. [1] - https://issues.apache.org/jira/browse/WICKET -- Jeremy Thomerson http://www.wickettraining.com On Thu, May 14, 2009 at 6:56 PM, Fernando Wermus fernando.wer...@gmail.com wrote: Hi all, I moved to wicket 1.3.6, the lastest before 1.4, without any luck. What I did next, it was to cut the code that was bother me and It is working now. Of course, I am afraid that this could have colateral effects. This is the code, if (group.hasRawInput()) { final String[] input = group.getInputAsArray(); if (input != null) { for (int i = 0; i input.length; i++) { if (uuid.equals(input[i])) { tag.put(checked, checked); } } } } If I liked to write a Jira with an example, What would I do? I've never done this before. On Thu, May 14, 2009 at 4:13 PM, Martijn Dashorst martijn.dasho...@gmail.com wrote: upgrading to a newer version is always preferred as a first measure. Martijn On Fri, May 15, 2009 at 1:12 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote: you can search jira for all known issues, i dont remember all of them from the top of my head :) -igor On Thu, May 14, 2009 at 4:09 PM, Fernando Wermus fernando.wer...@gmail.com wrote: Igor, I can move to a newer wicket version. Do you know if this is a known bug? On Thu, May 14, 2009 at 4:05 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: if you care to submit a quickstart that demonstrates this in a jira issue im sure someone will fix it relatively quickly. of course patches are applied even quicker :) -igor On Thu, May 14, 2009 at 4:02 PM, Fernando Wermus fernando.wer...@gmail.com wrote: Hi!, I am facing a problem that I don't know how to face. I have a wizard several steps. One of them has a checkGroup and several check. If I go to a step back and then a step foward, the checked boxes are lost. The same happens when a required field is not completed. I verified several times if there was a problem between models and It is not the case. What I found is that the checkgroup is raw, according to check impl, and it doesn't compare the second elseif. I don't know how to manage this situation and I looked up in Google and I saw some people asking about the same problem. I am using wicket 1.3.0. (check.class) if (group.hasRawInput()) { final String[] input = group.getInputAsArray(); if (input != null) { for (int i = 0; i input.length; i++) { if (uuid.equals(input[i])) { tag.put(checked, checked); } } } } else if (collection.contains(getModelObject())) { tag.put(checked, checked); } Thanks in advance. -- Fernando Wermus. www.linkedin.com/in/fernandowermus - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Fernando Wermus. www.linkedin.com/in/fernandowermus - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Fernando Wermus. www.linkedin.com/in/fernandowermus - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DateTextField Runtime Exception on loading textfield that doesn't match format
Never mind - I figured it out. DateTextField takes a Date not a String. --jim jobiwankanobi wrote: Is there a way to make it more lenient? I have data coming in from different sources - I want the form to load, give them a chance to change the format. --jim igor.vaynberg wrote: your format should match what you have in your model. otherwise you will get the same error when you try to stick the submitted value back into your model - but the error will be on the model site. -igor On Thu, May 14, 2009 at 4:26 PM, james o'brien jobr...@spinnphr.com wrote: I have the following: DateTextField when = new DateTextField(when, newPropertyModel(bloodPressure, when), M/d/); when.setOutputMarkupId(true); when.add(new DatePicker()); When the form loads with pre-existing date of this format: 5/1/09, I get the following error: java.lang.IllegalArgumentException: Cannot format given Object as a Date at java.text.DateFormat.format(DateFormat.java:279) at java.text.Format.format(Format.java:133) at org.apache.wicket.util.convert.converters.DateConverter.convertToString(DateConverter.java:57) at org.apache.wicket.Component.getModelObjectAsString(Component.java:1605) at org.apache.wicket.Component.getModelObjectAsString(Component.java:1580) TextField doesn't puke but I have been unable to set the date format for DatePicker without using DateTextField. Any suggestions? Thanks, --jim - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/DateTextField-Runtime-Exception-on-loading-textfield-that-doesn%27t--match-format-tp23550902p23553168.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component creation and initialization
Martijn, here Java is not safe as a language. Yo're able to invoke overrided methods on non-completely constructed objects. from my perspective it is a regular case in Wicket: class SampleComponent extends ... { String parameter; SampleComponent(String id, String parameter) { super(id); this.parameter = parameter; } // method is called from within superconstructor @Override void createAdditionalComponents(RepeatingView rv) { useSomehow(parameter); } } I know two approaches to work around: - onBeforeRender - a closure as a constructor formal parameter. But the latter does not help with built-in components. If Wicket does not help us with adding appropriate method for second-step-initialization it should document it in wiki, javadoc and books dear user, when overriding methods, beware using of yet unassigned constructor parameters. Hmm ... sounds stupid :) Martijn Dashorst wrote: This has been discussed till death previously and we have excluded it from our roadmap. We will never have an init() method for components. Gossling gave us a Constructor to initialize your Objects. Search and read the archives if you want more information on the subject. Martijn On Fri, May 15, 2009 at 12:36 AM, Juan G. Arias juangar...@gmail.com wrote: It would be very nice to add a new phase for component creation, like I said, an init() or createContent(). Is there a JIRA issue for that? If yes, I will vote for it and suggest to change the name to something _not_ related to the rendre phase. Thanks! Juan On Thu, May 14, 2009 at 3:31 PM, Daniel Stoch daniel.st...@gmail.comwrote: I think you can use hasBeenRendered() method instead of custom boolean flag. -- Daniel On 2009-05-14, at 20:15, Jeremy Thomerson wrote: You could probably do it in onBeforeRender - but you would need to keep a boolean flag to check if it's the first render so that you don't recreate them on a second render There was talking of adding an onBeforeFirstRender method, but I don't think it's happened yet - you could look for the method to see if I'm wrong. -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Component-creation-and-initialization-tp23545666p23553458.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component creation and initialization
Do you have any examples of where Wicket calls an overridable method from the constructor of a Wicket class? If so, please file it as a JIRA - that would be a bug. Most java programmers know not to call overridable methods from the constructor as a general rule, although there are times when it could inadvertantly happen - which is why we need bug reports if you see that happening. -- Jeremy Thomerson http://www.wickettraining.com On Fri, May 15, 2009 at 12:01 AM, Vladimir K koval...@gmail.com wrote: Martijn, here Java is not safe as a language. Yo're able to invoke overrided methods on non-completely constructed objects. from my perspective it is a regular case in Wicket: class SampleComponent extends ... { String parameter; SampleComponent(String id, String parameter) { super(id); this.parameter = parameter; } // method is called from within superconstructor �...@override void createAdditionalComponents(RepeatingView rv) { useSomehow(parameter); } } I know two approaches to work around: - onBeforeRender - a closure as a constructor formal parameter. But the latter does not help with built-in components. If Wicket does not help us with adding appropriate method for second-step-initialization it should document it in wiki, javadoc and books dear user, when overriding methods, beware using of yet unassigned constructor parameters. Hmm ... sounds stupid :) Martijn Dashorst wrote: This has been discussed till death previously and we have excluded it from our roadmap. We will never have an init() method for components. Gossling gave us a Constructor to initialize your Objects. Search and read the archives if you want more information on the subject. Martijn On Fri, May 15, 2009 at 12:36 AM, Juan G. Arias juangar...@gmail.com wrote: It would be very nice to add a new phase for component creation, like I said, an init() or createContent(). Is there a JIRA issue for that? If yes, I will vote for it and suggest to change the name to something _not_ related to the rendre phase. Thanks! Juan On Thu, May 14, 2009 at 3:31 PM, Daniel Stoch daniel.st...@gmail.comwrote: I think you can use hasBeenRendered() method instead of custom boolean flag. -- Daniel On 2009-05-14, at 20:15, Jeremy Thomerson wrote: You could probably do it in onBeforeRender - but you would need to keep a boolean flag to check if it's the first render so that you don't recreate them on a second render There was talking of adding an onBeforeFirstRender method, but I don't think it's happened yet - you could look for the method to see if I'm wrong. -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Component-creation-and-initialization-tp23545666p23553458.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component creation and initialization
it has just come to my mind I'm afraid Wicket can't guarantee that onBeforeRender would be called in any case. So there could be a case (isVisible() for instance) when onBeforeRender is not called yet but overriding method could read yet-not-completely-initialized object state. Instead of thinking how to work around isVisible() and the other cases why not just add a second-chance method and invoke it in appropriate places. in Component: boolean complete = false; void ensureCompletelyInitialized() { if(!complete){ finalizeCreation(); complete = true; } } void internalBeforeRender() { ensureCompletelyInitialized(); ... } I believe it makes sence. Martijn Dashorst wrote: This has been discussed till death previously and we have excluded it from our roadmap. We will never have an init() method for components. Gossling gave us a Constructor to initialize your Objects. Search and read the archives if you want more information on the subject. Martijn On Fri, May 15, 2009 at 12:36 AM, Juan G. Arias juangar...@gmail.com wrote: It would be very nice to add a new phase for component creation, like I said, an init() or createContent(). Is there a JIRA issue for that? If yes, I will vote for it and suggest to change the name to something _not_ related to the rendre phase. Thanks! Juan On Thu, May 14, 2009 at 3:31 PM, Daniel Stoch daniel.st...@gmail.comwrote: I think you can use hasBeenRendered() method instead of custom boolean flag. -- Daniel On 2009-05-14, at 20:15, Jeremy Thomerson wrote: You could probably do it in onBeforeRender - but you would need to keep a boolean flag to check if it's the first render so that you don't recreate them on a second render There was talking of adding an onBeforeFirstRender method, but I don't think it's happened yet - you could look for the method to see if I'm wrong. -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Component-creation-and-initialization-tp23545666p23553618.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component creation and initialization
1 - isVisible isn't called in the constructor. 2 - A constructor is for constructing - your object should not be in an incomplete state when the constructor is finished (such a state that methods such as isVisible can not be called) 3 - the question was about delayed creation of child components - why would isVisible rely on child components being created or not? by the time isVisible is called, any instance or model data that you need to compute visibility should have been initialized so that the component can work. In my experience, typically these needs for delayed component creation come not from a true need, but from a lack of understanding of the proper use of models. -- Jeremy Thomerson http://www.wickettraining.com On Fri, May 15, 2009 at 12:21 AM, Vladimir K koval...@gmail.com wrote: it has just come to my mind I'm afraid Wicket can't guarantee that onBeforeRender would be called in any case. So there could be a case (isVisible() for instance) when onBeforeRender is not called yet but overriding method could read yet-not-completely-initialized object state. Instead of thinking how to work around isVisible() and the other cases why not just add a second-chance method and invoke it in appropriate places. in Component: boolean complete = false; void ensureCompletelyInitialized() { if(!complete){ finalizeCreation(); complete = true; } } void internalBeforeRender() { ensureCompletelyInitialized(); ... } I believe it makes sence. Martijn Dashorst wrote: This has been discussed till death previously and we have excluded it from our roadmap. We will never have an init() method for components. Gossling gave us a Constructor to initialize your Objects. Search and read the archives if you want more information on the subject. Martijn On Fri, May 15, 2009 at 12:36 AM, Juan G. Arias juangar...@gmail.com wrote: It would be very nice to add a new phase for component creation, like I said, an init() or createContent(). Is there a JIRA issue for that? If yes, I will vote for it and suggest to change the name to something _not_ related to the rendre phase. Thanks! Juan On Thu, May 14, 2009 at 3:31 PM, Daniel Stoch daniel.st...@gmail.comwrote: I think you can use hasBeenRendered() method instead of custom boolean flag. -- Daniel On 2009-05-14, at 20:15, Jeremy Thomerson wrote: You could probably do it in onBeforeRender - but you would need to keep a boolean flag to check if it's the first render so that you don't recreate them on a second render There was talking of adding an onBeforeFirstRender method, but I don't think it's happened yet - you could look for the method to see if I'm wrong. -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Component-creation-and-initialization-tp23545666p23553618.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Component creation and initialization
Jeremy, I can't add another example to mentioned RepeatingView. Concerning RepeatingView... Wicket allow me just one point to subclass parent component markup within wicket:child/ tag. RepeatingView comes in handy. It allows me to reserve some places in base component markup and put something there in subclasssing component markup. I saw examples of that in some projects when studying Wicket. So I just copy the idea without thinking about WHEN to call the overridden method that fills in the RepeatingView instance. It is my fault :) If you add name attribute to wicket:child tag, and multiple wicket:extend name=... tags I would use it instead of RepeatingView. Concerning your post on onBeforeRender ... I didn't say that it is related to class' constructor. Yes it is related to delayed component creation. And the reason why I delay creation is to follow mentioned rule. It is not related to use of models in my case. I delay creation to allow subclassing components to replace some default parts of base component. Probably I'm doing something wrong. Then suggest me how to do it right. For instance I would like to subclass NatigationToolbar in DefaultDataTable. What should I do? Jeremy Thomerson-5 wrote: Do you have any examples of where Wicket calls an overridable method from the constructor of a Wicket class? If so, please file it as a JIRA - that would be a bug. Most java programmers know not to call overridable methods from the constructor as a general rule, although there are times when it could inadvertantly happen - which is why we need bug reports if you see that happening. -- Jeremy Thomerson http://www.wickettraining.com On Fri, May 15, 2009 at 12:01 AM, Vladimir K koval...@gmail.com wrote: Martijn, here Java is not safe as a language. Yo're able to invoke overrided methods on non-completely constructed objects. from my perspective it is a regular case in Wicket: class SampleComponent extends ... { String parameter; SampleComponent(String id, String parameter) { super(id); this.parameter = parameter; } // method is called from within superconstructor �...@override void createAdditionalComponents(RepeatingView rv) { useSomehow(parameter); } } I know two approaches to work around: - onBeforeRender - a closure as a constructor formal parameter. But the latter does not help with built-in components. If Wicket does not help us with adding appropriate method for second-step-initialization it should document it in wiki, javadoc and books dear user, when overriding methods, beware using of yet unassigned constructor parameters. Hmm ... sounds stupid :) Martijn Dashorst wrote: This has been discussed till death previously and we have excluded it from our roadmap. We will never have an init() method for components. Gossling gave us a Constructor to initialize your Objects. Search and read the archives if you want more information on the subject. Martijn On Fri, May 15, 2009 at 12:36 AM, Juan G. Arias juangar...@gmail.com wrote: It would be very nice to add a new phase for component creation, like I said, an init() or createContent(). Is there a JIRA issue for that? If yes, I will vote for it and suggest to change the name to something _not_ related to the rendre phase. Thanks! Juan On Thu, May 14, 2009 at 3:31 PM, Daniel Stoch daniel.st...@gmail.comwrote: I think you can use hasBeenRendered() method instead of custom boolean flag. -- Daniel On 2009-05-14, at 20:15, Jeremy Thomerson wrote: You could probably do it in onBeforeRender - but you would need to keep a boolean flag to check if it's the first render so that you don't recreate them on a second render There was talking of adding an onBeforeFirstRender method, but I don't think it's happened yet - you could look for the method to see if I'm wrong. -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Component-creation-and-initialization-tp23545666p23553458.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