Re: Submitting values for null associations

2014-02-11 Thread Marios Skounakis
I'm not sure there is a very clean solution. When switching to edit mode, you could set the User's Job to a new Job instance if it is null. You don't have to reattach/reassign any form components if you simply update the AbstractEntityModel's object. I.e. you either do

Re: Nested Forms

2014-01-10 Thread Marios Skounakis
Html does not support nested forms. Wicket works around this limitation and allows form nesting. I think it changes the html so that the inner form tags become span tags. This means that whenever any of the forms needs to be posted, everything is posted since in the result html there's only one

Re: Auto-save feature

2014-01-07 Thread Marios Skounakis
In a similar case I've used a wrapper around validators which controls whether they run or not. This way you can automatically parse the form component tree, find all validators and wrap them in a new Validator that runs them only if needed. I've done this because I wanted to be able to have the

Re: Generate PDF

2013-12-23 Thread Marios Skounakis
In case your requirements for pdf generation are not very complex, you could use FlyingSaucer (https://xhtmlrenderer.java.net/). It basically converts html to pdf. So you can create your output in html and then convert it to pdf using flying saucer. On Mon, Dec 23, 2013 at 10:45 PM, Niranjan Rao

Re: Session invalidation and background thread

2013-11-26 Thread Marios Skounakis
, Marios Skounakis msc...@gmail.com wrote: Bas, Thanks for your answer. I understand what you're saying and you're right. If I were designing the application now I'd do one of your suggestions. But unfortunately we've written most of the code and these threads now depend on spring session

Re: Session invalidation and background thread

2013-11-23 Thread Marios Skounakis
some code to neatly stop and clean up your threads. Met vriendelijke groet, Kind regards, Bas Gooren schreef Marios Skounakis op 22-11-2013 23:45: Hi all, This is maybe a Spring question but as my app is a wicket app and I use this list regularly and everyone is very helpful I thought I'd

Session invalidation and background thread

2013-11-22 Thread Marios Skounakis
Hi all, This is maybe a Spring question but as my app is a wicket app and I use this list regularly and everyone is very helpful I thought I'd ask here first. I have a RequestCycleListener which during onBeginRequest() conditionally spawns some background threads and runs them using an Executor.

Re: Conditionally include header item when page contains ajax components

2013-11-15 Thread Marios Skounakis
(veilJsThatDependsOnOriginalWicketAjaxReference) It's probably faster too... Nick On Thu, Nov 14, 2013 at 3:04 PM, Marios Skounakis msc...@gmail.com wrote: I probably wasn't clear enough. Here's my case: BasePage.renderHead() adds veil.js as javascript resource reference

Conditionally include header item when page contains ajax components

2013-11-14 Thread Marios Skounakis
Hi all, I have a base page from which all my pages inherit. I want to conditionally include a javascript reference (header item) if the page contains an ajax component. The reference is a veil implementation based on BlockUI which is redundant (and also causes a javascript error) if the page has

Re: Conditionally include header item when page contains ajax components

2013-11-14 Thread Marios Skounakis
. On Thu, Nov 14, 2013 at 2:04 PM, Sebastien seb...@gmail.com wrote: Hi Marios, IMO the best way IMO is to make your js reference extending JQueryPluginResourceReference (wicket 6) Best regards, Sebastien. On Thu, Nov 14, 2013 at 12:20 PM, Marios Skounakis msc...@gmail.com wrote: Hi all

Re: Conditionally include header item when page contains ajax components

2013-11-14 Thread Marios Skounakis
://wicketinaction.com/2012/07/wicket-6-resource-management/ On Thu, Nov 14, 2013 at 2:59 PM, Marios Skounakis msc...@gmail.com wrote: If I'm not mistaken this will cause JQuery to be included whenever my js reference is included. Effectively this will cause non-ajax pages

Re: java.util.Properties as Form Model

2013-10-18 Thread Marios Skounakis
An idea is to wrap the Properties object in a class of your own implementing Map as follows: class MyProps implements MapString, String { Properties props; public void put(String key, String value) { if (value == null) props.remove(key); else props.put(key, value); } This does sound

Ajax behavior that can be reused for multiple components

2013-10-08 Thread Marios Skounakis
Hi all, I want to implement an ajax behavior similar to AjaxFormComponentUpdatingBehavior but which can be attached only once to a parent container component and issue ajax calls for all contained form components. So what I did was extend AbstractDefaultAjaxBehavior and pretty much copy the

Re: Ajax behavior that can be reused for multiple components

2013-10-08 Thread Marios Skounakis
component to update. On Tue, Oct 8, 2013 at 10:49 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: This link might be useful too https://github.com/reiern70/antilia-bits/tree/master/wicket-sparelinks On Tue, Oct 8, 2013 at 9:31 PM, Marios Skounakis msc...@gmail.com wrote: Hi all

Component.isVisibleInHierarchy() - expensive or not?

2013-10-03 Thread Marios Skounakis
Hi all, I have a form with a few hundred components and I am calling isVisibleInHierarchy for each one of them twice. The reason I am doing this is because I am running some validations in onValidateModelObjects() and I want them skip validations for invisible components in some cases. None of

Re: Unable to find component in Development ONLY

2013-09-15 Thread Marios Skounakis
Wicket has a setting that checks for missing components and throws an exception in development but does not do so (I think it only logs a warning) in deployment. You are actually missing component pageTitle... On Sun, Sep 15, 2013 at 4:40 PM, William Speirs wspe...@apache.org wrote: Turns out

RequestLogger and MDC

2013-08-08 Thread Marios Skounakis
Hi all, I have run into the following problem with request logger: I have a RequestCycleListener which populates MDC (logging mapped diagnostic context) with some custom properties such as the sessionId, the userId, and some other stuff. The listener populates the MDC in onBeginRequest and

RequestLogger - logging page requests only

2013-08-07 Thread Marios Skounakis
Hi all, I want to customize request logger to only log page requests. I.e. I don't want resource requests, etc. I have overridden log(RequestData rd, SessionData sd) as follows: @Override protected void log(RequestData rd, SessionData sd) { if (rd.getResponseTarget() instanceof

Re: Passing parameters from java code to global ajax call listeners

2013-07-26 Thread Marios Skounakis
...@apache.orgwrote: Hi, You may mark any component with data-no-veil attribute. Later you can check with: if ($(attrs.c).data(no-veil) !== null) {...} On Fri, Jul 26, 2013 at 1:40 AM, Marios Skounakis msc...@gmail.com wrote: Hi all, I am subscribing to the global ajax call listeners

Re: Passing parameters from java code to global ajax call listeners

2013-07-26 Thread Marios Skounakis
is to mark the component/attributes somehow On Jul 27, 2013 12:04 AM, Marios Skounakis msc...@gmail.com wrote: Martin, Thanks for your answer. I'm not sure I understand though. What does mean mark any component with data-no-veil attribute? Use an attribute appender to do something

Passing parameters from java code to global ajax call listeners

2013-07-25 Thread Marios Skounakis
Hi all, I am subscribing to the global ajax call listeners to show and hide a veil during ajax calls. The veil is displayed during all ajax calls. I want a way for some components / ajax behaviors to opt our from the veil. What I'm doing now is adding an extra parameter to the ajaxAttributes and

Re: Mutliple forms - single login popup

2013-07-20 Thread Marios Skounakis
Jeff, What you should do is set the close/submit callback of the jquery login popup before it's shown. This assumes that you show it using an ajax call and not direct javascript. You should set the close callback to execute the AjaxFormSubmitBehavior linked with the particular form that you want

Re: FormComponent independent from the Model/Model object

2013-07-09 Thread Marios Skounakis
If you want to change the state of the input fields via javascript then do what Richard said. I guess since you are using an AjaxCheckBox you want to do it on the server side via ajax. So, here's what you need to do: add a boolean property to the Panel (e.g. componentsEnabled) and bind

Re: What is the purpose of Validatable.model?

2013-06-27 Thread Marios Skounakis
the property, and retrieve validation annotations associated with it. -igor On Tue, Jun 25, 2013 at 9:53 AM, Marios Skounakis msc...@gmail.com wrote: Hi all, What is the purpose of Validatable.model? I don't seem to be able to find any usages of Validatable.getModel

What is the purpose of Validatable.model?

2013-06-25 Thread Marios Skounakis
Hi all, What is the purpose of Validatable.model? I don't seem to be able to find any usages of Validatable.getModel(), setModel() or model... Thanks Marios

Re: IInitializer order

2013-06-24 Thread Marios Skounakis
position. It works. Thanks On Mon, Jun 24, 2013 at 9:09 AM, Cedric Gatay gata...@gmail.com wrote: Hi, You can write your own IStringResourceLoader providing your set of translations and register it in front of the list through the IInitializer mechanism. Regards, Le 24 juin 2013 07:12, Marios

Re: IInitializer order

2013-06-24 Thread Marios Skounakis
exactly where is your resource bundle and knows how to load it. On Mon, Jun 24, 2013 at 10:16 AM, Marios Skounakis msc...@gmail.com wrote: Not sure if this is what you mean but in Application.init I replaced the InitializerStringResourceLoader in application.getResourceSettings

Re: IInitializer order

2013-06-24 Thread Marios Skounakis
, Martin Grigorov mgrigo...@apache.orgwrote: On Mon, Jun 24, 2013 at 10:29 AM, Marios Skounakis msc...@gmail.com wrote: Martin, What I meant is that now I have my own class MyInitializerStringResourceLoader extends InitializerStringResourceLoader and its constructor calls super

Re: Javascript confirm with condition before submit

2013-06-24 Thread Marios Skounakis
Yeah, my example is wicket 6. I believe (I may be wrong though) that the logic is the same in 1.5.7 you just need to adapt the method calls. On Mon, Jun 24, 2013 at 11:06 AM, grignette lady-eli...@hotmail.fr wrote: It doesn't work. You call commitBehavior.getCallbackScript() but : Multiple

IInitializer order

2013-06-23 Thread Marios Skounakis
Hi all, I am developing a framework library with wicket components and utility classes that is intended to be reused in all wicket apps developed by our company. I wish to override some of the standard wicket messages (e.g. wicket-extensions datatable.no-records-found=No Records Found). I have

Re: Ajax form submit and Tomcat maxPostSize/connectionTimeout

2013-06-21 Thread Marios Skounakis
, 2013 at 10:11 PM, Marios Skounakis msc...@gmail.com wrote: Hi all, I have the following problem: - User submits form with lots of textareas via ajax - User gets a blank page I think (but I'm not quite sure yet) this happens when the textareas contain so much text that either

Re: Ajax form submit and Tomcat maxPostSize/connectionTimeout

2013-06-21 Thread Marios Skounakis
, Jun 21, 2013 at 11:24 AM, Marios Skounakis msc...@gmail.com wrote: Some more info after further investigation: The problem is definitely related to tomcat maxPostSize parameter. I have set this to a very small value (100) and the problem is occurring even in very small regular (non ajax

Re: Ajax form submit and Tomcat maxPostSize/connectionTimeout

2013-06-21 Thread Marios Skounakis
. What do you think? On Fri, Jun 21, 2013 at 12:48 PM, Martin Grigorov mgrigo...@apache.orgwrote: On Fri, Jun 21, 2013 at 11:44 AM, Marios Skounakis msc...@gmail.com wrote: Actually I want to read the whole input, and increasing tomcat maxPostSize is the solution. But I was puzzled

Re: Ajax form submit and Tomcat maxPostSize/connectionTimeout

2013-06-21 Thread Marios Skounakis
Martin, Thank you for your replies. You are right that using MultipartServletWebRequestImpl you can set the max size and handle the error. Cheers Marios On Fri, Jun 21, 2013 at 2:09 PM, Martin Grigorov mgrigo...@apache.orgwrote: On Fri, Jun 21, 2013 at 12:29 PM, Marios Skounakis msc

Re: Javascript confirm with condition before submit

2013-06-21 Thread Marios Skounakis
I personally like server side confirmations because they can be customized based on the submitted data and you can use the model to customize the confirmation. If you do it client side you need to do it in javascript and using the component's values which is in my opinion ugly. Usually I override

Re: Javascript confirm with condition before submit

2013-06-21 Thread Marios Skounakis
to the db. Perhaps if you use an AjaxFormSubmitBehavior instead of an AbstractDefaultAjaxBehavior you can repost the form data after user confirmation and avoid the need to store them in a serializable domain object. I haven't tried this. On Sat, Jun 22, 2013 at 12:46 AM, Marios Skounakis msc

Re: Javascript confirm with condition before submit

2013-06-21 Thread Marios Skounakis
Here is the basic solution. I believe you can expand on this. public class ServerSideConfirmationExamplePage extends WebPage { Person person; // needs to be serializable public ServerSideConfirmationExamplePage() { this(new Person()); } public

Ajax form submit and Tomcat maxPostSize/connectionTimeout

2013-06-20 Thread Marios Skounakis
Hi all, I have the following problem: - User submits form with lots of textareas via ajax - User gets a blank page I think (but I'm not quite sure yet) this happens when the textareas contain so much text that either maxPostSize or connectionTimeout (submit tries to store to db as well) are

Re: Paging and excessive database access (repeaters)

2013-06-11 Thread Marios Skounakis
This example is not quite optimized. The DetachableContactModel's constructor is public DetachableContactModel(Contact c) { this(c.getId()); } but it should be: public DetachableContactModel(Contact c) { this(c.getId()); setObject(c); } The way it's

Reusing behaviors across components

2013-06-10 Thread Marios Skounakis
Hi all, Is there any obvious reason why adding the same behavior instance that implements onBeforeRender and onAfterRender cannot be used on multiple components on the same form? Thanks Marios

Making FormComponents read only on and off

2013-05-30 Thread Marios Skounakis
Hi all, I have what seems a rather common requirement: to be able to switch form components to read-only mode on and off in ajax updates. The simple and clear solutions is to use the enabled property, but this results in ugly disabled controls in the browser. And you can't really handle this via

Re: Making FormComponents read only on and off

2013-05-30 Thread Marios Skounakis
. Carl-Eric On Thu, 30 May 2013 16:29:56 +0300 Marios Skounakis msc...@gmail.com wrote: Hi all, I have what seems a rather common requirement: to be able to switch form components to read-only mode on and off in ajax updates. The simple and clear solutions is to use the enabled property

Re: Wicket and tomcat cluster

2013-03-29 Thread Marios Skounakis
RenderStrategy.REDIRECT_TO_RENDER by default. See javadoc for details, but in short: you should configure your load balancer for sticky sessions. Dan On Thu, Mar 28, 2013 at 2:17 PM, Marios Skounakis msc...@gmail.com wrote: Hi all, I 'm planning to setup a terracotta tomcat cluster. The wicket

Re: Wicket and tomcat cluster

2013-03-29 Thread Marios Skounakis
such hooks. Dan On Mar 29, 2013 1:06 AM, Marios Skounakis msc...@gmail.com wrote: Dan, thanks for you answer. As you said, with the default implementation of DiskDataStore only the most recent page is kept in the session state and available on all servers. So are using non-sticky sessions

Wicket and tomcat cluster

2013-03-28 Thread Marios Skounakis
Hi all, I 'm planning to setup a terracotta tomcat cluster. The wicket site claims that all Wicket applications will work on a cluster automatically and without additional work . I understand that basically since session state is kept in serializable objects within the http session, it mostly

Re: Wicket Ajax Debug Errors - how to debug?

2013-03-17 Thread Marios Skounakis
wrote: Seems like this is caused by WICKET-4959. Please file a Jira issue. Sven On 03/15/2013 09:56 PM, Marios Skounakis wrote: Hi all, I am using a modal window as a substitute for messageboxes. E.g. I have a few forms with an ajax submit button, and I am using the modal window

Wicket Ajax Debug Errors - how to debug?

2013-03-15 Thread Marios Skounakis
Hi all, I am using a modal window as a substitute for messageboxes. E.g. I have a few forms with an ajax submit button, and I am using the modal window to first display a confirmation message, and if the user accepts it, to display a success / failure message. I am getting frequent errors in the

Image.initModel() returns null and forbids attaching an image to a form CompoundPropertyModel - why?

2013-03-14 Thread Marios Skounakis
Hi all, I have created a component that extends NonCachingImage which overrides getImageResource(). The intent was to include this in a form, and retrieve the image data from a property of the form object. However this does not work because Image.initModel() returns null and as a result my

Re: Ajax Behavior not working after 1 time

2013-03-14 Thread Marios Skounakis
Yes it is. What Martin says will fix your problem. On Thu, Mar 14, 2013 at 9:35 PM, eugenebalt eugeneb...@yahoo.com wrote: Martin, we're already doing setOutputMarkupId(true) on both dropdowns. Is that one different from OutputMarkupId? -- View this message in context:

Re: Form with multiple AjaxButton - why are all onEvent() called?

2013-02-06 Thread Marios Skounakis
You probably want to override onSubmit and not onEvent. onEvent is for handling events sent by the event mechanism, not for handling clicks... On Wed, Feb 6, 2013 at 1:28 PM, Ondrej Zizka ozi...@redhat.com wrote: Hi all, With Wicket 1.5.9, I have a form with form action=# ...

Re: Problem with markup inheritance in Wicket 6

2013-02-05 Thread Marios Skounakis
://cwiki.apache.org/WICKET/markup-inheritance.html But if this was working for you in 5.x then I presume you do have the markup inheritence setup right. ~ Thank you, Paul Bors On Sat, Feb 2, 2013 at 3:52 PM, Marios Skounakis msc...@gmail.com wrote: I've seen this happen too. It's

Re: Multiple select drop down in Wicket

2013-01-15 Thread Marios Skounakis
I've considered using select2 (it looks very impressive) but I was put off by the fact that its appearance is not consistent with the rest of the input controls. How do people solve this? On Tue, Jan 15, 2013 at 6:34 PM, Paul Bors p...@bors.ws wrote: I gave up on the normal select in HTML and

Re: What is the wicket 6 equivalent of ComponentRequestTarget?

2012-12-14 Thread Marios Skounakis
(new ComponentRenderingRequestHandl er(...)) This API has changed with Wicket 1.5. You may want to read its migration page since you migrate from older version directly to Wicket 6 On Wed, Dec 12, 2012 at 10:51 AM, Marios Skounakis msc...@gmail.com wrote: Hi all, I found this old code

Re: How important is detaching models really ?

2012-11-27 Thread Marios Skounakis
Hi Colin, I find I am in agreement with your points about lazy loaded parts of the data model and how this can be simplified if you use LDMs. However, if you use LDMs for edit pages, you need to deal with concurrency issues yourself. You cannot rely on Hibernate's optimistic concurrency

AuthenticatedWebSession and remember me problem

2012-10-10 Thread Marios Skounakis
Hi all, I am using Wicket 1.5.8 with wicket-auth and I can across the following problem. I have implemented a MyWebSession extends AuthenticatedWebSession with my own authentication, and a login page with the default loginpanel with the remember option enabled. All of my pages are showing the

Usage of PageReference

2012-09-26 Thread Marios Skounakis
Hi all, I've recently started using wicket. I'm still examining the various ways to do things in order to decide how to go about and implement the UI. I've noticed (trial and error) that if you have a modal window with a page content, it's not possible to pass values between the originating and