Re: I'm adding a new item to a ListView via ajax - how to get reference to the new item?
HI everyone, thanks very much for your help. So much to learn at the moment so I really appreciate you all helping me out - it takes a while to get to know what you can and can't do with wicket. AjaxRequestTarget.get() worked just fine. On Sun, Aug 17, 2008 at 7:17 PM, Peter Ertl [EMAIL PROTECTED] wrote: use AjaxRequestTarget.get() Am 17.08.2008 um 15:36 schrieb Martin Grigorov: On Sun, 2008-08-17 at 13:36 +0200, Wayne Pope wrote: Hi, But how do I get that target? As the items are being rendered using a ListView - the only time I can get access is during the populateItem - but thats a ListItem, I need a AjexRequestTarget to append the javascript? You could append Javascript at render time (in populateItem(ListItem()) by adding AjaxCallDecorator to your AjaxButton. Or with AttributePrepender/Appender for the 'onclick' AjaxButton attribute On Sun, Aug 17, 2008 at 1:28 PM, Vitaly Tsaplin [EMAIL PROTECTED]wrote: Hi, The item is already on your page so just use its html id in the javascript script you use to highlight it. Vitaly On Sun, Aug 17, 2008 at 1:22 PM, Wayne Pope [EMAIL PROTECTED] wrote: Hi everyone, I have a ListView that displays a list of cars (say). I have a small form on the page whereby they can add a new car using a AjaxFallbackButton. I can enter a new car and it updates the ListView However I want to highlight the newly added item, and I just can't seemt to figure out how I can 'target' the item. I'd like to do something like protected void onSubmit(AjaxRequestTarget target, Form arg1) { // add new car... if (target!=null) { target.addComponent(carList); target.addCompoent(THENEWITEM.addJavascript(new Effect.Highlight(this).toJavascript())); } - the question is how do I get the target reference to the new item added? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Ajax loading tooltip?
I can't say anything about having done it, I certainly haven't even if I'm using the prototip-minis, but I can comment on upgrading to prototip 2. I asked the same question a month ago, and the thing is that Richard has permission to use prototip 1.2 for free whereas prototip 2.x has a license from €3 for non commercial and upwards to €295 for a multi site commercial license. It is quite easy to upgrade it to 2.x though, I tried it and it all seemed to work fine but I reverted back to the free version again. Alex -Opprinnelig melding- Fra: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sendt: 16. august 2008 12:20 Til: users@wicket.apache.org Emne: Ajax loading tooltip? Hi Has anyone done an ajaxloading tool tip? Maybe even for prototip in minies? I see that prototip 2 has support for this actually: http://www.nickstakenburg.com/projects/prototip2/ .. Im crossing my fingers, and elsewise i'll do it:) But what about hte prototip in minies I guess that should be upgraded to prototip 2 if not already? -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax loading tooltip?
Thanks for notifying... I see if theres another provider then, one which are using apache or bsd license.. Alexander Landsnes Keül wrote: I can't say anything about having done it, I certainly haven't even if I'm using the prototip-minis, but I can comment on upgrading to prototip 2. I asked the same question a month ago, and the thing is that Richard has permission to use prototip 1.2 for free whereas prototip 2.x has a license from €3 for non commercial and upwards to €295 for a multi site commercial license. It is quite easy to upgrade it to 2.x though, I tried it and it all seemed to work fine but I reverted back to the free version again. Alex -Opprinnelig melding- Fra: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sendt: 16. august 2008 12:20 Til: users@wicket.apache.org Emne: Ajax loading tooltip? Hi Has anyone done an ajaxloading tool tip? Maybe even for prototip in minies? I see that prototip 2 has support for this actually: http://www.nickstakenburg.com/projects/prototip2/ .. Im crossing my fingers, and elsewise i'll do it:) But what about hte prototip in minies I guess that should be upgraded to prototip 2 if not already? -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Unable to serialize class com.google.common.collect.LinkedListMultimap$1
Hi, I am using Google collections with Wicket 1.3.4 and hit with this serialization error. ERROR - Objects- Error serializing object class web.AdminPage [object=[Page class = web.AdminPage, id = 5, version = 0]] org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: com.google.common.collect.LinkedListMultimap$1 I am pretty sure LinkedListMultimap is Serializable and I even did a test i.e. obj instaceof Serializable What am I missing here? Any input? Thanks. /lim/ -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19027449.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax loading tooltip?
What about this one http://15daysofjquery.com/examples/jqueryTooltips/demo2.php ? Alexander Landsnes Keül wrote: I can't say anything about having done it, I certainly haven't even if I'm using the prototip-minis, but I can comment on upgrading to prototip 2. I asked the same question a month ago, and the thing is that Richard has permission to use prototip 1.2 for free whereas prototip 2.x has a license from €3 for non commercial and upwards to €295 for a multi site commercial license. It is quite easy to upgrade it to 2.x though, I tried it and it all seemed to work fine but I reverted back to the free version again. Alex -Opprinnelig melding- Fra: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sendt: 16. august 2008 12:20 Til: users@wicket.apache.org Emne: Ajax loading tooltip? Hi Has anyone done an ajaxloading tool tip? Maybe even for prototip in minies? I see that prototip 2 has support for this actually: http://www.nickstakenburg.com/projects/prototip2/ .. Im crossing my fingers, and elsewise i'll do it:) But what about hte prototip in minies I guess that should be upgraded to prototip 2 if not already? -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
This is the anonymous inner class inside the LinkedListMultimap class which is not Serializable (LinkedListMultimap*$1*) Best regards Pierre TH Lim a écrit : Hi, I am using Google collections with Wicket 1.3.4 and hit with this serialization error. ERROR - Objects- Error serializing object class web.AdminPage [object=[Page class = web.AdminPage, id = 5, version = 0]] org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: com.google.common.collect.LinkedListMultimap$1 I am pretty sure LinkedListMultimap is Serializable and I even did a test i.e. obj instaceof Serializable What am I missing here? Any input? Thanks. /lim/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
I am aware of the $1. I did the instanceof check in my code. I printed the class name which is, of course, LinkedListMultimap$1 and it is indeed an instanceof Serializable. So basically, LinkedListMultimap$1 implements Serializable but it failed the checking at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:342). I find this very puzzling. Pierre Coquentin wrote: This is the anonymous inner class inside the LinkedListMultimap class which is not Serializable (LinkedListMultimap*$1*) Best regards Pierre TH Lim a écrit : Hi, I am using Google collections with Wicket 1.3.4 and hit with this serialization error. ERROR - Objects- Error serializing object class web.AdminPage [object=[Page class = web.AdminPage, id = 5, version = 0]] org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: com.google.common.collect.LinkedListMultimap$1 I am pretty sure LinkedListMultimap is Serializable and I even did a test i.e. obj instaceof Serializable What am I missing here? Any input? Thanks. /lim/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19027987.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
The Serlializable-check isn't sufficient. you can mark any class serializable if you want. what really counts is that all fields of the class are serializable, you should have a look at them ... TH Lim wrote: I am aware of the $1. I did the instanceof check in my code. I printed the class name which is, of course, LinkedListMultimap$1 and it is indeed an instanceof Serializable. So basically, LinkedListMultimap$1 implements Serializable but it failed the checking at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:342). I find this very puzzling. Pierre Coquentin wrote: This is the anonymous inner class inside the LinkedListMultimap class which is not Serializable (LinkedListMultimap*$1*) Best regards Pierre TH Lim a écrit : Hi, I am using Google collections with Wicket 1.3.4 and hit with this serialization error. ERROR - Objects- Error serializing object class web.AdminPage [object=[Page class = web.AdminPage, id = 5, version = 0]] org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: com.google.common.collect.LinkedListMultimap$1 I am pretty sure LinkedListMultimap is Serializable and I even did a test i.e. obj instaceof Serializable What am I missing here? Any input? Thanks. /lim/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19028210.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
I tried another method. Instead of passing the reference to my IDataProvider implementation, MyDataProvider, I recode MyDataProvider to get it from the MySession which extends Wicket Session. I don't any difference here but it works. I still not sure what caused MyDataProvider to fail to persist because of the List instance it contained. Btw, http://google-collections.googlecode.com/svn-history/r5/trunk/src/com/google/common/collect/LinkedListMultimap.java LinkedListMultimap uses the inner class Node which is also Serializable. Michael Sparer wrote: The Serlializable-check isn't sufficient. you can mark any class serializable if you want. what really counts is that all fields of the class are serializable, you should have a look at them ... -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19028815.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IOException: The handle is invalid - on file upload
After more investigation, the problems were coming from trying to run the upload in a separate thread. Once I move the code back into the main thread where the onSubmit is pressed it all works fine. Is it possible to have the upload process take place in a separate thread, so the user can continue working while the upload takes place? Andrew Moore wrote: Just to follow this up. When using the inputstream and the read() method on the same upload file. The number of lines read before getting in error message changes each time. Could it be a jdk bug? Andrew Moore wrote: I'm using wicket 1.3.4 and doing some file uploading and keep intermittantly getting the following error: IOException: The handle is invalid. My form is uploads zips and jpgs and is very similar to the wicket examples. ie in my submit button I do the following: if (uploadFile != null) { // Check new file, delete if it already existed imageProcessing.deleteFileIfExists(uploadFolder + File.separator + uploadFile.getClientFileName()); // Create a new file File newFile = new File(uploadFolder, uploadFile.getClientFileName()); try { // Save to new file newFile.createNewFile(); uploadFile.writeTo(newFile); }... It's the writeTo line that causes the error. Some jpgs and zips work fine, others don't or only intermittantly work. An example image I'm having errors with is this one: http://transfer.folioflow.com.s3.amazonaws.com/08092007045.jpg I've tried using the getInputStream() instead of the writeTo, and tried writing the inputstream into an output stream, but get exactly the same error while doing an inputstream.read(); I'm at a bit of a loss to what could be causing this. -- View this message in context: http://www.nabble.com/IOException%3A-The-handle-is-invalid---on-file-upload-tp18998030p19028996.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
Alright, if I pass LinkedListMultiMap instance into my IDataProvider implementation, MyDataProvider, Wicket is able to persist. Whereas, if I pass the List instance from LinkedListMultiMap.get(...), Wicket will throw the unserializable exception. I presume something in LinkedListMultimap$1 made it not serializable. My initial thought that LinkedListMultimap$1 was a serializable List was wrong. -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19029050.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
Node is not $1, that is LLMM$Node $1 is declared inside LLMM#get(K key): public ListV get(final @Nullable K key) { return new AbstractSequentialListV() { public int size() { return keyCount.count(key); } public ListIteratorV listIterator(int index) { return new ValueForKeyIterator(key, index); } }; } The AbstractSequentialListV is not serializable. Martijn On Mon, Aug 18, 2008 at 12:37 PM, TH Lim [EMAIL PROTECTED] wrote: Alright, if I pass LinkedListMultiMap instance into my IDataProvider implementation, MyDataProvider, Wicket is able to persist. Whereas, if I pass the List instance from LinkedListMultiMap.get(...), Wicket will throw the unserializable exception. I presume something in LinkedListMultimap$1 made it not serializable. My initial thought that LinkedListMultimap$1 was a serializable List was wrong. -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19029050.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.4 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
you save the provider to the session? that's kind of an anti-pattern as it gets serialized there anyway (at least in a clustered environment). you should rather boil down to the field that causes the not-serializable exception, wicket tells you exactly which field it is anyway. or provide us some code to help you. but if you inherit from sortabledataprovider or you implement IDataProvider it shouldn't be too difficult to find out which field it is ;-) regards, Michael TH Lim wrote: I tried another method. Instead of passing the reference to my IDataProvider implementation, MyDataProvider, I recode MyDataProvider to get it from the MySession which extends Wicket Session. I don't any difference here but it works. I still not sure what caused MyDataProvider to fail to persist because of the List instance it contained. Btw, http://google-collections.googlecode.com/svn-history/r5/trunk/src/com/google/common/collect/LinkedListMultimap.java LinkedListMultimap uses the inner class Node which is also Serializable. Michael Sparer wrote: The Serlializable-check isn't sufficient. you can mark any class serializable if you want. what really counts is that all fields of the class are serializable, you should have a look at them ... - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19029354.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using FileUpload.writeTo() in a background thread
I'm doing a file uploading screen, where some of the files can be quite large (up to 30mb) and am therefore hoping to be able to process the actual upload in a separate thread to the screen. All my post processing on the file that takes place works fine in a separate thread, but if I try to do the writing of the file with a FileUpload.writeTo() I get an IO exception that the file handle is invalid. Is what I'm trying to do possible? I'm guessing that the file handle is getting closed or lost as the upload page finishes. If it's not possible with the writeTo method, is there any other way of doing this? See example below. Thanks Andrew Example: OnSubmit (ie upload button) = public void onSubmit() { final FileUpload upload = uploadField.getFileUpload(); if (upload != null){ File newFile = new File(uploadFolder, upload.getClientFileName()); // create the new file newFile.createNewFile(); /* works if uploadFile.writeTo(newFile); is done here */ final ImportThread it = new ImportThread(getMySession(), upload, uploadFolder, newFile); it.start(); } } Separate thread: private static class ImportThread extends Thread { private final SignInSession session; private final FileUpload uploadFile; private final Folder uploadFolderThread; private File newFile; public ImportThread(SignInSession session, FileUpload uploadFile, Folder uploadFolderThread, File newFile) { logger.debug(long running thread constructor); this.session = session; this.uploadFile = uploadFile; this.uploadFolderThread = uploadFolderThread; this.newFile = newFile; this.filename = filename; } public void run() { logger.debug(long running thread run); uploadFile.writeTo(newFile); /* causes invalid file handle when run in thread */ //other post processing here } } -- View this message in context: http://www.nabble.com/Using-FileUpload.writeTo%28%29-in-a-background-thread-tp19030588p19030588.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem getting value from DateTimeField
Hi All, I have a couple of DateTimeField components on a form on a page that has a Link that opens another page. In the onClick() method for the Link I need to get the values for the dates to put into a PageParameters object. However I can't seem to get the modified values for the dates. I've tried adding startdatefield.processInput() and startdatefield.validate(). In either (or both) cases the value that is returned from the field in the getModelObject() method is always the original date value, and the value returned for getInput() is always null, null:null. OTOH in an onSubmit() method for a Button on the form I can get the modified value as expected. I also tried form.process() but that didn't work either. I don't want to do a submit since other components may cause validation errors that don't mean anything in this case. I'm probably missing something obvious but I can't figure it out and I didn't find anything helpful in searching this forum. Any ideas on how to get the date values without submitting the form would be appreciated. Thanks, Jim -- View this message in context: http://www.nabble.com/Problem-getting-value-from-DateTimeField-tp19031215p19031215.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
IndicatingAjaxLink with BaseTree appends after /td
I override BaseTree's newLink() to return an IndicatingAjaxLink: @Override public MarkupContainer newLink(String id, final ILinkCallback callback) { return new IndicatingAjaxLink(id) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { callback.onClick(target); } }; } Strangely, this produces markup like this: div id=tree1c7 table style=display:none id=tree1c7_0 /table table class=wicket-tree-content id=tree1c7_1 tr td class=half-line a class=junction-open href=# id=junctionLink1c8 onclick=wicketShow('junctionLink1c8--ajax-indicator');var wcall=wicketAjaxGet('../?wicket:interface=html:14:left-column: 1:item:tree:i:1:junctionLink::IBehaviorListener:0:1',function() {;wicketHide('junctionLink1c8--ajax- indicator');}.bind(this),function() { ;wicketHide('junctionLink1c8-- ajax-indicator');}.bind(this), function() {return Wicket.$ ('junctionLink1c8') != null;}.bind(this));return !wcall;/a /td span style=display:none; class=wicket-ajax-indicator id=junctionLink1c8--ajax-indicatorimg src=../resources/ org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/indicator.gif alt=//span td ... Notice that the indicater span output by IndicatingAjaxLink's WicketAjaxIndicatorAppender comes after the /td and not after the /a as I would have expected. Is this a bug? Thanks, Kaspar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: url controlling
if my requestTarget is of type IListenerInterfaceRequestTarget, WebRequestCodingStrategy it calls the method protected CharSequence encode(RequestCyclerequestCycle, IListenerInterfaceRequestTargetrequestTarget) , this method puts lot of details in url l?wicket:interface=:60 and does not find the mount path Johan Compagner wrote: If you really set it by class (and call setRedirect(true) but i dont think this is really needed in most cases) then you always should get an url with the packagename or if you mounted it see the mount. If you have an example where that doesnt happen make an issue with a quickstart On 8/14/08, miro [EMAIL PROTECTED] wrote: my application is showing with different urls for the same page , how can I control this ? the method setResponsepage(foo.class) sometimes this is the mout url sometimes it is http://localhost/pcr/?wicket:interface=:2 and some times it is package.classname , please help me what I need to override to control this behaviour. -- View this message in context: http://www.nabble.com/url-controlling-tp18990135p18990135.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/url-controlling-tp18990135p19032127.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Should AjaxEventBehaviour's not be removed?
I need a certain div to appear when the user mouse-overs an image. For this, i added a behaviour to the image: add(imageDiv.add(new AjaxEventBehavior(onmouseover) { @Override protected void onEvent(AjaxRequestTarget target) { div.setVisible(true); imageDiv.remove(this); target.addComponent(div); target.addComponent(imageDiv); } })); So I remove the behaviour once the div has been shown. If I mouse-over the image twice in a row very fast, I get a java.lang.IllegalStateException: No behavior listener found with behaviorId 0 I suppose that Wicket postpones the second request and when it is exectured later on, the behaviour has already been removed. What is the best way to have a JS behaviour executed only once? Thanks in advance, Kaspar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem getting value from DateTimeField
I was passing the dates (and some other fields) in parameters so they could be restored when returning back to the page. I just came across a different technique for doing this in Wicket In Action (listing 6.7) so it is no longer an issue for me. Thanks WIA! Great book - has helped me numerous times. Jim -- View this message in context: http://www.nabble.com/Problem-getting-value-from-DateTimeField-tp19031215p19032604.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: url when requestTarget is of type IListenerInterfaceRequestTarget
mount the page in your application class with a different encodingstrategy. e.g. indexedparamurlencodingstrategy which produces neat urls miro wrote: if my requestTarget is of type IListenerInterfaceRequestTarget, WebRequestCodingStrategy it calls the methodprotected CharSequence encode(RequestCycle requestCycle, IListenerInterfaceRequestTarget requestTarget) , this method puts lot of details in url l?wicket:interface=:60 which does not makes sense to me. Is there any way I can rephrase this and use the mounted string for this page ? - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/url-when-requestTarget-is-of-type-IListenerInterfaceRequestTarget-tp19005159p19032924.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
No, I didn't save the provider in the session. Just the LinkedListMultimap instance. As Martijn has pointed it out with the code snippet why $1 is not serializable, the only way is to keep the LinkedListMultimap and not the List. Wicket is pretty good. It points to the exact field where the problem was. Thanks guys. Michael Sparer wrote: you save the provider to the session? that's kind of an anti-pattern as it gets serialized there anyway (at least in a clustered environment). you should rather boil down to the field that causes the not-serializable exception, wicket tells you exactly which field it is anyway. or provide us some code to help you. but if you inherit from sortabledataprovider or you implement IDataProvider it shouldn't be too difficult to find out which field it is ;-) regards, Michael TH Lim wrote: I tried another method. Instead of passing the reference to my IDataProvider implementation, MyDataProvider, I recode MyDataProvider to get it from the MySession which extends Wicket Session. I don't any difference here but it works. I still not sure what caused MyDataProvider to fail to persist because of the List instance it contained. Btw, http://google-collections.googlecode.com/svn-history/r5/trunk/src/com/google/common/collect/LinkedListMultimap.java LinkedListMultimap uses the inner class Node which is also Serializable. Michael Sparer wrote: The Serlializable-check isn't sufficient. you can mark any class serializable if you want. what really counts is that all fields of the class are serializable, you should have a look at them ... -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19033438.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
but if you save the linkedlistmultimap (which isn't serializable, right?) in the session you'll run into problems as well ... at the latest in a clustered environment TH Lim wrote: No, I didn't save the provider in the session. Just the LinkedListMultimap instance. As Martijn has pointed it out with the code snippet why $1 is not serializable, the only way is to keep the LinkedListMultimap and not the List. Wicket is pretty good. It points to the exact field where the problem was. Thanks guys. Michael Sparer wrote: you save the provider to the session? that's kind of an anti-pattern as it gets serialized there anyway (at least in a clustered environment). you should rather boil down to the field that causes the not-serializable exception, wicket tells you exactly which field it is anyway. or provide us some code to help you. but if you inherit from sortabledataprovider or you implement IDataProvider it shouldn't be too difficult to find out which field it is ;-) regards, Michael TH Lim wrote: I tried another method. Instead of passing the reference to my IDataProvider implementation, MyDataProvider, I recode MyDataProvider to get it from the MySession which extends Wicket Session. I don't any difference here but it works. I still not sure what caused MyDataProvider to fail to persist because of the List instance it contained. Btw, http://google-collections.googlecode.com/svn-history/r5/trunk/src/com/google/common/collect/LinkedListMultimap.java LinkedListMultimap uses the inner class Node which is also Serializable. Michael Sparer wrote: The Serlializable-check isn't sufficient. you can mark any class serializable if you want. what really counts is that all fields of the class are serializable, you should have a look at them ... - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19033579.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
No, linkedlistmultimap is serializable. only $1 is not. If you look at the snippet the $1 class is created on the fly when linkedlistmultimap.get(...) is invoked. Michael Sparer wrote: but if you save the linkedlistmultimap (which isn't serializable, right?) in the session you'll run into problems as well ... at the latest in a clustered environment TH Lim wrote: No, I didn't save the provider in the session. Just the LinkedListMultimap instance. As Martijn has pointed it out with the code snippet why $1 is not serializable, the only way is to keep the LinkedListMultimap and not the List. Wicket is pretty good. It points to the exact field where the problem was. Thanks guys. Michael Sparer wrote: you save the provider to the session? that's kind of an anti-pattern as it gets serialized there anyway (at least in a clustered environment). you should rather boil down to the field that causes the not-serializable exception, wicket tells you exactly which field it is anyway. or provide us some code to help you. but if you inherit from sortabledataprovider or you implement IDataProvider it shouldn't be too difficult to find out which field it is ;-) regards, Michael TH Lim wrote: I tried another method. Instead of passing the reference to my IDataProvider implementation, MyDataProvider, I recode MyDataProvider to get it from the MySession which extends Wicket Session. I don't any difference here but it works. I still not sure what caused MyDataProvider to fail to persist because of the List instance it contained. Btw, http://google-collections.googlecode.com/svn-history/r5/trunk/src/com/google/common/collect/LinkedListMultimap.java LinkedListMultimap uses the inner class Node which is also Serializable. Michael Sparer wrote: The Serlializable-check isn't sufficient. you can mark any class serializable if you want. what really counts is that all fields of the class are serializable, you should have a look at them ... -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19034065.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Wicket Image - Java Image
I'm printing text to an image before adding it to the page. Right now the process goes like this: final BufferedDynamicImageResource resource = new BufferedDynamicImageResource(); java.awt.image.BufferedImage image; image = ImageIO.read(new File(C:\\path\\to\\image.png)); Graphics graphics = image.getGraphics(); graphics.drawString(user.getName(), 443, 215); resource.setImage(image); add(new Image(bothCardImage, resource)); In order to keep everything relative to the Wicket framework, I want to replace java.awt.image.BufferedImage image = ImageIO.read(new File(C:\\path\\to\\image.png)); Graphics graphics = image.getGraphics(); with org.apache.wicket.markup.html.image.Image wicketImage; wicketImage = new Image(img, new ResourceReference(ImageAnchor.class, image.png)); Graphics graphics = wicketImage.getGraphics(); However, I can't figure out how to getGraphics() from a Wicket Image. Any suggestions? Thanks much! -- View this message in context: http://www.nabble.com/Wicket-Image--%3E-Java-Image-tp19034138p19034138.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket Image - Java Image
Have you tried this: http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/image/resource/RenderedDynamicImageResource.html On Mon, Aug 18, 2008 at 11:32 AM, insom [EMAIL PROTECTED] wrote: I'm printing text to an image before adding it to the page. Right now the process goes like this: final BufferedDynamicImageResource resource = new BufferedDynamicImageResource(); java.awt.image.BufferedImage image; image = ImageIO.read(new File(C:\\path\\to\\image.png)); Graphics graphics = image.getGraphics(); graphics.drawString(user.getName(), 443, 215); resource.setImage(image); add(new Image(bothCardImage, resource)); In order to keep everything relative to the Wicket framework, I want to replace java.awt.image.BufferedImage image = ImageIO.read(new File(C:\\path\\to\\image.png)); Graphics graphics = image.getGraphics(); with org.apache.wicket.markup.html.image.Image wicketImage; wicketImage = new Image(img, new ResourceReference(ImageAnchor.class, image.png)); Graphics graphics = wicketImage.getGraphics(); However, I can't figure out how to getGraphics() from a Wicket Image. Any suggestions? Thanks much! -- View this message in context: http://www.nabble.com/Wicket-Image--%3E-Java-Image-tp19034138p19034138.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
So you're putting an object into your session just because on of its public methods returns a not-serializable object? TH Lim wrote: No, linkedlistmultimap is serializable. only $1 is not. If you look at the snippet the $1 class is created on the fly when linkedlistmultimap.get(...) is invoked. Michael Sparer wrote: but if you save the linkedlistmultimap (which isn't serializable, right?) in the session you'll run into problems as well ... at the latest in a clustered environment TH Lim wrote: No, I didn't save the provider in the session. Just the LinkedListMultimap instance. As Martijn has pointed it out with the code snippet why $1 is not serializable, the only way is to keep the LinkedListMultimap and not the List. Wicket is pretty good. It points to the exact field where the problem was. Thanks guys. Michael Sparer wrote: you save the provider to the session? that's kind of an anti-pattern as it gets serialized there anyway (at least in a clustered environment). you should rather boil down to the field that causes the not-serializable exception, wicket tells you exactly which field it is anyway. or provide us some code to help you. but if you inherit from sortabledataprovider or you implement IDataProvider it shouldn't be too difficult to find out which field it is ;-) regards, Michael TH Lim wrote: I tried another method. Instead of passing the reference to my IDataProvider implementation, MyDataProvider, I recode MyDataProvider to get it from the MySession which extends Wicket Session. I don't any difference here but it works. I still not sure what caused MyDataProvider to fail to persist because of the List instance it contained. Btw, http://google-collections.googlecode.com/svn-history/r5/trunk/src/com/google/common/collect/LinkedListMultimap.java LinkedListMultimap uses the inner class Node which is also Serializable. Michael Sparer wrote: The Serlializable-check isn't sufficient. you can mark any class serializable if you want. what really counts is that all fields of the class are serializable, you should have a look at them ... - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19034316.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
No that not the reason. The reason I need to keep the items each user has entered. I can be a List or Map but for this case linkedlistmultimap works best for me. Do you have a better alternative? I would like to how know to improve this. Michael Sparer wrote: So you're putting an object into your session just because on of its public methods returns a not-serializable object? TH Lim wrote: No, linkedlistmultimap is serializable. only $1 is not. If you look at the snippet the $1 class is created on the fly when linkedlistmultimap.get(...) is invoked. Michael Sparer wrote: but if you save the linkedlistmultimap (which isn't serializable, right?) in the session you'll run into problems as well ... at the latest in a clustered environment TH Lim wrote: No, I didn't save the provider in the session. Just the LinkedListMultimap instance. As Martijn has pointed it out with the code snippet why $1 is not serializable, the only way is to keep the LinkedListMultimap and not the List. Wicket is pretty good. It points to the exact field where the problem was. Thanks guys. Michael Sparer wrote: you save the provider to the session? that's kind of an anti-pattern as it gets serialized there anyway (at least in a clustered environment). you should rather boil down to the field that causes the not-serializable exception, wicket tells you exactly which field it is anyway. or provide us some code to help you. but if you inherit from sortabledataprovider or you implement IDataProvider it shouldn't be too difficult to find out which field it is ;-) regards, Michael TH Lim wrote: I tried another method. Instead of passing the reference to my IDataProvider implementation, MyDataProvider, I recode MyDataProvider to get it from the MySession which extends Wicket Session. I don't any difference here but it works. I still not sure what caused MyDataProvider to fail to persist because of the List instance it contained. Btw, http://google-collections.googlecode.com/svn-history/r5/trunk/src/com/google/common/collect/LinkedListMultimap.java LinkedListMultimap uses the inner class Node which is also Serializable. Michael Sparer wrote: The Serlializable-check isn't sufficient. you can mark any class serializable if you want. what really counts is that all fields of the class are serializable, you should have a look at them ... -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19034402.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket Image - Java Image
jwcarman wrote: Have you tried this: http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/image/resource/RenderedDynamicImageResource.html I hadn't tried it. Looking at it now, it appears to do the opposite of what I want. Its render(Graphics2D) function takes a Graphics input, but I'm looking for a way to get a Graphics as an output. However, I am by no means a Java graphics expert, so please tell me if I'm overlooking something that RenderedDynamicImageResource can do. Thanks again -- -- View this message in context: http://www.nabble.com/Wicket-Image--%3E-Java-Image-tp19034138p19034522.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1
I'd recommend to either use one of the standard collections in the session or a LoadableDetachableModel and save the items in a DB, but that depends on your usecase. i personally do the model approach as it keeps my session slim and avoids hibernate's lazyinitexceptions when dealing with the model objects between requests ... TH Lim wrote: No that not the reason. The reason I need to keep the items each user has entered. I can be a List or Map but for this case linkedlistmultimap works best for me. Do you have a better alternative? I would like to how know to improve this. Michael Sparer wrote: So you're putting an object into your session just because on of its public methods returns a not-serializable object? TH Lim wrote: No, linkedlistmultimap is serializable. only $1 is not. If you look at the snippet the $1 class is created on the fly when linkedlistmultimap.get(...) is invoked. Michael Sparer wrote: but if you save the linkedlistmultimap (which isn't serializable, right?) in the session you'll run into problems as well ... at the latest in a clustered environment TH Lim wrote: No, I didn't save the provider in the session. Just the LinkedListMultimap instance. As Martijn has pointed it out with the code snippet why $1 is not serializable, the only way is to keep the LinkedListMultimap and not the List. Wicket is pretty good. It points to the exact field where the problem was. Thanks guys. Michael Sparer wrote: you save the provider to the session? that's kind of an anti-pattern as it gets serialized there anyway (at least in a clustered environment). you should rather boil down to the field that causes the not-serializable exception, wicket tells you exactly which field it is anyway. or provide us some code to help you. but if you inherit from sortabledataprovider or you implement IDataProvider it shouldn't be too difficult to find out which field it is ;-) regards, Michael TH Lim wrote: I tried another method. Instead of passing the reference to my IDataProvider implementation, MyDataProvider, I recode MyDataProvider to get it from the MySession which extends Wicket Session. I don't any difference here but it works. I still not sure what caused MyDataProvider to fail to persist because of the List instance it contained. Btw, http://google-collections.googlecode.com/svn-history/r5/trunk/src/com/google/common/collect/LinkedListMultimap.java LinkedListMultimap uses the inner class Node which is also Serializable. Michael Sparer wrote: The Serlializable-check isn't sufficient. you can mark any class serializable if you want. what really counts is that all fields of the class are serializable, you should have a look at them ... - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Unable-to-serialize-class-com.google.common.collect.LinkedListMultimap%241-tp19027449p19034542.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: url when requestTarget is of type IListenerInterfaceRequestTarget
do you mean that I should mount a class several times for all different implementations of IRequestTaget ? like Michael Sparer wrote: mount the page in your application class with a different encodingstrategy. e.g. indexedparamurlencodingstrategy which produces neat urls miro wrote: if my requestTarget is of type IListenerInterfaceRequestTarget, WebRequestCodingStrategy it calls the method protected CharSequence encode(RequestCycle requestCycle, IListenerInterfaceRequestTarget requestTarget) , this method puts lot of details in url l?wicket:interface=:60 which does not makes sense to me. Is there any way I can rephrase this and use the mounted string for this page ? -- View this message in context: http://www.nabble.com/url-when-requestTarget-is-of-type-IListenerInterfaceRequestTarget-tp19005159p19035017.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is DynamicImageResource safe for multiple windows?
I found my problem in the end. There was an object that wasn't able to be correctly serialized (a JFreeChart object), which threw an error that, due to some mistake on my logging configuration I was hiding. Anyway, once I fixed the serialization problem, now everything is being correctly versioned and I don't see any problems with shared image resources. Thanks for the help! Michel On Fri, Aug 15, 2008 at 12:08 PM, Michel Goldstein [EMAIL PROTECTED] wrote: Building a sample to show the problem has been harder than I thought. Because on all bare-bones applications that I tried to build, the URLs end up being different (the counter on the interface seems to be working). What could make my larger application not increment the ?wicket:interface=:counter: count? That seems to be the source of my problem. On my application, it's always at 0. I'm using wicket 1.3.3 (which is the same version as the one I'm testing it with) and, besides a much deeper component tree, the only meaningful thing that is different on my application is that I initialize the SpringComponentInjector (which I don't think should be the issue, but it's good to mention). Thanks, Michel On Thu, Aug 14, 2008 at 10:26 PM, Michel Goldstein [EMAIL PROTECTED] wrote: As I mentioned, I basically used what was in the twiki about JFreeChart integration. I'll build a simple example of the problem and send it out sometime tomorrow (USA Pacific time). Thanks, Michel On Thu, Aug 14, 2008 at 7:59 PM, Timo Rantalaiho [EMAIL PROTECTED]wrote: On Thu, 14 Aug 2008, Michel Goldstein wrote: Spoke too soon... Unfortunately the problem still seems to be there even after I've added the NonCachingImage. This furthers the confirmation that it's not browser caching issue, but a resource sharing problem. From where does the image data come from, and when? You could show some code, preferably in an easily executable quickstart, and maybe someone could help you. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: url when requestTarget is of type IListenerInterfaceRequestTarget
No you only mount your page once, and after e.g. a formsubmit you could perform a redirect to the page if you want to keep your nice url - but i think we had that topic before, hadn't we? miro wrote: do you mean that I should mount a class several times for all different implementations of IRequestTaget ? like Michael Sparer wrote: mount the page in your application class with a different encodingstrategy. e.g. indexedparamurlencodingstrategy which produces neat urls miro wrote: if my requestTarget is of type IListenerInterfaceRequestTarget, WebRequestCodingStrategy it calls the method protected CharSequence encode(RequestCycle requestCycle, IListenerInterfaceRequestTarget requestTarget) , this method puts lot of details in url l?wicket:interface=:60 which does not makes sense to me. Is there any way I can rephrase this and use the mounted string for this page ? - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/url-when-requestTarget-is-of-type-IListenerInterfaceRequestTarget-tp19005159p19035420.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket Image - Java Image
You can use Graphics2D's drawImage() method can't you? On Mon, Aug 18, 2008 at 11:53 AM, insom [EMAIL PROTECTED] wrote: jwcarman wrote: Have you tried this: http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/image/resource/RenderedDynamicImageResource.html I hadn't tried it. Looking at it now, it appears to do the opposite of what I want. Its render(Graphics2D) function takes a Graphics input, but I'm looking for a way to get a Graphics as an output. However, I am by no means a Java graphics expert, so please tell me if I'm overlooking something that RenderedDynamicImageResource can do. Thanks again -- -- View this message in context: http://www.nabble.com/Wicket-Image--%3E-Java-Image-tp19034138p19034522.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
2 questions on Include
Hello, In my firm, we're currently using a homegrown component-like framework, based on cgi-perl scripts calling servlets. I would like to prove my boss how smooth the transition towards Wicket could be. I'm trying to make a first step, replacing the perl scripts with Wicket, and calling the components (here servlets), with Include. But i have 2 problems : 1/ When i call a servlet that has several parameters, for example add(*new** *Include(maxMin,http://myserver/maxminservlet?id=0001periodes=1st;1a;;)); Wicket actually replaces with amp;, as shown in the trace : DEBUG - UrlResourceStream - cannot convert url: http://myserver/maxminservlet?id=0001amp;periodes=1st;1a; to file (URI scheme is not file), falling back to the inputstream for polling This alters my servlet's behaviour, is there a mean to avoid this substitution ? 2/ Is it possible to catch the content of the include, and so possibly modify it before it is actually displayed in my Wicket page ? Thanks for your help Landry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HTML Fragments
I apologize if this question has been addressed before however I didn't find any thing doing a quick search. What is the recommended practice for handling HTML fragments from an AJAX response? For example, if I were doing something similar to jquery's load() or prototype's Updater() functions. Since in Wicket it seems that each WebPage class represents a single HTML page I'm having trouble wrapping my head around it. In an action based framework, like Stripes for example, I would simply have an event method forward to my JSP that is being returned for the ajax request. In Wicket, being a component model, I'm just not clear on the procedure. Take the Cheesr app from Wicket In Action, for example. In Chapter 3 a simple reusable cart component is made but it is plugged in and updated on a normal request/response (non AJAX). What would need to change for that WebPage/HTML to be updated via an AJAX call? Say if the Add link were clicked. Thanks.
Re: HTML Fragments
You implement the onClick() method of a link such as the AjaxFallbackLink http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/ajax/markup/html/AjaxFallbackLink.html If the AjaxRequestTarget is null then the browser does not have JavaScript enabled. @Override public void onClick(AjaxRequestTarget target) { if (target !=null) target.addComponent(cart); } Scott On Mon, Aug 18, 2008 at 10:22 AM, Gregg Bolinger [EMAIL PROTECTED] wrote: I apologize if this question has been addressed before however I didn't find any thing doing a quick search. What is the recommended practice for handling HTML fragments from an AJAX response? For example, if I were doing something similar to jquery's load() or prototype's Updater() functions. Since in Wicket it seems that each WebPage class represents a single HTML page I'm having trouble wrapping my head around it. In an action based framework, like Stripes for example, I would simply have an event method forward to my JSP that is being returned for the ajax request. In Wicket, being a component model, I'm just not clear on the procedure. Take the Cheesr app from Wicket In Action, for example. In Chapter 3 a simple reusable cart component is made but it is plugged in and updated on a normal request/response (non AJAX). What would need to change for that WebPage/HTML to be updated via an AJAX call? Say if the Add link were clicked. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTML Fragments
Thanks Scott. I think I get it now. On Mon, Aug 18, 2008 at 12:33 PM, Scott Swank [EMAIL PROTECTED] wrote: You implement the onClick() method of a link such as the AjaxFallbackLink http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/ajax/markup/html/AjaxFallbackLink.html If the AjaxRequestTarget is null then the browser does not have JavaScript enabled. @Override public void onClick(AjaxRequestTarget target) { if (target !=null) target.addComponent(cart); } Scott On Mon, Aug 18, 2008 at 10:22 AM, Gregg Bolinger [EMAIL PROTECTED] wrote: I apologize if this question has been addressed before however I didn't find any thing doing a quick search. What is the recommended practice for handling HTML fragments from an AJAX response? For example, if I were doing something similar to jquery's load() or prototype's Updater() functions. Since in Wicket it seems that each WebPage class represents a single HTML page I'm having trouble wrapping my head around it. In an action based framework, like Stripes for example, I would simply have an event method forward to my JSP that is being returned for the ajax request. In Wicket, being a component model, I'm just not clear on the procedure. Take the Cheesr app from Wicket In Action, for example. In Chapter 3 a simple reusable cart component is made but it is plugged in and updated on a normal request/response (non AJAX). What would need to change for that WebPage/HTML to be updated via an AJAX call? Say if the Add link were clicked. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: url when requestTarget is of type IListenerInterfaceRequestTarget
Is there a global configration for redirect , ie if I want all my form submission to do a redirect ? Michael Sparer wrote: No you only mount your page once, and after e.g. a formsubmit you could perform a redirect to the page if you want to keep your nice url - but i think we had that topic before, hadn't we? miro wrote: do you mean that I should mount a class several times for all different implementations of IRequestTaget ? like Michael Sparer wrote: mount the page in your application class with a different encodingstrategy. e.g. indexedparamurlencodingstrategy which produces neat urls miro wrote: if my requestTarget is of type IListenerInterfaceRequestTarget, WebRequestCodingStrategy it calls the method protected CharSequence encode(RequestCycle requestCycle, IListenerInterfaceRequestTarget requestTarget) , this method puts lot of details in url l?wicket:interface=:60 which does not makes sense to me. Is there any way I can rephrase this and use the mounted string for this page ? -- View this message in context: http://www.nabble.com/url-when-requestTarget-is-of-type-IListenerInterfaceRequestTarget-tp19005159p19035630.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTML Fragments
In an Ajax call you get a handle to the so-called ajax target. The ajax target is used to ajax-update components ('to be updated via an AJAX call'). So, roughly a non-ajax link is as follows: page.add(new Link(xx)); An ajax link is as follows: page.add(new AjaxLink(xx) { @Override onSubmit(Target target) { ... do your business logic here ... // Finally, indicate which components you need to update via ajax: target.addComponent(myAjaxUpdatePanelOrOtherComponent); } }); For a simple example, see http://www.wicket-library.com/wicket-examples/ajax/form.2 ** Martin 2008/8/18 Gregg Bolinger [EMAIL PROTECTED]: I apologize if this question has been addressed before however I didn't find any thing doing a quick search. What is the recommended practice for handling HTML fragments from an AJAX response? For example, if I were doing something similar to jquery's load() or prototype's Updater() functions. Since in Wicket it seems that each WebPage class represents a single HTML page I'm having trouble wrapping my head around it. In an action based framework, like Stripes for example, I would simply have an event method forward to my JSP that is being returned for the ajax request. In Wicket, being a component model, I'm just not clear on the procedure. Take the Cheesr app from Wicket In Action, for example. In Chapter 3 a simple reusable cart component is made but it is plugged in and updated on a normal request/response (non AJAX). What would need to change for that WebPage/HTML to be updated via an AJAX call? Say if the Add link were clicked. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: url when requestTarget is of type IListenerInterfaceRequestTarget
Subclass form, override onSubmit, make it final, perform the redirect in there, offer another method to be overriden instead of onsubmit and use that form throughout your app miro wrote: Is there a global configration for redirect , ie if I want all my form submission to do a redirect ? Michael Sparer wrote: No you only mount your page once, and after e.g. a formsubmit you could perform a redirect to the page if you want to keep your nice url - but i think we had that topic before, hadn't we? miro wrote: do you mean that I should mount a class several times for all different implementations of IRequestTaget ? like Michael Sparer wrote: mount the page in your application class with a different encodingstrategy. e.g. indexedparamurlencodingstrategy which produces neat urls miro wrote: if my requestTarget is of type IListenerInterfaceRequestTarget, WebRequestCodingStrategy it calls the methodprotected CharSequence encode(RequestCycle requestCycle, IListenerInterfaceRequestTarget requestTarget) , this method puts lot of details in url l?wicket:interface=:60 which does not makes sense to me. Is there any way I can rephrase this and use the mounted string for this page ? - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/url-when-requestTarget-is-of-type-IListenerInterfaceRequestTarget-tp19005159p19035633.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AjaxSelfUpdatingTimerBehavior works one time
Found it... I was using wicket:container in the html instead of div for the WebMarkupContainer. -- View this message in context: http://www.nabble.com/AjaxSelfUpdatingTimerBehavior-works-one-time-tp19002634p19035645.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Google friendly site remaining wickets nice stateful page contructor
All the Crawlable/indexable/Search Engine friendly pages cannot be session relative. Inherently those are more secure pages, probably better used for secure portion of your application vs. freely crawlable. Besides Search engines dont seem to like session ids. One can still achieve the effect of session relative pages for bookmarkable pages by using appropriate models and/or caching. My 2 cents... Mathias P.W Nilsson wrote: Hi! When building a site for a customer with wicket one of the nicest thing is that you can create a page and pass objects, Arrays etc to the page constructor. I use this on almost every page. ListItemFilter filters = new LinkedListItemFilter(); filters.add( new BrandFilter( new Brand( 12 ) ) ); filters.add( new OutletFilter( false ) ); filters.add( new GenderFilter( Gender.FEMALE ) ) ; . setResponsePage( new ItemPage( filters ) ); Now, If I should use PageParameters for this and remain the query in the PageParameters I would have a difficult time to parse this. When Using the PageNavigator I would get in even more trouble. My question is. How do you get around this if the customer requires the site to be google friendly and you still want to use a stateful approach? Is there some other way of letting wicket take care of the state and still have google friendly sites without using PageParameters? SiteMaps? Static pages? Has anyone experienced the same problem? -- View this message in context: http://www.nabble.com/Google-friendly-site-remaining-wickets-nice-stateful-page-contructor-tp18981499p19039481.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Nested forms
Hi folks, I find myself occasionally using nested forms in my Wicket apps. With nested forms, when the outer form is submitted, it triggers a validation and submission of any inner forms as well. In some cases I don't want this behaviour, but instead I want the inner form and outer form to be independent of one another. The way I've approached this is to put a disabled form in between the outer form and the inner form, which effectively blocks the outer form's submission from propagating to the inner form. It works, but it's ugly. Is there a better way to do this? One thought I had was to make this an explicit setting on the Form class (e.g. setIgnoreParentSubmissions(true)), but currently I can't see a better way to do it. jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [announce] Wicket in Action e-book has been published!
Almost 4 years of using Wicket, being productive, having fun and learning every day - and just now I ordered my copy of Wicket in Action*. Many thanks to all core developers Sven *the 'living-tree' edition ;) Martijn Dashorst schrieb: Almost 3 years of hard work, loosing friends, moving abroad, marrying lovely wives, late nights, early mornings, frustrated family, and all other bad (and good) things that cross one's life is now rewarded with the availability of the e-book edition of Wicket in Action. The print edition (also know as dead-tree edition) will be available in just over 2 weeks (estimated at Aug 29th). Eelco and I are *really*, *really* glad that the journey is finally over. We think it was worth it. Now we leave the book in your capable hands to make beautiful applications that make your boss and customers happy and we are sure you'll enjoy creating them. Eelco Hillenius Martijn Dashorst About Wicket in Action Wicket in Action is a comprehensive guide for Java developers building Wicket-based web applications. It introduces Wicket's structure and components, and moves quickly into examples of Wicket at work. Written by core committers, this book shows you the how-to and the why of Wicket. You'll learn to use and customize Wicket components, to interact with Spring and Hibernate, and to implement rich Ajax-driven features. Some quotes of early access reviewers: Finally, the Web Framework of web framework, Apache Wicket, now has a bible of its own. - Per Ejeklint Without question, Wicket in Action... is the be-all and end-all when it comes to Wicket. - Geertjan Wielenga Wicket In Action glues the areas of web development with Apache Wicket together and gives a great overview of Apache Wicket...it will make a great compendium. - Nino Martinez Wael You can read full reviews here: - Nick Heudecker: Wicket In Action Book Review http://www.theserverside.com/news/thread.tss?thread_id=50326 - Geertjan Wielenga: Wicket in Action: Undoubtedly The Wicket Bible http://blogs.sun.com/geertjan/entry/wicket_in_action_undoubtedly_the Free content If you don't think these reviewers are qualified to tell you to buy Wicket in Action, let these free samples convince you: * Chapter 1: http://www.manning.com/dashorst/ch01_dashorst.pdf * Chapter 8: http://www.manning.com/dashorst/ch08_dashorst.pdf * Excerpt: Creating Secure Web Applications with Apache Wicket (http://www.manning.com/free/excerpt_Wicket.html) MEAP readers If you bought the MEAP edition you'll receive a personal download link for the final e-book in your inbox today (or possibly tomorrow). We'd like to extend our gratitude to the MEAP readers - without you and your encouragements we would've given up. Limited summer discount There is a 35% discount when you buy Wicket in Action at the manning website before the end of August. For more details look here: http://manning.com/dashorst - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested forms
Can't you just override isEnabled() on the inner form and return true/false depending on whether the inner form should be processed? -Matej On Mon, Aug 18, 2008 at 10:42 PM, John Krasnay [EMAIL PROTECTED] wrote: Hi folks, I find myself occasionally using nested forms in my Wicket apps. With nested forms, when the outer form is submitted, it triggers a validation and submission of any inner forms as well. In some cases I don't want this behaviour, but instead I want the inner form and outer form to be independent of one another. The way I've approached this is to put a disabled form in between the outer form and the inner form, which effectively blocks the outer form's submission from propagating to the inner form. It works, but it's ugly. Is there a better way to do this? One thought I had was to make this an explicit setting on the Form class (e.g. setIgnoreParentSubmissions(true)), but currently I can't see a better way to do it. jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTML Fragments
Chapter 5 of Wicket in Action covers this topic, to be more specific: Section 5.4.2 Using AjaxFallbackLink to respond to client actions, and modifies the Cheesr store to use Ajax links to add items to the shopping cart instead of using normal links. Martijn On Mon, Aug 18, 2008 at 7:22 PM, Gregg Bolinger [EMAIL PROTECTED] wrote: I apologize if this question has been addressed before however I didn't find any thing doing a quick search. What is the recommended practice for handling HTML fragments from an AJAX response? For example, if I were doing something similar to jquery's load() or prototype's Updater() functions. Since in Wicket it seems that each WebPage class represents a single HTML page I'm having trouble wrapping my head around it. In an action based framework, like Stripes for example, I would simply have an event method forward to my JSP that is being returned for the ajax request. In Wicket, being a component model, I'm just not clear on the procedure. Take the Cheesr app from Wicket In Action, for example. In Chapter 3 a simple reusable cart component is made but it is plugged in and updated on a normal request/response (non AJAX). What would need to change for that WebPage/HTML to be updated via an AJAX call? Say if the Add link were clicked. Thanks. -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.4 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [announce] Wicket in Action e-book has been published!
I never did receive my email telling me the final copy was available for download. Should I email the publisher and ask for a new download link? On Mon, Aug 18, 2008 at 4:54 PM, Sven Meier [EMAIL PROTECTED] wrote: Almost 4 years of using Wicket, being productive, having fun and learning every day - and just now I ordered my copy of Wicket in Action*. Many thanks to all core developers Sven *the 'living-tree' edition ;) Martijn Dashorst schrieb: Almost 3 years of hard work, loosing friends, moving abroad, marrying lovely wives, late nights, early mornings, frustrated family, and all other bad (and good) things that cross one's life is now rewarded with the availability of the e-book edition of Wicket in Action. The print edition (also know as dead-tree edition) will be available in just over 2 weeks (estimated at Aug 29th). Eelco and I are *really*, *really* glad that the journey is finally over. We think it was worth it. Now we leave the book in your capable hands to make beautiful applications that make your boss and customers happy and we are sure you'll enjoy creating them. Eelco Hillenius Martijn Dashorst About Wicket in Action Wicket in Action is a comprehensive guide for Java developers building Wicket-based web applications. It introduces Wicket's structure and components, and moves quickly into examples of Wicket at work. Written by core committers, this book shows you the how-to and the why of Wicket. You'll learn to use and customize Wicket components, to interact with Spring and Hibernate, and to implement rich Ajax-driven features. Some quotes of early access reviewers: Finally, the Web Framework of web framework, Apache Wicket, now has a bible of its own. - Per Ejeklint Without question, Wicket in Action... is the be-all and end-all when it comes to Wicket. - Geertjan Wielenga Wicket In Action glues the areas of web development with Apache Wicket together and gives a great overview of Apache Wicket...it will make a great compendium. - Nino Martinez Wael You can read full reviews here: - Nick Heudecker: Wicket In Action Book Review http://www.theserverside.com/news/thread.tss?thread_id=50326 - Geertjan Wielenga: Wicket in Action: Undoubtedly The Wicket Bible http://blogs.sun.com/geertjan/entry/wicket_in_action_undoubtedly_the Free content If you don't think these reviewers are qualified to tell you to buy Wicket in Action, let these free samples convince you: * Chapter 1: http://www.manning.com/dashorst/ch01_dashorst.pdf * Chapter 8: http://www.manning.com/dashorst/ch08_dashorst.pdf * Excerpt: Creating Secure Web Applications with Apache Wicket (http://www.manning.com/free/excerpt_Wicket.html) MEAP readers If you bought the MEAP edition you'll receive a personal download link for the final e-book in your inbox today (or possibly tomorrow). We'd like to extend our gratitude to the MEAP readers - without you and your encouragements we would've given up. Limited summer discount There is a 35% discount when you buy Wicket in Action at the manning website before the end of August. For more details look here: http://manning.com/dashorst - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ResourceModel vs. getLocalizer
Hi! Which is generally the preferred / least expensive way to get a resource string? new ResourceModel(my.resource.key).getObject().toString(); or getLocalizer().getString(my.resource.key, MyComponent.this); I've been using getLocalizer almost everywhere, and only using ResourceModel when I'm trying to get a property string during Component construction (to avoid those getLocalizer warnings). But I'm not really sure if my reasoning is good... Thanks for any input. LBB -- View this message in context: http://www.nabble.com/ResourceModel-vs.-getLocalizer-tp19040992p19040992.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FeedbackPanel default outputMarkupId = true
Does it make sense to have outputMarkupId default to true for FeedbackPanel? Use case: somePanel.add (new OnChangeAjaxBehavior() { protected void onUpdate (AjaxRequestTarget target) { // do stuff, Session.get().info (did stuff); target.addChildren (getPage(), FeedbackPanel.class) ; } }); This code will work from anywhere in the component hierarchy, regardless of which component added the feedbackpanel, without the owning component having to call feedback.setOutputMarkupId(true)... I could just as well subclass FeedbackPanel but this seems like a common enough case that it makes sense to build it into the core... -- View this message in context: http://www.nabble.com/FeedbackPanel-default-outputMarkupId-%3D-true-tp19041186p19041186.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 2 questions on Include
Landry, 1 - setEscapeModelStrings(false) 2 - Subclass Include. Override onComponentTagBody and use importAsString() Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk landry soules wrote: Hello, In my firm, we're currently using a homegrown component-like framework, based on cgi-perl scripts calling servlets. I would like to prove my boss how smooth the transition towards Wicket could be. I'm trying to make a first step, replacing the perl scripts with Wicket, and calling the components (here servlets), with Include. But i have 2 problems : 1/ When i call a servlet that has several parameters, for example add(*new** *Include(maxMin,http://myserver/maxminservlet?id=0001periodes=1st;1a;;)); Wicket actually replaces with amp;, as shown in the trace : DEBUG - UrlResourceStream - cannot convert url: http://myserver/maxminservlet?id=0001amp;periodes=1st;1a; to file (URI scheme is not file), falling back to the inputstream for polling This alters my servlet's behaviour, is there a mean to avoid this substitution ? 2/ Is it possible to catch the content of the include, and so possibly modify it before it is actually displayed in my Wicket page ? Thanks for your help Landry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/2-questions-on-Include-tp19036146p19041450.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Should AjaxEventBehaviour's not be removed?
On Mon, 18 Aug 2008, Kaspar Fischer wrote: I suppose that Wicket postpones the second request and when it is exectured later on, the behaviour has already been removed. This sounds likely, as the requests are processed serially. What is the best way to have a JS behaviour executed only once? It is not so common to remove behaviours, but to toggle their enabled property. So maybe you can do something like this add(imageDiv.add(new AjaxEventBehavior(onmouseover) { private boolean called; @Override protected void onEvent(AjaxRequestTarget target) { div.setVisible(true); imageDiv.remove(this); target.addComponent(div); target.addComponent(imageDiv); called = true; } @Override protected boolean isEnabled() { return !called; } })); or if it doesn't do the trick, just do the check in onEvent(). Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ResourceModel vs. getLocalizer
On Mon, 18 Aug 2008, lesterburlap wrote: new ResourceModel(my.resource.key).getObject().toString(); or getLocalizer().getString(my.resource.key, MyComponent.this); Isn't the latter same as Component.getString(my.resource.key); ? And ResourceModel can typically be used directly as the model of the Label displaying the String add(new Label(foo, new ResourceModel(my.resource.key))); I've been using getLocalizer almost everywhere, and only using ResourceModel when I'm trying to get a property string during Component construction (to avoid those getLocalizer warnings). But I'm not really sure if my reasoning is good... I wouldn't think that there is any difference. If you are worried about performance, try profiling the application. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FeedbackPanel default outputMarkupId = true
On Mon, 18 Aug 2008, Patrick Angeles wrote: Does it make sense to have outputMarkupId default to true for FeedbackPanel? Use case: somePanel.add (new OnChangeAjaxBehavior() { protected void onUpdate (AjaxRequestTarget target) { // do stuff, Session.get().info (did stuff); target.addChildren (getPage(), FeedbackPanel.class) ; } }); This code will work from anywhere in the component hierarchy, regardless of which component added the feedbackpanel, without the owning component having to call feedback.setOutputMarkupId(true)... I could just as well subclass FeedbackPanel but this seems like a common enough case that it makes sense to build it into the core... With a suitable IComponentInstantiationListener you can probably achieve the wanted behavior in your own application. All my Wicket applications are very ajaxy, but maybe there is someone out there that is still doing the traditional whole- page-request stuff :) And a lot of defaults on Wicket are still based on that. It's kind of an established standard that by default, outputMarkupId is false, so in 1.3 or 1.4 I don't see it could be changed. Later on, if the change is made, maybe it would be better to change the default for all Components and not just FeedbackPanel. What do others think? Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]