Sending Data via Javascript and AJAX

2013-03-05 Thread Nick Mudge
I could not find an example that show's how to do what I want to do. I have a web page with a Save button on it. When the user presses the Save button I want to execute some javascript which calculates a value and then I want the value to be sent to the server where I store the value in a database

Re: ToolTips with Panel

2013-03-05 Thread Rodrigo Heffner
Hi Antonio, Have you tried Twitter Bootstrap's popover ( http://twitter.github.com/bootstrap/javascript.html#popovers) ? I'm not sure you can use pages inside, but you have control of the HTML so you can use panels. On 4 March 2013 11:48, anton wrote: >

Re: Another question on stateless/bookmarkable pages

2013-03-05 Thread Igor Vaynberg
a bookmarkable page is a page that can be instantiated via a url - meaning it has a default constructor or one that takes a PageParameters object. a stateful page can or can not be bookmarkable. a stateless page must be bookmarkable. -igor On Tue, Mar 5, 2013 at 1:40 PM, Andrea Del Bene wrote:

Another question on stateless/bookmarkable pages

2013-03-05 Thread Andrea Del Bene
Hi, I still have a little doubt about stateless and bookmarkable pages. if i have understood well a stateless page must respect the following requirements: -all its children components and behaviors must be stateless -the page must be instantiated with a constructor with no argument o

Re: AutoCompleteTextField displays "null"

2013-03-05 Thread Sven Meier
What does AllPersonnel's #toString() look like? Sven On 03/05/2013 05:23 PM, grazia wrote: my difficulty is that I am using a compoundpropertyModel this way: private final CompoundPropertyModel personnelModel = new CompoundPropertyModel(new AllPersonnel()); (...) autoComplete = new AutoComplet

Re: Persisting optional fields (null vs empty object)

2013-03-05 Thread Sven Meier
Hi Luis, >a custom PropertyModel ... would you recommend against this? models are one of Wicket's key selling points. If it works for you, go for it :). Sven On 03/05/2013 06:40 PM, pureza wrote: Sven, I was somehow able to get the behavior I want by implementing a custom PropertyModel th

Re: Persisting optional fields (null vs empty object)

2013-03-05 Thread pureza
Sven, I was somehow able to get the behavior I want by implementing a custom PropertyModel that creates the object if needed or sets it to null if it is empty. This way I hope to be able to reuse this PropertyModel in all my optional fields without any special custom code. Would you recommend aga

Re: AutoCompleteTextField displays "null"

2013-03-05 Thread grazia
my difficulty is that I am using a compoundpropertyModel this way: private final CompoundPropertyModel personnelModel = new CompoundPropertyModel(new AllPersonnel()); (...) autoComplete = new AutoCompleteTextField( "personnelAutoComplete", personnelModel, AllPerso

Re: AutoCompleteTextField displays "null"

2013-03-05 Thread Sven Meier
Works fine here: http://www.wicket-library.com/wicket-examples/ajax/autocomplete Check whether your model contains "null". Sven On 03/05/2013 04:58 PM, grazia wrote: Hi ! My AutoCompleteTextField displays "null" when no selection has been made. I tried setConvertEmptyInputStringToNull(false),

Re: Persisting optional fields (null vs empty object)

2013-03-05 Thread Sven Meier
Wicket's form handling with let the textfields write their values to their models first. FormComponentPanel#updateModel() is called after that. Sven On 03/05/2013 04:12 PM, pureza wrote: Just let the textFields work on their models as usual. I can't do that, because if I set the Address to nu

Re: Persisting optional fields (null vs empty object)

2013-03-05 Thread pureza
> Just let the textFields work on their models as usual. I can't do that, because if I set the Address to null the textfields will try to update fields of a null object. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Persisting-optional-fields-null-vs-empty-object

Re: Persisting optional fields (null vs empty object)

2013-03-05 Thread Sven Meier
Hi, >The way I applied your solution ... Just let the textFields work on their models as usual. Your FormComponentPanel's #convertInput() can be a noop, override #updateModel() to null the address if all its fields are empty. But doing this stuff outside from the UI layer (as Marc has sugges

Re: Persisting optional fields (null vs empty object)

2013-03-05 Thread Marc Nuri San FĂ©lix
Hi Pureza If you are using an MVC architecture, this problem can be addressed in the controller. You should check the address field on the save event and if its values are empty, just set the address null. On the other hand, if there is an option to set the address as a whole as a null value, in

Re: Persisting optional fields (null vs empty object)

2013-03-05 Thread pureza
Hi Sven, Thanks for your reply. Your solution works, but unfortunately I have too many optional fields and the resulting code feels kind of unnatural. The way I applied your solution was by creating the TextFields without any model (or with an empty model, to be precise). Then, convertInput() get

Re: Loading different ApplicationContexts(Spring) for each WicketServlet

2013-03-05 Thread MG
> *Sven:* > SpringWebApplicationFactory already supports an additional application > context to create the application from. > > All you have to do is to pass this additional context to your > SpringComponentInjector - I'm not sure how but it should be possible. > > Then you can still use one war:

Re: idle timeout javascript when page has a modal window or tinymce editor

2013-03-05 Thread Ernesto Reinaldo Barreiro
Search the list: this has been asked and answered before. On Tue, Mar 5, 2013 at 2:19 PM, fachhoch wrote: > I am using jquery plugin to detect idle time or inactivity and signout the > user , the plugin I use works fine, but the problem is with iframes, I have > lot of modal windows and tinymce

idle timeout javascript when page has a modal window or tinymce editor

2013-03-05 Thread fachhoch
I am using jquery plugin to detect idle time or inactivity and signout the user , the plugin I use works fine, but the problem is with iframes, I have lot of modal windows and tinymce editor in my pages and when user is either typing in tinymce editor or clicking on a modal window whihc use

Re: Loading different ApplicationContexts(Spring) for each WicketServlet

2013-03-05 Thread Martin Grigorov
Check http://blog.springsource.org/2011/08/09/whats-a-factorybean/ and http://docs.oracle.com/javaee/6/api/javax/inject/Provider.html On Tue, Mar 5, 2013 at 2:47 PM, Sven Meier wrote: > Hi, > > SpringWebApplicationFactory already supports an additional application > context to create the applic

Re: Loading different ApplicationContexts(Spring) for each WicketServlet

2013-03-05 Thread Sven Meier
Hi, SpringWebApplicationFactory already supports an additional application context to create the application from. All you have to do is to pass this additional context to your SpringComponentInjector - I'm not sure how but it should be possible. Then you can still use one war: two filters

Re: Loading different ApplicationContexts(Spring) for each WicketServlet

2013-03-05 Thread Martin Grigorov
On Tue, Mar 5, 2013 at 2:18 PM, MG wrote: > > > > You can try with different interfaces for the different beans, or by > using > > @ > > Qualifier > > > > I don't think I understand what do you mean here. > Do you propose I should have beanA and beanB in my application logic? If > so, this is jus

Re: Loading different ApplicationContexts(Spring) for each WicketServlet

2013-03-05 Thread Nick Pratt
You could embed Jetty inside your app (rather than deploying a war to tomcat) and run multiple copies taking a couple of command line params - namely port number and config file location. N On Mar 5, 2013 7:19 AM, "MG" wrote: > > > > You can try with different interfaces for the different beans,

Re: Loading different ApplicationContexts(Spring) for each WicketServlet

2013-03-05 Thread MG
> > You can try with different interfaces for the different beans, or by using > @ > Qualifier > I don't think I understand what do you mean here. Do you propose I should have beanA and beanB in my application logic? If so, this is just what I was trying to avoid, because the beautiful part of the

Re: Persisting optional fields (null vs empty object)

2013-03-05 Thread Sven Meier
A FormComponentPanel might help, implement #convertInput() to set the model object to null. Sven On 03/05/2013 12:17 PM, pureza wrote: Hi, I have a form with a few inputs to fill-in Address information. When creating the form I pass it an IModel.of(new Address()) and then I use a CompoundProp

SV: Strange wicket ajax behavior

2013-03-05 Thread Tron Walseth
Hi Personally, I vote for alternative 3 :-) the link is not an ajax link, but a normal link. this is because a new popup is needed, and the AjaxLink class doesn't have popup fuctionality, but the normal link has. Is it a problem to have an empty onClick-method on a normal link, and add an aj

