AbstractDefaultAjaxBehavior - getCallBackUrl
Hello, I am extending AbstractDefaultAjaxBehavior and using getCallBackUrl to place the ajax call in a JS function. This works fine. The only problem I have is that the getCallBackUrl does not seem to take into account the container's (tomcat) behavior of adding the JSESSIONID within the URL in case cookies are not enabled on the client browser. The JSESSIONID is added fine for other URLs within my app but when using getCallBackUrl and cookies are not enabled - the ajax call results in page expired. Is there a way that getCallBackUrl handles that right? Arie
Re: What can I do to speed up wicket initialization?
On Mon, Apr 19, 2010 at 5:32 PM, Zilvinas Vilutis cika...@gmail.com wrote: Spring / hibernate usually loads *before* seeing the message Started Wicket in deployment mode. Yes - this is what takes a long time - Spring / Hibernate. The Started Wicket in deployment mode comes from when Wicket finishes loading, but Wicket can not start loading until the other stuff is finished. Although i,n my project ( wicket / spring / hibernate ) it takes less than a second to finish the app loading after this message has appeared. Sure, because it's nearly the last thing that happens. It might be eh-cache, which usually takes a few secods to load too. Yes, this is what I'm getting at - there are many things that load before Wicket. You can't just post to the Wicket list and say how do I speed up Wicket when you have done absolutely no profiling. You need to put together numbers to see where your bottlenecks are before you can fix them. Best regards, -- Jeremy Thomerson http://www.wickettraining.com
Re: OnChangeAjaxBehavior and other form components
In the same context: is it possible to remove final from org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior.getEventHandler() I need to tweak the callback url. On Tue, 2010-04-20 at 15:25 -0700, Igor Vaynberg wrote: user AjaxFormComponentUpdatingBehavior -igor On Tue, Apr 20, 2010 at 2:37 PM, Steven Haines lyg...@yahoo.com wrote: Hi, I have a form component to which I added an OnChangeAjaxBehavior derivative and in its onUpdate() method I want to access the contents of it *and* another form field. Here's what I'm doing: form.add( new TextFieldString( street1 ).setRequired( true ) ); final TextFieldString zipcodeField = new TextFieldString( zipcode ); zipcodeField.setOutputMarkupId( true ); zipcodeField.setMarkupId( zip ); form.add( zipcodeField.setRequired( true ) ); // Load cities when the zipcode is updated zipcodeField.add( new OnChangeAjaxBehavior() { private static final long serialVersionUID = 1L; @Override protected void onUpdate( AjaxRequestTarget target ) { //TextFieldString street1 = ( TextFieldString )form.get( street1 ); //System.out.println( Street 1: + street1.getValue() ); System.out.println( Zipcode value (form component): + getFormComponent().getModelObject() ); // Do something with street1 and the zipcode } } ); The problem is that, although I've tried different techniques to obtain the value of the street1 text field, it is always returning null. I've tried creating street1 as a final text field and then calling its getValue() method, I've tried getting it from the form, as above, and I've tried reading from the underlying form model, all of which return null. Any suggestions? Thanks Steve - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Image Upload Using TinyMCE Within Wicket Framework
That would be really helpful. I'm struggling to get your example to work. -- View this message in context: http://n4.nabble.com/Image-Upload-Using-TinyMCE-Within-Wicket-Framework-tp1844756p2018575.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: AbstractDefaultAjaxBehavior - getCallBackUrl
I don't get the difference - Wicket's ajax calls work just fine - they are all on the page with the wicketAjaxGet() function - the first parameter which is the URL has the jsessionid when I generate my JS function which is only used to call the ajax * function* myFunction(){ *var* wcall=wicketAjaxGet('${ajaxCallUrl}' , *function*() { }, *function*() { }); } I generate the ajaxCallUrl with getCallbackUrl(*true*) of the behavior The result is something like ?wicket:interface=:0:homePagePanel:promotionsPanel::IActivePageBehaviorListener:10:wicket:ignoreIfNotActive=true With no jsessionid when actually required (cookies not enabled on the client browser) The full code of the behavior's onBind that does it @Override *protected* *void* onBind() { Component comp = getComponent(); markupId = comp.getMarkupId(); MapString, Object scriptParams = *new* HashMapString, Object(); scriptParams.put(ajaxCallUrl, getCallbackUrl(*true*).toString()); scriptParams.put(functionName, getGeneratedFunctionName()); *if* (paramName == *null*) getComponent().add(*new* ScriptHeaderContributor(AjaxJSFunctionBehavior.* class*, ajaxfunction.js, scriptParams)); *else* { scriptParams.put(paramName, paramName); getComponent().add(*new* ScriptHeaderContributor(AjaxJSFunctionBehavior.* class*, ajaxParamFunction.js, scriptParams)); } *super*.onBind(); } On Wed, Apr 21, 2010 at 9:11 AM, Arie Fishler arie@gmail.com wrote: Hello, I am extending AbstractDefaultAjaxBehavior and using getCallBackUrl to place the ajax call in a JS function. This works fine. The only problem I have is that the getCallBackUrl does not seem to take into account the container's (tomcat) behavior of adding the JSESSIONID within the URL in case cookies are not enabled on the client browser. The JSESSIONID is added fine for other URLs within my app but when using getCallBackUrl and cookies are not enabled - the ajax call results in page expired. Is there a way that getCallBackUrl handles that right? Arie
RE: Wicket DatePicker memory leak during ajax rerender?
Bumping this. Have anybody experienced memory leaks on the client when rerendering datepickers using wickets AjaxRequestTarget#addComponent()? -Original Message- From: Jomar Lorentzen [mailto:jomar.lorent...@statnett.no] Sent: 25. mars 2010 08:20 To: users@wicket.apache.org Subject: Wicket DatePicker memory leak during ajax rerender? Hi, we are using the DatePicker in a panel that is rerendered through ajax at a certain interval, and we have noticed that the DOM reporter in firebug reports that a new function is added each time the DatePicker is rerendered. As none on our team are really into javascript we're wondering if anybody could say if this is a potential memory leak? Each time the DatePicker is rerendered a new random javascript function of the type initdateXXX is added to the page. Are these initXXX references a potential memory leak on the browser, or would they be cleaned up by the browser if firebug had not been running? initdate838 = function() { Wicket.DateTime.init( ... ); }; if (wicketCalendarInitFinished) { // when a DatePicker is added via ajax, the loader is already finished, so // we call the init function directly. initdate838(); } else { // when page is rendered, all calendar components will be initialized after // the required js libraries have been loaded. wicketCalendarInits.push(initdate838); } Save a tree - don't print this e-mail unless necessary! Statnett SF, Tel. head office +47 22527000, Enterprise No. NO 962 986 633 VAT, www.statnett.no, firmap...@statnett.no _ This e-mail and any attached files are confidential and may be legally privileged. If you have received this transmission in error please notify the sender by reply e-mail immediately and then delete the e-mail. E-mail transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete. If verification is required please request a hard copy version. This e-mail message has been virus checked by the antivirus programs used by Statnett SF. _ Save a tree - don't print this e-mail unless necessary! Statnett SF, Tel. head office +47 22527000, Enterprise No. NO 962 986 633 VAT, www.statnett.no, firmap...@statnett.no _ This e-mail and any attached files are confidential and may be legally privileged. If you have received this transmission in error please notify the sender by reply e-mail immediately and then delete the e-mail. E-mail transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete. If verification is required please request a hard copy version. This e-mail message has been virus checked by the antivirus programs used by Statnett SF. _ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
No Redirect to login page
Hi to all, i am in my second try with swarm to get an secure web application. After the first example which works fine i started my real application. I use to have a none secure start page (extends WebPage) which links to some SecureWebPage. But when i click on the Link to get to the SecureWebPage the server delivers the page without any authentication. So no login page is shown and the secure content is shown to everybody. I done following steps: 1. Extend App to SwarmWebApplication 2. Create an hive file and register (content see on footer) 3. Extend Secure Pages to SecureWebPage 4. Create a login page and register to application (getLoginPage) At the moment there is no error message or anything else to hint me why no login is shown for the securewebpage. Hope someone can give me a hint to get a step further. Best regards Kruff hive content: grant principal org.apache.wicket.security.hive.authorization.SimplePrincipal admin { permission ${ComponentPermission} my.web.SourceControl, inherit, render; permission ${ComponentPermission} my.web.SourceControl, enable; }; -- View this message in context: http://n4.nabble.com/No-Redirect-to-login-page-tp2018795p2018795.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
Strange error
Hi! My application uses wicket-1.4.7. I've noticed recently in logs the following error: 2010-04-21 07:35:18,744 ERROR [org.apache.wicket.request.target.resource.SharedResourceRequestTarget] unable to lazily register shared resource resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js java.lang.ClassNotFoundException: resources at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.apache.wicket.application.DefaultClassResolver.resolveClass(DefaultClassResolver.java:114) at org.apache.wicket.request.target.resource.SharedResourceRequestTarget.respond(SharedResourceRequestTarget.java:151) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.eloquentix.soundpure.web.http.SeoFilter.doFilter(SeoFilter.java:56) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilte It doesn't make any sense to me... but maybe somebody have a clue what could be a reason. Thanks! Alex
an interface for page ?
hi I need to create some page factory where some page should extend some specific interface. Ideally, I would like to be able to request for ? extends MyInterface with MyInterface implementing the page interface however, currently, Page is a class. Would it be thinkable (for example for wicket 1.5) to have an interface for page, which would be used as well in setResponse(..) ? thanks in advance best regards -- Joseph Pachod IT THOMAS DAILY GmbH Adlerstraße 19 79098 Freiburg Deutschland T + 49 761 3 85 59 506 F + 49 761 3 85 59 550 E joseph.pac...@thomas-daily.de www.thomas-daily.de Geschäftsführer/Managing Directors: Wendy Thomas, Susanne Larbig Handelsregister Freiburg i.Br., HRB 3947 Registrieren Sie sich unter www.signin.thomas-daily.de für die kostenfreien TD Morning News, eine Auswahl aktueller Themen des Tages morgens um 9:00 in Ihrer Mailbox. Hinweis: Der Redaktionsschluss für unsere TD Morning News ist täglich um 8:30 Uhr. Es werden vorrangig Informationen berücksichtigt, die nach 16:00 Uhr des Vortages eingegangen sind. Die Email-Adresse unserer Redaktion lautet redakt...@thomas-daily.de. To receive the free TD News International - a selection of the day's top issues delivered to your mail box every day - please register at www.signin.thomas-daily.de Please note: Information received for our TD News International after 4 p.m. will be given priority for publication the following day. The daily editorial deadline is 8:30 a.m. You can reach our editorial staff at redakt...@thomas-daily.de. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
meaning of stricken item in Wicket 1.5 Wish List on the wiki ?
hi Could someone enlighten me with the meaning of stricken items in the Wicket 1.5 Wish List of the wiki (https://cwiki.apache.org/WICKET/wicket-15-wish-list.html ) ? thanks in advance best regards -- Joseph Pachod IT THOMAS DAILY GmbH Adlerstraße 19 79098 Freiburg Deutschland T + 49 761 3 85 59 506 F + 49 761 3 85 59 550 E joseph.pac...@thomas-daily.de www.thomas-daily.de Geschäftsführer/Managing Directors: Wendy Thomas, Susanne Larbig Handelsregister Freiburg i.Br., HRB 3947 Registrieren Sie sich unter www.signin.thomas-daily.de für die kostenfreien TD Morning News, eine Auswahl aktueller Themen des Tages morgens um 9:00 in Ihrer Mailbox. Hinweis: Der Redaktionsschluss für unsere TD Morning News ist täglich um 8:30 Uhr. Es werden vorrangig Informationen berücksichtigt, die nach 16:00 Uhr des Vortages eingegangen sind. Die Email-Adresse unserer Redaktion lautet redakt...@thomas-daily.de. To receive the free TD News International - a selection of the day's top issues delivered to your mail box every day - please register at www.signin.thomas-daily.de Please note: Information received for our TD News International after 4 p.m. will be given priority for publication the following day. The daily editorial deadline is 8:30 a.m. You can reach our editorial staff at redakt...@thomas-daily.de. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: an interface for page ?
It is already: public abstract class Page extends MarkupContainer implements IRedirectListener, IManageablePage, IRequestablePage Component# public final void setResponsePage(final Page page) { getRequestCycle().setResponsePage(page); } RequestCycle# public void setResponsePage(IRequestablePage page) { scheduleRequestHandlerAfterCurrent(new RenderPageRequestHandler(new PageProvider(page), RenderPageRequestHandler.RedirectPolicy.AUTO_REDIRECT)); } On Wed, 2010-04-21 at 14:45 +0200, Joseph Pachod wrote: hi I need to create some page factory where some page should extend some specific interface. Ideally, I would like to be able to request for ? extends MyInterface with MyInterface implementing the page interface however, currently, Page is a class. Would it be thinkable (for example for wicket 1.5) to have an interface for page, which would be used as well in setResponse(..) ? thanks in advance best regards - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: meaning of stricken item in Wicket 1.5 Wish List on the wiki ?
Some of them are already implemented, other have a comment below forwarding to a solution provided somewhere else (e.g. ImageBundle) On Wed, 2010-04-21 at 14:52 +0200, Joseph Pachod wrote: hi Could someone enlighten me with the meaning of stricken items in the Wicket 1.5 Wish List of the wiki (https://cwiki.apache.org/WICKET/wicket-15-wish-list.html ) ? thanks in advance best regards - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: OnChangeAjaxBehavior and other form components
Hi Igor, I looked at the JavaScript that is generated when adding an AjaxFormComponentUpdatingBehavior and it does not include any form fields other than the component to which it is added: onChange=if(this.value.length gt;= 5){var wcall=wicketAjaxPost('?wicket:interface=:1:gettingStartedPanel:step_1:zipcode::IBehaviorListener:0:', wicketSerialize(Wicket.$('zip')),function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$('zip') != null;}.bind(this));} Should I look at submitting the entire form via Ajax when my conditions are met? Or any other ideas about how to add a form field to the callback? Here is what I added to my WebPage: // Street 1 final TextFieldString street1 = new TextFieldString( street1 ); street1.setOutputMarkupId( true ); street1.setMarkupId( address1 ); form.add( street1.setRequired( true ) ); final TextFieldString zipcodeField = new TextFieldString( zipcode ); zipcodeField.setOutputMarkupId( true ); zipcodeField.setMarkupId( zip ); form.add( zipcodeField.setRequired( true ) ); zipcodeField.add( new AjaxFormComponentUpdatingBehavior( onChange ) { private static final long serialVersionUID = 1L; @Override public void onUpdate( AjaxRequestTarget target ) { System.out.println( Street 1 (final): + street1.getValue() ); TextFieldString street1f = ( TextFieldString )form.get( street1 ); System.out.println( Street 1 (form): + street1f.getValue() ); System.out.println( Zipcode value (form component): + getFormComponent().getModelObject() ); } @Override protected IAjaxCallDecorator getAjaxCallDecorator() { return new AjaxCallDecorator() { private static final long serialVersionUID = 1L; @Override public CharSequence decorateScript( CharSequence script ) { // Only return the script (which means that it will be executed) after the // user enters the 5th digit (or more) return if(this.value.length = 5){ + script + }; } }; } }); ...and on another note, I had the same code with an OnChangeAjaxBehavior and the callback was made when the 5th character was typed, but with the AjaxFormComponentUpdatingBehavior the callback was made when the component lost focus .. Thanks Steve - Original Message From: Igor Vaynberg igor.vaynb...@gmail.com To: users@wicket.apache.org; Steven Haines lyg...@yahoo.com Sent: Tue, April 20, 2010 6:25:03 PM Subject: Re: OnChangeAjaxBehavior and other form components user AjaxFormComponentUpdatingBehavior -igor On Tue, Apr 20, 2010 at 2:37 PM, Steven Haines lyg...@yahoo.com wrote: Hi, I have a form component to which I added an OnChangeAjaxBehavior derivative and in its onUpdate() method I want to access the contents of it *and* another form field. Here's what I'm doing: form.add( new TextFieldString( street1 ).setRequired( true ) ); final TextFieldString zipcodeField = new TextFieldString( zipcode ); zipcodeField.setOutputMarkupId( true ); zipcodeField.setMarkupId( zip ); form.add( zipcodeField.setRequired( true ) ); // Load cities when the zipcode is updated zipcodeField.add( new OnChangeAjaxBehavior() { private static final long serialVersionUID = 1L; @Override protected void onUpdate( AjaxRequestTarget target ) { //TextFieldString street1 = ( TextFieldString )form.get( street1 ); //System.out.println( Street 1: + street1.getValue() ); System.out.println( Zipcode value (form component): + getFormComponent().getModelObject() ); // Do something with street1 and the zipcode } } ); The problem is that, although I've tried different techniques to obtain the value of the street1 text field, it is always returning null. I've tried creating street1 as a final text field and then calling its getValue() method, I've tried getting it from the form, as above, and I've tried reading from the underlying form model, all of which return null. Any suggestions? Thanks Steve - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To
Re: Example for presenting pdf in modal window
Hi Ernesto, I tried using your code, but unfortunately I run into a NullPointerException when trying to load the pdf file. I placed the test.pfd file in the same directory as the MyPdfResource.java, but obviously the system can't find it. Any idea what I might have overlooked? ERROR - RequestCycle - java.lang.NullPointerException at java.io.ByteArrayInputStream.init(ByteArrayInputStream.java:89) at org.apache.wicket.markup.html.DynamicWebResource$1.getInputStream(DynamicWebResource.java:221) Thanks for your help, Natalie -- View this message in context: http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2018922.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: Example for presenting pdf in modal window
Hi Natalie, On your e-mail test.pfd which is not exactly the same as test.pdf? Maybe that's what is happening? I wrote this longtime ago... So, I will recreate the example on my local machine and see if it still works. Best, Ernesto On Wed, Apr 21, 2010 at 3:17 PM, nmetzger nmetz...@odu.edu wrote: Hi Ernesto, I tried using your code, but unfortunately I run into a NullPointerException when trying to load the pdf file. I placed the test.pfd file in the same directory as the MyPdfResource.java, but obviously the system can't find it. Any idea what I might have overlooked? ERROR - RequestCycle - java.lang.NullPointerException at java.io.ByteArrayInputStream.init(ByteArrayInputStream.java:89) at org.apache.wicket.markup.html.DynamicWebResource$1.getInputStream(DynamicWebResource.java:221) Thanks for your help, Natalie -- View this message in context: http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2018922.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: Example for presenting pdf in modal window
Hi Natalie, I have recreated the example and it works as expected (tested on FF, IE). So it must be some detail you are missing. Best, Ernesto On Wed, Apr 21, 2010 at 3:37 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Hi Natalie, On your e-mail test.pfd which is not exactly the same as test.pdf? Maybe that's what is happening? I wrote this longtime ago... So, I will recreate the example on my local machine and see if it still works. Best, Ernesto On Wed, Apr 21, 2010 at 3:17 PM, nmetzger nmetz...@odu.edu wrote: Hi Ernesto, I tried using your code, but unfortunately I run into a NullPointerException when trying to load the pdf file. I placed the test.pfd file in the same directory as the MyPdfResource.java, but obviously the system can't find it. Any idea what I might have overlooked? ERROR - RequestCycle - java.lang.NullPointerException at java.io.ByteArrayInputStream.init(ByteArrayInputStream.java:89) at org.apache.wicket.markup.html.DynamicWebResource$1.getInputStream(DynamicWebResource.java:221) Thanks for your help, Natalie -- View this message in context: http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2018922.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: Example for presenting pdf in modal window
Ernesto, I checked, but this was only a typo in my post, the file is called test.pdf. And fyi, I'm using wicket 1.4.6. My use case is this: I would like to have help pages displayed in my system that other people besides me edit. So I'd like to put them in a directory outside of my application and just load them whenever a user clicks on a help page. Any help is greatly appreciated, Natalie -- View this message in context: http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2018993.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: Example for presenting pdf in modal window
Natalie, As far as I can see you can use the same approach: the only thing that is different is the you will load the resource from somewhere else not from the class path. Do you want me to mail you the test pages (along with the wiki files) I just made to test it? Best Ernesto On Wed, Apr 21, 2010 at 3:57 PM, nmetzger nmetz...@odu.edu wrote: Ernesto, I checked, but this was only a typo in my post, the file is called test.pdf. And fyi, I'm using wicket 1.4.6. My use case is this: I would like to have help pages displayed in my system that other people besides me edit. So I'd like to put them in a directory outside of my application and just load them whenever a user clicks on a help page. Any help is greatly appreciated, Natalie -- View this message in context: http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2018993.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: Example for presenting pdf in modal window
Hi Ernesto, yes, please email those. And I tried putting in a complete path to a pdf file, but I'm getting the same error. Thanks for your help, Natalie From: reiern70 [via Apache Wicket] [mailto:ml-node+2019010-1360852028-229...@n4.nabble.com] Sent: Wednesday, April 21, 2010 10:10 AM To: Metzger, Natalie J. Subject: Re: Example for presenting pdf in modal window Natalie, As far as I can see you can use the same approach: the only thing that is different is the you will load the resource from somewhere else not from the class path. Do you want me to mail you the test pages (along with the wiki files) I just made to test it? Best Ernesto On Wed, Apr 21, 2010 at 3:57 PM, nmetzger [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=0 wrote: Ernesto, I checked, but this was only a typo in my post, the file is called test.pdf. And fyi, I'm using wicket 1.4.6. My use case is this: I would like to have help pages displayed in my system that other people besides me edit. So I'd like to put them in a directory outside of my application and just load them whenever a user clicks on a help page. Any help is greatly appreciated, Natalie -- View this message in context: http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2018993.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=1 For additional commands, e-mail: [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=2 - To unsubscribe, e-mail: [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=3 For additional commands, e-mail: [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=4 View message @ http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2019010.html To unsubscribe from Re: Example for presenting pdf in modal window, click here (link removed) =. -- View this message in context: http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2019020.html Sent from the Wicket - User mailing list archive at Nabble.com.
Re: Example for presenting pdf in modal window
Natalie, Done: I have mailed them to your private mail address as the list does not accepts attachments. Best, Ernesto On Wed, Apr 21, 2010 at 4:16 PM, nmetzger nmetz...@odu.edu wrote: Hi Ernesto, yes, please email those. And I tried putting in a complete path to a pdf file, but I'm getting the same error. Thanks for your help, Natalie From: reiern70 [via Apache Wicket] [mailto:ml-node+2019010-1360852028-229...@n4.nabble.com] Sent: Wednesday, April 21, 2010 10:10 AM To: Metzger, Natalie J. Subject: Re: Example for presenting pdf in modal window Natalie, As far as I can see you can use the same approach: the only thing that is different is the you will load the resource from somewhere else not from the class path. Do you want me to mail you the test pages (along with the wiki files) I just made to test it? Best Ernesto On Wed, Apr 21, 2010 at 3:57 PM, nmetzger [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=0 wrote: Ernesto, I checked, but this was only a typo in my post, the file is called test.pdf. And fyi, I'm using wicket 1.4.6. My use case is this: I would like to have help pages displayed in my system that other people besides me edit. So I'd like to put them in a directory outside of my application and just load them whenever a user clicks on a help page. Any help is greatly appreciated, Natalie -- View this message in context: http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2018993.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=1 For additional commands, e-mail: [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=2 - To unsubscribe, e-mail: [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=3 For additional commands, e-mail: [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=4 View message @ http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2019010.html To unsubscribe from Re: Example for presenting pdf in modal window, click here (link removed) =. -- View this message in context: http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2019020.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: Example for presenting pdf in modal window
Just one idea: check that your IDE is not filtering *.pdf files with the side effect that the file is not available as a resource. Ernesto On Wed, Apr 21, 2010 at 4:19 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Natalie, Done: I have mailed them to your private mail address as the list does not accepts attachments. Best, Ernesto On Wed, Apr 21, 2010 at 4:16 PM, nmetzger nmetz...@odu.edu wrote: Hi Ernesto, yes, please email those. And I tried putting in a complete path to a pdf file, but I'm getting the same error. Thanks for your help, Natalie From: reiern70 [via Apache Wicket] [mailto:ml-node+2019010-1360852028-229...@n4.nabble.com] Sent: Wednesday, April 21, 2010 10:10 AM To: Metzger, Natalie J. Subject: Re: Example for presenting pdf in modal window Natalie, As far as I can see you can use the same approach: the only thing that is different is the you will load the resource from somewhere else not from the class path. Do you want me to mail you the test pages (along with the wiki files) I just made to test it? Best Ernesto On Wed, Apr 21, 2010 at 3:57 PM, nmetzger [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=0 wrote: Ernesto, I checked, but this was only a typo in my post, the file is called test.pdf. And fyi, I'm using wicket 1.4.6. My use case is this: I would like to have help pages displayed in my system that other people besides me edit. So I'd like to put them in a directory outside of my application and just load them whenever a user clicks on a help page. Any help is greatly appreciated, Natalie -- View this message in context: http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2018993.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=1 For additional commands, e-mail: [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=2 - To unsubscribe, e-mail: [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=3 For additional commands, e-mail: [hidden email]http://n4.nabble.com/user/SendEmail.jtp?type=nodenode=2019010i=4 View message @ http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2019010.html To unsubscribe from Re: Example for presenting pdf in modal window, click here (link removed) =. -- View this message in context: http://n4.nabble.com/Example-for-presenting-pdf-in-modal-window-tp1879547p2019020.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: an interface for page ?
Martin Grigorov wrote: It is already: (..) thanks for this info :) is there any known estimation of wicket 1.5 release date ? ++ joseph - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
BoundCompoundPropertyModel
Hi All, Can anyone tell me the exact differences between a CompoundPropertyModel and a BoundCompoundPropertyModel? In an app i'm working on i'm getting a strange bug. When I update a compnent via ajax the value of that component is not set in the entity. thanks
Re: BoundCompoundPropertyModel
javadoc of bound: /** * A compound property model that supports type conversions and property expression bindings. * * @author Jonathan Locke * * @param T *The model object * * @deprecated See {...@link CompoundPropertyModel#bind(String)} */ -igor On Wed, Apr 21, 2010 at 8:25 AM, Ted Roeloffzen ted.roeloff...@gmail.com wrote: Hi All, Can anyone tell me the exact differences between a CompoundPropertyModel and a BoundCompoundPropertyModel? In an app i'm working on i'm getting a strange bug. When I update a compnent via ajax the value of that component is not set in the entity. thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: OnChangeAjaxBehavior and other form components
there is ajaxformsubmitbehavior if you want all the fields updated -igor On Wed, Apr 21, 2010 at 6:10 AM, Steven Haines lyg...@yahoo.com wrote: Hi Igor, I looked at the JavaScript that is generated when adding an AjaxFormComponentUpdatingBehavior and it does not include any form fields other than the component to which it is added: onChange=if(this.value.length = 5){var wcall=wicketAjaxPost('?wicket:interface=:1:gettingStartedPanel:step_1:zipcode::IBehaviorListener:0:', wicketSerialize(Wicket.$('zip')),function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$('zip') != null;}.bind(this));} Should I look at submitting the entire form via Ajax when my conditions are met? Or any other ideas about how to add a form field to the callback? Here is what I added to my WebPage: // Street 1 final TextFieldString street1 = new TextFieldString( street1 ); street1.setOutputMarkupId( true ); street1.setMarkupId( address1 ); form.add( street1.setRequired( true ) ); final TextFieldString zipcodeField = new TextFieldString( zipcode ); zipcodeField.setOutputMarkupId( true ); zipcodeField.setMarkupId( zip ); form.add( zipcodeField.setRequired( true ) ); zipcodeField.add( new AjaxFormComponentUpdatingBehavior( onChange ) { private static final long serialVersionUID = 1L; �...@override public void onUpdate( AjaxRequestTarget target ) { System.out.println( Street 1 (final): + street1.getValue() ); TextFieldString street1f = ( TextFieldString )form.get( street1 ); System.out.println( Street 1 (form): + street1f.getValue() ); System.out.println( Zipcode value (form component): + getFormComponent().getModelObject() ); } �...@override protected IAjaxCallDecorator getAjaxCallDecorator() { return new AjaxCallDecorator() { private static final long serialVersionUID = 1L; �...@override public CharSequence decorateScript( CharSequence script ) { // Only return the script (which means that it will be executed) after the // user enters the 5th digit (or more) return if(this.value.length = 5){ + script + }; } }; } }); ...and on another note, I had the same code with an OnChangeAjaxBehavior and the callback was made when the 5th character was typed, but with the AjaxFormComponentUpdatingBehavior the callback was made when the component lost focus .. Thanks Steve - Original Message From: Igor Vaynberg igor.vaynb...@gmail.com To: users@wicket.apache.org; Steven Haines lyg...@yahoo.com Sent: Tue, April 20, 2010 6:25:03 PM Subject: Re: OnChangeAjaxBehavior and other form components user AjaxFormComponentUpdatingBehavior -igor On Tue, Apr 20, 2010 at 2:37 PM, Steven Haines lyg...@yahoo.com wrote: Hi, I have a form component to which I added an OnChangeAjaxBehavior derivative and in its onUpdate() method I want to access the contents of it *and* another form field. Here's what I'm doing: form.add( new TextFieldString( street1 ).setRequired( true ) ); final TextFieldString zipcodeField = new TextFieldString( zipcode ); zipcodeField.setOutputMarkupId( true ); zipcodeField.setMarkupId( zip ); form.add( zipcodeField.setRequired( true ) ); // Load cities when the zipcode is updated zipcodeField.add( new OnChangeAjaxBehavior() { private static final long serialVersionUID = 1L; �...@override protected void onUpdate( AjaxRequestTarget target ) { //TextFieldString street1 = ( TextFieldString )form.get( street1 ); //System.out.println( Street 1: + street1.getValue() ); System.out.println( Zipcode value (form component): + getFormComponent().getModelObject() ); // Do something with street1 and the zipcode } } ); The problem is that, although I've tried different techniques to obtain the value of the street1 text field, it is always returning null. I've tried creating street1 as a final text field and then calling its getValue() method, I've tried getting it from the form, as above, and I've tried reading from the underlying form model, all of which return null. Any suggestions? Thanks Steve - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To
Which form componnent had focus when form was submitted?
Is there a way to figure out in a forms onSubmit which text field or button had focus when the form is submitted. I have done something in js to achieve this, but wanted to see if there was something already built in Wicket. I am limited to using form submit only no Ajax. Windows CE is having problems with some of the Ajax I tried to use. Thanks, Warren
Re: Which form componnent had focus when form was submitted?
you have to keep a HiddenField component and populate its value using javascript. -igor On Wed, Apr 21, 2010 at 9:41 AM, Warren Bell warr...@clarksnutrition.com wrote: Is there a way to figure out in a forms onSubmit which text field or button had focus when the form is submitted. I have done something in js to achieve this, but wanted to see if there was something already built in Wicket. I am limited to using form submit only no Ajax. Windows CE is having problems with some of the Ajax I tried to use. Thanks, Warren - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: meaning of stricken item in Wicket 1.5 Wish List on the wiki ?
striken through means: 1) already happened 2) already happened elsewhere 3) never gonna happen Most items fall in categories 1 and 2 Martijn On Wed, Apr 21, 2010 at 2:52 PM, Joseph Pachod j...@thomas-daily.de wrote: hi Could someone enlighten me with the meaning of stricken items in the Wicket 1.5 Wish List of the wiki (https://cwiki.apache.org/WICKET/wicket-15-wish-list.html ) ? thanks in advance best regards -- Joseph Pachod IT THOMAS DAILY GmbH Adlerstraße 19 79098 Freiburg Deutschland T + 49 761 3 85 59 506 F + 49 761 3 85 59 550 E joseph.pac...@thomas-daily.de www.thomas-daily.de Geschäftsführer/Managing Directors: Wendy Thomas, Susanne Larbig Handelsregister Freiburg i.Br., HRB 3947 Registrieren Sie sich unter www.signin.thomas-daily.de für die kostenfreien TD Morning News, eine Auswahl aktueller Themen des Tages morgens um 9:00 in Ihrer Mailbox. Hinweis: Der Redaktionsschluss für unsere TD Morning News ist täglich um 8:30 Uhr. Es werden vorrangig Informationen berücksichtigt, die nach 16:00 Uhr des Vortages eingegangen sind. Die Email-Adresse unserer Redaktion lautet redakt...@thomas-daily.de. To receive the free TD News International - a selection of the day's top issues delivered to your mail box every day - please register at www.signin.thomas-daily.de Please note: Information received for our TD News International after 4 p.m. will be given priority for publication the following day. The daily editorial deadline is 8:30 a.m. You can reach our editorial staff at redakt...@thomas-daily.de. - 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.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.4 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Back-button friendly ajax wizard navigation
I have a Page with a Wizard component. Currently using the next and previous buttons perform full-page (non-ajax) form submissions which has the necessary side-effect of being back-button friendly. I implemented an ajax version of the Wizard in order to get faster validations. That part works great - however, back button support is broken. (Clicking the browser back button brings the user to the page before the wizard page, instead of going back one page in the wizard). Is there a way I can use Wicket's ajax form support to have these faster validations while not breaking the back button? I tried doing: protected void onSubmit(AjaxRequestTarget target, Form? form) { if( target != null ) { ... setRedirect(true) } } to redirect the response in order to create a browser history entry. It didn't work, so clearly there's something fundamental here that I don't understand. Any suggestions? Thanks!
Re: OnChangeAjaxBehavior and other form components
Thanks Igor, the AjaxFormSubmitBehavior worked to give me access to all form fields. I have one additional problem: with the OnChangeAjaxBehavior implementation it used my Ajax call decorator correctly and sent me updates after the user typed the 5th character in the field, but with the AjaxFormSubmitBehavior it only calls back to my web page when the field loses focus. I setup both scenarios and looked at the HTML document. Here is the working one (OnChangeAjaxBehavior ): input wicket:id=zipcode class=js_disable id=zip value= name=zipcode onchange= if(this.value.length gt;= 5){var wcall=wicketAjaxPost('?wicket:interface=:1:gettingStartedPanel:step_1:zipcode::IBehaviorListener:0:', wicketSerialize(Wicket.$('zip')),function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$('zip') != null;}.bind(this));} script type=text/javascript!--/*--![CDATA[/*!--*/ new Wicket.ChangeHandler('zip'); /*--]]*//script And here is the one that only sends requests when the text field loses focus (AjaxFormSubmitBehavior): input wicket:id=zipcode class=js_disable id=zip value= name=zipcode onchange= if(this.value.length gt;= 5){var wcall=wicketSubmitFormById('step__114', '?wicket:interface=:7:gettingStartedPanel:step_1:zipcode::IActivePageBehaviorListener:0:amp;wicket:ignoreIfNotActive=true', null,function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$$(this)amp;amp;Wicket.$$('step__114')}.bind(this));}; My guess is that the Wicket.ChangeHandler('zip') is what is making it work, but that does not appear when I add the AjaxFormSubmitBehavior. Do you know what I need to add to it to get this behavior? Thanks so much! Steve - Original Message From: Igor Vaynberg igor.vaynb...@gmail.com To: users@wicket.apache.org; Steven Haines lyg...@yahoo.com Sent: Wed, April 21, 2010 12:35:20 PM Subject: Re: OnChangeAjaxBehavior and other form components there is ajaxformsubmitbehavior if you want all the fields updated -igor On Wed, Apr 21, 2010 at 6:10 AM, Steven Haines lyg...@yahoo.com wrote: Hi Igor, I looked at the JavaScript that is generated when adding an AjaxFormComponentUpdatingBehavior and it does not include any form fields other than the component to which it is added: onChange=if(this.value.length = 5){var wcall=wicketAjaxPost('?wicket:interface=:1:gettingStartedPanel:step_1:zipcode::IBehaviorListener:0:', wicketSerialize(Wicket.$('zip')),function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$('zip') != null;}.bind(this));} Should I look at submitting the entire form via Ajax when my conditions are met? Or any other ideas about how to add a form field to the callback? Here is what I added to my WebPage: // Street 1 final TextFieldString street1 = new TextFieldString( street1 ); street1.setOutputMarkupId( true ); street1.setMarkupId( address1 ); form.add( street1.setRequired( true ) ); final TextFieldString zipcodeField = new TextFieldString( zipcode ); zipcodeField.setOutputMarkupId( true ); zipcodeField.setMarkupId( zip ); form.add( zipcodeField.setRequired( true ) ); zipcodeField.add( new AjaxFormComponentUpdatingBehavior( onChange ) { private static final long serialVersionUID = 1L; @Override public void onUpdate( AjaxRequestTarget target ) { System.out.println( Street 1 (final): + street1.getValue() ); TextFieldString street1f = ( TextFieldString )form.get( street1 ); System.out.println( Street 1 (form): + street1f.getValue() ); System.out.println( Zipcode value (form component): + getFormComponent().getModelObject() ); } @Override protected IAjaxCallDecorator getAjaxCallDecorator() { return new AjaxCallDecorator() { private static final long serialVersionUID = 1L; @Override public CharSequence decorateScript( CharSequence script ) { // Only return the script (which means that it will be executed) after the // user enters the 5th digit (or more) return if(this.value.length = 5){ + script + }; } }; } }); ...and on another note, I had the same code with an OnChangeAjaxBehavior and the callback was made when the 5th character was typed, but with the AjaxFormComponentUpdatingBehavior the callback was made when the component lost focus .. Thanks Steve - Original Message From: Igor Vaynberg igor.vaynb...@gmail.com To: users@wicket.apache.org; Steven Haines lyg...@yahoo.com Sent: Tue, April 20, 2010 6:25:03 PM Subject: Re: OnChangeAjaxBehavior and other form components user
Re: Back-button friendly ajax wizard navigation
Since you are changing the DOM dynamically using Ajax, the browser -- correctly I would say -- isn't considering this a page change, so the back button should take you back to the page prior to the wizard. The browser history will be immutable from JavaScript, so that's not an option. To achieve the user experience you want, I think the best alternative is to validate your fields via Ajax onblur, but move between wizard steps using a form submit. Hope this helps. Ed. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: BoundCompoundPropertyModel
But how does that relate to the bug i'm having? Will the model lose the binding when an ajax-call updates the component? Ted 2010/4/21 Igor Vaynberg igor.vaynb...@gmail.com javadoc of bound: /** * A compound property model that supports type conversions and property expression bindings. * * @author Jonathan Locke * * @param T *The model object * * @deprecated See {...@link CompoundPropertyModel#bind(String)} */ -igor On Wed, Apr 21, 2010 at 8:25 AM, Ted Roeloffzen ted.roeloff...@gmail.com wrote: Hi All, Can anyone tell me the exact differences between a CompoundPropertyModel and a BoundCompoundPropertyModel? In an app i'm working on i'm getting a strange bug. When I update a compnent via ajax the value of that component is not set in the entity. thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: OnChangeAjaxBehavior and other form components
I finally got everything working... Here is what I did for anyone that comes across this problem.. I added an onComponentRendered() method to my AjaxFormSubmitBehavior in that method I added the new Wicket.ChangeHandler (I saw the code in the OnChangeAjaxBehavior class): @Override protected final void onComponentRendered() { Response response = getComponent().getResponse(); final String id = getComponent().getMarkupId(); response.write( JavascriptUtils.SCRIPT_OPEN_TAG ); response.write( new Wicket.ChangeHandler(' + id + '); ); response.write( JavascriptUtils.SCRIPT_CLOSE_TAG ); } So here is my final zipcode field: zipcodeField.add( new AjaxFormSubmitBehavior( form, onchange ) { private static final long serialVersionUID = 1L; @Override protected void onSubmit( AjaxRequestTarget target ) { // Access your objects through the form bound in your CompoundPropertyModel myModel.getZipcode(); myModel.getStreet1(); } @Override protected void onError( AjaxRequestTarget art ) { // Called for things like validation errors ... } @Override protected IAjaxCallDecorator getAjaxCallDecorator() { return new AjaxCallDecorator() { private static final long serialVersionUID = 1L; @Override public CharSequence decorateScript( CharSequence script ) { // Only return the script (which means that it will be executed) after the // user enters the 5th digit (or more) return if(this.value.length = 5){ + script + }; } }; } @Override protected final void onComponentRendered() { // Creates a new Wicket.ChangeHandler for immediate notifications of // change events Response response = getComponent().getResponse(); final String id = getComponent().getMarkupId(); response.write( JavascriptUtils.SCRIPT_OPEN_TAG ); response.write( new Wicket.ChangeHandler(' + id + '); ); response.write( JavascriptUtils.SCRIPT_CLOSE_TAG ); } } ); - Original Message From: Steven Haines lyg...@yahoo.com To: users@wicket.apache.org Sent: Wed, April 21, 2010 1:38:04 PM Subject: Re: OnChangeAjaxBehavior and other form components Thanks Igor, the AjaxFormSubmitBehavior worked to give me access to all form fields. I have one additional problem: with the OnChangeAjaxBehavior implementation it used my Ajax call decorator correctly and sent me updates after the user typed the 5th character in the field, but with the AjaxFormSubmitBehavior it only calls back to my web page when the field loses focus. I setup both scenarios and looked at the HTML document. Here is the working one (OnChangeAjaxBehavior ): input wicket:id=zipcode class=js_disable id=zip value= name=zipcode onchange= if(this.value.length gt;= 5){var wcall=wicketAjaxPost('?wicket:interface=:1:gettingStartedPanel:step_1:zipcode::IBehaviorListener:0:', wicketSerialize(Wicket.$('zip')),function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$('zip') != null;}.bind(this));} script type=text/javascript!--/*--![CDATA[/*!--*/ new Wicket.ChangeHandler('zip'); /*--]]*//script And here is the one that only sends requests when the text field loses focus (AjaxFormSubmitBehavior): input wicket:id=zipcode class=js_disable id=zip value= name=zipcode onchange= if(this.value.length gt;= 5){var wcall=wicketSubmitFormById('step__114', '?wicket:interface=:7:gettingStartedPanel:step_1:zipcode::IActivePageBehaviorListener:0:amp;wicket:ignoreIfNotActive=true', null,function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$$(this)amp;amp;Wicket.$$('step__114')}.bind(this));}; My guess is that the Wicket.ChangeHandler('zip') is what is making it work, but that does not appear when I add the AjaxFormSubmitBehavior. Do you know what I need to add to it to get this behavior? Thanks so much! Steve - Original Message From: Igor Vaynberg igor.vaynb...@gmail.com To: users@wicket.apache.org; Steven Haines lyg...@yahoo.com Sent: Wed, April 21, 2010 12:35:20 PM Subject: Re: OnChangeAjaxBehavior and other form components there is ajaxformsubmitbehavior if you want all the fields updated -igor On Wed, Apr 21, 2010 at 6:10 AM, Steven Haines lyg...@yahoo.com wrote: Hi Igor, I looked at the JavaScript that is generated when adding an AjaxFormComponentUpdatingBehavior and it does not
Re: Which form componnent had focus when form was submitted?
Thats what I am currently doing. It just felt to much like something I used to do in Struts. I don't know if there is much call for this, but it would be nice to have an onSubmit for a text field or other form components that would get fired off if that component was in focus when the form was submited, or maybe a Form onSubmit(Component componentInFocus). Just a thought, I end up doing a lot of this. Warren Igor Vaynberg wrote: you have to keep a HiddenField component and populate its value using javascript. -igor On Wed, Apr 21, 2010 at 9:41 AM, Warren Bell warr...@clarksnutrition.com wrote: Is there a way to figure out in a forms onSubmit which text field or button had focus when the form is submitted. I have done something in js to achieve this, but wanted to see if there was something already built in Wicket. I am limited to using form submit only no Ajax. Windows CE is having problems with some of the Ajax I tried to use. Thanks, Warren - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Thanks, Warren Bell
Simple TextField Override and A SubmitLink Question
I am a Wicket n00b. Just learning and writing a demo app to evaluate Wicket vs a few other MVC solutions which are having demos written by other developers in the group. I am having two issues. Issue 1 involves me trying to write a custom TextField to demo the idea of overriding a control and outputting custom HTML to support it. The plan was to override the onRender and write out plain text when the control is disabled instead of writing out a textbox with the enabled flag set to false (which is the default behavior). So I wrote a TextField with the following onRender: @Override public void onRender(MarkupStream stream) { if(this.isEnabled()) super.onRender(stream); else { getResponse().write(getModelValue()); this.renderNext(stream); } } I read about the renderNext on nabble, which resolved one exception I got, but now it throws exceptions saying that it cannot find the component as if I declared it in html, but did not add it to the hierarchy. I know the code outside this render is fine because if I change the code to keep the super.onRender() call, but merely surround the super with a span tag with display:none, it works fine. But I really wanted this style to work as a proof of concept of overriding the onRender to output whatever HTML we need. Customizing components to put our custom HTML seems to be Wicket's greatest feature. But clearly there is some aspect of the onRender contract that I am missing. The super must be taking care of something that I am not aware that I am required to take care of. Any Ideas? Issue 2: Same page. When the page is in readOnly mode, I set a readOnly flag, set all my controls to disabled, and change what links show. I am using SubmitLinks. When the page loads the first time one set of actions is enabled (such as a Modify link) and upon hitting modify, I set the controls to enabled, and display Save and Cancel links while hiding the others. But upon getting to the modifiable mode, none of the SubmitLinks work. I even tried showing all the links all the time and once I have run a request through the app, none of the links respond anymore. However, I found that if I eliminate the code that iterates through my controls, the links work. I wrote a simple setEnabled method that uses the IVisitor interface like so: @Override public Object component(Component comp) { MyBasePage page = (MyBasePage) comp.getPage(); if(FormComponent.class.isAssignableFrom(comp.getClass())) comp.setEnabled(!page.isReadOnly()); return IVisitor.CONTINUE_TRAVERSAL; } Thus each page will inherit from MyBasePage and just change the readOnly flag. I don't want to disable every Component since I want some of the links and other things to work. I may have to make this method smarter in the future, but for now this is pretty close to what I want...except for the small detail of not actually working. I know that the links are never getting disabled by this code because I debugged through it, and also echoed out the isVisible and isEnabled after the fact. However, when I don't do this, my links refuse to respond on the 2nd request. Further, the request they stop working on is when I am ENABLING the controls. So why if the links are not disabled, might they not be responding when I click on them. The onSubmit() method of the form never gets control. I've tried to provide all the information I know. Anyone have ideas? Even if you don't know what might be wrong, if you can suggest an avenue of investigation that would be helpful. Also, what resources do you suggest for a Wicket noob? I've been looking at the javadoc and the Wicket wiki and the examples on the apache site. But they all seem fairly light. The javadoc often has insufficient detail (see the onRender issue), the wiki has large important sections simply labelled TODO, and the examples seem mostly slanted toward things that don't really show off the good stuff. Are there other good resources that I should be using? Brian Mulholland - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
CSS not loading on WebMarkupContainer refresh
Hey guys. I have a page that contains 4 panels. In one of these panels I have a listview that is inside a WebMarkupContainer. The user click on an ajax link which opens up a modal. The user fills out the form and clicks submit. On submit the new information is added to the list view and the WebMarkupContainer is refreshed and the new information is displayed in the panel All of this is working just fine. The problem that I am running into now is that I want to add a tooltip to the data that is in the listview. I have done this by adding a AttributeModifier to my code and then adding the css file to my html code. FOr some reason this will not work unless I refresh the entire page. So when the new data is added to the listview the css does not work. After I click the page refresh button it works prefectly. How can I get it to work when the WebMarkupContainer is refreshed? Thanks T -- View this message in context: http://n4.nabble.com/CSS-not-loading-on-WebMarkupContainer-refresh-tp2019665p2019665.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
Ajax call gives up
Hi, I'm facing a nasty problem in my app. Submitting a form with Ajax (wicketSubmitFormById) makes the Ajax call back to the backend and after that immediately closes the connection for some unknown reason. The backend successfully process the request but at the end fails with Broken pipe. Debugging wicket-ajax.js shows that xhr.readyState is 2 (not 4) and soon after that it makes full page reload (window.location=...) which completely breaks the single-page model for our application. Google returns http://www.mail-archive.com/wicket-u...@lists.sourceforge.net/msg25940.html that looks very much like my problem. Unfortunately I cannot find what was the solution provided by Matej. Anyone else ever experienced something similar ? martin-g - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Which form componnent had focus when form was submitted?
you can create a subclass of hiddenfield that would add the necessary javascript for you and you will end up with a nice reusable component. -igor On Wed, Apr 21, 2010 at 11:43 AM, Warren Bell warr...@clarksnutrition.com wrote: Thats what I am currently doing. It just felt to much like something I used to do in Struts. I don't know if there is much call for this, but it would be nice to have an onSubmit for a text field or other form components that would get fired off if that component was in focus when the form was submited, or maybe a Form onSubmit(Component componentInFocus). Just a thought, I end up doing a lot of this. Warren Igor Vaynberg wrote: you have to keep a HiddenField component and populate its value using javascript. -igor On Wed, Apr 21, 2010 at 9:41 AM, Warren Bell warr...@clarksnutrition.com wrote: Is there a way to figure out in a forms onSubmit which text field or button had focus when the form is submitted. I have done something in js to achieve this, but wanted to see if there was something already built in Wicket. I am limited to using form submit only no Ajax. Windows CE is having problems with some of the Ajax I tried to use. Thanks, Warren - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Thanks, Warren Bell - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Back-button friendly ajax wizard navigation
Thanks Edward. I was hoping for some means of doing this in a redirect-after-post kind of way so that the javascript response to the client actually caused the browser to request the next wizard page via a new url, creating a back-button history entry. I guess generating that URL for a non-bookmarkable page during an ajax form submission and causing the client to redirect is not doable. In my particular case, I have a wizard step with a single radio group and no default option. Here I expect many users to simply click 'Next' and I was hoping to save them the full page submission just to display the error message. Unfortunately, here the onblur approach clearly won't work and I can't think of another event handler onto which I could attach it. However, it still sounds useful for my other form elements and I'll try it out there. Thanks again for the help. On Wed, Apr 21, 2010 at 1:47 PM, Edward Zarecor wic...@indeterminate.orgwrote: Since you are changing the DOM dynamically using Ajax, the browser -- correctly I would say -- isn't considering this a page change, so the back button should take you back to the page prior to the wizard. The browser history will be immutable from JavaScript, so that's not an option. To achieve the user experience you want, I think the best alternative is to validate your fields via Ajax onblur, but move between wizard steps using a form submit. Hope this helps. Ed. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Strip header contributors from Ajax response.
I have a component which contributes Js headers. This component is also rendered by AjaxRequestTarget. The problem is that when rendering ajax response the Js codes too are getting rendered. These Js codes were already contributed when this component first rendered (in non-Ajax mode). To fix this what I initially did was that in the onBeforeRender method of the component I was checking if the response NOT isAjax then add the header contributors, else, remove them. This was working fine, but problem is if I want to implement this is other components I would have to copy n paste the codes. So I decided to implement a behavior. I added all the header contributors to that behavior and it was supposed to do the job of adding n removing the header contributors. But we can't modify hierarchy from beforeRender of behavior so I am now stuck. Furthermore, this approach is not capable of removing JS contributed by super calsses of the componenet. Please suggest. Thanks and regards, Apple Grew my blog @ http://blog.applegrew.com/
Re: CSS not loading on WebMarkupContainer refresh
Hi T, Can you show the code you use to add the additional css file? Ernesto On Wed, Apr 21, 2010 at 10:52 PM, taygolf taylor.a.yo...@gmail.com wrote: Hey guys. I have a page that contains 4 panels. In one of these panels I have a listview that is inside a WebMarkupContainer. The user click on an ajax link which opens up a modal. The user fills out the form and clicks submit. On submit the new information is added to the list view and the WebMarkupContainer is refreshed and the new information is displayed in the panel All of this is working just fine. The problem that I am running into now is that I want to add a tooltip to the data that is in the listview. I have done this by adding a AttributeModifier to my code and then adding the css file to my html code. FOr some reason this will not work unless I refresh the entire page. So when the new data is added to the listview the css does not work. After I click the page refresh button it works prefectly. How can I get it to work when the WebMarkupContainer is refreshed? Thanks T -- View this message in context: http://n4.nabble.com/CSS-not-loading-on-WebMarkupContainer-refresh-tp2019665p2019665.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