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: CheckboxMultipleChoice in Ajax style
Hi Mathias, hi all, thanks for your help, I didn't know the AjaxFormChoiceComponentUpdatingBehavior so far. I now have the problem, that it jumps into the onUpdate method just once (when I click on a checkbox for the first time). If I click again on the same or any other checkbox, nothing happens. Does anyone have an explanation for that? Thank you Philipp This may confuse the web user quite a bit. It's preferred to send the request each time or cache it maybe. Form form = new Form( form ); List SITES = Arrays.asList(new String[] { The Server Side, Java Lobby, Java.Net }); final ListString values = new LinkedListString(); final CheckBoxMultipleChoice c = new CheckBoxMultipleChoice(site, new Model(), SITES ); c.add( new AjaxFormChoiceComponentUpdatingBehavior(){ @Override protected void onUpdate(AjaxRequestTarget target) { System.out.println( c.getModelObject() ); } }); form.add( c ); add( form ); In this onUpdate you could send to server, cache or whatever. -- 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
CheckboxMultipleChoice in Ajax style
Hi all, I wonder how I can create a CheckboxMultipleChoice that performs an action onUpdate. Ideally, the action is delayed by one second, so that a user has the chance to change more than one checkbox before the change is sent to the server (without a submit button). As I'm quite new to wicket, any code fragment would be greatly appreciated. All the best Philipp -- 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: Servlet container authentication in Wicket
Hi, I had a look at that specification but it doesn't give any more hints how to use it. Does somebody have any more working examples? Or is there a tutorial how to connect wicket to the local LDAP? Thanks for your help. Philipp j_security_check is part of the Servlet Specification section SRV.12.5.3.1 Login Form Notes (at least for version 2.5). It did exist in earlier versions but I've only quoted the latest. On Sun, Feb 1, 2009 at 5:03 PM, Philipp Daumke dau...@averbis.de wrote: Hi all, I followed the Servlet Container authentication as described in http://cwiki.apache.org/WICKET/servlet-container-authentication.html, but I do not get it working. At the moment I get an error in firefox when invoking the redirectToSecurityCheck() method: http://localhost:5080/j_security_check?j_username=testj_password=test _The requested resource () is not available. _I don't even know exactly what j_security_check is and don't find too much on the web. Do I have to configure Tomcat properly? Below is my full src. MyApp.java and web.xml look like in the example (see link aboe). Thank you for your help! Philipp public final class LoginPage extends WebPage { private String username; private String password; public LoginPage() { redirectToSecurityCheck(); /*if( ( ( MySession )getSession() ).isUserLoggedIn()) { // redirect to hide username and password from URL after user is logged in setRedirect( true ); setResponsePage( Index.class ); } else { redirectToSecurityCheck(); }*/ } /** * Common servlet login workaround */ private void redirectToSecurityCheck() { final Map parametersMap = ( ( WebRequestCycle )RequestCycle.get() ).getWebRequest().getHttpServletRequest().getParameterMap(); if( parametersMap.containsKey( username ) parametersMap.containsKey( password ) ) { // getting parameters from POST request final String userName = ( ( String[] )parametersMap.get( username ) )[ 0 ]; final String userPassword = ( ( String[] )parametersMap.get( password ) )[ 0 ]; // if POST parameters are ok, redirect them to j_security_check if( ( userName != null ) ( userPassword != null ) ) { getRequestCycle().setRedirect( false ); getRequestCycle().setRequestTarget( EmptyRequestTarget.getInstance() ); getResponse().redirect( /j_security_check?j_username= + userName + j_password= + userPassword ); } } } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } -- 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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: Servlet container authentication in Wicket
Hi all, just as a last reminder (before the article is archived;-), is there anybody who yould provide me with an example how to user Servlect container authentication in Wicket? I followed the example in http://cwiki.apache.org/WICKET/servlet-container-authentication.html but I get the error mentioned below. Maybe some more configuration in tomcat? Thank you for your help Philipp Hi Timm, I also tried to add my application name in it (like you proposed), but no difference, still doesn't work. Philipp http://localhost:5080/j_security_check?j_username=testj_password=test Shouldn't there be an application named? http://localhost:5080/MYAPP/j_security_check?j_username=testj_password=test Regards, Timm Am Sonntag, 1. Februar 2009 23:03:50 schrieb Philipp Daumke: Hi all, I followed the Servlet Container authentication as described in http://cwiki.apache.org/WICKET/servlet-container-authentication.html, but I do not get it working. At the moment I get an error in firefox when invoking the redirectToSecurityCheck() method: http://localhost:5080/j_security_check?j_username=testj_password=test _The requested resource () is not available. _I don't even know exactly what j_security_check is and don't find too much on the web. Do I have to configure Tomcat properly? Below is my full src. MyApp.java and web.xml look like in the example (see link aboe). Thank you for your help! Philipp public final class LoginPage extends WebPage { private String username; private String password; public LoginPage() { redirectToSecurityCheck(); /*if( ( ( MySession )getSession() ).isUserLoggedIn()) { // redirect to hide username and password from URL after user is logged in setRedirect( true ); setResponsePage( Index.class ); } else { redirectToSecurityCheck(); }*/ } /** * Common servlet login workaround */ private void redirectToSecurityCheck() { final Map parametersMap = ( ( WebRequestCycle )RequestCycle.get() ).getWebRequest().getHttpServletRequest().getParameterMap(); if( parametersMap.containsKey( username ) parametersMap.containsKey( password ) ) { // getting parameters from POST request final String userName = ( ( String[] )parametersMap.get( username ) )[ 0 ]; final String userPassword = ( ( String[] )parametersMap.get( password ) )[ 0 ]; // if POST parameters are ok, redirect them to j_security_check if( ( userName != null ) ( userPassword != null ) ) { getRequestCycle().setRedirect( false ); getRequestCycle().setRequestTarget( EmptyRequestTarget.getInstance() ); getResponse().redirect( /j_security_check?j_username= + userName + j_password= + userPassword ); } } } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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
Servlet container authentication in Wicket
Hi all, I followed the Servlet Container authentication as described in http://cwiki.apache.org/WICKET/servlet-container-authentication.html, but I do not get it working. At the moment I get an error in firefox when invoking the redirectToSecurityCheck() method: http://localhost:5080/j_security_check?j_username=testj_password=test _The requested resource () is not available. _I don't even know exactly what j_security_check is and don't find too much on the web. Do I have to configure Tomcat properly? Below is my full src. MyApp.java and web.xml look like in the example (see link aboe). Thank you for your help! Philipp public final class LoginPage extends WebPage { private String username; private String password; public LoginPage() { redirectToSecurityCheck(); /*if( ( ( MySession )getSession() ).isUserLoggedIn()) { // redirect to hide username and password from URL after user is logged in setRedirect( true ); setResponsePage( Index.class ); } else { redirectToSecurityCheck(); }*/ } /** * Common servlet login workaround */ private void redirectToSecurityCheck() { final Map parametersMap = ( ( WebRequestCycle )RequestCycle.get() ).getWebRequest().getHttpServletRequest().getParameterMap(); if( parametersMap.containsKey( username ) parametersMap.containsKey( password ) ) { // getting parameters from POST request final String userName = ( ( String[] )parametersMap.get( username ) )[ 0 ]; final String userPassword = ( ( String[] )parametersMap.get( password ) )[ 0 ]; // if POST parameters are ok, redirect them to j_security_check if( ( userName != null ) ( userPassword != null ) ) { getRequestCycle().setRedirect( false ); getRequestCycle().setRequestTarget( EmptyRequestTarget.getInstance() ); getResponse().redirect( /j_security_check?j_username= + userName + j_password= + userPassword ); } } } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } -- 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: Servlet container authentication in Wicket
Hi Timm, I also tried to add my application name in it (like you proposed), but no difference, still doesn't work. Philipp http://localhost:5080/j_security_check?j_username=testj_password=test Shouldn't there be an application named? http://localhost:5080/MYAPP/j_security_check?j_username=testj_password=test Regards, Timm Am Sonntag, 1. Februar 2009 23:03:50 schrieb Philipp Daumke: Hi all, I followed the Servlet Container authentication as described in http://cwiki.apache.org/WICKET/servlet-container-authentication.html, but I do not get it working. At the moment I get an error in firefox when invoking the redirectToSecurityCheck() method: http://localhost:5080/j_security_check?j_username=testj_password=test _The requested resource () is not available. _I don't even know exactly what j_security_check is and don't find too much on the web. Do I have to configure Tomcat properly? Below is my full src. MyApp.java and web.xml look like in the example (see link aboe). Thank you for your help! Philipp public final class LoginPage extends WebPage { private String username; private String password; public LoginPage() { redirectToSecurityCheck(); /*if( ( ( MySession )getSession() ).isUserLoggedIn()) { // redirect to hide username and password from URL after user is logged in setRedirect( true ); setResponsePage( Index.class ); } else { redirectToSecurityCheck(); }*/ } /** * Common servlet login workaround */ private void redirectToSecurityCheck() { final Map parametersMap = ( ( WebRequestCycle )RequestCycle.get() ).getWebRequest().getHttpServletRequest().getParameterMap(); if( parametersMap.containsKey( username ) parametersMap.containsKey( password ) ) { // getting parameters from POST request final String userName = ( ( String[] )parametersMap.get( username ) )[ 0 ]; final String userPassword = ( ( String[] )parametersMap.get( password ) )[ 0 ]; // if POST parameters are ok, redirect them to j_security_check if( ( userName != null ) ( userPassword != null ) ) { getRequestCycle().setRedirect( false ); getRequestCycle().setRequestTarget( EmptyRequestTarget.getInstance() ); getResponse().redirect( /j_security_check?j_username= + userName + j_password= + userPassword ); } } } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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
Budy indicator next to a checkbox
Hi all, I try to get a busy indicator next to a checkboxm, but it doesn't work. I tried to use the standard AjaxIndicatorAppender as shown in wicket-extensions. Does this class only work with extension-classes startign with Indicating..? Do you have an example how to show an indicator next to a checkbox? All the best Philipp public class CriticalCheckboxActionPanel extends Panel { Index index; private final AjaxIndicatorAppender indicatorAppender = new AjaxIndicatorAppender(); public MyCheckboxActionPanel(String id, final IModel model, final Item item, Index index) { ... AjaxCheckBox chb = new AjaxCheckBox(too_critical,new PropertyModel(to, too_critical)) { @Override protected void onUpdate(AjaxRequestTarget target) { try { Thread.sleep(5000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public String getAjaxIndicatorMarkupId() { return indicatorAppender.getMarkupId(); } }; chb.add(indicatorAppender); add(chb); } } -- 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: Budy indicator next to a checkbox
Thanks Igor, that was the point. Philipp ajaxcheckbox does not have a method public String getAjaxIndicatorMarkupId() so what are you trying to override? instead let your panel implement see IAjaxIndicatorAware -igor On Sun, Feb 1, 2009 at 3:49 PM, Philipp Daumke dau...@averbis.de wrote: Hi all, I try to get a busy indicator next to a checkboxm, but it doesn't work. I tried to use the standard AjaxIndicatorAppender as shown in wicket-extensions. Does this class only work with extension-classes startign with Indicating..? Do you have an example how to show an indicator next to a checkbox? All the best Philipp public class CriticalCheckboxActionPanel extends Panel { Index index; private final AjaxIndicatorAppender indicatorAppender = new AjaxIndicatorAppender(); public MyCheckboxActionPanel(String id, final IModel model, final Item item, Index index) { ... AjaxCheckBox chb = new AjaxCheckBox(too_critical,new PropertyModel(to, too_critical)) { @Override protected void onUpdate(AjaxRequestTarget target) { try { Thread.sleep(5000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public String getAjaxIndicatorMarkupId() { return indicatorAppender.getMarkupId(); } }; chb.add(indicatorAppender); add(chb); } } -- 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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: UTF-8 bug in wicket? Or in Tomcat?
Hi Jonas, thanks for your help, but I think it doesn't help. Just to make sure that I understood the Application#init correctly, you meant to do it like this, right(?): public class MyApp extends WebApplication { public void init() { getRequestCycleSettings().setResponseRequestEncoding(UTF-8); getMarkupSettings().setDefaultMarkupEncoding(UTF-8); } public Class getHomePage() { return Index.class; } } Still, it seems to convert my code from latin1 to utf8, even though I enter utf8-text. Thanks for further help Philipp Hi, have you tried setting getRequestCycleSettings().setResponseRequestEncoding(UTF-8); getMarkupSettings().setDefaultMarkupEncoding(UTF-8); in your Application#init If you don't set the default markup encoding explicitly, the default for it is the 'os provided encoding' (see: IMarkupSettings#getDefaultMarkupEncoding) cheers, Jonas On Fri, Jan 30, 2009 at 1:02 AM, Philipp Daumke dau...@averbis.de wrote: Hi Mathias, 'äöü' is actually already converted to 'äöü' when I add a breakpoint at the onSubmit method of my form (so right when I get the input of the text field from my model). My whole eclipse is in UTF-8, Wicket writes UTF-8 to each HTML-Page, my firefox says UTF-8. What I think is that Wicket or Tomcat treats my UTF8-String äöü as an ISO-8859-1 String and converts it from iso to utf8, so into 'äöü'. When I copy 'äöü' into a tmp.txt file in unix-shell which is in UTF-8 and do an iconv -futf8 -tlatin1 tmp.txt on it, the output is 'äöü' again. Any idea what to do? All the best Philipp Do you save it to a database and then display the text? How do you present it? -- 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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: UTF-8 bug in wicket? Or in Tomcat?
Hi Jonas, hi Johann, grrh, I forgot to set URIEncoding=UTF-8. Now it works, thank you for your help. All the best Philipp Hi Philipp, yes, thats correct. We had similar problems and fixed it that way, but maybe something else is still not set to UTF-8. I assume you have configured your tomcat connector using URIEncoding=UTF-8 (I think that is what Johan is referring to?). Have you tried adding a meta tag to your markup? Something like [meta http-equiv=Content-Type content=text/html; charset=UTF-8 /] cheers, Jonas On Fri, Jan 30, 2009 at 9:11 AM, Philipp Daumke dau...@averbis.de wrote: Hi Jonas, thanks for your help, but I think it doesn't help. Just to make sure that I understood the Application#init correctly, you meant to do it like this, right(?): public class MyApp extends WebApplication { public void init() { getRequestCycleSettings().setResponseRequestEncoding(UTF-8); getMarkupSettings().setDefaultMarkupEncoding(UTF-8); } public Class getHomePage() { return Index.class; } } Still, it seems to convert my code from latin1 to utf8, even though I enter utf8-text. Thanks for further help Philipp Hi, have you tried setting getRequestCycleSettings().setResponseRequestEncoding(UTF-8); getMarkupSettings().setDefaultMarkupEncoding(UTF-8); in your Application#init If you don't set the default markup encoding explicitly, the default for it is the 'os provided encoding' (see: IMarkupSettings#getDefaultMarkupEncoding) cheers, Jonas On Fri, Jan 30, 2009 at 1:02 AM, Philipp Daumke dau...@averbis.de wrote: Hi Mathias, 'äöü' is actually already converted to 'äöü' when I add a breakpoint at the onSubmit method of my form (so right when I get the input of the text field from my model). My whole eclipse is in UTF-8, Wicket writes UTF-8 to each HTML-Page, my firefox says UTF-8. What I think is that Wicket or Tomcat treats my UTF8-String äöü as an ISO-8859-1 String and converts it from iso to utf8, so into 'äöü'. When I copy 'äöü' into a tmp.txt file in unix-shell which is in UTF-8 and do an iconv -futf8 -tlatin1 tmp.txt on it, the output is 'äöü' again. Any idea what to do? All the best Philipp Do you save it to a database and then display the text? How do you present it? -- 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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: Focus on component
Hi Matthew, this solution works perfectly well, thanks a lot. Philipp You can write a behaviour for it so it will be more reusable. The following is based on http://cwiki.apache.org/WICKET/request-focus-on-a-specific-form-component.html and works for both regular and ajax requests. private final class MyLink extends AjaxFallbackLink { public void onClick(AjaxRequestTarget target) { onShowForm(target); myField.add(new FocusBehavior()); } } public class FocusBehavior extends AbstractBehavior { /** * */ private static final long serialVersionUID = 1L; @Override public void bind(Component component) { super.bind(component); component.setOutputMarkupId(true); final Response response = component.getResponse(); if (response instanceof WebResponse !((WebResponse)response).isAjax()) { component.setComponentBorder(new IComponentBorder() { /** * */ private static final long serialVersionUID = 1L; public void renderBefore(Component component) { } public void renderAfter(Component component) { final Response response = component.getResponse(); response.write( script type=\text/javascript\ language=\javascript\document.getElementById(\ + component.getMarkupId() + \).focus()/script); } }); } this.component = component; } private Component component; @Override public void renderHead(IHeaderResponse response) { if (response.getResponse() instanceof WebResponse ((WebResponse)response.getResponse()).isAjax()) { response.renderOnLoadJavascript(document.getElementById(' + component.getMarkupId() + ').focus()); } } @Override public boolean isTemporary() { return true; } } On Thu, Jan 29, 2009 at 4:07 PM, Philipp Daumke dau...@averbis.de wrote: Hi Michael, thanks for your help, but it doesn't work yet. My code: TextField myField = new TextField(text); myField.setOutputMarkupId(true); myField.setOutputMarkupPlaceholderTag(true); add(myField); private final class MyLink extends AjaxFallbackLink { public void onClick(AjaxRequestTarget target) { onShowForm(target); target.appendJavascript(getElementById('+myField.getMarkupId()+ ').focus()); } } Is there something obviously wrong? Correct Javascript syntax and semantic? Is there an alternative wicket approach so that I don't have to use Javascript myself? Thanks for help Philipp use target.(pre|append)Javascript if you want additional JS executed before/after doing the wicket-ajax stuff if you only want to set the focus (without any ajax involved), don't use ajaxlink, use e.g. a simple WebmarkupContainer hth, michael Philipp Daumke-2 wrote: Dear all, I try to show and focus on a text field when clicking on a link. The focus however doesn't work. I tried to follow an example in cwiki ( http://cwiki.apache.org/WICKET/calling-javascript-function-on-wicket-components-onclick.html) but I somehow do something wrong. I tried to add some javascript attribute via AttributeAppender, but then I get a null pointer exception in onClick (target is null). When I comment that line out (so don't add the Attribute), everything works fine except that focus doesn't work. Any help appreciated. Thanks a lot Philipp Here's my code: in a WebMarkupContainer: link.add(new AttributeAppender(onClick, new Model(getElementById('+textfield.getMarkupId()+ ').onFocus();), ;)); in my custom Link Class: public void onClick(AjaxRequestTarget target) { showFormThatContainsTextField(target); } void showFormThatContainsTextField(AjaxRequestTarget target) { // toggle the visibility ... // redraw the add container. target.addComponent(this); } -- 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 - Michael Sparer http://techblog.molindo.at -- 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 -- 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
Focus on component
Dear all, I try to show and focus on a text field when clicking on a link. The focus however doesn't work. I tried to follow an example in cwiki (http://cwiki.apache.org/WICKET/calling-javascript-function-on-wicket-components-onclick.html) but I somehow do something wrong. I tried to add some javascript attribute via AttributeAppender, but then I get a null pointer exception in onClick (target is null). When I comment that line out (so don't add the Attribute), everything works fine except that focus doesn't work. Any help appreciated. Thanks a lot Philipp Here's my code: in a WebMarkupContainer: link.add(new AttributeAppender(onClick, new Model(getElementById('+textfield.getMarkupId()+ ').onFocus();), ;)); in my custom Link Class: public void onClick(AjaxRequestTarget target) { showFormThatContainsTextField(target); } void showFormThatContainsTextField(AjaxRequestTarget target) { // toggle the visibility ... // redraw the add container. target.addComponent(this); } -- 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: textfield to take only numnbers
Hi Miro, can't you use a PatternValidator such as: add(new TextField(textfieldname).add(new PatternValidator(^\\d+$))); Cheers Philipp I s there any textfield which takes only numbers, I dont want user to enter letters only numbers so I want a textfield which takes only numbers is there any such textfield ? -- 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: Focus on component
Hi Michael, thanks for your help, but it doesn't work yet. My code: TextField myField = new TextField(text); myField.setOutputMarkupId(true); myField.setOutputMarkupPlaceholderTag(true); add(myField); private final class MyLink extends AjaxFallbackLink { public void onClick(AjaxRequestTarget target) { onShowForm(target); target.appendJavascript(getElementById('+myField.getMarkupId()+ ').focus()); } } Is there something obviously wrong? Correct Javascript syntax and semantic? Is there an alternative wicket approach so that I don't have to use Javascript myself? Thanks for help Philipp use target.(pre|append)Javascript if you want additional JS executed before/after doing the wicket-ajax stuff if you only want to set the focus (without any ajax involved), don't use ajaxlink, use e.g. a simple WebmarkupContainer hth, michael Philipp Daumke-2 wrote: Dear all, I try to show and focus on a text field when clicking on a link. The focus however doesn't work. I tried to follow an example in cwiki (http://cwiki.apache.org/WICKET/calling-javascript-function-on-wicket-components-onclick.html) but I somehow do something wrong. I tried to add some javascript attribute via AttributeAppender, but then I get a null pointer exception in onClick (target is null). When I comment that line out (so don't add the Attribute), everything works fine except that focus doesn't work. Any help appreciated. Thanks a lot Philipp Here's my code: in a WebMarkupContainer: link.add(new AttributeAppender(onClick, new Model(getElementById('+textfield.getMarkupId()+ ').onFocus();), ;)); in my custom Link Class: public void onClick(AjaxRequestTarget target) { showFormThatContainsTextField(target); } void showFormThatContainsTextField(AjaxRequestTarget target) { // toggle the visibility ... // redraw the add container. target.addComponent(this); } -- 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 - Michael Sparer http://techblog.molindo.at -- 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
UTF-8 bug in wicket? Or in Tomcat?
Hi all, when I enter German umlauts (e.g. äöü) in a wicket text field it's converted to äöü. Everything seems to be in UTF-8. I already tried to apply a filter as described in http://wiki.apache.org/tomcat/Tomcat/UTF-8 without success. Any ideas? Thanks for your help Philipp -- 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: UTF-8 bug in wicket? Or in Tomcat?
Hi Mathias, 'äöü' is actually already converted to 'äöü' when I add a breakpoint at the onSubmit method of my form (so right when I get the input of the text field from my model). My whole eclipse is in UTF-8, Wicket writes UTF-8 to each HTML-Page, my firefox says UTF-8. What I think is that Wicket or Tomcat treats my UTF8-String äöü as an ISO-8859-1 String and converts it from iso to utf8, so into 'äöü'. When I copy 'äöü' into a tmp.txt file in unix-shell which is in UTF-8 and do an iconv -futf8 -tlatin1 tmp.txt on it, the output is 'äöü' again. Any idea what to do? All the best Philipp Do you save it to a database and then display the text? How do you present it? -- 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
Render other components
Dear all, I look for an example how to render Wicket-Components (in my case an AjaxDefaultDataTable) triggered by other Components (in my case AjaxLink). In my case the two components are defined in different Java-Classes. I looked for a while in the examples and in the wiki, but coudln't find anything. I appreciate your help or just a few links to some examples! All the best Philipp To make a silly example, I look for something like: class1 AjaxLink link = new AjaxLink(link, new PropertyModel(obj, id)) { public void onClick(AjaxRequestTarget target) { getComponent(myAjaxDefaultDataTable).render(); } }; ... class2 ... add(new AjaxFallbackDefaultDataTable(myAjaxDefaultDataTable, columns, relationProvider, 20) { { setOutputMarkupId(true); } }); -- 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: Render other components
Dear Cemal, thanks for your fast help. You understood what I meant but I still have the problem, that I don't know how to get the instance myADDT. I tried Page page = target.getPage(); AjaxFallbackDefaultDataTable myADDT= (AjaxFallbackDefaultDataTable) page.get(relTable); but get myADDT=null. Probably because relTable is something like the 2nd or 3rd ancestor on that page (see below)? Thanks for your help again Philipp My Main HTML-Page Index.html: ... span wicket:id=tabs class=tabpanel/span ... Includes this subpage Index$TabPanel1.html wicket:panel table class=relTable cellspacing=0 wicket:id=relTable[table]/table (wicket:panel Philipp, I'm not sure I have fully understood what you are after but it may be that something as straight forward as making the component to be added (ADDT) invisible - setVisible(false) - when first added to its parent (eg the page) and making it visible in your AjaxLink (AL) onClick implementation. Don't forget to setOutputMarkupPlaceholderTag(true) as well as setOutputMarkupId(true) on your ADDT and to add the ADDT to the AjaxRequestTarget - target.addComponent(myADDT) - in that onClick method. Regards - Cemal http://www.jWeekend.co.uk jWeekend Philipp Daumke-2 wrote: Dear all, I look for an example how to render Wicket-Components (in my case an AjaxDefaultDataTable) triggered by other Components (in my case AjaxLink). In my case the two components are defined in different Java-Classes. I looked for a while in the examples and in the wiki, but coudln't find anything. I appreciate your help or just a few links to some examples! All the best Philipp To make a silly example, I look for something like: class1 AjaxLink link = new AjaxLink(link, new PropertyModel(obj, id)) { public void onClick(AjaxRequestTarget target) { getComponent(myAjaxDefaultDataTable).render(); } }; ... class2 ... add(new AjaxFallbackDefaultDataTable(myAjaxDefaultDataTable, columns, relationProvider, 20) { { setOutputMarkupId(true); } }); -- 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 -- 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: Render other components
Hi all, I finally my error and post the working solution. I need to use a colon : to find children. AjaxLink link = new AjaxLink(link, new PropertyModel(obj, id)) { public void onClick(AjaxRequestTarget target) { Page page = target.getPage(); AjaxFallbackDefaultDataTable myADDT= (AjaxFallbackDefaultDataTable) page.get(tabs:panel:relTable); target.addComponent(myADDT); } } For tabs, panel and relTable I put setOutputMarkupId(true); (don't know whether this was necessary). Philipp Dear Cemal, thanks for your fast help. You understood what I meant but I still have the problem, that I don't know how to get the instance myADDT. I tried Page page = target.getPage(); AjaxFallbackDefaultDataTable myADDT= (AjaxFallbackDefaultDataTable) page.get(relTable); but get myADDT=null. Probably because relTable is something like the 2nd or 3rd ancestor on that page (see below)? Thanks for your help again Philipp My Main HTML-Page Index.html: ... span wicket:id=tabs class=tabpanel/span ... Includes this subpage Index$TabPanel1.html wicket:panel table class=relTable cellspacing=0 wicket:id=relTable[table]/table (wicket:panel Philipp, I'm not sure I have fully understood what you are after but it may be that something as straight forward as making the component to be added (ADDT) invisible - setVisible(false) - when first added to its parent (eg the page) and making it visible in your AjaxLink (AL) onClick implementation. Don't forget to setOutputMarkupPlaceholderTag(true) as well as setOutputMarkupId(true) on your ADDT and to add the ADDT to the AjaxRequestTarget - target.addComponent(myADDT) - in that onClick method. Regards - Cemal http://www.jWeekend.co.uk jWeekend Philipp Daumke-2 wrote: Dear all, I look for an example how to render Wicket-Components (in my case an AjaxDefaultDataTable) triggered by other Components (in my case AjaxLink). In my case the two components are defined in different Java-Classes. I looked for a while in the examples and in the wiki, but coudln't find anything. I appreciate your help or just a few links to some examples! All the best Philipp To make a silly example, I look for something like: class1 AjaxLink link = new AjaxLink(link, new PropertyModel(obj, id)) { public void onClick(AjaxRequestTarget target) { getComponent(myAjaxDefaultDataTable).render(); } }; ... class2 ... add(new AjaxFallbackDefaultDataTable(myAjaxDefaultDataTable, columns, relationProvider, 20) { { setOutputMarkupId(true); } }); -- 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 -- 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: Render other components
Hi Jonas, hi Cemal, I think both of you mean similar things. So I need to attributes in my custom panel, one for the referring instance (in my case an instance of Class Index) and one for the component that I want to render (in my case AjaxFallbackDefaultDataTable). So my new custom panel looks like the one below. Agree? Thank you for your help Philipp public class TermIDLinkPanel extends Panel { Index indexInstance; Component componentInstance; public TermIDLinkPanel(Index indexInstance, Component component, String id, final IModel model, final Item item) { super(id, model); this.indexInstance = indexInstance; this.componentInstance = component; ... AjaxLink link = new AjaxLink(link_termID, new PropertyModel(obj, id)) { public void onClick(AjaxRequestTarget target) { target.addComponent(componentInstance); Page page = target.getPage(); //API to change the result list that shall be newly rendered TermIDLinkPanel.this.indexInstance.updateRelationResultList(); target.addComponent(componentInstance); } }; add(link); } } Philipp, I expect your page's constructor creates and adds your custom panel. So, either make the whole panel invisible, or, if the panel hosts other widgets that need to be shown before your AjaxLink is clicked, you can provide an API on your panel to make the ADDT invisble/visible. This would be better than accessing the ADDT directly (encapsulation). Is that what you meant? If not, create the simplest possible http://wicket.apache.org/quickstart.html QuickStart (remember to delete the target folder), zip it up and attach the zip file to your post so we can take a look. Regards- Cemal http://www.jWeekend.co.uk jWeekend Hi, I somehow doubt this is considered good practice to let one component know where in the component tree another component is situated. The code you propose breaks very easily e.g. if you introduce another container around the ADDT. Why don't you just pass the ADDT instance into the AjaxLink? something like: final AjaxFallbackDefaultDataTable myADDT = ... AjaxLink link = new AjaxLink(link, new PropertyModel(obj, id)) { public void onClick(AjaxRequestTarget target) { target.addComponent(myADDT); } } ...but I'm not sure if that's a better practice. At least this doesn't break as easily if you change the position of the ADDT in the component tree. Maybe a core-dev could shed some light on this issue? cheers, Jonas On Tue, Jan 27, 2009 at 2:21 PM, Philipp Daumke dau...@averbis.de wrote: Hi all, I finally my error and post the working solution. I need to use a colon : to find children. AjaxLink link = new AjaxLink(link, new PropertyModel(obj, id)) { public void onClick(AjaxRequestTarget target) { Page page = target.getPage(); AjaxFallbackDefaultDataTable myADDT= (AjaxFallbackDefaultDataTable) page.get(tabs:panel:relTable); target.addComponent(myADDT); } } For tabs, panel and relTable I put setOutputMarkupId(true); (don't know whether this was necessary). Philipp Dear Cemal, thanks for your fast help. You understood what I meant but I still have the problem, that I don't know how to get the instance myADDT. I tried Page page = target.getPage(); AjaxFallbackDefaultDataTable myADDT= (AjaxFallbackDefaultDataTable) page.get(relTable); but get myADDT=null. Probably because relTable is something like the 2nd or 3rd ancestor on that page (see below)? Thanks for your help again Philipp My Main HTML-Page Index.html: ... span wicket:id=tabs class=tabpanel/span ... Includes this subpage Index$TabPanel1.html wicket:panel table class=relTable cellspacing=0 wicket:id=relTable[table]/table (wicket:panel Philipp, I'm not sure I have fully understood what you are after but it may be that something as straight forward as making the component to be added (ADDT) invisible - setVisible(false) - when first added to its parent (eg the page) and making it visible in your AjaxLink (AL) onClick implementation. Don't forget to setOutputMarkupPlaceholderTag(true) as well as setOutputMarkupId(true) on your ADDT and to add the ADDT to the AjaxRequestTarget - target.addComponent(myADDT) - in that onClick method. Regards - Cemal http://www.jWeekend.co.uk jWeekend Philipp Daumke-2 wrote: Dear all, I look for an example how to render Wicket-Components (in my case an AjaxDefaultDataTable) triggered by other Components (in my case AjaxLink). In my case the two components are defined in different Java-Classes. I looked for a while in the examples and in the wiki, but coudln't find anything. I appreciate your help or just a few links to some examples! All the best Philipp To make a silly example, I look for something like: class1 AjaxLink link = new AjaxLink(link, new PropertyModel(obj, id
How can FeedbackPanel show error message of AjaxEditablePanel ?
Hi all, I try to show the error message of an AjaxEditablePanel in a FeedbackPanel, but it doesn't work. On the web I only find examples where FormComponents are validated. My AjaxEditablePanel is not part of a form? Any idea or example? Thank you Philipp -- 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
DefaultDataTable and AjaxEditableLabel
Dear all, I try to create an editable column using DefaultDataTable and AjaxEditableLabel. My current version is posted below but it's quite a hack and I wonder whether there's an official good solution for that before I go on with my work. Thanks al lot for your help Philipp HTML:table class=tablename cellspacing=0 wicket:id=termTable[table]/table Java: columns = new ArrayListIColumn(); columns.add(new AbstractColumn(new Model(ColumnName)) { public void populateItem(Item cellItem, String componentId, final IModel model) { cellItem.setModel(model); ObjectToDisplay to = (ObjectToDisplay )cellItem.getModelObject(); String attribute1= to.getAttribute1(); cellItem.add(new AjaxEditableLabel(componentId, new Model(attribute1)) { @Override protected void onSubmit(AjaxRequestTarget target) { super.onSubmit(target); String newAttribute1 = (String) getModelObject(); ObjectToDisplay obj = (ObjectToDisplay ) getParent().getModelObject(); obj.setAttribute1(newAttribute1); System.out.println(New Attribute for + obj .getId() + : + obj .getAttribute1(); } }); } add(new DefaultDataTable(tablename, columns, provider, 20)); SortableDataProvider provider = new SortableDataProvider() { public int size() { return resultList.getEntries().size(); } public IModel model(Object object) { TableObject entry = (TableObject) object; return new Model((Serializable) entry); } /*public Iterator iterator(int first, int count) { return resultList.selectEntries(first, count).iterator(); }*/ public Iterator iterator(int first, int count) { SortParam sp = getSort(); return resultList.selectEntries(first, count, sp).iterator(); } }; -- 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: DefaultDataTable and AjaxEditableLabel
Hi Uwe, thanks for the link. I agree that my model passing is weird. Your link to the example explains an editable TreeTable but I look for a DataTable example. In that tree table example I cannot use the tree.table.PropertyEditableColumn as as the DefaultDataTable I want to use requires data.table.IColumns (not tree.table.IColumns) , or am I wrong? Or can I just cast them? Another ideas? Not to be mentioned I'm a wicket newbie and there's maybe a very simple solution for that Thanks, Philipp Philipp Daumke schrieb: I try to create an editable column using DefaultDataTable and AjaxEditableLabel. My current version is posted below but it's quite a hack and I wonder whether there's an official good solution for that before I go on with my work. i think the passing of your models is a little weird. anyhow, you might want to take a look at this example: http://wicketstuff.org/wicket13/nested/?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.ajax.builtin.tree.EditableTreeTablePage cu uwe -- 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