DropDownChoice and Null value

2010-03-21 Thread Ivan Dudko
Hello! I am trying to use DropDownChoice. The first problem is no null value in DropDownChoice... (I must add null value to choices array) How i can do this in right way? And second problem is i can't understand why if i add System.out.println in getIdValue method it calls twice for each ID?

Re: (Un-)deployment woes on Tomcat (and JBoss)

2010-03-21 Thread Alexandros Karypidis
Ok, I've pinpointed the underlying cause. Indeed, the file is simply removed before the destroy() method has a chance to clean up. I verified this by using this ugly hack: 1. Adding a field: private InputStream wicketJarProtector; 2. In WicketFilter.init() I open the wicket jar to

Text replace with component

2010-03-21 Thread Sigmar Muuga
Hello, lets say I have something like this: String label = You may click %destinationLink% to visit our store of %destinationLabel%; Now I want to replace %destinationLink% with new BookmarkableLink(...); I am using GNU Gettext translations(.po files), thats why such solution... Is it possible

Re: Ajax has too much control?

2010-03-21 Thread Sven Meier
Hi David, DropDownChoice#wantOnSelectionChangedNotifications() will trigger rendering of the complete page. On Ajax request only those components are rendered you explicitely 'add' to the request, see AjaxRequestTarget#addComponent(). If you want to have the same for Ajax requests, you can

Access file from Javascript

2010-03-21 Thread Jon
My Wicket app has a page that calls a Javascript function that accesses an XML file. I have added the Javascript resource and it runs, but it cannot access the XML file. How do I set the XML file as a resource so it can be accessed by Javascript?

Re: Access file from Javascript

2010-03-21 Thread Martin Makundi
Hi! You mean remote xml file.. on the server. ** Martin 2010/3/21 Jon zon...@ozemail.com.au: My Wicket app has a page that calls a Javascript function that accesses an XML file. I have added the Javascript resource and it runs, but it cannot access the XML file. How do I set the XML file as

Re: Access file from Javascript

2010-03-21 Thread JonnyL
Hi Martin, Yes, the XML file is a remote file on the server. I have written a javascript function that returns a node value from the XML file, the javascript function is in a JS file which is referenced in the page header. The javascript cannot access the XML file because I believe it is not

Re: Access file from Javascript

2010-03-21 Thread Martin Makundi
Hi! I can suggest two things: a) reference it as resource in wicket, similar way you do with javascript or css, find out its url b) put the xml file in your src/webapp directory, static files can be accessed directly from there. ** Martin 2010/3/21 JonnyL zon...@ozemail.com.au: Hi Martin,

Re: Ajax has too much control?

2010-03-21 Thread David Chang
Sven, Thanks for your input. It seems that you do not understand the problem I have (Wicket problem??? or my page problem???). I know how Ajax works by adding components to Ajax request target. When it is non-Ajax, my page runs correctly with all three controls. When Country DDC

Re: Access file from Javascript

2010-03-21 Thread JonnyL
Hi, Can you expand on option a). I am adding my JS and CSS as resources by creating ResourceReference() for them and using renderCSSreference() and renderJavascriptReference() to add them to the pages header, but how I do not know how to add a resource reference to the XML file. Thanks

Re: Ajax has too much control?

2010-03-21 Thread Johan Compagner
Do you add the state ddc to the ajax target when you get a ajax country event? - Original message - Sven, Thanks for your input. It seems that you do not understand the problem I have (Wicket problem??? or my page problem???). I know how Ajax works by adding components to Ajax

Re: Access file from Javascript

2010-03-21 Thread Martin Makundi
Hi! Here is how it works with css, look in Palette.java: new ResourceReference(Palette.class, palette.css) /** * Renders header contributions * * @param response */ public void renderHead(IHeaderResponse response) {

Re: Ajax has too much control?

2010-03-21 Thread Sven Meier
David, It seems that you do not understand the problem I have obviously not ;). A quickstart would help me to understand your problem better, but perhaps others have already a clue? Sven David Chang wrote: Sven, Thanks for your input. It seems that you do not understand the problem I

Re: Ajax has too much control?

