Re: I'm adding a new item to a ListView via ajax - how to get reference to the new item?

2008-08-18 Thread Wayne Pope
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 PROTECT

RE: Ajax loading tooltip?

2008-08-18 Thread Alexander Landsnes Keül
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 f

Re: Ajax loading tooltip?

2008-08-18 Thread Nino Saturnino Martinez Vazquez Wael
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

Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim
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$WicketNotSerializa

Re: Ajax loading tooltip?

2008-08-18 Thread Nino Saturnino Martinez Vazquez Wael
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

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread Pierre Coquentin
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

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim
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.Serial

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread Michael Sparer
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 cl

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim
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 b

Re: IOException: The handle is invalid - on file upload

2008-08-18 Thread Andrew Moore
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 continu

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim
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

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread Martijn Dashorst
Node is not $1, that is LLMM$Node $1 is declared inside LLMM#get(K key): public List get(final @Nullable K key) { return new AbstractSequentialList() { public int size() { return keyCount.count(key); } public ListIterator listIterator(int index) {

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread Michael Sparer
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

Using FileUpload.writeTo() in a background thread

2008-08-18 Thread Andrew Moore
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 th

Problem getting value from DateTimeField

2008-08-18 Thread jnorris
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

IndicatingAjaxLink with BaseTree appends after

2008-08-18 Thread Kaspar Fischer
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 pu

Re: url controlling

2008-08-18 Thread miro
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

Should AjaxEventBehaviour's not be removed?

2008-08-18 Thread Kaspar Fischer
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); image

Re: Problem getting value from DateTimeField

2008-08-18 Thread jnorris
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

Re: url when requestTarget is of type IListenerInterfaceRequestTarget

2008-08-18 Thread Michael Sparer
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 CharSeque

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim
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 prob

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread Michael Sparer
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 po

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim
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 int

Wicket Image -> Java Image

2008-08-18 Thread insom
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"))

Re: Wicket Image -> Java Image

2008-08-18 Thread James Carman
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 n

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread Michael Sparer
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

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread TH Lim
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 int

Re: Wicket Image -> Java Image

2008-08-18 Thread insom
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) fu

Re: Unable to serialize class com.google.common.collect.LinkedListMultimap$1

2008-08-18 Thread Michael Sparer
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

Re: url when requestTarget is of type IListenerInterfaceRequestTarget

2008-08-18 Thread miro
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

Re: Is DynamicImageResource safe for multiple windows?

2008-08-18 Thread Michel Goldstein
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

Re: url when requestTarget is of type IListenerInterfaceRequestTarget

2008-08-18 Thread Michael Sparer
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 > implementation

Re: Wicket Image -> Java Image

2008-08-18 Thread James Carman
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/RenderedDynamicIma

2 questions on Include

2008-08-18 Thread landry soules
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 c

HTML Fragments

2008-08-18 Thread Gregg Bolinger
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. Si

Re: HTML Fragments

2008-08-18 Thread Scott Swank
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 o

Re: HTML Fragments

2008-08-18 Thread Gregg Bolinger
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/AjaxFallbackL

Re: url when requestTarget is of type IListenerInterfaceRequestTarget

2008-08-18 Thread miro
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 tha

Re: HTML Fragments

2008-08-18 Thread Martin Makundi
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

Re: url when requestTarget is of type IListenerInterfaceRequestTarget

2008-08-18 Thread Michael Sparer
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

Re: AjaxSelfUpdatingTimerBehavior works one time

2008-08-18 Thread trames
Found it... I was using in the html instead of 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. -

Re: Google friendly site remaining wickets nice stateful page contructor

2008-08-18 Thread Ritesh Trivedi
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

Nested forms

2008-08-18 Thread John Krasnay
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 inde

Re: [announce] Wicket in Action e-book has been published!

2008-08-18 Thread Sven Meier
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 abro

Re: Nested forms

2008-08-18 Thread Matej Knopp
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. Wi

Re: HTML Fragments

2008-08-18 Thread Martijn Dashorst
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, Greg

Re: [announce] Wicket in Action e-book has been published!

2008-08-18 Thread James Carman
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 > eve

ResourceModel vs. getLocalizer

2008-08-18 Thread lesterburlap
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

FeedbackPanel default outputMarkupId = true

2008-08-18 Thread Patrick Angeles
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

Re: 2 questions on Include

2008-08-18 Thread jWeekend
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, >

Re: Should AjaxEventBehaviour's not be removed?

2008-08-18 Thread Timo Rantalaiho
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

Re: ResourceModel vs. getLocalizer

2008-08-18 Thread Timo Rantalaiho
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

Re: FeedbackPanel default outputMarkupId = true

2008-08-18 Thread Timo Rantalaiho
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 stuf

Re: [announce] Wicket in Action e-book has been published!

2008-08-18 Thread Martijn Dashorst
On Tue, Aug 19, 2008 at 12:05 AM, James Carman <[EMAIL PROTECTED]> wrote: > 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? If you bought at the manning site, then yes. If you shopped at Amazon, t

Re: [announce] Wicket in Action e-book has been published!

2008-08-18 Thread Nino Saturnino Martinez Vazquez Wael
Hhhehe, know the situation my wifes pregnant with our second child, and we(I) need to do some fixing too and split a room into two pieces before it's born, so I sacrificed my Suzuki sv 650 (which I never used anyway btw).. Eelco Hillenius wrote: On Thu, Aug 14, 2008 at 3:47 AM, Johan Compagne

Re: FeedbackPanel default outputMarkupId = true

2008-08-18 Thread Nino Saturnino Martinez Vazquez Wael
I still for one try to get ajax away for public(unauthorized) parts, for seo and caching purposes but it depends on the situation.. Timo Rantalaiho wrote: On Mon, 18 Aug 2008, Patrick Angeles wrote: Does it make sense to have outputMarkupId default to true for FeedbackPanel? Use case: so