Persisting optional fields (null vs empty object)

2013-03-05 Thread pureza
Hi, I have a form with a few inputs to fill-in Address information. When creating the form I pass it an IModel.of(new Address()) and then I use a CompoundPropertyModel to attach each input with the corresponding Address field. However, the address is optional. If the user doesn't fill it, I'd lik

Re: Loading different ApplicationContexts(Spring) for each WicketServlet

2013-03-05 Thread Martin Grigorov
Hi, You can try with different interfaces for the different beans, or by using @ Qualifier or you can even split the app in two - two different .war files that share a common .jar. The wars just have different web.xml and applicationContext.xml On Tue, Mar 5, 2013 at 12:51 PM, MG wrote: > Excu

Loading different ApplicationContexts(Spring) for each WicketServlet

2013-03-05 Thread MG
Excuse me, if anyone is reading this for the second time, because I already tried with this question on stackoverflow (with no luck). I'm developing a web application with Spring and Wicket. I would like to achieve, that different paths get different applicationContexts loaded. *How can I do that

Re: WebSocket problem with Jetty 9

2013-03-05 Thread Martin Grigorov
Hi, Jetty 9.x APIs are not stable yet. wicket-native-websocket-jetty9 uses M0 and needs upgrade to the later 9.x milestone. You can either play with wicket-native-websocket-jetty (Jetty 7/8) or try to upgrade to the new Jetty 9.x APIs in wicket-native-websocket-jetty9 and contribute your work. O

Re: Strange wicket ajax behavior

2013-03-05 Thread Martin Grigorov
Hi, I see three options: 1) the Ajax request calls AbstractDefaultAjaxBehavior#respond(AjaxRequestTarget) and there the page is added for repaint. 2) the page is either expired (or even not stored at all, check the server logs for any exceptions) and the Ajax call cannot find the page and the comp

WebSocket problem with Jetty 9

2013-03-05 Thread Bjoern Wuest
Hello, I do my first steps using Apache Wicket and would like to test the WebSocket feature. However, I fail to get anything compiled and deployed. Wicket by itself seems to work (i,e. "message" in Index.html is replaced successfully). I am using Jetty 9.0.0M3 and Wicket 6.6.0. Here are my "

Strange wicket ajax behavior

2013-03-05 Thread Tron Walseth
Hi all, I am using wicket-openlayers to produce maps. This works (mostly) like a charm. Now I have a problem, I want to get the map extent serverside, in order to produce a list of features within the bounds of the map. In order to get this, I need to get the map extent when the link is click

Re: 42lines CDI injection failure fallback - set to null?

2013-03-05 Thread Ondrej Zizka
For the future reference: One can inject using @Inject Instance bean; and then call bean.isUnsatisfied() This wouldn't throw an exception and allow to check before use. Ondra On 03/05/2013 12:59 AM, Igor Vaynberg wrote: this is how cdi works, if it cannot inject something it