2010-03-21 Thread Martin Makundi
Hi David! Maybe you need this (at least this is what worked for me): /** * @author Martin */ public abstract class AjaxFormSubmittingChangeListenerBehavior extends AjaxFormSubmitBehavior { private final static Method hiddenFieldGetter; static { try { hiddenFieldGetter =

Re: Access file from Javascript

2010-03-21 Thread JonnyL
Hi, I still don't get it. I have added the code you suggested and that returns the url to the resource, but how do I reference the resource in the page. Apologies if this is a dumb question, but I am stumped on this. Thanks MartinM wrote: Hi! Here is how it works with css, look in

Re: Access file from Javascript

2010-03-21 Thread Martin Makundi
Hi! Well.. you have the url.. you can reference it from javascript by expressing it in for exampel a javascript variable... would that work for you? protected void onRender(MarkupStream markupStream) { super.onRender(markupStream);

Links and labels

2010-03-21 Thread Sigmar Muuga
Hello, does anybody know, how to add label to links? I have markup like this: a href=# wicket:id=link1[link label goes here]/a Now in java I want to do something like this: LinkObject link = new BookmarkablePageLinkObject(link1, HomePage.class, regParams); link.add(new

Re: Links and labels

2010-03-21 Thread Martin Makundi
Try this: a href=# wicket:id=link1span wicket:id=id/span/a ** Martin 2010/3/21 Sigmar Muuga meedi...@gmail.com: Hello, does anybody know, how to add label to links? I have markup like this: a href=# wicket:id=link1[link label goes here]/a Now in java I want to do something like this:  

Tomcat and Eclipse setup

2010-03-21 Thread Don Esteban
Hi all I'm using Eclipse with embedded tomcat and did the following: 1. Create a dynamic web project 2. Create a HelloWorld sample app This results in a traditional directory structure: /src /src/myproject/ src/myproject/log4j.properties src/myproject/HelloWorld.html

Tomcat and Eclipse setup

2010-03-21 Thread Stefan Riegel
Hi all I'm using Eclipse with embedded tomcat and did the following: 1. Create a dynamic web project 2. Create a HelloWorld sample app This results in a traditional directory structure: /src /src/myproject/ src/myproject/log4j.properties src/myproject/HelloWorld.html

Dynamic javascript generation

2010-03-21 Thread Sigmar Muuga
Hello, I have to generate some javascript on the server side and then include it into my page. Which is the best way to do this with current stable wicket release? A the moment I am thinking about extending WebResource Sigmar

RE: Dynamic javascript generation

2010-03-21 Thread Stefan Lindner
Generate some Javasript in response to e.g. a button klick? Or generate JavaScript when the page is rendered? -Ursprüngliche Nachricht- Von: Sigmar Muuga [mailto:meedi...@gmail.com] Gesendet: Sonntag, 21. März 2010 19:53 An: users@wicket.apache.org Betreff: Dynamic javascript generation

Re: Dynamic javascript generation

2010-03-21 Thread Sigmar Muuga
I need to include this dynamic js in my header with script tag like this in gmail: script src=?view=pageamp;name=browseramp;ver=zpwhtygjntrz view-source:https://mail.google.com/mail/?view=pagename=browserver=zpwhtygjntrz/script Some behaviour of that script depends on my session data on server

AW: Dynamic javascript generation

2010-03-21 Thread Stefan Lindner
Ok, try this add(new AbstractBehavior() { @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.renderJavascript(some dynamically

Re: Dynamic javascript generation

2010-03-21 Thread Sigmar Muuga
My script tags are all in specific order, so how can I put this script right after some certain script tag there? Sigmar On Sun, Mar 21, 2010 at 10:31 PM, Stefan Lindner lind...@visionet.dewrote: Ok, try this add(new AbstractBehavior() { @Override

RE: Dynamic javascript generation

2010-03-21 Thread Stefan Lindner
Add them in the needed order response.renderJavascript(first, firstUniqueID); response.renderJavascript(second, firstUniqueID); -Ursprüngliche Nachricht- Von: Sigmar Muuga [mailto:meedi...@gmail.com] Gesendet: Sonntag, 21. März 2010 21:36 An: users@wicket.apache.org

Re: Links and labels

2010-03-21 Thread Steve Mactaggart
The other way I have implemented that in our local code is to create a LabeledBookmakableLink. This link takes a 4th parameter that is the label to display. Then override the onComponentTagBody to rewrite the contents of the a tag to put in the content. Code looks like: public

Forms in a base class

2010-03-21 Thread Steve Mactaggart
Hi all, Before I go to far trying to prove I have a bug, I thought i'd crowd source an answer. We have a lot of Edit pages that have a lot of simmilar structure, and what I wanted to do is create a BaseEditPage that contains the form, the save/cancel buttons, some layout stuff and a

Re: Forms in a base class

2010-03-21 Thread Jeremy Thomerson
you need to be adding the components to the form. you're currently adding them to the page itself. the component hierarchy is thus broken. on your child page, either do getForm().add(foo) [you'll need to expose a getForm method that returns the form from the parent page] or else on your parent

RE: Forms in a base class

2010-03-21 Thread Josh Chappelle
Jeremy, What is the setTransparentResolver(true) method? I tried to find it on the form component and I couldn't? I'm using wicket 1.4.7. Thanks, Josh -Original Message- From: Jeremy Thomerson [mailto:jer...@wickettraining.com] Sent: Sunday, March 21, 2010 7:40 PM To:

Re: Forms in a base class

2010-03-21 Thread Steve Mactaggart
Excellent, My simple test now seems to work if I do a getForm(). Although I really like the thought of setTransparentResolver(), but as with Josh, I can't find it in 1.4.7.. I also have this problem with a Border object, I'll have to look into seeing if I can get around the same problem by

RE: Help with integrating NTLM in wicket application

2010-03-21 Thread Josh Chappelle
Bryan, We have an NTLMPage that we redirect the browser to. If there is no authorization header this is what we do. String auth = request.getHeader(Authorization); if (auth == null) { setRedirect(false);

Re: Forms in a base class

2010-03-21 Thread Jeremy Thomerson
Sorry, override isTransparentResolver. The set method is only on Border. -- Jeremy Thomerson http://www.wickettraining.com On Sun, Mar 21, 2010 at 8:00 PM, Steve Mactaggart steve.mactagg...@gmail.com wrote: Excellent, My simple test now seems to work if I do a getForm(). Although I

Re: Forms in a base class

2010-03-21 Thread Igor Vaynberg
dont think that will work. it will work for rendering, but for processing components it wont work because they really need to be descendants of the form. -igor On Sun, Mar 21, 2010 at 7:08 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Sorry, override isTransparentResolver.  The set