Google Analytics and AJAX
Is anyone doing this: http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55519 If so can you share your code? If not I'll build it ;) John-
Re: Twenty Six Wicket Tricks
+1 Wicket Cookbook On Tue, Jul 28, 2009 at 6:04 PM, taha siddiqi wrote: > +1 > "26 Wicket Tricks" or "Wicket Cookbook" or "Wicket Recipes" > > (Whenever I am trying something new I always try a cookbook, It later > on acts as a reference too) > > taha > > > On Wed, Jul 29, 2009 at 3:38 AM, Matej Knopp wrote: > > On Tue, Jul 28, 2009 at 11:55 PM, Vladimir K wrote: > >> > >> > >> Matej Knopp-2 wrote: > >>> > >>> Modal Window is an ajax component. Submitting it with regular submit > >>> is not supported and it never was. > >>> > >> > >> But I would like to have AjaxFallbackModalWindow that survives page > refresh. > >> Why not author my own if the aims are different? Probably requirements > we > >> have are far from being accepted as common. > > Of course you can. There's nothing wrong with that. > >> > >> > >> > >>> Again, modal window doesn't support regular submits (by design) so if > >>> you want to do file upload you'll have to use a hidden iframe or some > >>> other approach like that. > >>> > >> > >> IMO, Iframe is not an approach it is a work around the limitation (made > by > >> design) :) > > Yes. But from the beginning Modal Window was designed as Ajax Component. > >> > >> > >> > >>> I just looked at jquery dialog example. The dialog is declared in > >>> markup but it is then reparented as top level DOM element. Same thing > >>> wicket modalwindow does. > >>> > >> > >> What is especial in my case is that the page height is limited by the > window > >> height and contains a srollable div within. Taking into account that the > >> browsers we support works well with fixed positioning and assuming that > the > >> following excerpt works: > >> > >> > >> > >>> Fixed positioning is a special case of absolute positioning. For fixed > >>> elements, the containing block is always taken to be the viewport of > the > >>> browser window. > > This is true. Unfortunately it doesn't apply to IE6 which doesn't > > support position:fixed. Modal Window was written couple of years ago > > when IE6 position was quite strong, however even now we can't afford > > to ignore it. Unfortunately. > >>> > >> > >> It seems to be pretty doable. But it needs investigation. I haven't > tried > >> yet. > > Position:fixed will work in your case if you can afford to ignore IE6. > > But it's not something we can do in wicket extensions. > >> > >> > >> > Anyway it is possible to do what the modal.js is doing by Wicket means > and > don't have a component tree mismatch with DOM. > >>> > >>> Is it really? Mind sharing with me how? > >>> > >> > >> In case if the position:fixed does not help I would subclass a Form and > make > >> it a container of ModalWindows. Then by placing the > >> modal-window-container-form at the body level I would acquire a new > >> ModalWindow from the container. Does it make sense? > >> > > So the ModalWindow would have to be added to the container (which I > > assume would have to be added to the page itself)? That's rather > > limiting. > > > > -Matej > >> -- > >> View this message in context: > http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24708596.html > >> Sent from the Wicket - User mailing list archive at Nabble.com. > >> > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> For additional commands, e-mail: users-h...@wicket.apache.org > >> > >> > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Re: reuseitems problems
It might also be that it is wickettester related problem, maybe something goes somehow wrong there. I will try to make a quickstart. ** Martin 2009/7/29 Vladimir K : > > Hmm ... i can imagine the only case - somewhere resolveObject() method is > called during deserialization. > But I'm afraid your code don't have such a method and the cause is > different. > > > MartinM wrote: >> >> I do not know exactly what happens, but if I run the debugger I can >> see thet the page seen by the formcomponents' propertymodels is in a >> different state than the one actually holding the form components. >> >> I wonder if ajax has something to do with this, because only part of >> the page is refreshed via ajax. Maybe the parent page and the >> refreshed ajax panel remain in different serialization graphs? >> >> ** >> Martin >> >> 2009/7/28 Vladimir K : >>> >>> trying to undertand what is happening in your case. When the page is >>> serialized the steam contains the whole graph, including the ListView and >>> it's items and the page default model and the ListView items models. When >>> the page is deserialized, the whole graph is restored including page, its >>> model, items and their models. My understanding is that in your case the >>> items models are the old ones that was in the previous version of the >>> page, >>> how could it be? Or I didn't get what you were saying. >>> >>> >>> MartinM wrote: Or session store.. anyways, that's not relevant. The important fact is that the copies are different. ** Martin 2009/7/28 Martin Makundi : >> why do you get Page instance 2 on page refresh? > > Wicket always deserializes page state from diskstore.. so it is a copy. > > ** > Martin > >> >> >> MartinM wrote: >>> please describe the context. I don > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/reuseitems-problems-tp24702133p24705851.html >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > -- > View this message in context: > http://www.nabble.com/reuseitems-problems-tp24702133p24708835.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: javascript effects before an ajax call
I have a workaround and it goes a little something like this: Wicket.replaceOuterHtml=function(element, text) { new $(element.id).fade({ duration: 0.4, afterFinish: function(effect) { if (Wicket.Browser.isIE()) { Wicket.replaceOuterHtmlIE(element, text); } else if (Wicket.Browser.isSafari() || Wicket.Browser.isOpera()) { Wicket.replaceOuterHtmlSafari(element, text); } else /* GECKO */ { // create range and fragment var range = element.ownerDocument.createRange(); range.selectNode(element); var fragment = range.createContextualFragment(text); element.parentNode.replaceChild(fragment, element); } $(element.id).appear({ duration: 0.4}); }}); } Putting that at the top of the html overrides the wicket function, adds in a javascript effect, then using the onFinish hook, runs the original Wicket code, the precedes with another effect. This makes the effects run immediately after the ajax call has completed... This adds a fade transition every time wicket replaces a dom element. A better version would allow you to do it with some hooks, passing in your transition functions. 2009/7/28 Antony Stubbs > (sorry, sent to wrong list before) > Is it possible to override certain methods in wicketajax.js ? In order to > modify the behaviour of one of the methods. > > but i'd prefer not to run a patched wicket, or have to run on a copy of the > whole wicketajax.js file - but i will if i have to :/ > > what i want to do is add pre and post hooks > processComponent#Wicket.replaceOuterHtml function - as this will solve what > I want to do - i.e. run an animation on the element to be replaced, after > the ajax call completes, but before the element is replaced. > > p.s. martijn, is there any info available on the plan for the new ajax > system? > > I just found - there is a post animation hook in Scriptaculous, which I > have working to run the ajax request in, however this doesn't quite get > there, as there's is of course the delay between when the animation > finishes, and when the ajax request actually completes - which is too long. > > Update: > I've tried overriding the js functions like this: > > > > function newProcessComponent: function(steps, node) { > alert('replaced!'); > } > > Wicket.Ajax.Call.prototype.processComponent = newProcessComponent > > > Wicket.replaceOuterHtml=function() {alert( > 'replaceOuterHtml');} > Wicket.Ajax.Call.prototype.processComponent: > function(steps, node) {{alert('processComponent');} > > but only the replaceOuterHtml functions works, i think because the there's > a difference because processComponent is a member of an object... > I need to replace processComponent so that I can have access to the > > Cheers, > Antony Stubbs, > > sharca.com > > On 27/07/2009, at 9:31 PM, Martijn Dashorst wrote: > > Not 100% sure if it's already done, but I've bugged Matej with this > > request for 1.5's new Ajax implementation. > > > Martijn > > > On Mon, Jul 27, 2009 at 9:40 AM, Antony Stubbs > wrote: > > Was this ever implemented / solved?: > > > > > Nov 21, 2006; 07:09am Re: Using Javascript Effects Before An Ajax Call > > This is possible to do with wicket, however it would require minor > > enhancement of the ajax processing code. > > > We already have infrastructure for asynchronously postponing processing > > steps. > > > However, I can't do that right now. Maybe in a week or so. So if anyone > > really needs to pause between executing scripts from "prependJavascript" > > and replacing the elements (which is I understand right this is all > > about), keep bugging me, I will eventually implement that. :) > > > -Matej > > > cygnusx2112 wrote: > > > Thanks for the clarification Igor. I ended up achieving the desired affect > > by > > using an AjaxCallDecarator in combination with a server side pause. > > Basically I was trying to do the following: > > > 1) Run animation effect on element > > 2) Use Ajax request to replace element > > 3) Run another animation effect on the element > > > As you noticed, I needed a way to block so that #2 and #3 would not step > > on > > #1. As a non-Javascript guru I was unable to find a way to block the > > Javascript "thread" without some kind of CPU beating hack loop. However, > > the > > solution I am using seems to work well. > > > In my efforts to accomplish this I have built some pretty interesting > > subclasses of AjaxEventBehavior that might be worth contributing. They > > basically allow you to cleanly add pre/post visual effects to components > > around an Ajax event. > > > Regards, > > > -MT > > > > > > igor.vaynberg wrote: > > > the effect is clearly executed asynchronously from the rest of the > > javascript "thread" so you need to find a way to block until the effect > > is > > complete. > > > -igor > > > > ... [show rest of quote] > > > > - > > Take Surveys. Earn Cash. Influence the Future of IT >
Re: Twenty Six Wicket Tricks
+1 "26 Wicket Tricks" or "Wicket Cookbook" or "Wicket Recipes" (Whenever I am trying something new I always try a cookbook, It later on acts as a reference too) taha On Wed, Jul 29, 2009 at 3:38 AM, Matej Knopp wrote: > On Tue, Jul 28, 2009 at 11:55 PM, Vladimir K wrote: >> >> >> Matej Knopp-2 wrote: >>> >>> Modal Window is an ajax component. Submitting it with regular submit >>> is not supported and it never was. >>> >> >> But I would like to have AjaxFallbackModalWindow that survives page refresh. >> Why not author my own if the aims are different? Probably requirements we >> have are far from being accepted as common. > Of course you can. There's nothing wrong with that. >> >> >> >>> Again, modal window doesn't support regular submits (by design) so if >>> you want to do file upload you'll have to use a hidden iframe or some >>> other approach like that. >>> >> >> IMO, Iframe is not an approach it is a work around the limitation (made by >> design) :) > Yes. But from the beginning Modal Window was designed as Ajax Component. >> >> >> >>> I just looked at jquery dialog example. The dialog is declared in >>> markup but it is then reparented as top level DOM element. Same thing >>> wicket modalwindow does. >>> >> >> What is especial in my case is that the page height is limited by the window >> height and contains a srollable div within. Taking into account that the >> browsers we support works well with fixed positioning and assuming that the >> following excerpt works: >> >> >> >>> Fixed positioning is a special case of absolute positioning. For fixed >>> elements, the containing block is always taken to be the viewport of the >>> browser window. > This is true. Unfortunately it doesn't apply to IE6 which doesn't > support position:fixed. Modal Window was written couple of years ago > when IE6 position was quite strong, however even now we can't afford > to ignore it. Unfortunately. >>> >> >> It seems to be pretty doable. But it needs investigation. I haven't tried >> yet. > Position:fixed will work in your case if you can afford to ignore IE6. > But it's not something we can do in wicket extensions. >> >> >> Anyway it is possible to do what the modal.js is doing by Wicket means and don't have a component tree mismatch with DOM. >>> >>> Is it really? Mind sharing with me how? >>> >> >> In case if the position:fixed does not help I would subclass a Form and make >> it a container of ModalWindows. Then by placing the >> modal-window-container-form at the body level I would acquire a new >> ModalWindow from the container. Does it make sense? >> > So the ModalWindow would have to be added to the container (which I > assume would have to be added to the page itself)? That's rather > limiting. > > -Matej >> -- >> View this message in context: >> http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24708596.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
[problem] http://dliu-pc:8080/WB/../brainSideBar?wicket:interface=:1:comments:post::IFormSubmitListener::
Hi, I am a rookie to Wicket and need help here. The problem may be easy for you but the detailed introduction is tedious. In one shortest sentence, the URL shown in the subject should be http://dliu-pc:8080/WB/brainSideBar?wicket:interface=:1:comments:post::IFormSubmitListener:: instead (i.e., parent folder sign .. eliminated), in my opinion. The underneath is about details: Environment: Tomcat 6.0.18 Wicket 1.3.6 JRE 1.6 update 13 Web app: WB maintained by Tomcat and the url is http://dliu-pc:8080/WB. (Actually, on local machine.) Problem: The involved url is http://dliu-pc:8080/WB/brainSideBar. WebPage brainSideBar contains a Wicket Panel Comments. In one case, Comments throws one RestartResponseAtInterceptPageException to let the users log in. The address bar shows http://dliu-pc:8080/WB/?wicket:interface=:2 thereafter. Login page shows normally. After the user log in, we cannot go back to http://dliu-pc:8080/WB/brainSideBar since the url is wrong as shown in the subject, which was revealed by a HTTP sniffer tool. This url is interpreted by FireFox 3.5 and Chrome as http://dliu-pc:8080/brainSideBar?wicket:interface=:1:comments:post::IFormSubmitListener::. There is nothing in page source. If now we ask the browser to go to the correct url http://dliu-pc:8080/WB/brainSideBar?wicket:interface=:1:comments:post::IFormSubmitListener::, brainSideBar will be correctly shown while the url shown in the address bar becomes http://dliu-pc:8080/WB/?wicket:interface=:1:1:::. One fact that may matter: Previously, WicketFilter was used for url-pattern /app/*; the url returned under the same scenario was (only important segments shown here:) ...WB/app/../app/brainSideBar?, so that the correct url ...WB/app/brainSideBar?...was finally composed. This problem is beyond my Wicket ability and I cannot move forward in two days. Thanks in advance for your help! DaPe
Re: will there be a performance gain to use singleton to remove references to the service object in models?
Hi Martijin, Thats a very good point. I definitely overlooked that risk before. Thank you for pointing it out! Thanks, Jason Wang Martijn Dashorst wrote: There's the risk of keeping the retrieved service as a reference somewhere, e.g. by declaring it final and using it inside an anon inner class, negating any and all gains you've done by using the static lookup. The @SpringBean annotated references are safe to pass around (as they are implemented as proxies to your services) Martijn On Tue, Jul 28, 2009 at 9:50 AM, Eelco Hillenius wrote: Actually, thinking about it, if you're very tight on memory, it will save you a reference, particularly when the page gets serialized. So if you are worrying about efficiency *and* are ok with this code style, it's an option. :-) Eelco On Tue, Jul 28, 2009 at 12:47 AM, Eelco Hillenius wrote: It might give you a very slight edge to use a singleton as you (or the annotation processor in this case) don't have to introspect and work through a proxy. If you're not bothered by singletons (I, for one typically are): go for it. However, keep that famous 'premature optimization is the root of all evil' in mind; 99.9% chance you're optimizing something that will never ever become a bottleneck. Eelco 2009/7/27 Murat Yücel : Hi Jason I dont have a performance comparison, but i cannot see why you should gain better performance. All spring beans are as default singleton, so you will just forward a singleton using a singleton. /Murat 2009/7/28 Jason Wang : Hi all, Although I am using spring-wicket to prevent the whole spring being serialized, It still brothers me to see the references in the model object, for example: Instead of using this: public class MyViewObjectProvider extends SortableDataProvider{ @SpringBean("daoService") private DAOServices daoService; private String objectID; public Iterator iterator(final int first, final int count){ . return daoService.load(objectId).subList(first, first+count).iterator(); } } I always write a singleton helper class for the service to be used, so I can have the model this way: public class MyViewObjectProvider extends SortableDataProvider{ //so no reference to the dao service object private String objectID; public Iterator iterator(final int first, final int count){ . //here the DAOServiceHelper.get() returns a instance that managed by spring(with the actual service object injected.) return DAOServiceHelper.get().load(objectId).subList(first, first+count).iterator(); } } So my question is, will there be a noticeable performance gain to do it the 2nd way? The reason to ask is that the static kind of singleton usage is indeed anti-spring, and makes my eyes bleed If no one has done a performance comparison, I might have to do one myself. Just being lazy... Thanks, Jason Wang - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Palette override localization
Is there a way to turn off the localization of the choices in a Palette component? It looks like the AbstractChoice has the ability but the Palette which uses AbstractOptions does not. Thanks, Tim
Re: reuseitems problems
Hmm ... i can imagine the only case - somewhere resolveObject() method is called during deserialization. But I'm afraid your code don't have such a method and the cause is different. MartinM wrote: > > I do not know exactly what happens, but if I run the debugger I can > see thet the page seen by the formcomponents' propertymodels is in a > different state than the one actually holding the form components. > > I wonder if ajax has something to do with this, because only part of > the page is refreshed via ajax. Maybe the parent page and the > refreshed ajax panel remain in different serialization graphs? > > ** > Martin > > 2009/7/28 Vladimir K : >> >> trying to undertand what is happening in your case. When the page is >> serialized the steam contains the whole graph, including the ListView and >> it's items and the page default model and the ListView items models. When >> the page is deserialized, the whole graph is restored including page, its >> model, items and their models. My understanding is that in your case the >> items models are the old ones that was in the previous version of the >> page, >> how could it be? Or I didn't get what you were saying. >> >> >> MartinM wrote: >>> >>> Or session store.. anyways, that's not relevant. The important fact is >>> that the copies are different. >>> >>> ** >>> Martin >>> >>> 2009/7/28 Martin Makundi : > why do you get Page instance 2 on page refresh? Wicket always deserializes page state from diskstore.. so it is a copy. ** Martin > > > MartinM wrote: >> >>> please describe the context. I don >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> >> >> -- >> View this message in context: >> http://www.nabble.com/reuseitems-problems-tp24702133p24705851.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/reuseitems-problems-tp24702133p24708835.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Caching a resource on the browser side
hi Juri I did it the same way as you did and it worked fine. Even more : I didn't even see lines in http header (???). However, it doesn't fit my use case : I need to get the link to the file to embed it in a javascript. Previously I did it this way : PageParameters parameters = new PageParameters(); parameters.add(AMChartDataProviderPage.DATA_KEY, set.getDataId()); return RequestCycle.get().urlFor(AMChartDataProviderPage.class, parameters).toString(); however I don't know how to do it with what you provided... ++ On Tue, Jul 28, 2009 at 10:32 AM, Juri Prokofiev wrote: > It works for me. > > ResourceLink csvLink = new ResourceLink("csvLink", new > ResourceReference(AnnouncementCsvResource.ID), params); > add(csvLink); > > public class AnnouncementCsvResource extends WebResource > { > public static final String ID = "csv"; > �...@override > public IResourceStream getResourceStream() > { > return new CsvResourceStream(); > } > > �...@override > protected void setHeaders(WebResponse response) > { > super.setHeaders(response); > response.setAttachmentHeader("announcements.csv"); > response.setHeader("Cache-Control", "no-cache"); > } > > private class CsvResourceStream extends AbstractStringResourceStream > { > �...@override > public String getContentType() > { > return "text/plain"; > } > > �...@override > protected Charset getCharset() > { > return Charset.forName("ISO-8859-1"); > } > > �...@override > protected String getString() > { > return "bla bla "; > } > } > } > > > On Tue, Jul 28, 2009 at 10:44 AM, ZedroS Schwart > wrote: > >> Thanks for this answer Juri. >> >> I tried it (once again) and it didn't work : the setHeaders method >> isn't called... >> >> I use Live HTTP headers to check what goes through : >> http://localhost:8080/charts/data/dataId/KBU >> >> >> >> GET /charts/data/dataId/KBU HTTP/1.1 >> >> Host: localhost:8080 >> >> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) >> Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11 >> >> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 >> >> Accept-Language: en,de;q=0.5 >> >> Accept-Encoding: gzip,deflate >> >> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 >> >> Keep-Alive: 300 >> >> Connection: keep-alive >> >> Cookie: JSESSIONID=1gxaom5muzh66 >> >> >> >> HTTP/1.x 200 OK >> >> Content-Type: text/csv; charset=UTF-8 >> >> Content-Length: 5726 >> >> Server: Jetty(6.1.16) >> >> >> thanks again >> zedros >> >> On Tue, Jul 28, 2009 at 8:59 AM, Juri Prokofiev wrote: >> > To set headers to a resource you need to extend setHeaders method from >> > WebResource. Example: >> > �...@override >> > protected void setHeaders(WebResponse response) >> > { >> > super.setHeaders(response); >> > response.setAttachmentHeader("announcements.csv"); >> > response.setHeader("Cache-Control", "no-cache"); >> > } >> > >> > Check your headers. If Cache-Control is passed then resource should be >> > cached on user side. >> > >> > On Tue, Jul 28, 2009 at 1:02 AM, ZedroS Schwart >> > wrote: >> > >> >> hi >> >> >> >> We need to provide a flash application (www.amcharts.com if anyone is >> >> interested) with some content through some files. >> >> >> >> As the files are users specific (and determined with data from the >> >> session), we went for some page delivering the content like this : >> >> public AMChartDataProviderPage(final PageParameters parameters) >> >> { >> >> Object object = parameters.get(DATA_KEY); >> >> if ((object == null) || !(object instanceof String) || >> >> "".equals(object)) >> >> { >> >> throw new IllegalStateException("Expected parameter " + >> >> DATA_KEY + " not provided or empty"); >> >> } >> >> String dataId = (String) object; >> >> ByteArrayResource resourceStream; >> >> try >> >> { >> >> resourceStream = new ByteArrayResource("text/csv", >> >> IOHelper.getResourceAsByteArray(dataId + ".csv")); >> >> } >> >> catch (IOException e) >> >> { >> >> throw ExceptionHelper.wrap(e); >> >> } >> >> getRequestCycle().setRequestTarget(new >> >> ResourceStreamRequestTarget(resourceStream.getResourceStream())); >> >> } >> >> >> >> However, I don't manage to get this resource to be cached on the user >> >> browser side, despite the resource being cacheable. From what I've >> >> seen, setHeaders() in WebResource is never called... Neither did I >> >> manage to set them myself (on the page they're never called neither... >> >> and the request cycle has no webresponse on which to define the >> >> header). >> >> >> >> Any clue ? >> >> >> >> thanks in advance >> >> zedros >> >> >> >> - >> >> To unsubscribe
Re: Twenty Six Wicket Tricks
On Tue, Jul 28, 2009 at 11:55 PM, Vladimir K wrote: > > > Matej Knopp-2 wrote: >> >> Modal Window is an ajax component. Submitting it with regular submit >> is not supported and it never was. >> > > But I would like to have AjaxFallbackModalWindow that survives page refresh. > Why not author my own if the aims are different? Probably requirements we > have are far from being accepted as common. Of course you can. There's nothing wrong with that. > > > >> Again, modal window doesn't support regular submits (by design) so if >> you want to do file upload you'll have to use a hidden iframe or some >> other approach like that. >> > > IMO, Iframe is not an approach it is a work around the limitation (made by > design) :) Yes. But from the beginning Modal Window was designed as Ajax Component. > > > >> I just looked at jquery dialog example. The dialog is declared in >> markup but it is then reparented as top level DOM element. Same thing >> wicket modalwindow does. >> > > What is especial in my case is that the page height is limited by the window > height and contains a srollable div within. Taking into account that the > browsers we support works well with fixed positioning and assuming that the > following excerpt works: > > > >> Fixed positioning is a special case of absolute positioning. For fixed >> elements, the containing block is always taken to be the viewport of the >> browser window. This is true. Unfortunately it doesn't apply to IE6 which doesn't support position:fixed. Modal Window was written couple of years ago when IE6 position was quite strong, however even now we can't afford to ignore it. Unfortunately. >> > > It seems to be pretty doable. But it needs investigation. I haven't tried > yet. Position:fixed will work in your case if you can afford to ignore IE6. But it's not something we can do in wicket extensions. > > > >>>Anyway it is possible to do what the modal.js is doing by Wicket means and >>>don't have a component tree mismatch with DOM. >> >> Is it really? Mind sharing with me how? >> > > In case if the position:fixed does not help I would subclass a Form and make > it a container of ModalWindows. Then by placing the > modal-window-container-form at the body level I would acquire a new > ModalWindow from the container. Does it make sense? > So the ModalWindow would have to be added to the container (which I assume would have to be added to the page itself)? That's rather limiting. -Matej > -- > View this message in context: > http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24708596.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Twenty Six Wicket Tricks
We developed a RAD framework that builds page design dynamically completely basing on metadata. So there is no any concrete page that I could extract. I believe it would be more convinient for you and simpler for me to just have a look at the concrete page without dynamic layout. Matej Knopp-2 wrote: > > Doesn't really have to be a complete quickstart. Put the pages with > markup in a zip (without any external references to your daos, etc). > That should be enough. > > -Matej > > On Tue, Jul 28, 2009 at 11:13 PM, Vladimir K wrote: >> >> Ok then. I'm a noob in maven and ... I even don't know how to make a >> quickstart of this problem for you. I have never done Wicket project from >> scratch. But I have just found a free "maven by example book" and started >> to >> read. I will be back soon :) >> >> >> Matej Knopp-2 wrote: >>> >>> This would be then a bug in nested forms support and not in the modal >>> window itself. If a form inside modal window is submitted only that >>> form should be processed. I still don't understand what problem >>> exactly this fixes. >>> >>> -Matej >>> >>> On Tue, Jul 28, 2009 at 10:04 PM, Vladimir K wrote: The following class fixes the problem. It is the evidence of mismatch I'm saying about. public class ModalWindowForm extends Form { public ModalWindowForm(String id) { super(id); } �...@override public Form getRootForm() { Form form = super.getRootForm(); if ((findParent(ModalWindow.class) != null) && (form.findParent(ModalWindow.class) == null)) return this; else return form; } } I assume I don't understand something. But anyway I expect following the least surprise rule. Matej Knopp-2 wrote: > > On Tue, Jul 28, 2009 at 8:31 PM, Vladimir K wrote: >> >> Jeremy, >> >> from my perspective ModalWindow is a mix of javascript widget that >> works >> in >> non-wicket mode and an wicket wrapper that bridges js widget with >> wicket. >> It >> is always created at the body level. That's why I said it's a cheat. >> Thus >> are problems with form submitting when nested forms are used. > There is a good reason why the modal window has to be created on body > level. That's the only reliable way to have element > with absolute position. If you create the DOM structure deeper you are > risking that a container has position:relative somewhere which will > essentially break it. Welcome to the wonderful world of CSS. > >> Community >> introduced a solution (a wrapping form that is threated as the root) >> to >> work >> around the mismatch of ModalWindow structure. There is an issue >> registered >> about that. But Matej keeps stating that we should put MW into a >> form. >> What >> says that he is not aware what the problem is. And there are more >> problems >> caused by the fact that the element is created by javascript. > Is it, really? > > I've already explained why the DOM structure is created on root level. > If you have form component inside modal window, chances are that > wicket will (to support nested forms) render it as div. If this > happens it is no longer possible to serialize the form when doing an > ajax submit. That's why the actual modal window markup contains a real > form. > > And this is why it is necessary to put a modal window inside a form if > you want to have form in modal window. What we should have done is to > put a wicket form inside the modal window panel itself (just to force > all forms in modal window content) to be rendered as nested. But for > some reason i thought that a simple mention in javadoc about putting > modal window to form would be sufficient. My bad. > >> >> From the other hand I believe it is possible to write pure Wicket >> component >> that would be as trice as simpler and won't suffer with problems with >> request lifecycle. Probably I'm wrong and it is not worth turning the >> old >> ModalWindow into pure Wicket component due to expensiveness of the >> effort >> that would be spent to remain it compatible. > Would you mind specifying the actual problems with "request > lifecycle"? And how exactly would a "pure wicket modal window" look > like? No javascript? >> >> The same about tree components. The API is very difficult to >> comprehend. >> Component does not work as I expect in dynamic context. But >> thankfully >> Sven >> implemented different implementation that does what is expect and >> usable >> as >> well as DataTable component. I believe forking and fixing the >> origin
Re: Twenty Six Wicket Tricks
Matej Knopp-2 wrote: > > Modal Window is an ajax component. Submitting it with regular submit > is not supported and it never was. > But I would like to have AjaxFallbackModalWindow that survives page refresh. Why not author my own if the aims are different? Probably requirements we have are far from being accepted as common. > Again, modal window doesn't support regular submits (by design) so if > you want to do file upload you'll have to use a hidden iframe or some > other approach like that. > IMO, Iframe is not an approach it is a work around the limitation (made by design) :) > I just looked at jquery dialog example. The dialog is declared in > markup but it is then reparented as top level DOM element. Same thing > wicket modalwindow does. > What is especial in my case is that the page height is limited by the window height and contains a srollable div within. Taking into account that the browsers we support works well with fixed positioning and assuming that the following excerpt works: > Fixed positioning is a special case of absolute positioning. For fixed > elements, the containing block is always taken to be the viewport of the > browser window. > It seems to be pretty doable. But it needs investigation. I haven't tried yet. >>Anyway it is possible to do what the modal.js is doing by Wicket means and >>don't have a component tree mismatch with DOM. > > Is it really? Mind sharing with me how? > In case if the position:fixed does not help I would subclass a Form and make it a container of ModalWindows. Then by placing the modal-window-container-form at the body level I would acquire a new ModalWindow from the container. Does it make sense? -- View this message in context: http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24708596.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Twenty Six Wicket Tricks
Doesn't really have to be a complete quickstart. Put the pages with markup in a zip (without any external references to your daos, etc). That should be enough. -Matej On Tue, Jul 28, 2009 at 11:13 PM, Vladimir K wrote: > > Ok then. I'm a noob in maven and ... I even don't know how to make a > quickstart of this problem for you. I have never done Wicket project from > scratch. But I have just found a free "maven by example book" and started to > read. I will be back soon :) > > > Matej Knopp-2 wrote: >> >> This would be then a bug in nested forms support and not in the modal >> window itself. If a form inside modal window is submitted only that >> form should be processed. I still don't understand what problem >> exactly this fixes. >> >> -Matej >> >> On Tue, Jul 28, 2009 at 10:04 PM, Vladimir K wrote: >>> >>> The following class fixes the problem. It is the evidence of mismatch I'm >>> saying about. >>> >>> public class ModalWindowForm extends Form { >>> public ModalWindowForm(String id) { >>> super(id); >>> } >>> >>> �...@override >>> public Form getRootForm() { >>> Form form = super.getRootForm(); >>> >>> if ((findParent(ModalWindow.class) != null) && >>> (form.findParent(ModalWindow.class) == null)) >>> return this; >>> else >>> return form; >>> } >>> } >>> >>> I assume I don't understand something. But anyway I expect following the >>> least surprise rule. >>> >>> >>> >>> Matej Knopp-2 wrote: On Tue, Jul 28, 2009 at 8:31 PM, Vladimir K wrote: > > Jeremy, > > from my perspective ModalWindow is a mix of javascript widget that > works > in > non-wicket mode and an wicket wrapper that bridges js widget with > wicket. > It > is always created at the body level. That's why I said it's a cheat. > Thus > are problems with form submitting when nested forms are used. There is a good reason why the modal window has to be created on body level. That's the only reliable way to have element with absolute position. If you create the DOM structure deeper you are risking that a container has position:relative somewhere which will essentially break it. Welcome to the wonderful world of CSS. > Community > introduced a solution (a wrapping form that is threated as the root) to > work > around the mismatch of ModalWindow structure. There is an issue > registered > about that. But Matej keeps stating that we should put MW into a form. > What > says that he is not aware what the problem is. And there are more > problems > caused by the fact that the element is created by javascript. Is it, really? I've already explained why the DOM structure is created on root level. If you have form component inside modal window, chances are that wicket will (to support nested forms) render it as div. If this happens it is no longer possible to serialize the form when doing an ajax submit. That's why the actual modal window markup contains a real form. And this is why it is necessary to put a modal window inside a form if you want to have form in modal window. What we should have done is to put a wicket form inside the modal window panel itself (just to force all forms in modal window content) to be rendered as nested. But for some reason i thought that a simple mention in javadoc about putting modal window to form would be sufficient. My bad. > > From the other hand I believe it is possible to write pure Wicket > component > that would be as trice as simpler and won't suffer with problems with > request lifecycle. Probably I'm wrong and it is not worth turning the > old > ModalWindow into pure Wicket component due to expensiveness of the > effort > that would be spent to remain it compatible. Would you mind specifying the actual problems with "request lifecycle"? And how exactly would a "pure wicket modal window" look like? No javascript? > > The same about tree components. The API is very difficult to > comprehend. > Component does not work as I expect in dynamic context. But thankfully > Sven > implemented different implementation that does what is expect and > usable > as > well as DataTable component. I believe forking and fixing the original > component would be much more expensive. After that so many people > should > start complaining about that to convince core team that there is not > just > one person who is experiencing problems. It is always difficult to > accomplish. I would like to have some clarification on this. What is so difficult about the Wicket Tree API? (apart from the fact that it uses swing TreeModel which seem to be too confusing for some people).
Re: Twenty Six Wicket Tricks
Ok then. I'm a noob in maven and ... I even don't know how to make a quickstart of this problem for you. I have never done Wicket project from scratch. But I have just found a free "maven by example book" and started to read. I will be back soon :) Matej Knopp-2 wrote: > > This would be then a bug in nested forms support and not in the modal > window itself. If a form inside modal window is submitted only that > form should be processed. I still don't understand what problem > exactly this fixes. > > -Matej > > On Tue, Jul 28, 2009 at 10:04 PM, Vladimir K wrote: >> >> The following class fixes the problem. It is the evidence of mismatch I'm >> saying about. >> >> public class ModalWindowForm extends Form { >> public ModalWindowForm(String id) { >> super(id); >> } >> >> �...@override >> public Form getRootForm() { >> Form form = super.getRootForm(); >> >> if ((findParent(ModalWindow.class) != null) && >> (form.findParent(ModalWindow.class) == null)) >> return this; >> else >> return form; >> } >> } >> >> I assume I don't understand something. But anyway I expect following the >> least surprise rule. >> >> >> >> Matej Knopp-2 wrote: >>> >>> On Tue, Jul 28, 2009 at 8:31 PM, Vladimir K wrote: Jeremy, from my perspective ModalWindow is a mix of javascript widget that works in non-wicket mode and an wicket wrapper that bridges js widget with wicket. It is always created at the body level. That's why I said it's a cheat. Thus are problems with form submitting when nested forms are used. >>> There is a good reason why the modal window has to be created on body >>> level. That's the only reliable way to have element >>> with absolute position. If you create the DOM structure deeper you are >>> risking that a container has position:relative somewhere which will >>> essentially break it. Welcome to the wonderful world of CSS. >>> Community introduced a solution (a wrapping form that is threated as the root) to work around the mismatch of ModalWindow structure. There is an issue registered about that. But Matej keeps stating that we should put MW into a form. What says that he is not aware what the problem is. And there are more problems caused by the fact that the element is created by javascript. >>> Is it, really? >>> >>> I've already explained why the DOM structure is created on root level. >>> If you have form component inside modal window, chances are that >>> wicket will (to support nested forms) render it as div. If this >>> happens it is no longer possible to serialize the form when doing an >>> ajax submit. That's why the actual modal window markup contains a real >>> form. >>> >>> And this is why it is necessary to put a modal window inside a form if >>> you want to have form in modal window. What we should have done is to >>> put a wicket form inside the modal window panel itself (just to force >>> all forms in modal window content) to be rendered as nested. But for >>> some reason i thought that a simple mention in javadoc about putting >>> modal window to form would be sufficient. My bad. >>> From the other hand I believe it is possible to write pure Wicket component that would be as trice as simpler and won't suffer with problems with request lifecycle. Probably I'm wrong and it is not worth turning the old ModalWindow into pure Wicket component due to expensiveness of the effort that would be spent to remain it compatible. >>> Would you mind specifying the actual problems with "request >>> lifecycle"? And how exactly would a "pure wicket modal window" look >>> like? No javascript? The same about tree components. The API is very difficult to comprehend. Component does not work as I expect in dynamic context. But thankfully Sven implemented different implementation that does what is expect and usable as well as DataTable component. I believe forking and fixing the original component would be much more expensive. After that so many people should start complaining about that to convince core team that there is not just one person who is experiencing problems. It is always difficult to accomplish. >>> I would like to have some clarification on this. What is so difficult >>> about the Wicket Tree API? (apart from the fact that it uses swing >>> TreeModel which seem to be too confusing for some people). What does >>> "dynamic" context mean? Assuming you have properly implemented >>> TreeModel that fires the proper notifications, wicket tree is capable >>> for updating itself on ajax request by only transmitting the changed >>> part to the clients. How much more dynamic can you get? >>> >>> For next version we will probably ditch swing Tree
Re: Twenty Six Wicket Tricks
Why just 26 tricks?More please..! I feel the learning curve for Wicket is kind of tall and more tricks can definitely help new comers in terms of available practical tools and understanding masterful use of Wicket by gurus and ... and ... --- On Tue, 7/28/09, David Chang wrote: > From: David Chang > Subject: Re: Twenty Six Wicket Tricks > To: users@wicket.apache.org > Date: Tuesday, July 28, 2009, 5:04 PM > > I would buy the book too. When will it be available? > > --- On Tue, 7/28/09, Mathias Nilsson > wrote: > > > From: Mathias Nilsson > > Subject: Re: Twenty Six Wicket Tricks > > To: users@wicket.apache.org > > Date: Tuesday, July 28, 2009, 1:02 PM > > > > +1 > > > > I would buy the book. > > -- > > View this message in context: > > http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24703709.html > > Sent from the Wicket - User mailing list archive at > > Nabble.com. > > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Twenty Six Wicket Tricks
I would buy the book too. When will it be available? --- On Tue, 7/28/09, Mathias Nilsson wrote: > From: Mathias Nilsson > Subject: Re: Twenty Six Wicket Tricks > To: users@wicket.apache.org > Date: Tuesday, July 28, 2009, 1:02 PM > > +1 > > I would buy the book. > -- > View this message in context: > http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24703709.html > Sent from the Wicket - User mailing list archive at > Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Reg next line character in the passed String
Thank you... On Mon, Jul 27, 2009 at 11:34 PM, Juri Prokofiev wrote: > Maybe this CSS trick will help you: > > > > .formatPre { > overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, > not needed in Firefox 3 */ > white-space: pre-wrap; /* css-3 */ > white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ > white-space: -pre-wrap; /* Opera 4-6 */ > white-space: -o-pre-wrap; /* Opera 7 */ > /* width: 99%; */ > word-wrap: break-word; /* Internet Explorer 5.5+ */ > } > > > > On Mon, Jul 27, 2009 at 11:56 PM, Swapna Rachamalla < > swapna.rachama...@gmail.com> wrote: > > > HI Igor > > > > I have tried with you suggestions..now it is displaying the whole content > > but it is not displaying in the next line wherever i need to display.. > > > > Here is the code in HTML: > > > > > > > > > > > > > > > > Here is the Java Code: > > RepeatingView rv = new RepeatingView("mfg"); > > WebMarkupContainer wmc = new WebMarkupContainer(rv.newChildId()); > > BookmarkablePageLink mfgLink = null; > > String finalString=""; > >String AMfgNames = "\n\n"+" A "+"\n\n"; > >String BMfgNames = "\n\n"+" B "+"\n\n"; > > String CMfgNames = "\n\n"+" C "+"\n\n"; > >String DMfgNames = "\n\n"+" D "+"\n\n"; > >String EMfgNames = "\n\n"+" E "+"\n\n"; > >String FMfgNames = "\n\n"+" F "+"\n\n"; > >String GMfgNames = "\n\n"+" G "+"\n\n"; > >String HMfgNames = "\n\n"+" H "+"\n\n"; > >for(Manufacturer mfg: mfgs) > >{ > > > >String mfgName = mfg.getName(); > >//if(Pattern.matches("[aA][a-zA-Z_0-9]*",mfgName )) > > if(Pattern.matches("[aA][\\w\\W\\s\\S\\d\\D.]*",mfgName )) > > AMfgNames = AMfgNames + mfgName +" | "; > >if(Pattern.matches("[bB][\\w\\W\\s\\S\\d\\D.]*",mfgName )) > >BMfgNames = BMfgNames + mfgName +" | "; > > if(Pattern.matches("[cC][\\w\\W\\s\\S\\d\\D.]*",mfgName )) > >CMfgNames = CMfgNames + mfgName +" | "; > >if(Pattern.matches("[dD][\\w\\W\\s\\S\\d\\D.]*",mfgName )) > >DMfgNames = DMfgNames + mfgName +" | "; > >if(Pattern.matches("[eE][\\w\\W\\s\\S\\d\\D.]*",mfgName )) > >EMfgNames = EMfgNames + mfgName +" | "; > >if(Pattern.matches("[fF][\\w\\W\\s\\S\\d\\D.]*",mfgName )) > >FMfgNames = FMfgNames + mfgName +" | "; > >if(Pattern.matches("[gG][\\w\\W\\s\\S\\d\\D.]*",mfgName )) > >GMfgNames = GMfgNames + mfgName +" | "; > >if(Pattern.matches("[hH][\\w\\W\\s\\S\\d\\D.]*",mfgName )) > >HMfgNames = HMfgNames + mfgName +" | "; > > > > > > // s = s + mfg.getName()+" | "; > >s = s + mfgName +" | "; > > mfgLink = > ManufacturerDetailPage.getBookmarkableLink("mfgLink", > > mfg); > > mfgLinkA = > > ManufacturerDetailPage.getBookmarkableLink("mfgLinkA", mfg); > >mfgLinkB = > > ManufacturerDetailPage.getBookmarkableLink("mfgLinkB", mfg); > >mfgLinkC = > > ManufacturerDetailPage.getBookmarkableLink("mfgLinkC", mfg); > >mfgLinkD = > > ManufacturerDetailPage.getBookmarkableLink("mfgLinkD", mfg); > >mfgLinkE = > > ManufacturerDetailPage.getBookmarkableLink("mfgLinkE", mfg); > >mfgLinkF = > > ManufacturerDetailPage.getBookmarkableLink("mfgLinkF", mfg); > >//mfgLink.add(new Label("index", new Model(index++))); > > > >} > >finalString = finalString + AMfgNames + BMfgNames + CMfgNames + > > DMfgNames + EMfgNames + FMfgNames + GMfgNames + HMfgNames ; > > mfgLink.add(new Label("mfgName", finalString).setRenderBodyOnly(true)); > > wmc.add(mfgLink); > > rv.add(wmc); > > add(rv); > > } > > > > On Fri, Jul 24, 2009 at 8:55 PM, Jeremy Thomerson < > > jer...@wickettraining.com > > > wrote: > > > > > You said in your email that you are using span tags. What is the > > > generated HTML? Do you have span tags inside pre tags? Have you > > > tried setRenderBodyOnly(true)? Or just attach the wicket:id to the > > > pre tags directly? > > > > > > -- > > > Jeremy Thomerson > > > http://www.wickettraining.com > > > > > > > > > > > > > > > On Fri, Jul 24, 2009 at 6:38 PM, Swapna > > > Rachamalla wrote: > > > > Hi Igor > > > > > > > > I am using tag. > > > > > > > > It is displaying > > > > > > > > A > > > > > > > > A2B TRACKING SOLUTIONS | Aastra | Aastra Phones | ABBYY | ABO Gear | > > ABT > > > | > > > > AC Delco | ACCESS > > > > > > > > but the actual String value is the following: > > > > > > > > A > > > > > > > > A2B TRACKING SOLUTIONS | Aastra | Aastra Phones | ABBYY | ABO Gear | > > ABT > > > | > > > > AC Delco | ACCESS HD | ACCUSCREEN | ACD SYSTEMS LICENSING | ACP - > > MEMORY > > > > UPGRADES | Accell | Accell Corp | Acer | Acme Hitch | Acomdata | > > Acoustic > > > > Research | Actiontec Electr
Re: reuseitems problems
I do not know exactly what happens, but if I run the debugger I can see thet the page seen by the formcomponents' propertymodels is in a different state than the one actually holding the form components. I wonder if ajax has something to do with this, because only part of the page is refreshed via ajax. Maybe the parent page and the refreshed ajax panel remain in different serialization graphs? ** Martin 2009/7/28 Vladimir K : > > trying to undertand what is happening in your case. When the page is > serialized the steam contains the whole graph, including the ListView and > it's items and the page default model and the ListView items models. When > the page is deserialized, the whole graph is restored including page, its > model, items and their models. My understanding is that in your case the > items models are the old ones that was in the previous version of the page, > how could it be? Or I didn't get what you were saying. > > > MartinM wrote: >> >> Or session store.. anyways, that's not relevant. The important fact is >> that the copies are different. >> >> ** >> Martin >> >> 2009/7/28 Martin Makundi : why do you get Page instance 2 on page refresh? >>> >>> Wicket always deserializes page state from diskstore.. so it is a copy. >>> >>> ** >>> Martin >>> MartinM wrote: > >> please describe the context. I don >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > -- > View this message in context: > http://www.nabble.com/reuseitems-problems-tp24702133p24705851.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Disable LinkTree iconLink
Both links are created in LinkIconPanel. You can subclass it or replace it by your own class (it's really a tiny class) and disable the links there. -Matej On Tue, Jul 28, 2009 at 7:40 PM, Seven Corners wrote: > I have a LinkTree wherein I need to disable the links on certain nodes. It > was easy to disable the contentLink but I haven't been able to figure out > how to disable the iconLink. My links are BookmarkablePageLinks, but > iconLink is not a proper link; rather it appears that it's a element > with an onclick handler, that contains an element that has no > surrounding anchor or onclick handlers. While nothing happens on my > disabled icons when you click the mouse, the mouse still transforms into a > link mouse (a hand instead of a pointer), and I'd like to prevent that. > > Short of cheating and tweaking the style to set the pointer, I don't know > how to really disable the thing. > > Any ideas? > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Twenty Six Wicket Tricks
On Tue, Jul 28, 2009 at 12:08 PM, Matej Knopp wrote: > I would like to have some clarification on this. What is so difficult > about the Wicket Tree API? (apart from the fact that it uses swing > TreeModel which seem to be too confusing for some people). Confusing for some, easy for others (who maybe already have worked with it in Swing) :-) Components like that get complex pretty quickly. Look at what other frameworks deliver and see if you can use that without a lot of hacking (if they provide a tree widget backed by a model to start with, most probably just don't). But hey, the more alternatives the merrier; in the end API design (and thus Wicket widget design) involves a lot of subjective choices. Eelco - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Twenty Six Wicket Tricks
This would be then a bug in nested forms support and not in the modal window itself. If a form inside modal window is submitted only that form should be processed. I still don't understand what problem exactly this fixes. -Matej On Tue, Jul 28, 2009 at 10:04 PM, Vladimir K wrote: > > The following class fixes the problem. It is the evidence of mismatch I'm > saying about. > > public class ModalWindowForm extends Form { > public ModalWindowForm(String id) { > super(id); > } > > �...@override > public Form getRootForm() { > Form form = super.getRootForm(); > > if ((findParent(ModalWindow.class) != null) && > (form.findParent(ModalWindow.class) == null)) > return this; > else > return form; > } > } > > I assume I don't understand something. But anyway I expect following the > least surprise rule. > > > > Matej Knopp-2 wrote: >> >> On Tue, Jul 28, 2009 at 8:31 PM, Vladimir K wrote: >>> >>> Jeremy, >>> >>> from my perspective ModalWindow is a mix of javascript widget that works >>> in >>> non-wicket mode and an wicket wrapper that bridges js widget with wicket. >>> It >>> is always created at the body level. That's why I said it's a cheat. Thus >>> are problems with form submitting when nested forms are used. >> There is a good reason why the modal window has to be created on body >> level. That's the only reliable way to have element >> with absolute position. If you create the DOM structure deeper you are >> risking that a container has position:relative somewhere which will >> essentially break it. Welcome to the wonderful world of CSS. >> >>> Community >>> introduced a solution (a wrapping form that is threated as the root) to >>> work >>> around the mismatch of ModalWindow structure. There is an issue >>> registered >>> about that. But Matej keeps stating that we should put MW into a form. >>> What >>> says that he is not aware what the problem is. And there are more >>> problems >>> caused by the fact that the element is created by javascript. >> Is it, really? >> >> I've already explained why the DOM structure is created on root level. >> If you have form component inside modal window, chances are that >> wicket will (to support nested forms) render it as div. If this >> happens it is no longer possible to serialize the form when doing an >> ajax submit. That's why the actual modal window markup contains a real >> form. >> >> And this is why it is necessary to put a modal window inside a form if >> you want to have form in modal window. What we should have done is to >> put a wicket form inside the modal window panel itself (just to force >> all forms in modal window content) to be rendered as nested. But for >> some reason i thought that a simple mention in javadoc about putting >> modal window to form would be sufficient. My bad. >> >>> >>> From the other hand I believe it is possible to write pure Wicket >>> component >>> that would be as trice as simpler and won't suffer with problems with >>> request lifecycle. Probably I'm wrong and it is not worth turning the old >>> ModalWindow into pure Wicket component due to expensiveness of the effort >>> that would be spent to remain it compatible. >> Would you mind specifying the actual problems with "request >> lifecycle"? And how exactly would a "pure wicket modal window" look >> like? No javascript? >>> >>> The same about tree components. The API is very difficult to comprehend. >>> Component does not work as I expect in dynamic context. But thankfully >>> Sven >>> implemented different implementation that does what is expect and usable >>> as >>> well as DataTable component. I believe forking and fixing the original >>> component would be much more expensive. After that so many people should >>> start complaining about that to convince core team that there is not just >>> one person who is experiencing problems. It is always difficult to >>> accomplish. >> I would like to have some clarification on this. What is so difficult >> about the Wicket Tree API? (apart from the fact that it uses swing >> TreeModel which seem to be too confusing for some people). What does >> "dynamic" context mean? Assuming you have properly implemented >> TreeModel that fires the proper notifications, wicket tree is capable >> for updating itself on ajax request by only transmitting the changed >> part to the clients. How much more dynamic can you get? >> >> For next version we will probably ditch swing TreeModel for something >> simpler but we will still need some kind of modal change notification. >> Wicket tree has many objectives, simplicity is only one of them. >> Having simple tree is nice as long as you don't have to refresh the >> entire thing every time you expand a node or add a node child. >> >> -Matej >>> >>> >>> jthomerson wrote: Why create your own? Submit a patch to fix what you see is wrong with the curre
Re: Twenty Six Wicket Tricks
On Tue, Jul 28, 2009 at 9:58 PM, Vladimir K wrote: > > Matej, > > one of the problems is that when ajax submit happens (by pressing ajax > submit button that resides in a form that resides in a ModalWindow that is > put into another form) it contains no data for the components of enclosing > form but the process of handling the submit handles the eclosing form and > the validation fails or the values become empty. (If I remember all the > details correctly - it was 3 months ago) How can this happen? The submit should only process nested form and leave the outer forms alone. When nested form is submitted there is no reason for validating any component in the outer form. > > Another problem happens when you don't use ajax submit but regular one > instead. If I'm not wrong Wicket can't find components of inner form. Modal Window is an ajax component. Submitting it with regular submit is not supported and it never was. > > In case if some pieces are missed in sandwitch Form>ModalWinwod>Form the > mismatch occurs immediately. > > Having no acces to hardcoded form element makes impossible to enhance > ModalWindow as well as to implement just regular upload submit from within > ModalWindow without patching .js file. If you could fix that (preventing > wicket from making it a div) and make the form configurable it would be > great! Again, modal window doesn't support regular submits (by design) so if you want to do file upload you'll have to use a hidden iframe or some other approach like that. > > Concerning Tree. It is my subjective opinion. It is the API that was > difficult to figure out how to employ to solve my tasks. I find the > difference betwen DataTable and TreeTable APIs to be unnecessary difficulty > to users. At least they are two different things that requires more time to > learn and work with. And if you have a panel where you switch between table > and tree you have to write an abstraction layer. Sven's TableTree just fits > where it should be. I completely added it within 2 hours. TreeTable took 2 > days to learn and employ. Once again, I'm subjective here. It was just my > experience. My idea is that diversity is a good thing when the original > component dont meet our needs makes the development more complicated. TreeTable is slightly problematic because it doesn't use regular table but it builds the layout by css. There was a good reason back then for building it like this but it's not relevant anymore. Apart from that - tree table gets list of IColumns and a TreeModel. How is this complicated? > > I'm aware of CSS positioning model and I have ideas to investigate. Besides > there are a jQuery popup window which example is embedded into enclosing div > and can be freely relocated inside the body. I just looked at jquery dialog example. The dialog is declared in markup but it is then reparented as top level DOM element. Same thing wicket modalwindow does. > > Anyway it is possible to do what the modal.js is doing by Wicket means and > don't have a component tree mismatch with DOM. Is it really? Mind sharing with me how? -Matej > > > Matej Knopp-2 wrote: >> >> On Tue, Jul 28, 2009 at 8:31 PM, Vladimir K wrote: >>> >>> Jeremy, >>> >>> from my perspective ModalWindow is a mix of javascript widget that works >>> in >>> non-wicket mode and an wicket wrapper that bridges js widget with wicket. >>> It >>> is always created at the body level. That's why I said it's a cheat. Thus >>> are problems with form submitting when nested forms are used. >> There is a good reason why the modal window has to be created on body >> level. That's the only reliable way to have element >> with absolute position. If you create the DOM structure deeper you are >> risking that a container has position:relative somewhere which will >> essentially break it. Welcome to the wonderful world of CSS. >> >>> Community >>> introduced a solution (a wrapping form that is threated as the root) to >>> work >>> around the mismatch of ModalWindow structure. There is an issue >>> registered >>> about that. But Matej keeps stating that we should put MW into a form. >>> What >>> says that he is not aware what the problem is. And there are more >>> problems >>> caused by the fact that the element is created by javascript. >> Is it, really? >> >> I've already explained why the DOM structure is created on root level. >> If you have form component inside modal window, chances are that >> wicket will (to support nested forms) render it as div. If this >> happens it is no longer possible to serialize the form when doing an >> ajax submit. That's why the actual modal window markup contains a real >> form. >> >> And this is why it is necessary to put a modal window inside a form if >> you want to have form in modal window. What we should have done is to >> put a wicket form inside the modal window panel itself (just to force >> all forms in modal window content) to be rendered as nested. But for >> some reason i thought that a simple mention in
Re: Twenty Six Wicket Tricks
The following class fixes the problem. It is the evidence of mismatch I'm saying about. public class ModalWindowForm extends Form { public ModalWindowForm(String id) { super(id); } @Override public Form getRootForm() { Form form = super.getRootForm(); if ((findParent(ModalWindow.class) != null) && (form.findParent(ModalWindow.class) == null)) return this; else return form; } } I assume I don't understand something. But anyway I expect following the least surprise rule. Matej Knopp-2 wrote: > > On Tue, Jul 28, 2009 at 8:31 PM, Vladimir K wrote: >> >> Jeremy, >> >> from my perspective ModalWindow is a mix of javascript widget that works >> in >> non-wicket mode and an wicket wrapper that bridges js widget with wicket. >> It >> is always created at the body level. That's why I said it's a cheat. Thus >> are problems with form submitting when nested forms are used. > There is a good reason why the modal window has to be created on body > level. That's the only reliable way to have element > with absolute position. If you create the DOM structure deeper you are > risking that a container has position:relative somewhere which will > essentially break it. Welcome to the wonderful world of CSS. > >> Community >> introduced a solution (a wrapping form that is threated as the root) to >> work >> around the mismatch of ModalWindow structure. There is an issue >> registered >> about that. But Matej keeps stating that we should put MW into a form. >> What >> says that he is not aware what the problem is. And there are more >> problems >> caused by the fact that the element is created by javascript. > Is it, really? > > I've already explained why the DOM structure is created on root level. > If you have form component inside modal window, chances are that > wicket will (to support nested forms) render it as div. If this > happens it is no longer possible to serialize the form when doing an > ajax submit. That's why the actual modal window markup contains a real > form. > > And this is why it is necessary to put a modal window inside a form if > you want to have form in modal window. What we should have done is to > put a wicket form inside the modal window panel itself (just to force > all forms in modal window content) to be rendered as nested. But for > some reason i thought that a simple mention in javadoc about putting > modal window to form would be sufficient. My bad. > >> >> From the other hand I believe it is possible to write pure Wicket >> component >> that would be as trice as simpler and won't suffer with problems with >> request lifecycle. Probably I'm wrong and it is not worth turning the old >> ModalWindow into pure Wicket component due to expensiveness of the effort >> that would be spent to remain it compatible. > Would you mind specifying the actual problems with "request > lifecycle"? And how exactly would a "pure wicket modal window" look > like? No javascript? >> >> The same about tree components. The API is very difficult to comprehend. >> Component does not work as I expect in dynamic context. But thankfully >> Sven >> implemented different implementation that does what is expect and usable >> as >> well as DataTable component. I believe forking and fixing the original >> component would be much more expensive. After that so many people should >> start complaining about that to convince core team that there is not just >> one person who is experiencing problems. It is always difficult to >> accomplish. > I would like to have some clarification on this. What is so difficult > about the Wicket Tree API? (apart from the fact that it uses swing > TreeModel which seem to be too confusing for some people). What does > "dynamic" context mean? Assuming you have properly implemented > TreeModel that fires the proper notifications, wicket tree is capable > for updating itself on ajax request by only transmitting the changed > part to the clients. How much more dynamic can you get? > > For next version we will probably ditch swing TreeModel for something > simpler but we will still need some kind of modal change notification. > Wicket tree has many objectives, simplicity is only one of them. > Having simple tree is nice as long as you don't have to refresh the > entire thing every time you expand a node or add a node child. > > -Matej >> >> >> jthomerson wrote: >>> >>> Why create your own? Submit a patch to fix what you see is wrong with >>> the current one. Everyone wins. >>> >>> -- >>> Jeremy Thomerson >>> http://www.wickettraining.com >>> >>> >>> >>> >>> On Tue, Jul 28, 2009 at 12:20 PM, Vladimir K wrote: ModalWindow (being a wicket cheat :) ) deserves a sole book of tricks. I'll definitely author my own modal window unless someone fixes the original one. -1 on including ModalWindow to the book. >>>
Re: Twenty Six Wicket Tricks
Matej, one of the problems is that when ajax submit happens (by pressing ajax submit button that resides in a form that resides in a ModalWindow that is put into another form) it contains no data for the components of enclosing form but the process of handling the submit handles the eclosing form and the validation fails or the values become empty. (If I remember all the details correctly - it was 3 months ago) Another problem happens when you don't use ajax submit but regular one instead. If I'm not wrong Wicket can't find components of inner form. In case if some pieces are missed in sandwitch Form>ModalWinwod>Form the mismatch occurs immediately. Having no acces to hardcoded form element makes impossible to enhance ModalWindow as well as to implement just regular upload submit from within ModalWindow without patching .js file. If you could fix that (preventing wicket from making it a div) and make the form configurable it would be great! Concerning Tree. It is my subjective opinion. It is the API that was difficult to figure out how to employ to solve my tasks. I find the difference betwen DataTable and TreeTable APIs to be unnecessary difficulty to users. At least they are two different things that requires more time to learn and work with. And if you have a panel where you switch between table and tree you have to write an abstraction layer. Sven's TableTree just fits where it should be. I completely added it within 2 hours. TreeTable took 2 days to learn and employ. Once again, I'm subjective here. It was just my experience. My idea is that diversity is a good thing when the original component dont meet our needs makes the development more complicated. I'm aware of CSS positioning model and I have ideas to investigate. Besides there are a jQuery popup window which example is embedded into enclosing div and can be freely relocated inside the body. Anyway it is possible to do what the modal.js is doing by Wicket means and don't have a component tree mismatch with DOM. Matej Knopp-2 wrote: > > On Tue, Jul 28, 2009 at 8:31 PM, Vladimir K wrote: >> >> Jeremy, >> >> from my perspective ModalWindow is a mix of javascript widget that works >> in >> non-wicket mode and an wicket wrapper that bridges js widget with wicket. >> It >> is always created at the body level. That's why I said it's a cheat. Thus >> are problems with form submitting when nested forms are used. > There is a good reason why the modal window has to be created on body > level. That's the only reliable way to have element > with absolute position. If you create the DOM structure deeper you are > risking that a container has position:relative somewhere which will > essentially break it. Welcome to the wonderful world of CSS. > >> Community >> introduced a solution (a wrapping form that is threated as the root) to >> work >> around the mismatch of ModalWindow structure. There is an issue >> registered >> about that. But Matej keeps stating that we should put MW into a form. >> What >> says that he is not aware what the problem is. And there are more >> problems >> caused by the fact that the element is created by javascript. > Is it, really? > > I've already explained why the DOM structure is created on root level. > If you have form component inside modal window, chances are that > wicket will (to support nested forms) render it as div. If this > happens it is no longer possible to serialize the form when doing an > ajax submit. That's why the actual modal window markup contains a real > form. > > And this is why it is necessary to put a modal window inside a form if > you want to have form in modal window. What we should have done is to > put a wicket form inside the modal window panel itself (just to force > all forms in modal window content) to be rendered as nested. But for > some reason i thought that a simple mention in javadoc about putting > modal window to form would be sufficient. My bad. > >> >> From the other hand I believe it is possible to write pure Wicket >> component >> that would be as trice as simpler and won't suffer with problems with >> request lifecycle. Probably I'm wrong and it is not worth turning the old >> ModalWindow into pure Wicket component due to expensiveness of the effort >> that would be spent to remain it compatible. > Would you mind specifying the actual problems with "request > lifecycle"? And how exactly would a "pure wicket modal window" look > like? No javascript? >> >> The same about tree components. The API is very difficult to comprehend. >> Component does not work as I expect in dynamic context. But thankfully >> Sven >> implemented different implementation that does what is expect and usable >> as >> well as DataTable component. I believe forking and fixing the original >> component would be much more expensive. After that so many people should >> start complaining about that to convince core team that there is not just >> one person who is experiencing problems. It is always dif
Re: Tree and TabbedPanel components
Yes I understand this is a refresh problem. 1. By repainting I am assuming you mean that the right panel should invoke the setOutputMarkupId. With this parameter set, the repainting is taken care of by Ajaxified component. Please inform if you have different view. 2. If I have invalid markups, what would be the efficient way of debugging and pin-pointing the problem. I really appreciate your prompt answers. Please bear with me for the time being. Raj igor.vaynberg wrote: > > sounds like you are either not repainting the right component, or you > have invalid markup and the browser is puking on replacing the dom. > > -igor > > > On Tue, Jul 28, 2009 at 11:02 AM, rajkaushik wrote: >> >> Yes Igor, >> >> I am using the Ajax. Here is my partial code. Please suggest me the >> possible >> misses - Raj >> >> >> protected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode node) >> ... >> Panel panelOnClick = new DetailTabbedPanel("detailPanel", >> defNode); >> panelOnClick.setOutputMarkupId(true); >> this.detailPanel.replaceWith(panelOnClick); >> this.detailPanel = panelOnClick; >> target.addComponent(panelOnClick); >> >> >> } >> >> >> - >> public class DetailTabbedPanel extends Panel { >> >> >> private JMXMutableTreeNode nodeDef; >> private AjaxTabbedPanel ajaxTabbedPanel; >> >> >> public DetailTabbedPanel(String id, JMXMutableTreeNode nodeDef) { >> super(id); >> this.nodeDef = nodeDef; >> getTabbedPanel("detailTabbedPanel"); >> } >> >> public void getTabbedPanel(String tabbedId) { >> >> List tabs=new ArrayList(); >> >> /* tabs.add(new AbstractTab(new >> StringResourceModel("tab.conprops", >> DetailTabbedPanel.this, null)){ >> **//** >> * >> *//* >> private static final long serialVersionUID = 1L; >> >> public Panel getPanel(String panelId){ >> >> if(nodeDef.getUserObject() instanceof >> ObjectInstanceNodeInfo){ >> return new >> SMBeanTabConnectionPanel(panelId, nodeDef); >> } else { >> return new >> SMTabConnectionPanel(panelId, nodeDef); >> } >> //return new EmptyPanel(panelId); >> } >> });*/ >> >> tabs.add(new PanelCachingTab(new AbstractTab(new >> StringResourceModel("tab.smprops", DetailTabbedPanel.this, null)){ >> /** >> * >> */ >> private static final long serialVersionUID = 1L; >> >> public Panel getPanel(String panelId) >> { >> SMTabSMPanel panel1 = new >> SMTabSMPanel(panelId, nodeDef); >> panel1.setOutputMarkupId(true); >> return panel1; >> >> } >> })); >> >> tabs.add(new PanelCachingTab(new AbstractTab(new >> StringResourceModel("tab.mobiprops", DetailTabbedPanel.this, null)){ >> /** >> * >> */ >> private static final long serialVersionUID = 1L; >> >> public Panel getPanel(String panelId) >> { >> SMTabMobiPanel panel2 = new >> SMTabMobiPanel(panelId, nodeDef); >> panel2.setOutputMarkupId(true); >> return panel2; >> >> } >> })); >> >> >> tabs.add(new PanelCachingTab(new AbstractTab(new >> StringResourceModel("tab.vcprops", DetailTabbedPanel.this, null)){ >> /** >> * >> */ >> private static final long serialVersionUID = 1L; >> >> public Panel getPanel(String panelId) >> { >> SMTabVCPanel panel3 = new >> SMTabVCPanel(panelId, nodeDef); >> panel3.setOutputMarkupId(true); >> return panel3; >> >> } >> })); >> >> tabs.add(new PanelCachingTab(new AbstractTab(new >> StringResourceModel("tab.poolprops", DetailTabbedPanel.this, null)) { >> /** >> * >> */ >> private static final long serialVersionUID = 1L; >> >> public Panel getPanel(String panelId) >> { >> SMTabPoolPanel panel4 = new >> SMTabPoolPanel(panelId, nodeDef); >> panel4.setOutputMarkupId(true); >> return panel4; >> } >>
Re: DZone Refcard - "Getting Started with Apache Wicket"
I agree. Thanks, much appreciated! On Tue, Jul 28, 2009 at 4:34 AM, Anton Veretennikov wrote: > Congratulations! Nice work! > > -- Tony > > On Tue, Jul 28, 2009 at 12:32 AM, Andrew > Lombardi wrote: >> DZone launched a Refcard about Apache Wicket here - http://dzone.it/yml >> >> A quick description from the website: >> >> Among the dizzying number of Web frameworks available today, Wicket’s simple >> and intuitive approach to Web development has led it to become a favorite >> among many Java developers. This Refcard brings you quickly up to speed on >> some of the key features of Apache Wicket 1.3, showing you how to configure >> the framework, define your domain model, create standard Wicket components >> and add internationalization options. >> >> Enjoy! >> >> >> To our success! >> >> Mystic Coders, LLC | Code Magic | www.mysticcoders.com >> >> ANDREW LOMBARDI | and...@mysticcoders.com >> 2321 E 4th St. Ste C-128, Santa Ana CA 92705 >> ofc: 949-528-6480 >> fax: 714-782-6024 >> cell: 714-697-8046 >> linked-in: http://www.linkedin.com/in/andrewlombardi >> twitter: http://www.twitter.com/kinabalu >> >> Eco-Tip: Printing e-mails is usually a waste. >> >> >> This message is for the named person's use only. You must not, directly or >> indirectly, use, >> disclose, distribute, print, or copy any part of this message if you are >> not the intended recipient. >> >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Twenty Six Wicket Tricks
On Tue, Jul 28, 2009 at 8:31 PM, Vladimir K wrote: > > Jeremy, > > from my perspective ModalWindow is a mix of javascript widget that works in > non-wicket mode and an wicket wrapper that bridges js widget with wicket. It > is always created at the body level. That's why I said it's a cheat. Thus > are problems with form submitting when nested forms are used. There is a good reason why the modal window has to be created on body level. That's the only reliable way to have element with absolute position. If you create the DOM structure deeper you are risking that a container has position:relative somewhere which will essentially break it. Welcome to the wonderful world of CSS. > Community > introduced a solution (a wrapping form that is threated as the root) to work > around the mismatch of ModalWindow structure. There is an issue registered > about that. But Matej keeps stating that we should put MW into a form. What > says that he is not aware what the problem is. And there are more problems > caused by the fact that the element is created by javascript. Is it, really? I've already explained why the DOM structure is created on root level. If you have form component inside modal window, chances are that wicket will (to support nested forms) render it as div. If this happens it is no longer possible to serialize the form when doing an ajax submit. That's why the actual modal window markup contains a real form. And this is why it is necessary to put a modal window inside a form if you want to have form in modal window. What we should have done is to put a wicket form inside the modal window panel itself (just to force all forms in modal window content) to be rendered as nested. But for some reason i thought that a simple mention in javadoc about putting modal window to form would be sufficient. My bad. > > From the other hand I believe it is possible to write pure Wicket component > that would be as trice as simpler and won't suffer with problems with > request lifecycle. Probably I'm wrong and it is not worth turning the old > ModalWindow into pure Wicket component due to expensiveness of the effort > that would be spent to remain it compatible. Would you mind specifying the actual problems with "request lifecycle"? And how exactly would a "pure wicket modal window" look like? No javascript? > > The same about tree components. The API is very difficult to comprehend. > Component does not work as I expect in dynamic context. But thankfully Sven > implemented different implementation that does what is expect and usable as > well as DataTable component. I believe forking and fixing the original > component would be much more expensive. After that so many people should > start complaining about that to convince core team that there is not just > one person who is experiencing problems. It is always difficult to > accomplish. I would like to have some clarification on this. What is so difficult about the Wicket Tree API? (apart from the fact that it uses swing TreeModel which seem to be too confusing for some people). What does "dynamic" context mean? Assuming you have properly implemented TreeModel that fires the proper notifications, wicket tree is capable for updating itself on ajax request by only transmitting the changed part to the clients. How much more dynamic can you get? For next version we will probably ditch swing TreeModel for something simpler but we will still need some kind of modal change notification. Wicket tree has many objectives, simplicity is only one of them. Having simple tree is nice as long as you don't have to refresh the entire thing every time you expand a node or add a node child. -Matej > > > jthomerson wrote: >> >> Why create your own? Submit a patch to fix what you see is wrong with >> the current one. Everyone wins. >> >> -- >> Jeremy Thomerson >> http://www.wickettraining.com >> >> >> >> >> On Tue, Jul 28, 2009 at 12:20 PM, Vladimir K wrote: >>> >>> ModalWindow (being a wicket cheat :) ) deserves a sole book of tricks. >>> I'll >>> definitely author my own modal window unless someone fixes the original >>> one. >>> -1 on including ModalWindow to the book. >>> >>> >>> egolan74 wrote: I can't wait for yet another great Wicket book. I will surly buy it. regarding tricks, using Modal window can be nice. Integrating Wicket with JS libs (If it's not a topic for a small book by itself). Cool stuff with Ajax. Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary On Tue, Dec 30, 2008 at 10:32 AM, Jonathan Locke wrote: > > Well, over the break here I've started something I swore I would never > do > again (well, two things, if you include the JavaOne talk I'm working > on). > I'm writing a (hopefully re
Re: reuseitems problems
trying to undertand what is happening in your case. When the page is serialized the steam contains the whole graph, including the ListView and it's items and the page default model and the ListView items models. When the page is deserialized, the whole graph is restored including page, its model, items and their models. My understanding is that in your case the items models are the old ones that was in the previous version of the page, how could it be? Or I didn't get what you were saying. MartinM wrote: > > Or session store.. anyways, that's not relevant. The important fact is > that the copies are different. > > ** > Martin > > 2009/7/28 Martin Makundi : >>> why do you get Page instance 2 on page refresh? >> >> Wicket always deserializes page state from diskstore.. so it is a copy. >> >> ** >> Martin >> >>> >>> >>> MartinM wrote: > please describe the context. I don >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/reuseitems-problems-tp24702133p24705851.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: reuseitems problems
Or session store.. anyways, that's not relevant. The important fact is that the copies are different. ** Martin 2009/7/28 Martin Makundi : >> why do you get Page instance 2 on page refresh? > > Wicket always deserializes page state from diskstore.. so it is a copy. > > ** > Martin > >> >> >> MartinM wrote: >>> please describe the context. I don > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: reuseitems problems
> why do you get Page instance 2 on page refresh? Wicket always deserializes page state from diskstore.. so it is a copy. ** Martin > > > MartinM wrote: >> >>> please describe the context. I don - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: reuseitems problems
Martin, why do you get Page instance 2 on page refresh? MartinM wrote: > >> please describe the context. I don't see how the process of serialization >> makes the instance of the object obsolete. > > 1. Page instantiation. Page instance 1 {manipulating target data 1}, > formComponent instance 1->target data instance 1. > 2. Ajax request or similar onto page. > 3. Page refresh (deserialized from diskstore). Page instance 2 > {manipulating target data instance 2}, reused formComponent instance > 1->target data instance 1. > > So in stage 3 the page is manipulating target data instance 2 while > the reused form components still manipulate target data instance 1. > > What this means? It means that for example if you Submit form, the > values will be updated onto target data 1. The mistake is that if your > Page instance 2 handles saving procedure, it will save the target data > {2} which does not receive the form submit. > > This might work differently with detached models. I do not bother with > detached models on lightweight models. > > ** > Martin > >> >> MartinM wrote: >>> >>> Hi! >>> >>> I am having trouble with listView.setReuseitems(true). >>> >>> My problem is that >>> 1. on first request the listview creates form components. >>> 2. on second (or third ...) request the listView reuses the form >>> components. >>> 3. however, the propertymodels attached to the formcomponents at 1 are >>> no longer viable, because their target objects are only the orignal >>> serialization copies. In state 2 or 3 the form components now update >>> totally obsolete instances of the target objects . >>> >>> A better strategy would probably be to just copy the rawInput states >>> of the formComponents instead of really reusing the components. >>> >>> Comments, anybody? Did I misunderstand something? I have been >>> debugging this for 6 hours now, maybe my brain melted down already. .. >>> >>> ** >>> Martin >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> >> >> -- >> View this message in context: >> http://www.nabble.com/reuseitems-problems-tp24702133p24704253.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/reuseitems-problems-tp24702133p24705518.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Twenty Six Wicket Tricks
well thought out answer. thanks. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Jul 28, 2009 at 1:31 PM, Vladimir K wrote: > > Jeremy, > > from my perspective ModalWindow is a mix of javascript widget that works in > non-wicket mode and an wicket wrapper that bridges js widget with wicket. It > is always created at the body level. That's why I said it's a cheat. Thus > are problems with form submitting when nested forms are used. Community > introduced a solution (a wrapping form that is threated as the root) to work > around the mismatch of ModalWindow structure. There is an issue registered > about that. But Matej keeps stating that we should put MW into a form. What > says that he is not aware what the problem is. And there are more problems > caused by the fact that the element is created by javascript. > > From the other hand I believe it is possible to write pure Wicket component > that would be as trice as simpler and won't suffer with problems with > request lifecycle. Probably I'm wrong and it is not worth turning the old > ModalWindow into pure Wicket component due to expensiveness of the effort > that would be spent to remain it compatible. > > The same about tree components. The API is very difficult to comprehend. > Component does not work as I expect in dynamic context. But thankfully Sven > implemented different implementation that does what is expect and usable as > well as DataTable component. I believe forking and fixing the original > component would be much more expensive. After that so many people should > start complaining about that to convince core team that there is not just > one person who is experiencing problems. It is always difficult to > accomplish. > > > jthomerson wrote: >> >> Why create your own? Submit a patch to fix what you see is wrong with >> the current one. Everyone wins. >> >> -- >> Jeremy Thomerson >> http://www.wickettraining.com >> >> >> >> >> On Tue, Jul 28, 2009 at 12:20 PM, Vladimir K wrote: >>> >>> ModalWindow (being a wicket cheat :) ) deserves a sole book of tricks. >>> I'll >>> definitely author my own modal window unless someone fixes the original >>> one. >>> -1 on including ModalWindow to the book. >>> >>> >>> egolan74 wrote: I can't wait for yet another great Wicket book. I will surly buy it. regarding tricks, using Modal window can be nice. Integrating Wicket with JS libs (If it's not a topic for a small book by itself). Cool stuff with Ajax. Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary On Tue, Dec 30, 2008 at 10:32 AM, Jonathan Locke wrote: > > Well, over the break here I've started something I swore I would never > do > again (well, two things, if you include the JavaOne talk I'm working > on). > I'm writing a (hopefully relatively short) book. It's called > "Twenty-Six > Wicket Tricks". Each trick in the book (lettered from A-Z) demonstrates > something that people typically want to do and in the process builds a > reusable and educational component. I've got 13 tricks coded up now and > ideas for a handful more, but if there are any requests out there, > please > let me know. I'd also be interested in getting some idea how many > people > would be interested in this book (would provide some fuel for me to get > it > done). It does not cover any of the same ground as Wicket in Action > (which > you should buy if you have not already!), BTW. It's more of a companion > to > that book. > > Happy Holidays! > > Best, > > Jonathan > > > -- > View this message in context: > http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p21214357.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - Eyal Golan egola...@gmail.com Visit: JVDrums LinkedIn: LinkedIn >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24704037.html >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wi
Re: Twenty Six Wicket Tricks
Jeremy, from my perspective ModalWindow is a mix of javascript widget that works in non-wicket mode and an wicket wrapper that bridges js widget with wicket. It is always created at the body level. That's why I said it's a cheat. Thus are problems with form submitting when nested forms are used. Community introduced a solution (a wrapping form that is threated as the root) to work around the mismatch of ModalWindow structure. There is an issue registered about that. But Matej keeps stating that we should put MW into a form. What says that he is not aware what the problem is. And there are more problems caused by the fact that the element is created by javascript. >From the other hand I believe it is possible to write pure Wicket component that would be as trice as simpler and won't suffer with problems with request lifecycle. Probably I'm wrong and it is not worth turning the old ModalWindow into pure Wicket component due to expensiveness of the effort that would be spent to remain it compatible. The same about tree components. The API is very difficult to comprehend. Component does not work as I expect in dynamic context. But thankfully Sven implemented different implementation that does what is expect and usable as well as DataTable component. I believe forking and fixing the original component would be much more expensive. After that so many people should start complaining about that to convince core team that there is not just one person who is experiencing problems. It is always difficult to accomplish. jthomerson wrote: > > Why create your own? Submit a patch to fix what you see is wrong with > the current one. Everyone wins. > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > > On Tue, Jul 28, 2009 at 12:20 PM, Vladimir K wrote: >> >> ModalWindow (being a wicket cheat :) ) deserves a sole book of tricks. >> I'll >> definitely author my own modal window unless someone fixes the original >> one. >> -1 on including ModalWindow to the book. >> >> >> egolan74 wrote: >>> >>> I can't wait for yet another great Wicket book. >>> I will surly buy it. >>> >>> regarding tricks, >>> using Modal window can be nice. >>> Integrating Wicket with JS libs (If it's not a topic for a small book by >>> itself). >>> Cool stuff with Ajax. >>> >>> >>> Eyal Golan >>> egola...@gmail.com >>> >>> Visit: http://jvdrums.sourceforge.net/ >>> LinkedIn: http://www.linkedin.com/in/egolan74 >>> >>> P Save a tree. Please don't print this e-mail unless it's really >>> necessary >>> >>> >>> On Tue, Dec 30, 2008 at 10:32 AM, Jonathan Locke >>> wrote: >>> Well, over the break here I've started something I swore I would never do again (well, two things, if you include the JavaOne talk I'm working on). I'm writing a (hopefully relatively short) book. It's called "Twenty-Six Wicket Tricks". Each trick in the book (lettered from A-Z) demonstrates something that people typically want to do and in the process builds a reusable and educational component. I've got 13 tricks coded up now and ideas for a handful more, but if there are any requests out there, please let me know. I'd also be interested in getting some idea how many people would be interested in this book (would provide some fuel for me to get it done). It does not cover any of the same ground as Wicket in Action (which you should buy if you have not already!), BTW. It's more of a companion to that book. Happy Holidays! Best, Jonathan -- View this message in context: http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p21214357.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> - >>> Eyal Golan >>> egola...@gmail.com >>> >>> Visit: JVDrums >>> LinkedIn: LinkedIn >>> >> >> -- >> View this message in context: >> http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24704037.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24705381.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: use
Re: Tree and TabbedPanel components
sounds like you are either not repainting the right component, or you have invalid markup and the browser is puking on replacing the dom. -igor On Tue, Jul 28, 2009 at 11:02 AM, rajkaushik wrote: > > Yes Igor, > > I am using the Ajax. Here is my partial code. Please suggest me the possible > misses - Raj > > > protected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode node) > ... > Panel panelOnClick = new DetailTabbedPanel("detailPanel", defNode); > panelOnClick.setOutputMarkupId(true); > this.detailPanel.replaceWith(panelOnClick); > this.detailPanel = panelOnClick; > target.addComponent(panelOnClick); > > > } > > > - > public class DetailTabbedPanel extends Panel { > > > private JMXMutableTreeNode nodeDef; > private AjaxTabbedPanel ajaxTabbedPanel; > > > public DetailTabbedPanel(String id, JMXMutableTreeNode nodeDef) { > super(id); > this.nodeDef = nodeDef; > getTabbedPanel("detailTabbedPanel"); > } > > public void getTabbedPanel(String tabbedId) { > > List tabs=new ArrayList(); > > /* tabs.add(new AbstractTab(new StringResourceModel("tab.conprops", > DetailTabbedPanel.this, null)){ > **//** > * > *//* > private static final long serialVersionUID = 1L; > > public Panel getPanel(String panelId){ > > if(nodeDef.getUserObject() instanceof > ObjectInstanceNodeInfo){ > return new > SMBeanTabConnectionPanel(panelId, nodeDef); > } else { > return new > SMTabConnectionPanel(panelId, nodeDef); > } > //return new EmptyPanel(panelId); > } > });*/ > > tabs.add(new PanelCachingTab(new AbstractTab(new > StringResourceModel("tab.smprops", DetailTabbedPanel.this, null)){ > /** > * > */ > private static final long serialVersionUID = 1L; > > public Panel getPanel(String panelId) > { > SMTabSMPanel panel1 = new > SMTabSMPanel(panelId, nodeDef); > panel1.setOutputMarkupId(true); > return panel1; > > } > })); > > tabs.add(new PanelCachingTab(new AbstractTab(new > StringResourceModel("tab.mobiprops", DetailTabbedPanel.this, null)){ > /** > * > */ > private static final long serialVersionUID = 1L; > > public Panel getPanel(String panelId) > { > SMTabMobiPanel panel2 = new > SMTabMobiPanel(panelId, nodeDef); > panel2.setOutputMarkupId(true); > return panel2; > > } > })); > > > tabs.add(new PanelCachingTab(new AbstractTab(new > StringResourceModel("tab.vcprops", DetailTabbedPanel.this, null)){ > /** > * > */ > private static final long serialVersionUID = 1L; > > public Panel getPanel(String panelId) > { > SMTabVCPanel panel3 = new > SMTabVCPanel(panelId, nodeDef); > panel3.setOutputMarkupId(true); > return panel3; > > } > })); > > tabs.add(new PanelCachingTab(new AbstractTab(new > StringResourceModel("tab.poolprops", DetailTabbedPanel.this, null)) { > /** > * > */ > private static final long serialVersionUID = 1L; > > public Panel getPanel(String panelId) > { > SMTabPoolPanel panel4 = new > SMTabPoolPanel(panelId, nodeDef); > panel4.setOutputMarkupId(true); > return panel4; > } > })); > > tabs.add(new PanelCachingTab(new AbstractTab(new > StringResourceModel("tab.nicprops", DetailTabbedPanel.this, null)) { > /** > * > */ > private static final long serialVersionUID = 1L; > > public Panel getPanel(String panelId) { > > SMTabNicPanel panel5 = new > SMTabNicPanel(panelId, nodeDef); > panel5.setOutputMarkupId(true); > return panel5; > } > })); > > aja
Re: Tree and TabbedPanel components
Yes Igor, I am using the Ajax. Here is my partial code. Please suggest me the possible misses - Raj protected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode node) ... Panel panelOnClick = new DetailTabbedPanel("detailPanel", defNode); panelOnClick.setOutputMarkupId(true); this.detailPanel.replaceWith(panelOnClick); this.detailPanel = panelOnClick; target.addComponent(panelOnClick); } - public class DetailTabbedPanel extends Panel { private JMXMutableTreeNode nodeDef; private AjaxTabbedPanel ajaxTabbedPanel; public DetailTabbedPanel(String id, JMXMutableTreeNode nodeDef) { super(id); this.nodeDef = nodeDef; getTabbedPanel("detailTabbedPanel"); } public void getTabbedPanel(String tabbedId) { List tabs=new ArrayList(); /* tabs.add(new AbstractTab(new StringResourceModel("tab.conprops", DetailTabbedPanel.this, null)){ **//** * *//* private static final long serialVersionUID = 1L; public Panel getPanel(String panelId){ if(nodeDef.getUserObject() instanceof ObjectInstanceNodeInfo){ return new SMBeanTabConnectionPanel(panelId, nodeDef); } else { return new SMTabConnectionPanel(panelId, nodeDef); } //return new EmptyPanel(panelId); } });*/ tabs.add(new PanelCachingTab(new AbstractTab(new StringResourceModel("tab.smprops", DetailTabbedPanel.this, null)){ /** * */ private static final long serialVersionUID = 1L; public Panel getPanel(String panelId) { SMTabSMPanel panel1 = new SMTabSMPanel(panelId, nodeDef); panel1.setOutputMarkupId(true); return panel1; } })); tabs.add(new PanelCachingTab(new AbstractTab(new StringResourceModel("tab.mobiprops", DetailTabbedPanel.this, null)){ /** * */ private static final long serialVersionUID = 1L; public Panel getPanel(String panelId) { SMTabMobiPanel panel2 = new SMTabMobiPanel(panelId, nodeDef); panel2.setOutputMarkupId(true); return panel2; } })); tabs.add(new PanelCachingTab(new AbstractTab(new StringResourceModel("tab.vcprops", DetailTabbedPanel.this, null)){ /** * */ private static final long serialVersionUID = 1L; public Panel getPanel(String panelId) { SMTabVCPanel panel3 = new SMTabVCPanel(panelId, nodeDef); panel3.setOutputMarkupId(true); return panel3; } })); tabs.add(new PanelCachingTab(new AbstractTab(new StringResourceModel("tab.poolprops", DetailTabbedPanel.this, null)) { /** * */ private static final long serialVersionUID = 1L; public Panel getPanel(String panelId) { SMTabPoolPanel panel4 = new SMTabPoolPanel(panelId, nodeDef); panel4.setOutputMarkupId(true); return panel4; } })); tabs.add(new PanelCachingTab(new AbstractTab(new StringResourceModel("tab.nicprops", DetailTabbedPanel.this, null)) { /** * */ private static final long serialVersionUID = 1L; public Panel getPanel(String panelId) { SMTabNicPanel panel5 = new SMTabNicPanel(panelId, nodeDef); panel5.setOutputMarkupId(true); return panel5; } })); ajaxTabbedPanel = new AjaxTabbedPa
Re: reuseitems problems
> please describe the context. I don't see how the process of serialization > makes the instance of the object obsolete. 1. Page instantiation. Page instance 1 {manipulating target data 1}, formComponent instance 1->target data instance 1. 2. Ajax request or similar onto page. 3. Page refresh (deserialized from diskstore). Page instance 2 {manipulating target data instance 2}, reused formComponent instance 1->target data instance 1. So in stage 3 the page is manipulating target data instance 2 while the reused form components still manipulate target data instance 1. What this means? It means that for example if you Submit form, the values will be updated onto target data 1. The mistake is that if your Page instance 2 handles saving procedure, it will save the target data {2} which does not receive the form submit. This might work differently with detached models. I do not bother with detached models on lightweight models. ** Martin > > MartinM wrote: >> >> Hi! >> >> I am having trouble with listView.setReuseitems(true). >> >> My problem is that >> 1. on first request the listview creates form components. >> 2. on second (or third ...) request the listView reuses the form >> components. >> 3. however, the propertymodels attached to the formcomponents at 1 are >> no longer viable, because their target objects are only the orignal >> serialization copies. In state 2 or 3 the form components now update >> totally obsolete instances of the target objects . >> >> A better strategy would probably be to just copy the rawInput states >> of the formComponents instead of really reusing the components. >> >> Comments, anybody? Did I misunderstand something? I have been >> debugging this for 6 hours now, maybe my brain melted down already. .. >> >> ** >> Martin >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > -- > View this message in context: > http://www.nabble.com/reuseitems-problems-tp24702133p24704253.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Disable LinkTree iconLink
I have a LinkTree wherein I need to disable the links on certain nodes. It was easy to disable the contentLink but I haven't been able to figure out how to disable the iconLink. My links are BookmarkablePageLinks, but iconLink is not a proper link; rather it appears that it's a element with an onclick handler, that contains an element that has no surrounding anchor or onclick handlers. While nothing happens on my disabled icons when you click the mouse, the mouse still transforms into a link mouse (a hand instead of a pointer), and I'd like to prevent that. Short of cheating and tweaking the style to set the pointer, I don't know how to really disable the thing. Any ideas?
RE: Thanks Wicket-Team!
Wow Only four months? How many developers? I'm very impressed :) Fantastic work Best regards -Mensaje original- De: Oliver Krohne [mailto:okro...@yahoo.de] Enviado el: martes, 28 de julio de 2009 13:02 Para: users@wicket.apache.org Asunto: Thanks Wicket-Team! Hi, Many thanks to the Wicket-Team for the great Framework and of course for the support I have received from the mailinglist. I started with zero-Wicket knowledge and now 4 month later we have launched a new community website: http://fytch.com It is based on Wicket, Spring, OpenJPA, Lucene, PostgreSQL. I would be glad if you try out Fytch and of course any feedback is welcome. Should I put Fytch on the wiki "Sites using Wicket"? Thanks for the fabulous Wicket, Oliver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: reuseitems problems
Martin, please describe the context. I don't see how the process of serialization makes the instance of the object obsolete. In my practice I use a detachable model when rendering View page and I use a static model when rendering an Edit page. In onSubmit method I save the model object and forward the user to the View page. MartinM wrote: > > Hi! > > I am having trouble with listView.setReuseitems(true). > > My problem is that > 1. on first request the listview creates form components. > 2. on second (or third ...) request the listView reuses the form > components. > 3. however, the propertymodels attached to the formcomponents at 1 are > no longer viable, because their target objects are only the orignal > serialization copies. In state 2 or 3 the form components now update > totally obsolete instances of the target objects . > > A better strategy would probably be to just copy the rawInput states > of the formComponents instead of really reusing the components. > > Comments, anybody? Did I misunderstand something? I have been > debugging this for 6 hours now, maybe my brain melted down already. .. > > ** > Martin > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/reuseitems-problems-tp24702133p24704253.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Twenty Six Wicket Tricks
Why create your own? Submit a patch to fix what you see is wrong with the current one. Everyone wins. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Jul 28, 2009 at 12:20 PM, Vladimir K wrote: > > ModalWindow (being a wicket cheat :) ) deserves a sole book of tricks. I'll > definitely author my own modal window unless someone fixes the original one. > -1 on including ModalWindow to the book. > > > egolan74 wrote: >> >> I can't wait for yet another great Wicket book. >> I will surly buy it. >> >> regarding tricks, >> using Modal window can be nice. >> Integrating Wicket with JS libs (If it's not a topic for a small book by >> itself). >> Cool stuff with Ajax. >> >> >> Eyal Golan >> egola...@gmail.com >> >> Visit: http://jvdrums.sourceforge.net/ >> LinkedIn: http://www.linkedin.com/in/egolan74 >> >> P Save a tree. Please don't print this e-mail unless it's really >> necessary >> >> >> On Tue, Dec 30, 2008 at 10:32 AM, Jonathan Locke >> wrote: >> >>> >>> Well, over the break here I've started something I swore I would never do >>> again (well, two things, if you include the JavaOne talk I'm working on). >>> I'm writing a (hopefully relatively short) book. It's called "Twenty-Six >>> Wicket Tricks". Each trick in the book (lettered from A-Z) demonstrates >>> something that people typically want to do and in the process builds a >>> reusable and educational component. I've got 13 tricks coded up now and >>> ideas for a handful more, but if there are any requests out there, please >>> let me know. I'd also be interested in getting some idea how many people >>> would be interested in this book (would provide some fuel for me to get >>> it >>> done). It does not cover any of the same ground as Wicket in Action >>> (which >>> you should buy if you have not already!), BTW. It's more of a companion >>> to >>> that book. >>> >>> Happy Holidays! >>> >>> Best, >>> >>> Jonathan >>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p21214357.html >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> >> - >> Eyal Golan >> egola...@gmail.com >> >> Visit: JVDrums >> LinkedIn: LinkedIn >> > > -- > View this message in context: > http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24704037.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Twenty Six Wicket Tricks
ModalWindow (being a wicket cheat :) ) deserves a sole book of tricks. I'll definitely author my own modal window unless someone fixes the original one. -1 on including ModalWindow to the book. egolan74 wrote: > > I can't wait for yet another great Wicket book. > I will surly buy it. > > regarding tricks, > using Modal window can be nice. > Integrating Wicket with JS libs (If it's not a topic for a small book by > itself). > Cool stuff with Ajax. > > > Eyal Golan > egola...@gmail.com > > Visit: http://jvdrums.sourceforge.net/ > LinkedIn: http://www.linkedin.com/in/egolan74 > > P Save a tree. Please don't print this e-mail unless it's really > necessary > > > On Tue, Dec 30, 2008 at 10:32 AM, Jonathan Locke > wrote: > >> >> Well, over the break here I've started something I swore I would never do >> again (well, two things, if you include the JavaOne talk I'm working on). >> I'm writing a (hopefully relatively short) book. It's called "Twenty-Six >> Wicket Tricks". Each trick in the book (lettered from A-Z) demonstrates >> something that people typically want to do and in the process builds a >> reusable and educational component. I've got 13 tricks coded up now and >> ideas for a handful more, but if there are any requests out there, please >> let me know. I'd also be interested in getting some idea how many people >> would be interested in this book (would provide some fuel for me to get >> it >> done). It does not cover any of the same ground as Wicket in Action >> (which >> you should buy if you have not already!), BTW. It's more of a companion >> to >> that book. >> >> Happy Holidays! >> >> Best, >> >> Jonathan >> >> >> -- >> View this message in context: >> http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p21214357.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > > - > Eyal Golan > egola...@gmail.com > > Visit: JVDrums > LinkedIn: LinkedIn > -- View this message in context: http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24704037.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
intercomponent communications
I don't see much buzz about this topic here, just a request for the trick for the forthcoming Johnatan Locke book. So it seems for now that just a few poople are interested in. I experienced problems in different places with approaches where components are loosely coupled and they try on their own to find the component which is supposed to be the source of events. I ended up with a form that serves as a subscription service for the components and dispatches the events. Let me know if somebody is interested in the implementation.
Re: DropDownChoice with ID and Value
Yes, you are right. Didn't read the question close enough. -- View this message in context: http://www.nabble.com/DropDownChoice-with-ID-and-Value-tp24686742p24703752.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Twenty Six Wicket Tricks
+1 I would buy the book. -- View this message in context: http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24703709.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Twenty Six Wicket Tricks
+1 I will buy such trick Erik van Oosten wrote: > > Jonathan Locke wrote: >> I've got 13 tricks coded up now and >> ideas for a handful more, but if there are any requests out there, please >> let me know >> > Perhaps something about handling URLs. Like writing your own url coding > strategy and how to mount pages with URL that have some variable before > the fixed parts (like /{language}/products/{productid}). > > Regards, > Erik. > > > -- > Erik van Oosten > http://www.day-to-day-stuff.blogspot.com/ > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24703581.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
reuseitems problems
Hi! I am having trouble with listView.setReuseitems(true). My problem is that 1. on first request the listview creates form components. 2. on second (or third ...) request the listView reuses the form components. 3. however, the propertymodels attached to the formcomponents at 1 are no longer viable, because their target objects are only the orignal serialization copies. In state 2 or 3 the form components now update totally obsolete instances of the target objects . A better strategy would probably be to just copy the rawInput states of the formComponents instead of really reusing the components. Comments, anybody? Did I misunderstand something? I have been debugging this for 6 hours now, maybe my brain melted down already. .. ** Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Problem with PagingNavigator and NavigatorLabel
sounds like you are not using loadable detachable models in your listview -igor On Mon, Jul 27, 2009 at 11:55 AM, LEWIS, LONNIE wrote: > Hello, > I am a newbie to Wicket and am trying to fix an existing page. My problem: we > have a simple page containing a PagingNavigator and NavigatorLabel. They both > display the correct data upon initial load. To add a record, we navigate to a > page, enter the data and press "submit". The data is saved correctly (using > JPA's "save" method) and we navigate back to the initial page using > "setResponsePage". This is when I have a problem, the "NavigatorLabel" isn't > updated at all, it still read "Showing 1 to 3 of 3" (if we originally had > three records, now have four). Also, the data in the "PagingNavigator" isn't > updated correctly. The size of the control isn't adjusted to include the new > record. The new record may appear, if the sort order causes it to appear in > the middle of the resut set. > > What are we doing wrong? > > Thanks. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AW: SSL - ajax login
i have no idea. you might want to google it. -igor On Tue, Jul 28, 2009 at 1:43 AM, Arthur Leigh Allen wrote: > i use my own (graphic) buttons in wicket. > after getting rid of my own code and just using a modified AjaxFallbackButton > with overridden getCallbackUrl() method, > the form was submitted but i could see an error in the error console of > firefox (translated by me): > > security error: content from > http://localhost:8080/projectname/?wicket:interface=:0:2::: is not allowed to > load data from > https://localhost:8443/projectname/?wicket:interface=:0:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:2:IBehaviorListener:0:&random=0.573852961623538 > > error: uncaught exception: [Exception... "Access to restricted URI denied" > code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location: > "http://localhost:8080/projectname/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js > Line: 884"] > > is it about cross domain (http and https) AJAX queries? > > > > > > > Von: Igor Vaynberg > An: users@wicket.apache.org > Gesendet: Montag, den 27. Juli 2009, 18:24:20 Uhr > Betreff: Re: AW: SSL - ajax login > > hmm, it might be like you said - ajax request with an untrusted cert > might be failing. > > it looks from the console like wicket is trying to hit that url, what > you can do is set a breakpoint in wicketfilter and see if that request > ever reaches the server. > > -igor > > On Mon, Jul 27, 2009 at 4:56 AM, Arthur Leigh > Allen wrote: >> Hi again Igor, >> >> I did the following now: >> I called the website directly with https://localhost:8443/projectname and >> then I performed a login and it worked. >> >> Any idea? >> >> Thx Arthur >> >> >> >> >> >> Von: Igor Vaynberg >> An: users@wicket.apache.org >> Gesendet: Sonntag, den 26. Juli 2009, 22:22:22 Uhr >> Betreff: Re: AW: SSL - ajax login >> >> the href is not a problem; you seeing # appended to the end of the url >> is the correct behavior. what should have happened was the ajax call >> to that https url in the background. >> >> so what you should be looking into is why the ajax call with that >> https url was never made or response from it not processed, since we >> know the url itself works - because you pasted it into the browser and >> it worked. maybe wicket ajax console can give you a clue, firebug also >> has facilities that let you monitor requests being made. you should >> see a call to that https url when you click the link. >> >> -igor >> >> On Sun, Jul 26, 2009 at 1:15 PM, Arthur Leigh >> Allen wrote: >>> Hi Igor, >>> >>> I used Firebug to have a look at the onClick event. >>> I've inspected two links, one usual ajax link and one for the ssl login. >>> >>> >>> >>> Regarding the first link: >>> href="?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:linkForgotLogin:container:link::ILinkListener::" >>> >>> onClick="var >>> wcall=wicketAjaxGet('?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:linkForgotLogin:container:link::IBehaviorListener:0:',null,null, >>> function() {return Wicket.$('link141') != null;}.bind(this));return >>> !wcall;" >>> >>> >>> >>> Regarding the ssl login link: >>> href="#" >>> >>> onClick="var wcall=wicketSubmitFormById('loginForm13b', >>> 'https://localhost:8443/projectname/?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:container:link::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true', >>> 'buttonLogin:container:link' ,null,null, function() {return >>> Wicket.$$(this)&&Wicket.$$('loginForm13b')}.bind(this));;; return false;" >>> >>> >>> >>> I clicked on the ssl login link and the page jumped to the anchor # but the >>> form is not submitted. The symbol # was appended to the address bar of the >>> browser. >>> I copied the url in the onClick event and entered it manually in the >>> address bar of my browser. The xml code for the ajax response was shown in >>> the browser - as known from wicket ajax debug. >>> >>> I guess the problem is the href attribute. I would expect to see an url >>> like >>> https://localhost:8443/projectname/wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:container:link:: >>> [etc.] >>> >>> Do you have any idea how I can solve the problem? >>> >>> Thx, >>> Arthur >>> >>> >>> >>> >>> >>> >>> >>> >>> Von: Igor Vaynberg >>> An: users@wicket.apache.org >>> Gesendet: Freitag, den 24. Juli 2009, 21:51:48 Uhr >>> Betreff: Re: AW: SSL - ajax login >>> >>> whatever url you see when hovering over the link is not the url used >>> for ajax - not necessarily. you should inspect the onclick handlers. >>> >>> -igor >>> >>> On Fri, Jul 24, 2009 at 12:20 PM, Arthur Leigh >>> Allen wrote: no, sorry... the url is not changing to http://locahost:8080/projectname/# but w
Re: will there be a performance gain to use singleton to remove references to the service object in models?
Don't guess, profile it. 2009/7/28 Jason Wang : > Hi all, > > Although I am using spring-wicket to prevent the whole spring being > serialized, It still brothers me to see the references in the model > object, for example: > > Instead of using this: > > public class MyViewObjectProvider extends SortableDataProvider{ > �...@springbean("daoService") > private DAOServices daoService; > > private String objectID; > > public Iterator iterator(final int first, final int count){ > . > return daoService.load(objectId).subList(first, > first+count).iterator(); > } > > } > > > > I always write a singleton helper class for the service to be used, so I can > have the model this way: > > public class MyViewObjectProvider extends SortableDataProvider{ > //so no reference to the dao service object > > private String objectID; > public Iterator iterator(final int first, final int count){ > . > //here the DAOServiceHelper.get() returns a instance that managed by > spring(with the actual service object injected.) > return DAOServiceHelper.get().load(objectId).subList(first, > first+count).iterator(); > } > > } > > So my question is, will there be a noticeable performance gain to do it the > 2nd way? > The reason to ask is that the static kind of singleton usage is indeed > anti-spring, and makes > my eyes bleed > > If no one has done a performance comparison, I might have to do one myself. > Just being lazy... > > > Thanks, > > Jason Wang > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: will there be a performance gain to use singleton to remove references to the service object in models?
also safe to do with salve because it removes the field and rewrites field reads with lookups. wicket-spring and salve were created for a reason - to make it easy to work with services in an environment where objects are often serialized. salve doesnt have the memory overhead of wicket's @SpringBean, but @SpringBean doesnt have the complexity of a bytecode instrumentation step. -igor On Tue, Jul 28, 2009 at 1:03 AM, Martijn Dashorst wrote: > There's the risk of keeping the retrieved service as a reference > somewhere, e.g. by declaring it final and using it inside an anon > inner class, negating any and all gains you've done by using the > static lookup. The @SpringBean annotated references are safe to pass > around (as they are implemented as proxies to your services) > > Martijn > > On Tue, Jul 28, 2009 at 9:50 AM, Eelco > Hillenius wrote: >> Actually, thinking about it, if you're very tight on memory, it will >> save you a reference, particularly when the page gets serialized. So >> if you are worrying about efficiency *and* are ok with this code >> style, it's an option. :-) >> >> Eelco >> >> On Tue, Jul 28, 2009 at 12:47 AM, Eelco >> Hillenius wrote: >>> It might give you a very slight edge to use a singleton as you (or the >>> annotation processor in this case) don't have to introspect and work >>> through a proxy. If you're not bothered by singletons (I, for one >>> typically are): go for it. However, keep that famous 'premature >>> optimization is the root of all evil' in mind; 99.9% chance you're >>> optimizing something that will never ever become a bottleneck. >>> >>> Eelco >>> >>> 2009/7/27 Murat Yücel : Hi Jason I dont have a performance comparison, but i cannot see why you should gain better performance. All spring beans are as default singleton, so you will just forward a singleton using a singleton. /Murat 2009/7/28 Jason Wang : > Hi all, > > Although I am using spring-wicket to prevent the whole spring being > serialized, It still brothers me to see the references in the model > object, for example: > > Instead of using this: > > public class MyViewObjectProvider extends SortableDataProvider{ > �...@springbean("daoService") > private DAOServices daoService; > > private String objectID; > > public Iterator iterator(final int first, final int count){ > . > return daoService.load(objectId).subList(first, > first+count).iterator(); > } > > } > > > > I always write a singleton helper class for the service to be used, so I > can > have the model this way: > > public class MyViewObjectProvider extends SortableDataProvider{ > //so no reference to the dao service object > > private String objectID; > public Iterator iterator(final int first, final int count){ > . > //here the DAOServiceHelper.get() returns a instance that managed by > spring(with the actual service object injected.) > return DAOServiceHelper.get().load(objectId).subList(first, > first+count).iterator(); > } > > } > > So my question is, will there be a noticeable performance gain to do it > the > 2nd way? > The reason to ask is that the static kind of singleton usage is indeed > anti-spring, and makes > my eyes bleed > > If no one has done a performance comparison, I might have to do one > myself. > Just being lazy... > > > Thanks, > > Jason Wang > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > > > -- > Become a Wicket expert, learn from the best: http://wicketinaction.com > Apache Wicket 1.3.5 is released > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketTester and org.slf4j.LoggerFactory and org.slf4j.Logger not serializable
Hello Jeremy, thanks for the reply. Painfully obvious now (doh!). David. - Original Message - From: "Jeremy Thomerson" To: users@wicket.apache.org Sent: Monday, July 27, 2009 7:52:57 PM GMT -06:00 US/Canada Central Subject: Re: WicketTester and org.slf4j.LoggerFactory and org.slf4j.Logger not serializable Your logger instances should either be transient or static - so that they are not serialized. -- Jeremy Thomerson http://www.wickettraining.com On Mon, Jul 27, 2009 at 8:01 PM, David Brown wrote: > Hello, I have a Wicket 1.4rc4 application with a homegrown set of JDBC DAO > classes: basic JDBC Connection and various methods for SQL queries and > transactions. And Connection pooling is imported into the same JDBC DAO class > and works well against the JUnit TestCases. The JUnit TestCases for the JDBC > DAO implementation is comprehensive and complete with no failed testcases (17 > in all). Now, I want to start testing the Pages that use my JDBC DAO class > using WicketTester but the TestCases so far are failing with errors. I have > scoured this topic with Google and have re-read Dashorst/Hillenius, Kent Tong > and the Wicket Wiki and other articles covering WicketTester including the > JavaDocs. My TestCases are having trouble with my JDBC DAOs as they not > seriablizable because of heavy use of the logging packages: > > org.slf4j.LoggerFactory and org.slf4j.Logger > > I don't to remove all of the logging from my JDBC DAOs to implement > WicketTester. Is there some way around this type of issue with serialization? > Please advise, David. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DropDownChoice with ID and Value
The thing that makes your example awkward (IMHO, of course) is that it leaves out how the value that the user selects makes its way back into the app's domain object. The OP said he wants "my model updates with 1, 2, and 3." From that I understand he has some object with an int property... class Widget { private int type; //... } Widget myWidget; To complete your example, you would have to do the following when the component was initialized: - create a variable of type Choice to hold the selection - loop through the list of choices, finding the one that matches myWidget.type and storing it in the variable - pass a PropertyModel to the DDC pointing to the choice variable Then, when the form is submitted, the Choice variable would contain a (possibly different) Choice object, corresponding to the one the user selected. You would then have to set myWidget.type from the id property of your choice variable. In my example, this is all done automatically, since the PropertyModel points directly to the property to be updated. But this is only possible if you give DDC a list of objects of the same type as the property. jk On Mon, Jul 27, 2009 at 05:13:05PM -0700, Mathias Nilsson wrote: > > Wasn't this more awkward? > > -- > View this message in context: > http://www.nabble.com/DropDownChoice-with-ID-and-Value-tp24686742p24690478.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Problem with PagingNavigator and NavigatorLabel
Not sure what code to include. The authors used a lot of class inheritance, so it is difficult to include the whole thing. HTML Showing 1 to 25 of 1157 << < 1 2 3 4 5 6 7 8 9 10 > >> Email Address Delete? Edit [emailAddress] Some of the code Creates the data view protected DataView createDataView () { DataView view = new DataView("sorting", getDataProvider()){ @SuppressWarnings("unchecked") protected void populateItem (final Item item) { MarkablePersistableWrapper wrapper = (MarkablePersistableWrapper)item.getModelObject(); addRowItems(item, wrapper, (T)wrapper.getTarget()); addEditingRowFields(item, wrapper); item.add(new AttributeModifier("class", true, new AbstractReadOnlyModel(){ public Object getObject () { return (item.getIndex() % 2 == 1) ? "even" : "odd"; } })); } }; view.setItemsPerPage(getAdminService().getConsoleConstants().getNoOfRows()); return view; } Save the row and return protected void commitForm () { if (validateItem()) { try { //Saves the new record getPersistableManager().save(getPersistable()); //Return to summary page setResponsePage(getFormResponsePage()); } catch (RuntimeException e) { throw e; } } } Is this what you are looking for? Thanks for the help! Mathias Nilsson wrote: > > Can you provide us with some code on which model you use and how? > -- View this message in context: http://www.nabble.com/Problem-with-PagingNavigator-and-NavigatorLabel-tp24694245p24698057.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Thanks Wicket-Team!
Good work. Now, if I can only learn wicket as well as you have! :) On Tue, Jul 28, 2009 at 7:01 AM, Oliver Krohne wrote: > Hi, > > Many thanks to the Wicket-Team for the great Framework and > of course for the support I have received from the mailinglist. > > I started with zero-Wicket knowledge and now 4 month later > we have launched a new community website: > > http://fytch.com > > It is based on Wicket, Spring, OpenJPA, Lucene, PostgreSQL. > > I would be glad if you try out Fytch and of course any feedback is welcome. > Should I put Fytch on the wiki "Sites using Wicket"? > > Thanks for the fabulous Wicket, > Oliver > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Thanks Wicket-Team!
That's impressive! Nice concept, looks very good... I'll use it :). Alex okrohne wrote: > > Hi, > > Many thanks to the Wicket-Team for the great Framework and > of course for the support I have received from the mailinglist. > > I started with zero-Wicket knowledge and now 4 month later > we have launched a new community website: > > http://fytch.com > > It is based on Wicket, Spring, OpenJPA, Lucene, PostgreSQL. > > I would be glad if you try out Fytch and of course any feedback is > welcome. > Should I put Fytch on the wiki "Sites using Wicket"? > > Thanks for the fabulous Wicket, > Oliver > > > > -- View this message in context: http://www.nabble.com/Thanks-Wicket-Team%21-tp24697082p24697954.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ajax indicator turning off
Erik van Oosten wrote: > > This seems like something that warrants a new Jira issue. > > Regards, > Erik. > Patch submitted https://issues.apache.org/jira/browse/WICKET-2401 -- View this message in context: http://www.nabble.com/Ajax-indicator-turning-off-tp24655744p24697620.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Thanks Wicket-Team!
Gute Arbeit Leute und viel Erfolg mit dem Projekt. Ich hoffe wir ziehen auch bald nach :) Gruß Arthur Von: Oliver Krohne An: users@wicket.apache.org Gesendet: Dienstag, den 28. Juli 2009, 13:01:53 Uhr Betreff: Thanks Wicket-Team! Hi, Many thanks to the Wicket-Team for the great Framework and of course for the support I have received from the mailinglist. I started with zero-Wicket knowledge and now 4 month later we have launched a new community website: http://fytch.com It is based on Wicket, Spring, OpenJPA, Lucene, PostgreSQL. I would be glad if you try out Fytch and of course any feedback is welcome. Should I put Fytch on the wiki "Sites using Wicket"? Thanks for the fabulous Wicket, Oliver
Re: Thanks Wicket-Team!
Yeah.. cool ! You guys got your site goin' on 4real! ** Martin 2009/7/28 Oliver Krohne : > Hi, > > Many thanks to the Wicket-Team for the great Framework and > of course for the support I have received from the mailinglist. > > I started with zero-Wicket knowledge and now 4 month later > we have launched a new community website: > > http://fytch.com > > It is based on Wicket, Spring, OpenJPA, Lucene, PostgreSQL. > > I would be glad if you try out Fytch and of course any feedback is welcome. > Should I put Fytch on the wiki "Sites using Wicket"? > > Thanks for the fabulous Wicket, > Oliver > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Thanks Wicket-Team!
Hi, Many thanks to the Wicket-Team for the great Framework and of course for the support I have received from the mailinglist. I started with zero-Wicket knowledge and now 4 month later we have launched a new community website: http://fytch.com It is based on Wicket, Spring, OpenJPA, Lucene, PostgreSQL. I would be glad if you try out Fytch and of course any feedback is welcome. Should I put Fytch on the wiki "Sites using Wicket"? Thanks for the fabulous Wicket, Oliver
Re: Problem with PagingNavigator and NavigatorLabel
Can you provide us with some code on which model you use and how? -- View this message in context: http://www.nabble.com/Problem-with-PagingNavigator-and-NavigatorLabel-tp24694245p24697018.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket as a web service framework
Hi All,I am interested in using wicket as web service framework. We already use it to serve a web and mobile web browser application but now we have a need to open up the API for other types of client and I think it would be great if I can leverage a lot of the wicket work already done like the authentication and form validation. I see from this blog post that others have thought of this and indeed it shows how to implement a simple web service, however Jonathan's comment below makes a good point as I will also need to handle POST requests http://blog.brunoborges.com.br/2008/11/restful-web-services-with-wicket.html So I am wondering if anyone has taken this further and perhaps we could talk about how to best approach this strategy or perhaps you think I am completely mad to even think about using wicket in this way in which case please do say so.
Re: AJAX refresh of ListView in Form
Hi, this blog entry provides a solution for your problem: http://oktech.hu/blog/2009/07/adding-and-removing-rows-in-wicket.html Regards: Szabolcs John Patterson wrote: > > Hi, I have a ListView in a table that can have rows dynamically added with > AJAX. When I add a row and enter a value, then add another row the first > row is reset to an empty value. > > Do I need to submit the form for each AJAX request to send the new values > to the server? > > Thanks, > > JD > -- View this message in context: http://www.nabble.com/AJAX-refresh-of-ListView-in-Form-tp19105261p24696102.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: how to get some data from servlet
Thanks Fernando, I was looking for some code like this! Fernando Wermus-2 wrote: > > Hi, > > Instead using a servlet you could try the following (you can find the > whole > code at wicketstuff pickwick ) > > This way you will have the session because your are into the > requestCycle > > On your WicketApp > > mount(new URIRequestTargetUrlCodingStrategy("/upload") { > @Override public IRequestTarget decode(RequestParameters > requestParameters) { > try { > return new > UploadRequestTarget(decodeParameters(requestParameters).getString("uri")); > } catch (Exception e) { > throw new WicketRuntimeException(e); > } > } > }); > > Your own class for uploading images or whatever you want > > public class UploadRequestTarget implements IRequestTarget { > String parameters; > > public UploadRequestTarget(String parameters) { > this.parameters=uri; > } > > public void detach(RequestCycle requestCycle) {} > > public void respond(RequestCycle requestCycle) { > HttpServletRequest > request=((WebRequest)requestCycle.getRequest()).getHttpServletRequest(); > HttpServletResponse > response=((WebResponse)requestCycle.getResponse()).getHttpServletResponse(); > > response.setHeader("Connection","close"); > > FileItemFactory factory = new DiskFileItemFactory(); > ServletFileUpload upload = new ServletFileUpload(factory); > > List items=null; > PrintWriter out=null; > try { > out = response.getWriter(); > items = upload.parseRequest(request); > > for (int i = 0; i < items.size(); i++) { > DiskFileItem item = (DiskFileItem) items.get(i); > // As we are interested not in regular form fields, we > filter only files > if (!item.isFormField()) { > String fileName=COMPLETE IT > item.write(new File(fileName)); > out.print("RESP.100"); > out.flush(); > } > } > } catch (FileUploadException e1) { > out.print("RESP.200"); > // flush the stream to speed up applet notification > out.flush(); > e1.printStackTrace(); > } catch (Exception e) { > e.printStackTrace(); > } > > } > > > On Sun, Jul 19, 2009 at 3:20 PM, Altuğ B. Altıntaş > wrote: > >> Hi Igor; >> >> I found the problem; problem is when i hit my UploadServlet via http-get >> method , i simply write the url and hit the enter then below code is >> working >> >> Session wicketSession = Session.get(); >> >> I can get wicket Session, wow !! it is great... >> >> BUT ... >> >> When i hit my UploadServlet via http-post method, swfupload access in >> that >> way then i can NOT access wicketSession. >> >> I mean this code : >> >> Session wicketSession = Session.get(); >> >> it throws : >> >> java.lang.IllegalStateException: you can only locate or create sessions >> in >> the context of a request cycle >> >> Any idea ? >> >> Thanks >> >> Altug.. >> >> >> 2009/7/14 Igor Vaynberg >> >> > that doesnt make any sense. all things within the webapp share the >> > session. you guys are welcome to create a quickstart that replicates >> > this. >> > >> > -igor >> > >> > On Tue, Jul 14, 2009 at 3:47 AM, Altuğ B. Altıntaş >> > wrote: >> > > Also I have a problem like yours. >> > > >> > > Servlet session and Wicket's session are different so you are getting >> > nul. >> > > Just debug your application and you will see that they have different >> > > session Id's. >> > > >> > > I tried to use WicketSessionFilter but it doesn't work. >> > > >> > > I am using wicket 1.3.5. >> > > >> > > Cheers... >> > > >> > > Altug. >> > > >> > > 2009/6/23 danisevsky >> > > >> > >> hello, I am using MyMultiFileUploadServlet for uploading files and >> in >> > some >> > >> wicket component I need find out how many files was uploaded. >> > >> I was trying to set this number to the HttpSession in >> > >> MyMultiFileUploadServlet and get it in the component: >> > >> >> > >>HttpSession httpSession = ((WebRequest) >> > >> getRequest()).getHttpServletRequest() >> > >>.getSession(); >> > >> String count = httpSession >> > >>.getAttribute("filesCount"); >> > >> >> > >> but count is always null. Is there any way how to get some data from >> > >> servlet? Thanks >> > >> >> > > >> > > >> > > >> > > -- >> > > Altuğ. >> > > >> > >> > - >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> > For additional commands, e-mail: users-h...@wicket.apache.org >> > >> > >> >> >> -- >> Altuğ. >> > > > > -- > Fernando Wermus. > > www.linkedin.com/in/
AW: AW: SSL - ajax login
i use my own (graphic) buttons in wicket. after getting rid of my own code and just using a modified AjaxFallbackButton with overridden getCallbackUrl() method, the form was submitted but i could see an error in the error console of firefox (translated by me): security error: content from http://localhost:8080/projectname/?wicket:interface=:0:2::: is not allowed to load data from https://localhost:8443/projectname/?wicket:interface=:0:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:2:IBehaviorListener:0:&random=0.573852961623538 error: uncaught exception: [Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location: "http://localhost:8080/projectname/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js Line: 884"] is it about cross domain (http and https) AJAX queries? Von: Igor Vaynberg An: users@wicket.apache.org Gesendet: Montag, den 27. Juli 2009, 18:24:20 Uhr Betreff: Re: AW: SSL - ajax login hmm, it might be like you said - ajax request with an untrusted cert might be failing. it looks from the console like wicket is trying to hit that url, what you can do is set a breakpoint in wicketfilter and see if that request ever reaches the server. -igor On Mon, Jul 27, 2009 at 4:56 AM, Arthur Leigh Allen wrote: > Hi again Igor, > > I did the following now: > I called the website directly with https://localhost:8443/projectname and > then I performed a login and it worked. > > Any idea? > > Thx Arthur > > > > > > Von: Igor Vaynberg > An: users@wicket.apache.org > Gesendet: Sonntag, den 26. Juli 2009, 22:22:22 Uhr > Betreff: Re: AW: SSL - ajax login > > the href is not a problem; you seeing # appended to the end of the url > is the correct behavior. what should have happened was the ajax call > to that https url in the background. > > so what you should be looking into is why the ajax call with that > https url was never made or response from it not processed, since we > know the url itself works - because you pasted it into the browser and > it worked. maybe wicket ajax console can give you a clue, firebug also > has facilities that let you monitor requests being made. you should > see a call to that https url when you click the link. > > -igor > > On Sun, Jul 26, 2009 at 1:15 PM, Arthur Leigh > Allen wrote: >> Hi Igor, >> >> I used Firebug to have a look at the onClick event. >> I've inspected two links, one usual ajax link and one for the ssl login. >> >> >> >> Regarding the first link: >> href="?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:linkForgotLogin:container:link::ILinkListener::" >> >> onClick="var >> wcall=wicketAjaxGet('?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:linkForgotLogin:container:link::IBehaviorListener:0:',null,null, >> function() {return Wicket.$('link141') != null;}.bind(this));return !wcall;" >> >> >> >> Regarding the ssl login link: >> href="#" >> >> onClick="var wcall=wicketSubmitFormById('loginForm13b', >> 'https://localhost:8443/projectname/?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:container:link::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true', >> 'buttonLogin:container:link' ,null,null, function() {return >> Wicket.$$(this)&&Wicket.$$('loginForm13b')}.bind(this));;; return false;" >> >> >> >> I clicked on the ssl login link and the page jumped to the anchor # but the >> form is not submitted. The symbol # was appended to the address bar of the >> browser. >> I copied the url in the onClick event and entered it manually in the address >> bar of my browser. The xml code for the ajax response was shown in the >> browser - as known from wicket ajax debug. >> >> I guess the problem is the href attribute. I would expect to see an url like >> https://localhost:8443/projectname/wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:container:link:: >> [etc.] >> >> Do you have any idea how I can solve the problem? >> >> Thx, >> Arthur >> >> >> >> >> >> >> >> >> Von: Igor Vaynberg >> An: users@wicket.apache.org >> Gesendet: Freitag, den 24. Juli 2009, 21:51:48 Uhr >> Betreff: Re: AW: SSL - ajax login >> >> whatever url you see when hovering over the link is not the url used >> for ajax - not necessarily. you should inspect the onclick handlers. >> >> -igor >> >> On Fri, Jul 24, 2009 at 12:20 PM, Arthur Leigh >> Allen wrote: >>> no, sorry... the url is not changing to http://locahost:8080/projectname/# >>> but when I hold the mouse pointer over the link, I see the url in the >>> status bar. When I hold the mouse pointer over other links, I see very long >>> urls a la >>> http://localhost:8080/projectname/;jsessionid=wicket:interface. >>> >>> But as you suggested, I'll debug the ja
Re: Ajax indicator turning off
This seems like something that warrants a new Jira issue. Regards, Erik. John Patterson wrote: > > > > paolo di tommaso wrote: >> >> Yep, intercept the ajax call and inc/dec a counter >> >> -- paolo >> > > Although I could correct the indicator behaviour in all my own AJAX > components, it would probably make more sense to incorporate it into > wickets default AJAX behaviour. If people think it makes sense I can > supply a patch. > > John > -- View this message in context: http://www.nabble.com/Ajax-indicator-turning-off-tp24655744p24694924.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: log4j question with wicket
Maarten, a) In my source tree, it is in webapp/src/main/resources/log4j.properties. When deployed, it ends up in WEB-INF/classes/log4j.properties b) yes, log4j-1.2.15.jar log4j is working fine, I can get a root logger and log to it. The problem seems that the wicket infrastructure is using slf4j and somehow, tomcat6 is passing its catalina.out as a root logger to log4j, rather than the log4j root logger. I am not a boffin on slf4j and there seems to be little documentation on how to integrate slf4j into tomcat, rather than log4j. I am sure there is somebody who is using tomcat, wicket and slf4j/log4j in production? P On Mon, Jul 27, 2009 at 7:35 PM, Maarten Bosteels wrote: > a) Where does the log4j.properties file for your webapp reside ? > b) Do you have a log4j.jar in WEB-INF/lib/ ? > > M. > > > On Mon, Jul 27, 2009 at 4:45 PM, pieter claassen < > pieter.claas...@gmail.com> wrote: > >> I am sure something is broken in tomcat. This is not a dependency issue as >> the build runs file and manually logging info with log4j also works (see >> below). The problem seems when wicket logs using slf4j and this only goes >> to >> catalina.log (I cannot get this redirected to my own log file). >> >> If I understand this correctly, wicket uses slf4j to log its own >> internals. >> With tomcat6, I am supposed to then configure log4j (or any adapter that I >> want to) to get that information to the location I would like to (a local >> text log file). >> >> I am trying to enable wicket's requestlog debugging and directing the >> output >> to my application log file for later inspection. >> >> If I run the following code, I get a message in catalina.out (I also get >> all >> the debug information from wicket requestlogger on catalina.out) >> >> Logger logger=LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); >> logger.info("AUTH PAGE ACCESSED"); >> >> When I run the code under a debugger, I can see that logger points to >> catalina.out, so clearly I failed to point rootLogger to another file with >> either of my log4j.properties settings. >> >> Note however, that if I use org.apache.log4j.Logger then I can correctly >> dump logging infor to my target file >> >> Logger.getRootLogger().info("AUTHPAGE Logged with >> Logger.getRootLogger()"); >> >> Here is my question: >> >> 1. What is the correct procedure to enable request logging with wicket and >> tomcat so that each of my applications dumps its request data to a >> specific >> text file? >> >> Thanks for all the feedback so far. >> Pieter >> >> >> here is my log4j.properties in my tomcat lib directory >> >> log4j.rootLogger=INFO, R >> log4j.appender.R=org.apache.log4j.RollingFileAppender >> log4j.appender.R.File=${catalina.home}/logs/tomcat.log >> log4j.appender.R.MaxFileSize=10MB >> log4j.appender.R.MaxBackupIndex=10 >> log4j.appender.R.layout=org.apache.log4j.PatternLayout >> log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n >> log4j.logger.org.apache.catalina=INFO, R >> >> log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INFO, >> R >> log4j.logger.org.apache.catalina.core=INFO, R >> log4j.logger.org.apache.catalina.session=INFO, R >> >> Here is my application log4j.properties file. >> >> log4j.rootLogger=INFO,R >> log4j.category.org.apache.wicket.protocol.http.RequestLogger=INFO >> log4j.logger.org.apache.wicket=INFO >> log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO >> log4j.logger.org.apache.wicket.version=INFO >> log4j.logger.org.apache.wicket.RequestCycle=INFO >> log4j.appender.R=org.apache.log4j.RollingFileAppender >> log4j.appender.R.File=/var/log/${application.name}/application.log >> log4j.appender.R.MaxFileSize=10MB >> log4j.appender.R.MaxBackupIndex=10 >> log4j.appender.R.layout=org.apache.log4j.PatternLayout >> log4j.appender.R.layout.ConversionPattern=%p %t %c - log file%m%n >> >> >> >> On Mon, Jul 27, 2009 at 12:00 PM, Maarten Bosteels >> wrote: >> >> > On Fri, Jul 24, 2009 at 3:47 PM, pieter claassen > > >wrote: >> > >> > > I think that slf4j is not working in my setup and it might have >> nothing >> > to >> > > do with Tomcat. As a matter of fact, I assume I don't even have to >> have >> > > log4j or slf4j working with tomcat, but that as long as my POM >> references >> > > the correct dependencies, my application should log correctly? >> > > >> > > To overcome the following error, I had to upgrade by slf4j and log4j >> deps >> > > to >> > > the latest version. >> > > >> > > Caused by: java.lang.IllegalAccessError: tried to access field >> > > org.slf4j.impl.StaticLoggerBinder.SINGLETON from class >> > > org.slf4j.LoggerFactory >> > > >> > > These are my maven deps. >> > > >> > > >> > >org.slf4j >> > >slf4j-log4j12 >> > >1.5.6 >> > > >> > > >> > >org.slf4j >> > >slf4j-api >> > >1.5.6 >> > > >> > >> > >> > You still need log4j itself. add this dependency: >> > >> > >> >log4j >> >
Re: Caching a resource on the browser side
It works for me. ResourceLink csvLink = new ResourceLink("csvLink", new ResourceReference(AnnouncementCsvResource.ID), params); add(csvLink); public class AnnouncementCsvResource extends WebResource { public static final String ID = "csv"; @Override public IResourceStream getResourceStream() { return new CsvResourceStream(); } @Override protected void setHeaders(WebResponse response) { super.setHeaders(response); response.setAttachmentHeader("announcements.csv"); response.setHeader("Cache-Control", "no-cache"); } private class CsvResourceStream extends AbstractStringResourceStream { @Override public String getContentType() { return "text/plain"; } @Override protected Charset getCharset() { return Charset.forName("ISO-8859-1"); } @Override protected String getString() { return "bla bla "; } } } On Tue, Jul 28, 2009 at 10:44 AM, ZedroS Schwart wrote: > Thanks for this answer Juri. > > I tried it (once again) and it didn't work : the setHeaders method > isn't called... > > I use Live HTTP headers to check what goes through : > http://localhost:8080/charts/data/dataId/KBU > > > > GET /charts/data/dataId/KBU HTTP/1.1 > > Host: localhost:8080 > > User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) > Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11 > > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > > Accept-Language: en,de;q=0.5 > > Accept-Encoding: gzip,deflate > > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 > > Keep-Alive: 300 > > Connection: keep-alive > > Cookie: JSESSIONID=1gxaom5muzh66 > > > > HTTP/1.x 200 OK > > Content-Type: text/csv; charset=UTF-8 > > Content-Length: 5726 > > Server: Jetty(6.1.16) > > > thanks again > zedros > > On Tue, Jul 28, 2009 at 8:59 AM, Juri Prokofiev wrote: > > To set headers to a resource you need to extend setHeaders method from > > WebResource. Example: > >@Override > >protected void setHeaders(WebResponse response) > >{ > >super.setHeaders(response); > >response.setAttachmentHeader("announcements.csv"); > >response.setHeader("Cache-Control", "no-cache"); > >} > > > > Check your headers. If Cache-Control is passed then resource should be > > cached on user side. > > > > On Tue, Jul 28, 2009 at 1:02 AM, ZedroS Schwart > > wrote: > > > >> hi > >> > >> We need to provide a flash application (www.amcharts.com if anyone is > >> interested) with some content through some files. > >> > >> As the files are users specific (and determined with data from the > >> session), we went for some page delivering the content like this : > >> public AMChartDataProviderPage(final PageParameters parameters) > >>{ > >>Object object = parameters.get(DATA_KEY); > >>if ((object == null) || !(object instanceof String) || > >> "".equals(object)) > >>{ > >>throw new IllegalStateException("Expected parameter " + > >> DATA_KEY + " not provided or empty"); > >>} > >>String dataId = (String) object; > >>ByteArrayResource resourceStream; > >>try > >>{ > >>resourceStream = new ByteArrayResource("text/csv", > >> IOHelper.getResourceAsByteArray(dataId + ".csv")); > >>} > >>catch (IOException e) > >>{ > >>throw ExceptionHelper.wrap(e); > >>} > >>getRequestCycle().setRequestTarget(new > >> ResourceStreamRequestTarget(resourceStream.getResourceStream())); > >>} > >> > >> However, I don't manage to get this resource to be cached on the user > >> browser side, despite the resource being cacheable. From what I've > >> seen, setHeaders() in WebResource is never called... Neither did I > >> manage to set them myself (on the page they're never called neither... > >> and the request cycle has no webresponse on which to define the > >> header). > >> > >> Any clue ? > >> > >> thanks in advance > >> zedros > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> For additional commands, e-mail: users-h...@wicket.apache.org > >> > >> > > > > > > -- > > http://www.autoladu.ee - kõik varuosad ühes kohas > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- http://www.autoladu.ee - kõik varuosad ühes kohas
Re: will there be a performance gain to use singleton to remove references to the service object in models?
There's the risk of keeping the retrieved service as a reference somewhere, e.g. by declaring it final and using it inside an anon inner class, negating any and all gains you've done by using the static lookup. The @SpringBean annotated references are safe to pass around (as they are implemented as proxies to your services) Martijn On Tue, Jul 28, 2009 at 9:50 AM, Eelco Hillenius wrote: > Actually, thinking about it, if you're very tight on memory, it will > save you a reference, particularly when the page gets serialized. So > if you are worrying about efficiency *and* are ok with this code > style, it's an option. :-) > > Eelco > > On Tue, Jul 28, 2009 at 12:47 AM, Eelco > Hillenius wrote: >> It might give you a very slight edge to use a singleton as you (or the >> annotation processor in this case) don't have to introspect and work >> through a proxy. If you're not bothered by singletons (I, for one >> typically are): go for it. However, keep that famous 'premature >> optimization is the root of all evil' in mind; 99.9% chance you're >> optimizing something that will never ever become a bottleneck. >> >> Eelco >> >> 2009/7/27 Murat Yücel : >>> Hi Jason >>> >>> I dont have a performance comparison, but i cannot see why you should >>> gain better performance. >>> All spring beans are as default singleton, so you will just forward a >>> singleton using a singleton. >>> >>> /Murat >>> >>> 2009/7/28 Jason Wang : Hi all, Although I am using spring-wicket to prevent the whole spring being serialized, It still brothers me to see the references in the model object, for example: Instead of using this: public class MyViewObjectProvider extends SortableDataProvider{ �...@springbean("daoService") private DAOServices daoService; private String objectID; public Iterator iterator(final int first, final int count){ . return daoService.load(objectId).subList(first, first+count).iterator(); } } I always write a singleton helper class for the service to be used, so I can have the model this way: public class MyViewObjectProvider extends SortableDataProvider{ //so no reference to the dao service object private String objectID; public Iterator iterator(final int first, final int count){ . //here the DAOServiceHelper.get() returns a instance that managed by spring(with the actual service object injected.) return DAOServiceHelper.get().load(objectId).subList(first, first+count).iterator(); } } So my question is, will there be a noticeable performance gain to do it the 2nd way? The reason to ask is that the static kind of singleton usage is indeed anti-spring, and makes my eyes bleed If no one has done a performance comparison, I might have to do one myself. Just being lazy... Thanks, Jason Wang - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Problem with PagingNavigator and NavigatorLabel
Hello, I am a newbie to Wicket and am trying to fix an existing page. My problem: we have a simple page containing a PagingNavigator and NavigatorLabel. They both display the correct data upon initial load. To add a record, we navigate to a page, enter the data and press "submit". The data is saved correctly (using JPA's "save" method) and we navigate back to the initial page using "setResponsePage". This is when I have a problem, the "NavigatorLabel" isn't updated at all, it still read "Showing 1 to 3 of 3" (if we originally had three records, now have four). Also, the data in the "PagingNavigator" isn't updated correctly. The size of the control isn't adjusted to include the new record. The new record may appear, if the sort order causes it to appear in the middle of the resut set. What are we doing wrong? Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: will there be a performance gain to use singleton to remove references to the service object in models?
Actually, thinking about it, if you're very tight on memory, it will save you a reference, particularly when the page gets serialized. So if you are worrying about efficiency *and* are ok with this code style, it's an option. :-) Eelco On Tue, Jul 28, 2009 at 12:47 AM, Eelco Hillenius wrote: > It might give you a very slight edge to use a singleton as you (or the > annotation processor in this case) don't have to introspect and work > through a proxy. If you're not bothered by singletons (I, for one > typically are): go for it. However, keep that famous 'premature > optimization is the root of all evil' in mind; 99.9% chance you're > optimizing something that will never ever become a bottleneck. > > Eelco > > 2009/7/27 Murat Yücel : >> Hi Jason >> >> I dont have a performance comparison, but i cannot see why you should >> gain better performance. >> All spring beans are as default singleton, so you will just forward a >> singleton using a singleton. >> >> /Murat >> >> 2009/7/28 Jason Wang : >>> Hi all, >>> >>> Although I am using spring-wicket to prevent the whole spring being >>> serialized, It still brothers me to see the references in the model >>> object, for example: >>> >>> Instead of using this: >>> >>> public class MyViewObjectProvider extends SortableDataProvider{ >>> �...@springbean("daoService") >>> private DAOServices daoService; >>> >>> private String objectID; >>> >>> public Iterator iterator(final int first, final int count){ >>> . >>> return daoService.load(objectId).subList(first, >>> first+count).iterator(); >>> } >>> >>> } >>> >>> >>> >>> I always write a singleton helper class for the service to be used, so I can >>> have the model this way: >>> >>> public class MyViewObjectProvider extends SortableDataProvider{ >>> //so no reference to the dao service object >>> >>> private String objectID; >>> public Iterator iterator(final int first, final int count){ >>> . >>> //here the DAOServiceHelper.get() returns a instance that managed by >>> spring(with the actual service object injected.) >>> return DAOServiceHelper.get().load(objectId).subList(first, >>> first+count).iterator(); >>> } >>> >>> } >>> >>> So my question is, will there be a noticeable performance gain to do it the >>> 2nd way? >>> The reason to ask is that the static kind of singleton usage is indeed >>> anti-spring, and makes >>> my eyes bleed >>> >>> If no one has done a performance comparison, I might have to do one myself. >>> Just being lazy... >>> >>> >>> Thanks, >>> >>> Jason Wang >>> >>> >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: will there be a performance gain to use singleton to remove references to the service object in models?
It might give you a very slight edge to use a singleton as you (or the annotation processor in this case) don't have to introspect and work through a proxy. If you're not bothered by singletons (I, for one typically are): go for it. However, keep that famous 'premature optimization is the root of all evil' in mind; 99.9% chance you're optimizing something that will never ever become a bottleneck. Eelco 2009/7/27 Murat Yücel : > Hi Jason > > I dont have a performance comparison, but i cannot see why you should > gain better performance. > All spring beans are as default singleton, so you will just forward a > singleton using a singleton. > > /Murat > > 2009/7/28 Jason Wang : >> Hi all, >> >> Although I am using spring-wicket to prevent the whole spring being >> serialized, It still brothers me to see the references in the model >> object, for example: >> >> Instead of using this: >> >> public class MyViewObjectProvider extends SortableDataProvider{ >> �...@springbean("daoService") >> private DAOServices daoService; >> >> private String objectID; >> >> public Iterator iterator(final int first, final int count){ >> . >> return daoService.load(objectId).subList(first, >> first+count).iterator(); >> } >> >> } >> >> >> >> I always write a singleton helper class for the service to be used, so I can >> have the model this way: >> >> public class MyViewObjectProvider extends SortableDataProvider{ >> //so no reference to the dao service object >> >> private String objectID; >> public Iterator iterator(final int first, final int count){ >> . >> //here the DAOServiceHelper.get() returns a instance that managed by >> spring(with the actual service object injected.) >> return DAOServiceHelper.get().load(objectId).subList(first, >> first+count).iterator(); >> } >> >> } >> >> So my question is, will there be a noticeable performance gain to do it the >> 2nd way? >> The reason to ask is that the static kind of singleton usage is indeed >> anti-spring, and makes >> my eyes bleed >> >> If no one has done a performance comparison, I might have to do one myself. >> Just being lazy... >> >> >> Thanks, >> >> Jason Wang >> >> >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: will there be a performance gain to use singleton to remove references to the service object in models?
Hi Jason, You could have a look at http://code.google.com/p/salve/ By making use of some byte code instrumentation it will replace your dependency injections by static lookups, i.e. the best of both worlds. I wouldn't know about the performance of each approach however. Regards, Wilko Jason Wang-2 wrote: > > Hi all, > > Although I am using spring-wicket to prevent the whole spring being > serialized, It still brothers me to see the references in the model > object, for example: > > Instead of using this: > > public class MyViewObjectProvider extends SortableDataProvider{ > >@SpringBean("daoService") > private DAOServices daoService; > > private String objectID; > > public Iterator iterator(final int first, final int count){ > . >return daoService.load(objectId).subList(first, > first+count).iterator(); > } > > } > > > > I always write a singleton helper class for the service to be used, so I > can have the model this way: > > public class MyViewObjectProvider extends SortableDataProvider{ > >//so no reference to the dao service object > > private String objectID; > > public Iterator iterator(final int first, final int count){ > . > //here the DAOServiceHelper.get() returns a instance that managed by > spring(with the actual service object injected.) >return DAOServiceHelper.get().load(objectId).subList(first, > first+count).iterator(); > } > > > } > > So my question is, will there be a noticeable performance gain to do it > the 2nd way? > The reason to ask is that the static kind of singleton usage is indeed > anti-spring, and makes > my eyes bleed > > If no one has done a performance comparison, I might have to do one > myself. Just being lazy... > > > Thanks, > > Jason Wang > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/will-there-be-a-performance-gain-to-use-singleton-to-remove-references-to-the-service-object-in-models--tp24690276p24694064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Caching a resource on the browser side
Thanks for this answer Juri. I tried it (once again) and it didn't work : the setHeaders method isn't called... I use Live HTTP headers to check what goes through : http://localhost:8080/charts/data/dataId/KBU GET /charts/data/dataId/KBU HTTP/1.1 Host: localhost:8080 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en,de;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Cookie: JSESSIONID=1gxaom5muzh66 HTTP/1.x 200 OK Content-Type: text/csv; charset=UTF-8 Content-Length: 5726 Server: Jetty(6.1.16) thanks again zedros On Tue, Jul 28, 2009 at 8:59 AM, Juri Prokofiev wrote: > To set headers to a resource you need to extend setHeaders method from > WebResource. Example: > �...@override > protected void setHeaders(WebResponse response) > { > super.setHeaders(response); > response.setAttachmentHeader("announcements.csv"); > response.setHeader("Cache-Control", "no-cache"); > } > > Check your headers. If Cache-Control is passed then resource should be > cached on user side. > > On Tue, Jul 28, 2009 at 1:02 AM, ZedroS Schwart > wrote: > >> hi >> >> We need to provide a flash application (www.amcharts.com if anyone is >> interested) with some content through some files. >> >> As the files are users specific (and determined with data from the >> session), we went for some page delivering the content like this : >> public AMChartDataProviderPage(final PageParameters parameters) >> { >> Object object = parameters.get(DATA_KEY); >> if ((object == null) || !(object instanceof String) || >> "".equals(object)) >> { >> throw new IllegalStateException("Expected parameter " + >> DATA_KEY + " not provided or empty"); >> } >> String dataId = (String) object; >> ByteArrayResource resourceStream; >> try >> { >> resourceStream = new ByteArrayResource("text/csv", >> IOHelper.getResourceAsByteArray(dataId + ".csv")); >> } >> catch (IOException e) >> { >> throw ExceptionHelper.wrap(e); >> } >> getRequestCycle().setRequestTarget(new >> ResourceStreamRequestTarget(resourceStream.getResourceStream())); >> } >> >> However, I don't manage to get this resource to be cached on the user >> browser side, despite the resource being cacheable. From what I've >> seen, setHeaders() in WebResource is never called... Neither did I >> manage to set them myself (on the page they're never called neither... >> and the request cycle has no webresponse on which to define the >> header). >> >> Any clue ? >> >> thanks in advance >> zedros >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > > -- > http://www.autoladu.ee - kõik varuosad ühes kohas > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ajax indicator turning off
paolo di tommaso wrote: > > Yep, intercept the ajax call and inc/dec a counter > > -- paolo > Although I could correct the indicator behaviour in all my own AJAX components, it would probably make more sense to incorporate it into wickets default AJAX behaviour. If people think it makes sense I can supply a patch. John -- View this message in context: http://www.nabble.com/Ajax-indicator-turning-off-tp24655744p24693787.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Resource without sessionId
When I try to request a resource using url http://domain.com/resource.csv then I get 302 to http://domain.com/resource.csv;jsessionid=joiadfadsfad and all generated links it csv file with 'jsessionid' parameter. How to use resource without sessionid? Thank you
Re: Caching a resource on the browser side
To set headers to a resource you need to extend setHeaders method from WebResource. Example: @Override protected void setHeaders(WebResponse response) { super.setHeaders(response); response.setAttachmentHeader("announcements.csv"); response.setHeader("Cache-Control", "no-cache"); } Check your headers. If Cache-Control is passed then resource should be cached on user side. On Tue, Jul 28, 2009 at 1:02 AM, ZedroS Schwart wrote: > hi > > We need to provide a flash application (www.amcharts.com if anyone is > interested) with some content through some files. > > As the files are users specific (and determined with data from the > session), we went for some page delivering the content like this : > public AMChartDataProviderPage(final PageParameters parameters) >{ >Object object = parameters.get(DATA_KEY); >if ((object == null) || !(object instanceof String) || > "".equals(object)) >{ >throw new IllegalStateException("Expected parameter " + > DATA_KEY + " not provided or empty"); >} >String dataId = (String) object; >ByteArrayResource resourceStream; >try >{ >resourceStream = new ByteArrayResource("text/csv", > IOHelper.getResourceAsByteArray(dataId + ".csv")); >} >catch (IOException e) >{ >throw ExceptionHelper.wrap(e); >} >getRequestCycle().setRequestTarget(new > ResourceStreamRequestTarget(resourceStream.getResourceStream())); >} > > However, I don't manage to get this resource to be cached on the user > browser side, despite the resource being cacheable. From what I've > seen, setHeaders() in WebResource is never called... Neither did I > manage to set them myself (on the page they're never called neither... > and the request cycle has no webresponse on which to define the > header). > > Any clue ? > > thanks in advance > zedros > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- http://www.autoladu.ee - kõik varuosad ühes kohas