Of IColumns, Builders and Lambdas

2017-09-18 Thread ChambreNoire
Hi,

Just wondering if anyone had already thought of instantiating IColumns using
the builder pattern in conjunction with Lambdas for things like cell/header
styling and column visibility (and more depending on the type of column) ?
My extended columns usually involve a fair bit of method overriding or large
ungainly constructors so I was thinking this might make things a tad more
succinct (LambaColumn pushed further).

Any thoughts?

Cheers

CN

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket Wizard Query

2017-08-09 Thread ChambreNoire
Hello,

Yeah I get the general gist it's just the 'return this' in 
WizardStep#getView(final String id, final Component parent, final IWizard
wizard) that I find a tad odd...

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Wizard-Query-tp4678477p4678494.html
Sent from the Users forum 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 Wizard Query

2017-08-07 Thread ChambreNoire
Hello,

Would someone with a working knowledge of the Wicket extensions Wizard
component care to explain the overall design of this component specifically
the relationship between IWizard, IWizardModel and IWizardStep ? I'm looking
over the sources and whilst I can use it fine, I don't really understand the
rationale behind the design of this component.

Many thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Wizard-Query-tp4678477.html
Sent from the Users forum 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: patterns for web ui apps. mvc models

2017-03-25 Thread ChambreNoire
Hello,

What do you make of the following ? A "view model" associated with each view
(mostly for edit forms). This model (separate from LDMs encapsulating
entities) would handle all FormComponent values and updates (select lists,
etc..). At creation it would extract required entity properties and upon
submit would be called to hydrate the entity with the changes and save. Up
until recently I put most of this logic in the Panels alongside the actual
components and the idea of calling services for saving entities from an
IModel seems wrong somehow but I would be interested in your take on this
...

Thanks!

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/patterns-for-web-ui-apps-mvc-models-tp1867567p4677441.html
Sent from the Users forum 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



Required DateTimeField not showing 'is required' feedback...

2016-09-12 Thread ChambreNoire
Hello,

Quick question: When I attach a FeedbackPanel to a DateTimeField with
setRequired(true), the required message never shows in the feedback whereas
validators like DateValidator.maximum work fine…

Any ideas?

Thanks

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Required-DateTimeField-not-showing-is-required-feedback-tp4675499.html
Sent from the Users forum 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: Bug in TreeTable example (with SelectableFolderContent)

2016-08-31 Thread ChambreNoire
Great, that's exactly what I did!

Thanks!

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Bug-in-TreeTable-example-with-SelectableFolderContent-tp4675396p4675404.html
Sent from the Users forum 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



Bug in TreeTable example (with SelectableFolderContent)

2016-08-31 Thread ChambreNoire
Hi,

I'm using Trees for the first time and I've discovered a bug with one of the
examples. 

When using SelectableFolderContent, if one does the following :

1) select a tree node/leaf 
2) collapse the selected node/leaf parent (effectively making the previous
selection invisible)
3) select another node/leaf

Boom! ClassCastException! Model cannot be cast to NodeModel at
TableTree$2.component(TableTree.java:195).

Any ideas on how to resolve this? (it happens on the live example site too!)

Many Thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Bug-in-TreeTable-example-with-SelectableFolderContent-tp4675396.html
Sent from the Users forum 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: Dynamic localisation

2016-07-01 Thread ChambreNoire
I think I'll try rolling my own Localizer to do on the fly substitutions
although that NestedStringResourceLoader looks pretty useful!

My thanks to you both,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamic-localisation-tp4674990p4675001.html
Sent from the Users forum 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: Dynamic localisation

2016-07-01 Thread ChambreNoire
The thing is, I don't know in advance which words need to be dynamically
changed.

So for instance :

"The user is not currently associated with a service"

I could want to replace 'user', 'service' or even 'associated' depending on
the context.

I could always add context-specific property files with the overridden
version :

package_contextA.properties > The peasant is not current managed by a
landowner

I suppose these could be generated at build by parsing the base
package.properties and generating context-specific property files where
necessary (only if these contain words to be replaced).

Seems a bit messy though...

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamic-localisation-tp4674990p4674992.html
Sent from the Users forum 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



Dynamic localisation

2016-06-30 Thread ChambreNoire
Hello,

I wonder if any of you have encountered a similar problem.

I'd like to be able to replace specific localised terms depending on the
context (according to a session variable with can change during the session
life).

So for instance, in certain contexts all occurrences of the word 'user'
within property bundles would be displayed as 'collaborator'.

I'd like to be able to do this in a configurable manner rather than having
to define multiple versions of my property bundles depending on this
context.

Any ideas?

Thanks

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamic-localisation-tp4674990.html
Sent from the Users forum 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: Issue with the FileUploadField

2016-06-14 Thread ChambreNoire
Ha! I've never encountered this in recent versions of Wicket (6 & 7) as I've
never needed to upload files on those projects. My question concerned an old
legacy app I need to extend running in 1.3.7 (!). So my options are migrate
to 7 (no time and not worth it), figure out the iframes trick referred to in
other posts, give up modals. So I don't want to spend any time on this so I
just reworked the interface to use a SubmitLink from a non-modal panel. 

Thanks anyway!

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Issue-with-the-FileUploadField-tp1868606p4674888.html
Sent from the Users forum 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: Issue with the FileUploadField

2016-06-13 Thread ChambreNoire
Hey there,

Little late in the day, but I'm trying to find a working example of a simple
ajax fileuploadfield to be used within a modal window. A lot of post refer
to
http://www.dooriented.com/blog/2008/04/23/wicket-ajax-like-file-upload-on-a-modal-window/
however this link is dead and I couldn't find a cached version.

If anyone could point me towards a working example I'd really appreciate
that!

Thanks

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Issue-with-the-FileUploadField-tp1868606p4674879.html
Sent from the Users forum 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



Trouble updating ListEditor with a detachable model

2016-04-11 Thread ChambreNoire
Hi,

I'm trying to use the ListEditor component from the Wicket in Action blog
(). I'm giving it a PropertyModel that points to "parent.children" where
parent is a LDM that loads a 'parent' from the database. It displays
properly however when I update the TextFields added to the ListItems and try
to save the parent, I get the following persistence exception
"org.hibernate.NonUniqueObjectException: a different object with the same
identifier value was already associated with the session".

I get the feeling that this is due to the way the ListEditor handles the
model update. What would be required to adapt it to my usage?

Many Thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Trouble-updating-ListEditor-with-a-detachable-model-tp4674272.html
Sent from the Users forum 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: ResourceModel usage within ModalWindow content Panel

2016-03-19 Thread ChambreNoire
Nevermind, using a PackageStringResourceLoader works fine!

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ResourceModel-usage-within-ModalWindow-content-Panel-tp4674067p4674077.html
Sent from the Users forum 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: ResourceModel usage within ModalWindow content Panel

2016-03-19 Thread ChambreNoire
No that won't work anyway because the ModalWindow instance is added at the
page level and reused throughout. So basically I need to pass the panel
where the content panel is instantiated to this content panel so that it can
resolve the resources. Bit ugly..

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ResourceModel-usage-within-ModalWindow-content-Panel-tp4674067p4674071.html
Sent from the Users forum 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: ResourceModel usage within ModalWindow content Panel

2016-03-19 Thread ChambreNoire
Hey there,

Indeed I'm using a Panel rather than a separate page.

I could just use StringResourceModel("key", modalwindow.getParent(), null)
but I was hoping for something less verbose that would cover all
resourcemodel use in the modal content panel...

Thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ResourceModel-usage-within-ModalWindow-content-Panel-tp4674067p4674069.html
Sent from the Users forum 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



ResourceModel usage within ModalWindow content Panel

2016-03-19 Thread ChambreNoire
Hi,

I'd like to be able to use localised string resources declared within the
ModalWindow's parent panel from within the ModalWindow content Panel.

Any ideas?

Many Thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ResourceModel-usage-within-ModalWindow-content-Panel-tp4674067.html
Sent from the Users forum 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



Difficulty with related, mutually updating fields

2015-11-23 Thread ChambreNoire
Hello,

I have a form with the following fields : start date, duration (in days) &
end date. I want the user to be able to enter EITHER a duration OR an end
date and the other field will be automatically calculated according to this
and the start date. Each field has an associated feedback label. However,
simple as this seems, I’m having trouble pulling it off. Here’s what I’m
going for in terms of behaviour:

+ If the start date is missing, the others are blanked and disabled.

+ Changing either field results in an ajax update of both and the other
field is calculated.

+ When the form is submitted, the “calculated” field must be null (even
though it displays the calculated value). The underlying domain object
should have either a duration or an end date but not both.

+ If a user removes the value of the calculated field, it just gets
recalculated.

+ If a user changes the value of the calculated field (for a valid value),
the other field is blanked and is updated with a calculated value - it
becomes the calculated field.

+ If a user enters an invalid value into the calculated field this results
in a feedback error and the non-calculated field doesn’t update.

+ Similarly, if the user enters an invalid value into the non-calculated
field the feedback error is shown and the calculated field is NOT updated
(it remains based on the previous valid non-calculated field value).

+ It would be nice to be able to chain these fields – have another duration
/ end date couple which use the first couple’s end date (calculated or not)
as a start date. 

Any pointers would be most appreciated as I’m having trouble seeing this
clearly…

Thanks,

CN


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Difficulty-with-related-mutually-updating-fields-tp4672701.html
Sent from the Users forum 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



Validating Forms before page load

2015-10-16 Thread ChambreNoire
Hello,

Is there any way to programmatically validate a wicket form on page/panel
load? I have a panel who's visibility is determined by its sibling form's
validity. That works fine except on initially loading the parent panel as
the new form is considered valid regardless of content...

Many thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Validating-Forms-before-page-load-tp4672260.html
Sent from the Users forum 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: Validating Forms before page load

2015-10-16 Thread ChambreNoire
Yeah I'd have prefered to just call form.hasError rather than checking 10
fields on the modelobject but hey it works!
Thanks,
CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Validating-Forms-before-page-load-tp4672260p4672262.html
Sent from the Users forum 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: Upgrading Wicket 1.2 site

2015-09-08 Thread ChambreNoire
I did a migration from 1.3.7 to 6.18 quite recently (main project plus shared
sub-module). I found the process quite simple really and it was an
opportunity to revisit some very poorly constructed code. My main problem
wasn't so much with the migration itself but with my colleagues' code.
Clearly the majority have very little understanding of the overall 'Wicket
philosophy', the most egregious failing being a complete lack of
understanding of the power of Wicket models and the pull model.

This could also be an opportunity for you to take a step back and
re-evaluate a lot of decisions both technical and functional (which
regrettably wasn't possible in my case). Maybe Wicket isn't suitable for you
anymore or maybe the rest of your project could use an architectural
rethink.

Good luck whatever you choose!

CN 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Upgrading-Wicket-1-2-site-tp4671909p4671924.html
Sent from the Users forum 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: Download serves empty files with correct number of pages !?!

2015-03-31 Thread ChambreNoire
OK so the empty PDFs where due to some strangeness with the build config
which is fixed. The filename and extensions are added by
item.getModelObject().getFile(). So it works fine now however using
DownloadLink the file still downloads rather than is opened in a new tab. 

Any ideas?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Download-serves-empty-files-with-correct-number-of-pages-tp4670117p4670125.html
Sent from the Users forum 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: Download serves empty files with correct number of pages !?!

2015-03-31 Thread ChambreNoire
Is there an easy way of overloading the ContentDisposition.ATTACHMENT already
used in DownloadLink?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Download-serves-empty-files-with-correct-number-of-pages-tp4670117p4670127.html
Sent from the Users forum 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: Download serves empty files with correct number of pages !?!

2015-03-30 Thread ChambreNoire
Francois Meillet wrote
 path = new ClassPathResource(descriptors/hc).getFile(); 
 the path isn't null ?

Nope. By the time we get to the line :

return new FileResourceStream(new File(path, getModelObject().getFile()));

the path isn't null and this ends up instantiating a FileResourceStream with
a file that both has the correct path and exist()s...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Download-serves-empty-files-with-correct-number-of-pages-tp4670117p4670121.html
Sent from the Users forum 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: Download serves empty files with correct number of pages !?!

2015-03-30 Thread ChambreNoire
Sure but no exception is thrown!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Download-serves-empty-files-with-correct-number-of-pages-tp4670117p4670119.html
Sent from the Users forum 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: Large forms

2015-02-24 Thread ChambreNoire
Many thanks for all the options!

Since I'm on the subject of large forms, I was wondering what you opinion of
appropriate class / db design is for such cases (300+ fields)? I was
thinking of splitting the form into a number of sub-forms each with its own
entity / table. The main issue with this would be doing lots of db joins -
especially considering that the fields to sub-form ratio would vary (some
could have up to 30 fields and others as little as one). There's also the
EAV approach but there seem to be many conflicting opinions on this. I'm
currently using a relational db but a move to nosql would be possible if it
would greatly simplify this issue...

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Large-forms-tp4669718p4669748.html
Sent from the Users forum 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



Large forms

2015-02-23 Thread ChambreNoire
Hey there,

In the case of large forms with 20+ fields, how should one go about coding
the wicket components? I have a large form of over 300 fields divided into
20 pages to code. Instantiating and wiring up each of these one by one would
take an age. 

Any ideas?

Many thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Large-forms-tp4669718.html
Sent from the Users forum 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: Large forms

2015-02-23 Thread ChambreNoire
Yes I'm aware of WicketRAD and WicketBeans but both projects appear to have
been abandonned. I take it there's nothing more recent? I'll have to
implement something myself (and these two projects will certainly be useful
for inspiration).

Thanks

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Large-forms-tp4669718p4669720.html
Sent from the Users forum 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: ListenerInvocationNotAllowedException woes

2015-02-19 Thread ChambreNoire
 OK, it seems that this is now a regular occurrence on our production
platform so any assistance you can provide would be greatly appreciated...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ListenerInvocationNotAllowedException-woes-tp4669616p4669645.html
Sent from the Users forum 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: ListenerInvocationNotAllowedException woes

2015-02-19 Thread ChambreNoire
Yes I confirm that isEnabledInHierarchy == false

Here you go :

org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException:
Behavior rejected interface invocation. Component: [AjaxLink [Component id =
search]] Behavior: org.apache.wicket.ajax.markup.html.AjaxLink$1@73829fd3
Listener: [RequestListenerInterface name=IBehaviorListener, method=public
abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()]
at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:237)
at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:250)
at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:236)
at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:890)
at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at
org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:122)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at
org.apache.catalina.core.StandardHostValve.__invoke(StandardHostValve.java:170)
org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException:
Behavior rejected interface invocation. Component: [AjaxLink [Component id =
search]] Behavior: org.apache.wicket.ajax.markup.html.AjaxLink$1@73829fd3
Listener: [RequestListenerInterface name=IBehaviorListener, method=public
abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()]
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java)
at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:237)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:250)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:236)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:890)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
at java.lang.Thread.run(Thread.java:745)
at

Re: ListenerInvocationNotAllowedException woes

2015-02-19 Thread ChambreNoire
Hi,

The search AjaxLink is disabled. It's a service link and when it is
clicked, it changes a content panel and sets a current view session
variable. Its onConfigure method sets enabled based on whether the link
refers to the current view. So effectively, click it once and it gets
disabled until a different service link is clicked. 

So this happens because of this. But surely disabling links like this is
pretty common? Why is this an issue now?

Many thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ListenerInvocationNotAllowedException-woes-tp4669616p4669652.html
Sent from the Users forum 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: ListenerInvocationNotAllowedException woes

2015-02-19 Thread ChambreNoire
Hmm that's what I thought. It's just that this has never been an issue
before. Maybe this has something to do with our recent migration to tomcat7
vs an embedded Jetty previously...

I'll implement the suggeted changes. Thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ListenerInvocationNotAllowedException-woes-tp4669616p4669654.html
Sent from the Users forum 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



ListenerInvocationNotAllowedException woes

2015-02-18 Thread ChambreNoire
Hi there,

Since our recent migration to 6.18 we've been getting a fair number of
ListenerInvocationNotAllowedExceptions when users click on links. This
redirects them to page which states that the access is denied. Here's a
typical trace :

org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException:
Behavior rejected interface invocation. Component: [AjaxLink [Component id =
patients]] Behavior: org.apache.wicket.ajax.markup.html.AjaxLink$1@5f7f5101
Listener: [RequestListenerInterface name=IBehaviorListener, method=public
abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] 
at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:237)
 
at
org.apache.wicket.core.reqzuest.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:250)
at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:236)
at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:890)
 
at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
 
at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261) 
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
 
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
 
at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
 
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282) 
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 
at
org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
 
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
 
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
 
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
 
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) 
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) 
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) 
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
 
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) 
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
 
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
 
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
 
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 
at java.lang.Thread.run(Thread.java:745) 

I've poked around online and it seems that this would be solved by
specifying an ACTIVE AjaxChannel thus :

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);

attributes.setChannel(new AjaxChannel(AjaxChannel.DEFAULT_NAME,
AjaxChannel.Type.ACTIVE));
}

Obviously I can refactor this into a Custom Link class to avoid code
duplication but it still seems a bit odd to have to re-wire all our links
(plus I currently don't really have much of a handle on AjaxChannels). Could
this approach have any unwanted side-effects?

Many thanks,

CN


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ListenerInvocationNotAllowedException-woes-tp4669616.html
Sent from the Users forum 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



When should one use fragments?

2015-01-21 Thread ChambreNoire
Hello,

I'm going over some old code and I have noticed that some devs are using
fragments to slice up views. For instance, one Panel only has a single
'content' div and then the 3 different views are displayed by switching
between 3 Fragments with replaceWith(). This seems to me to break the 'avoid
changing the component hierarchy' best practice. My understanding was that
Fragments were mostly of use in ListView scenarios.

Any thoughts on this and appropriate Fragment use in general?

Thanks,

CN


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/When-should-one-use-fragments-tp4669062.html
Sent from the Users forum 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: DebugBar reports strange sizes

2015-01-05 Thread ChambreNoire
I'm having trouble fully understanding Wicket's serialization. 

I understand that if I declare a final object outside of an anonymous inner
class and then use it from within that anonymous inner class, the compiler
will ass a member variable to the anonymous inner class which gets
serialized.

final Object outer = /a 10K entity/;

add(new Label(label, new LoadableDetachableModel() {

@Override
protected Object load() {
return outer;
}
}));

However if the containing component / page has a large Model 

setDefaultModel(Model.of(/a 50K entity/));

DebugBar Inspector reports that the Label takes up 66.5K (including the 6.1K
debugbar).

Does this mean that all anonymous inner classes, declared within a component
with such a model, will serialize a copy of the container? This seems to be
what the sizes reported by the DebugBar suggests...

(I'm aware of the correct usage of LDMs etc. I'd just like to understand the
consequences of the various anti-patterns)

Thanks,

CN



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DebugBar-reports-strange-sizes-tp4668920p4668926.html
Sent from the Users forum 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



DebugBar reports strange sizes

2015-01-04 Thread ChambreNoire
Hello,

I’m playing around, trying to make sense of the DebugBar Inspector, in
particular the sizes reported.

I have a page with two Labels. I have artificially boosted their sizes with
a large instance variable. One is 1M the other 0,5M. In the inspector each
is reported as 1,5M. 

Any ideas why this is?

Many Thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DebugBar-reports-strange-sizes-tp4668920.html
Sent from the Users forum 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



Select overlaping inside autosized ModalWindow

2014-12-17 Thread ChambreNoire
Hi,

I have just noticed that if one places a select within the content panel
assigned to a ModalWindow, if the select is wider than any other component
in the content, it overlaps.

ex:

modal = new ModalWindow(modal)
.setInitialHeight(0)
.setInitialWidth(0)
.setMinimalHeight(0)
.setMinimalWidth(0)
.setContent(new TestPanel(ModalWindow.CONTENT_ID))
.setAutoSize(true);

wicket:panel
test
select
optionOne/option
optionTwo/option
optionPretty long string just for example/option
optionThree/option
/select
/wicket:panel

Any ideas?

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Select-overlaping-inside-autosized-ModalWindow-tp4668822.html
Sent from the Users forum 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: Using 6.X snapshots

2014-12-10 Thread ChambreNoire
Nevermind. It was a combination of the update not going through due to
problems with my VPN setup and the small fact that the version should have
been 6.19.0-SNAPSHOT and not 6.19-SNAPSHOT.

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-6-X-snapshots-tp4668702p4668705.html
Sent from the Users forum 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



Stateless login page with auth-roles

2014-12-10 Thread ChambreNoire
Hi,

I've followed the Wicket guide's chapter on security in order to implement
authorization. Amongst other bits it advises using the following code in the
AuthenticatedPage :

@Override
protected void onConfigure() {
super.onConfigure();

AuthenticatedWebApplication app =
(AuthenticatedWebApplication)Application.get();
//if user is not signed in, redirect him to sign in page
if(!AuthenticatedWebSession.get().isSignedIn())
app.restartResponseAtSignInPage();
}

The problem is that restartResponseAtSignInPage() binds a new session so I
end up with a session despite redirecting to the stateless login page.

Any ideas?

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Stateless-login-page-with-auth-roles-tp4668706.html
Sent from the Users forum 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: Stateless login page with auth-roles

2014-12-10 Thread ChambreNoire
No, not directly, but it leads to the set() method of
RestartResponseAtInterceptPageException's inner InterceptData class which
calls bind();

https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java#L141

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Stateless-login-page-with-auth-roles-tp4668706p4668709.html
Sent from the Users forum 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: Stateless login page with auth-roles

2014-12-10 Thread ChambreNoire
Yes I thought of that but it doesn't redirect to the loginpage (and results
in WicketRuntimeExceptions - Error attaching this container for rendering -
possibly because of a resulting page missmatch). I'm obviously missing
something...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Stateless-login-page-with-auth-roles-tp4668706p4668712.html
Sent from the Users forum 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



Using 6.X snapshots

2014-12-09 Thread ChambreNoire
Hi,

How can one work with the latest snapshot of a specific wicket module. I'm
trying to use wicket-auth-roles 6.19.0-SNAPSHOT but Maven won't retrieve
it...

dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket-auth-roles/artifactId
version6.19-SNAPSHOT/version
/dependency

with the proper added repository as found on the wicket main site.

Any ideas?

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-6-X-snapshots-tp4668702.html
Sent from the Users forum 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: turning off page versioning

2014-12-08 Thread ChambreNoire
Hmm it's no really working for me. Occassionally ajax links within the single
page cause a StalePageException which results in a refresh but without the
expected panel change normally caused by the link which is jarring..

Any ideas?

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/turning-off-page-versioning-tp4667631p4668677.html
Sent from the Users forum 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: turning off page versioning

2014-12-08 Thread ChambreNoire
ok but it has only started happening since I added the single-page-instance
code...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/turning-off-page-versioning-tp4667631p4668679.html
Sent from the Users forum 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: Force AjaxLink to be enabled

2014-12-05 Thread ChambreNoire
Hmm. I managed to get this working for AjaxLinks but now I have a similar
situation for simple 'Link's used to download files via
ResourceStreamRequestHandler. I override isLinkEnabled() but I still get a
ListenerInvocationNotAllowedException. 

Any ideas?

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-AjaxLink-to-be-enabled-tp4668631p4668661.html
Sent from the Users forum 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: Force AjaxLink to be enabled

2014-12-05 Thread ChambreNoire
gah!

Always finish debugging before posting. Just needed to override
canCallListenerInterface(). Easy peasy!

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-AjaxLink-to-be-enabled-tp4668631p4668662.html
Sent from the Users forum 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



Force AjaxLink to be enabled

2014-12-04 Thread ChambreNoire
Hi,

Having recently migrated an old app all the way from 1.3 to 6, one of the
issues I encountered was that links and other component take their parents
into consideration when determining their enabled state (introduced in
1.4?). This is a real pain for me in a few specific cases. I can't override
isEnabledInHierarchy as it's final. Is there a easy quick and dirty way
around for a given link ? 

Many Thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-AjaxLink-to-be-enabled-tp4668631.html
Sent from the Users forum 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: Force AjaxLink to be enabled

2014-12-04 Thread ChambreNoire
Ha! Yes I was going to do that tonight but fine. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-AjaxLink-to-be-enabled-tp4668631p4668633.html
Sent from the Users forum 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: FIXED: TextField cursor reset mid-editing

2014-12-04 Thread ChambreNoire
OK so this is what I have. Disclaimer: I'm no javascript/jQuery expert so
this is mostly cobbled together from things I have found online and tested
in my particular situation. Any optimisations are more than welcome!

So first the script

(function($) {
$.fn.getCaretPosition = function() {
var input = this.get(0);
if (!input) return; // No (input) element found
if ('selectionStart' in input) {
// Standard-compliant browsers
return input.selectionStart;
} else if (document.selection) {
// IE
input.focus();
var sel = document.selection.createRange();
var selLen = document.selection.createRange().text.length;
sel.moveStart('character', -input.value.length);
return sel.text.length - selLen;
}
};
$.fn.setCaretPosition = function(position) {
var input = this.get(0);
if (!input) return false; // No (input) element found

input.value = input.value;
// ^ this is used to not only get focus, but
// to make sure we don't have it everything -selected-
// (it causes an issue in chrome, and having it doesn't hurt any
other browser)

if (input.createTextRange) {
var range = input.createTextRange();
range.move('character', position);
range.select();
return true;
} else {
// (input.selectionStart === 0 added for Firefox bug)
if (input.selectionStart || input.selectionStart === 0) {
input.focus();
input.setSelectionRange(position, position);
return true;
} else  { // fail city, fortunately this never happens (as far
as I've tested) :)
input.focus();
return false;
}
}
}
})(jQuery);

Then I add the following behavior to my TextField :

add(new AjaxFormComponentUpdatingBehavior(onkeyup) {

@Override
protected void onUpdate(AjaxRequestTarget target) {

String id = getComponent().getMarkupId();

String caret = id + _caretPosition;
String selector = $('# + id + ');

target.prependJavaScript(var $s =  + selector +
;if($s[0]===document.activeElement){ +
jQuery.data(document,' + caret + ', + selector +
.getCaretPosition());});

onFieldUpdate(getFormComponent(), target);

target.appendJavaScript(var $p = jQuery.data(document,' + caret +
'); +
if($p!=undefined){ + selector + .setCaretPosition($p); +
jQuery.removeData(document,' + caret + ');});
}

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);

String id = getFormComponent().getMarkupId() + _onkeyup;

attributes.setThrottlingSettings(new ThrottlingSettings(id,
seconds(1), true));
}
});

So this gets round the 'zapping focus back to the original field after
hitting tab' issue I experienced as the behavior will be called a bit after
I hit tab due to the throttle settings but that won't affect whether the
field is focused or not (it won't regain focus). So I can check this and
bypass the whole thing if the field isn't focused simply by not storing the
caret position and consequently not re-setting it.

You'll notice I'm storing the caretPosition in 'document' using
jQuery.data(). There's probably a more 'js/jquery best practices' way to do
this. I should also be clearing the position once I set it (thinking out
loud) so I'll add that above.

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-cursor-reset-mid-editing-tp4668582p4668635.html
Sent from the Users forum 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: Force AjaxLink to be enabled

2014-12-04 Thread ChambreNoire
Haha I had already overridden AbstractLink#isLinkEnabled()  and yes now
Wicket renders a link rather than a span but clicking doesn't work.
OnClick() isn't called at all.

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-AjaxLink-to-be-enabled-tp4668631p4668638.html
Sent from the Users forum 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



FIXED: TextField cursor reset mid-editing

2014-12-03 Thread ChambreNoire
Nevermind. I figured it out. I just needed to perform the check on the
prepend rather than the append.

Thanks for the help!

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-cursor-reset-mid-editing-tp4668582p4668606.html
Sent from the Users forum 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: TextField cursor reset mid-editing

2014-12-02 Thread ChambreNoire
Hi, 

I've got this working now but there's a catch:

Given two textfields with both this enhanced onKeyup behavior and an onBlur
behavior, if I quickly type something into the first field, press tab and
start typing into the second field there is some strangeness with the field
focusing.

field1:onblur
field1:onkeyup
field2:onblur
field2:onkeyup
field1:onblur

So on-screen this means that while I'm typing into the second field the
focus is shifted back to the first and then to the second again. If I'm
still typing when this happens, focus with go back to the first field after
this. It's a mess.

Can anyone think of a way around this? I tried making the onKeyUp
setCaretPosition conditional upon field focus but this doesn't work as
:focus returns false strangely...

field.add(new AjaxFormComponentUpdatingBehavior(onkeyup) {

@Override
protected void onUpdate(AjaxRequestTarget target) {

String selector = $('# + getComponent().getMarkupId() + ').;

target.prependJavaScript(selector + data.caretPosition =  +
selector + getCaretPosition(););

onFieldUpdate(getFormComponent(), target);

target.appendJavaScript(selector + setCaretPosition( + selector +
data.caretPosition););
}

Many thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-cursor-reset-mid-editing-tp4668582p4668599.html
Sent from the Users forum 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: TextField cursor reset mid-editing

2014-12-02 Thread ChambreNoire
I'm afraid that doesn't work . When the keyup behavior updates a field that
the user is editing, the refresh of its parent must cause the field to loose
focus and therefore the caret is never repositioned. Without the
'$('#id')[0] === document.activeElement' it works but, as previously
described, then tabbing between fields is a mess.

I dumped a boiled down quickstart illustrating this  here
https://dl.dropboxusercontent.com/u/32242922/fields.zip  .

The only way I see this working is by using some convoluted global variable
where the caret position is stored in a global variable, indexed against the
markupId and flushed by the onblur behavior to avoid repositioning. Seems
pretty crap...

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-cursor-reset-mid-editing-tp4668582p4668601.html
Sent from the Users forum 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



TextField cursor reset mid-editing

2014-11-28 Thread ChambreNoire
Hi,

I was wondering if there's a way around the following problem - at least a
slightly more elegant one than I came up with! 

When one adds an AjaxFormUpdatingBehavior(onkeyup) to a TextField, if
during the update the source TextField is added to the AjaxRequestTarget the
resulting behaviour is a TextField which periodically resets it's
cursor/caret position to zero (depending on the Behavior's throttle
settings). This is obviously problematic during typing.

In my particular case, the TextField in question is within a container
alongside the label, suffix and a bunch of status indicators (a super-field
of sorts). These all react to changes in the textfield content. When I'm
updating from outside it's not a problem but when the update comes from
within as a result of an onKeyUp update, I add the container to the
AjaxRequestTarget in order to get all the sub-components updated and thus
end up with the aforementioned cursor issue. 

I have worked around this by performing partial updates in this specific
case (all the siblings minus the offending textfield) and appending some
JQuery to the AjaxRequestTarget in order to update the container css class
but it's hardly ideal...

Any thoughts?

Thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-cursor-reset-mid-editing-tp4668582.html
Sent from the Users forum 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: TextField cursor reset mid-editing

2014-11-28 Thread ChambreNoire
Many Thanks. 

That works fine as far as the cursor is concerned but it seems that on the
ajax call, if the textfield is smaller than the content it contains, the
content is scrolled back to the start (while the cursor stays where it
should be). I'm currently trawling the web for solutions to this.

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-cursor-reset-mid-editing-tp4668582p4668586.html
Sent from the Users forum 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



Migrating SecondLevelCacheSessionStore

2014-11-03 Thread ChambreNoire
Hello Wicketeers,

I am posting this question in the hope that some if the more knowledgeable
members of the wicket community can help me understand Wicket's
serialisation process and use of SessionStores, etc..

I have been tasked with overhauling a fairly old Wicket project and this
includes migrating from Wicket 1.3.8 to 1.6+. I have been migrating
incrementally and I'm now working my way to 1.5.12 compliance. The issue I
have encountered is as follows : in 1.3 a SecondLevelCacheSessionStore was
used with a DiskPageStore which had most of it's methods overridden and
either left empty or set to return null or false. The original programmer
left no indication of why this was done (I'm told there was a ‘valid’ reason
but no-one remembers and it would seem that this former colleague didn’t
believe in documentation and/or commenting). 

This is an area of Wicket I've always left alone so consequently I have
little notion of what is actually happening here. I’d appreciate any
information about this aspect of Wicket as I’m having trouble finding online
resources which can spell this out. This would certainly bolster my Wicket
knowledge and help me understand what my predecessor was trying to achieve,
why,  whether it’s still applicable and if need be how to port it to 1.5+.

Many thanks in advance,

C

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Migrating-SecondLevelCacheSessionStore-tp4668256.html
Sent from the Users forum 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: Migrating SecondLevelCacheSessionStore

2014-11-03 Thread ChambreNoire
I should add that this web application uses a Single Page approach.
Everything is achieved via ajax panel replacement (which would make page
versioning redundant wouldn't it?)...

C

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Migrating-SecondLevelCacheSessionStore-tp4668256p4668257.html
Sent from the Users forum 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



IModel-based multiple-selection DataTable

2014-05-27 Thread ChambreNoire
Hello,

I'm trying to roll my own paginated multiple-selection datatable and I'm not
sure how to store the selected entities. Many of the solutions I have found
online simply add/remove selected entities to/from a SetMyEntity located
in the parent component however my DataProviders use
LoadableDetachableModels. I could always store them in a Set of IModels but
then I'd have to load everything for comparisons. I'm currently digging
around in the sources for DataTable and I'm thinking that maybe I would have
to provide a custom Item id generation based on the persistent entities' ids
and use that to determine whether an item is selected or not but I'm not too
sure about this approach (and would also make this solution un-generic)...

Has anyone else tried something along these lines?  

Many Thanks,

Anthony

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IModel-based-multiple-selection-DataTable-tp4666043.html
Sent from the Users forum 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: Tooltips/Contextual menu with interactive content

2014-02-22 Thread ChambreNoire
Yup,

I found it shortly after my original post. I'm a bit apprehensive about
overriding jQuery styles but other than that it certainly looks promising.
Only problem, I'm running 1.4 on this project (old project no mandate to
upgrade to 6 unfortunately).

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Tooltips-Contextual-menu-with-interactive-content-tp4664619p4664632.html
Sent from the Users forum 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



Tooltips/Contextual menu with interactive content

2014-02-21 Thread ChambreNoire
Hello folks,

Here's what I'd like to achieve : A user clicks on an image - although this
could be any type of component (I suppose this makes it more of a contextual
menu). A floating panel appears over/below the component. In this panel I
can put anything but in my specific use case I'd like a simple vertical list
of actions (perhaps with icons) which depend on the component that the menu
is attached too. Clicking on an action will perform a state change at the
level of the component. All this ajaxified.

I've been looking around for something htat would permit me to achieve this
without too much hastle (not being much of a JQuery/JS expert) without much
success. Any ideas? 

Many thanks,

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Tooltips-Contextual-menu-with-interactive-content-tp4664619.html
Sent from the Users forum 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: Hybrid palette with DropDownChoice and ListView

2014-02-19 Thread ChambreNoire
Great, I'm still getting NonUniqueObjectExceptions when I save. Back to the
drawing board. *sigh*

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Hybrid-palette-with-DropDownChoice-and-ListView-tp4664445p4664562.html
Sent from the Users forum 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: Hybrid palette with DropDownChoice and ListView

2014-02-14 Thread ChambreNoire
OK so this is what I have so far. Seems to work OK.

public class DropDownPaletteT extends FormComponentPanel {

private static final String UNSELECTED_ID = unselected;
private static final String SELECT_ACTION_ID = select;
private static final String SELECTED_ID = selected;
private static final String SELECTED_NAME_ID = selected_name;
private static final String UNSELECT_ID = unselect;

private IModel choicesModel;
private IChoiceRenderer choiceRenderer;

private transient ListT selectedChoices;
private transient ListT unselectedChoices;

private String[] ids;

public DropDownPalette(String id, IModel model, IModel choicesModel,
IChoiceRenderer choiceRenderer) {
super(id, model);

setOutputMarkupId(true);

this.choicesModel = choicesModel;
this.choiceRenderer = choiceRenderer;

IModel unselectedChoices = new LoadableDetachableModel() {

@Override
protected Object load() {

return getUnselectedChoices();
}
};

DropDownChoice choice = new DropDownChoice(UNSELECTED_ID, new
Model(), unselectedChoices, choiceRenderer);

choice.add(new OnChangeAjaxBehavior() {

@Override
protected void onUpdate(AjaxRequestTarget target) {

target.addComponent(DropDownPalette.this);
}
});

add(choice);

add(new AjaxLink(SELECT_ACTION_ID) {

@Override
public void onClick(AjaxRequestTarget target) {

getModelCollection().add(getCurrentChoice());

setCurrentChoice(null);
initIds();

onItemSelected(target);

target.addComponent(DropDownPalette.this);
}

@SuppressWarnings(unchecked)
private T getCurrentChoice() {
return (T) getParent().get(UNSELECTED_ID).getModelObject();
}

private void setCurrentChoice(T choice) {
getParent().get(UNSELECTED_ID).setModelObject(choice);
}

@Override
protected void onBeforeRender() {

setVisibilityAllowed(getCurrentChoice() != null);
super.onBeforeRender();
}

@Override
protected boolean callOnBeforeRenderIfNotVisible() {
return true;
}
});

IModel selectedChoices = new AbstractReadOnlyModel() {

@Override
public Object getObject() {
return getSelectedChoices();
}
};

add(new ListView(SELECTED_ID, selectedChoices) {

@Override
protected void populateItem(ListItem item) {

Object displayValue =
getChoiceRenderer().getDisplayValue(item.getModelObject());

item.add(new Label(SELECTED_NAME_ID, new
Model(String.valueOf(displayValue;

item.add(new AjaxLink(UNSELECT_ID) {

@Override
@SuppressWarnings(SuspiciousMethodCalls)
public void onClick(AjaxRequestTarget target) {

   
getModelCollection().remove(getParent().getModelObject());

flushSelectedChoices(); // in order to reload the
choices

onItemUnselected(target);

target.addComponent(DropDownPalette.this);
}
});
}
});
}

protected void onItemUnselected(AjaxRequestTarget target) {}

protected void onItemSelected(AjaxRequestTarget target) {}

@Override
protected void convertInput() {
setConvertedInput(getSelectedChoices());
}

protected void onBeforeRender() {

if (!getForm().hasError()) {
initIds();
}
super.onBeforeRender();
}

@SuppressWarnings(unchecked)
public ListT getSelectedChoices() {

if (selectedChoices == null) {

IChoiceRenderer renderer = getChoiceRenderer();

if (ids.length == 0) {
return Collections.EMPTY_LIST;
}

selectedChoices = new ArrayListT(ids.length);

for (String id : ids) {

for (T choice : getChoices()) {

if (renderer.getIdValue(choice, 0).equals(id)) {

selectedChoices.add(choice);
break;
}
}
}
}
return selectedChoices;
}

@SuppressWarnings(unchecked)
public ListT getUnselectedChoices() {

if (unselectedChoices == null) {

CollectionT choices = getChoices();

if (choices.size() - ids.length == 0) {
return Collections.EMPTY_LIST;
}

unselectedChoices = new ArrayListT(Math.max(1, choices.size()
- ids.length));


Hybrid palette with DropDownChoice and ListView

2014-02-13 Thread ChambreNoire
Hello,

I'd like to create a hybrid 'palette'. First there's a DropDownChoice with
an 'Add' link and next to this a vertical list of selected items, each with
a 'remove' link. Of course, adding an item removes it from the
DropDownChoice and adds it to the list and vice-versa for item 'removal'. 

I have already started but I fear that this is probably going to be fairly
complicated as it involves using ListViews in a form and DropDownChoice
customisation so any pointers to get me going would be most appreciated.
I'll post some code once I have something vaguely functional!

Thanks,

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Hybrid-palette-with-DropDownChoice-and-ListView-tp4664445.html
Sent from the Users forum 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: Hybrid palette with DropDownChoice and ListView

2014-02-13 Thread ChambreNoire
Thanks for the suggestions. Regrettably the spec requires a vertical list of
labels and specifically not a multi choice list as used in the extensions
Palette component otherwise yes it would be trivial to make the right hand
side a one row drop down as you mention...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Hybrid-palette-with-DropDownChoice-and-ListView-tp4664445p4664448.html
Sent from the Users forum 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



Submitting values for null associations

2014-02-11 Thread ChambreNoire
Hi,

I have a form which can flip between edit and view modes. Its fields share a
common CompoundPropertyModel which in turn points to an AbstractEntityModel
similar to that described in the 'Wicket in Action' blog. 

My problem is with associations that happen to be null. If I have a User
entity with a lazily initialised Job association, during viewing all works
fine but when I edit the user and enter some text into a field that is bound
to User.Job.Name I get a WicketRuntimeException: Attempted to set property
value on a null object. How is this kind of situation generally handled?

Many thanks,

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Submitting-values-for-null-associations-tp4664365.html
Sent from the Users forum 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: Submitting values for null associations

2014-02-11 Thread ChambreNoire
Yes I'm aware of this but the problem is I'm reusing the same
AbstractEntityModel (effectively a LoadableDetachableModel that loads from
the db) for the edit mode and the User instance in the db has no Job
instance (yet). I could always re-build a Model using the unproxied User
instance when I flip from view to edit but then all the child form
components would need to be reassigned as I'm not rebuilding the view...

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Submitting-values-for-null-associations-tp4664365p4664368.html
Sent from the Users forum 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: Submitting values for null associations

2014-02-11 Thread ChambreNoire
I forgot to mention, the reason I don't systematically make a new Job
instance is that when saving the form hibernate creates a new Job instance
which is effectively empty if no Job details have been input.

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Submitting-values-for-null-associations-tp4664365p4664369.html
Sent from the Users forum 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: Submitting values for null associations

2014-02-11 Thread ChambreNoire
Why would that make any difference? A null Job is still a null Job. Unless
I'm missing something...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Submitting-values-for-null-associations-tp4664365p4664371.html
Sent from the Users forum 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: Submitting values for null associations

2014-02-11 Thread ChambreNoire
I'm afraid I still don't see it. I think I'm just going to have to use a
nested model at the form level and rebuild it whenever I toggle
viewing/editing mode. So I'd build a new Model() from the unproxied User
when switching to edit mode and build a new
AbstractEntityModelUser(user.id, User.class) when switching to viewing.
I'd also have to check for empty associations and null then upon saving so
as not to have empty associations (rows with just an id) in the db. Seems
rather painstaking but I can think of a better way atm...

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Submitting-values-for-null-associations-tp4664365p4664373.html
Sent from the Users forum 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



Accessing WebApplication from the service layer

2014-02-03 Thread ChambreNoire
Hey,

I've just been sketching out an entity locking mechanism (below) to prevent
users from editing entities which another user is already in the process of
editing. It works fine but the problem is that placing this in my
WebApplication class means that I need to make MyApplication.get() call from
within my service layer and this seems a tad messy. Is this a Wicket
cardinal sin or am I just stressing over nothing?

Cheers,

Chambre

class EntityLock {

public String entityId;
public String entityName;

public String sessionId;

public Date locked;
public Date lastBumped;
}

@SuppressWarnings(unchecked)
private MapString, EntityLock getEntityLocksByEntity() {

HashMapString, EntityLock locksByEntity = (HashMapString,
EntityLock) getMetaData(ENTITY_LOCKS_BY_ENTITY);

if (locksByEntity == null) {
locksByEntity = new HashMapString, EntityLock();

setMetaData(ENTITY_LOCKS_BY_ENTITY, locksByEntity);
}
return locksByEntity;
}

public boolean acquireEntityLock(PersistentEntity entity) {

EntityLock lock = getEntityLocksByEntity().get(entity.getId());

if (lock != null) {
if ((System.currentTimeMillis() - lock.lastBumped.getTime()) 
(1 * 60 * 1000)) {

releaseEntityLock(entity);
} else {
return false;
}
}

getEntityLocksByEntity().put(entity.getId(), newEntityLock(entity));

return true;
}

private EntityLock newEntityLock(PersistentEntity entity) {

EntityLock newLock = new EntityLock();

newLock.entityId = entity.getId();

if (entity instanceof HibernateProxy) {
newLock.entityName = ((HibernateProxy)
entity).getHibernateLazyInitializer().getEntityName();
} else {
newLock.entityName = entity.getClass().getName();
}

newLock.sessionId = getSession().getId();

Date now = new Date();

newLock.locked = now;
newLock.lastBumped = now;

return newLock;
}

public void releaseEntityLock(PersistentEntity entity) {

getEntityLocksByEntity().remove(entity.getId());
}

public boolean isEntityLocked(PersistentEntity entity) {

return getEntityLocksByEntity().get(entity.getId()) != null;
}


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Accessing-WebApplication-from-the-service-layer-tp4664145.html
Sent from the Users forum 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: Accessing WebApplication from the service layer

2014-02-03 Thread ChambreNoire
Hello,

OK so no storing my MapString, EntityLock in the Application MetaData
then?

Many thanks,

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Accessing-WebApplication-from-the-service-layer-tp4664145p4664147.html
Sent from the Users forum 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: Accessing WebApplication from the service layer

2014-02-03 Thread ChambreNoire
Yes however I also store the id of the session that owns the lock in a map so
that I can easily flush locks when a user session expires. This would mean
that EntityLockService would need access to the current WebSession which
also seems messy...

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Accessing-WebApplication-from-the-service-layer-tp4664145p4664149.html
Sent from the Users forum 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: Accessing WebApplication from the service layer

2014-02-03 Thread ChambreNoire
Yup that's exactly what I have done. My problem lies with the lock creation
in newEntityLock(PersistentEntity entity) which needs the session Id...

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Accessing-WebApplication-from-the-service-layer-tp4664145p4664152.html
Sent from the Users forum 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: Session creation with stateless pages in Chrome

2013-05-29 Thread ChambreNoire
That's the problem. Session.bind() isn't called. I put a breakpoin in
AbstractHttpSessionStore.bind() but still it's hard to tell what's causing
this to be called...



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Session-creation-with-stateless-pages-in-Chrome-tp4659106p4659122.html
Sent from the Users forum 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



Session creation with stateless pages in Chrome

2013-05-28 Thread ChambreNoire
Hello folks,

I have rendered all of my pre-login wicket pages fully stateless. I have
just noticed that while no wicket sessions are created until a valid login
occurs using most browsers, when accessing the site via Google Chrome, the
wicket session is bound after the initial rendering. As for various reasons
I have opted to extract cetain pageparameters within the wicket session
constructor, this is problematic. I suppose could always move this
pageparameter extraction into the various stateless pages which need these
parameters (and thus duplicate it) however I'd like to know why on earth
this happens exclusively with Google Chrome (in case it's symptomatic of
some other undetected problem).

Any ideas?

Thanks,

Anthony



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Session-creation-with-stateless-pages-in-Chrome-tp4659106.html
Sent from the Users forum 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: Session creation with stateless pages in Chrome

2013-05-28 Thread ChambreNoire
How would I check this? I disabled Predict network actions to improve page
load performance but that hasn't changed anything.

Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Session-creation-with-stateless-pages-in-Chrome-tp4659106p4659111.html
Sent from the Users forum 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



Separating a form

2012-09-25 Thread ChambreNoire
Hi,

I have a simple ContactEditPanel which contains a form and a number of
textfields. Up until now I included an AjaxSubmitLink in this panel which,
if the form content is valid, saves/updates the Contact instance contained
in the Panel model. So far so simple. However now I'd like to remove the
link in order that I may, depending on the context in which I use the
ContactEditPanel, place the submit link at different levels of my overall
component hierarchy. For instance in one context I'd like to use to flip
between ContactEditPanel and ContactViewPanel with a bar of actions above
the current view (edit | save , cancel). Another context would be to use
ContactEditPanel in a standalone way (maybe part of a multi-step process)
with just a save link below.

I was contemplating refactoring my ContactEditPanel to extends
FormComponentPanel rather than Panel as described here but I'm not sure
whether this is the right approach and I'm having trouble wrapping my head
around this.

Any help would be most appreciated!

Many Thanks,

CN




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Separating-a-form-tp4652301.html
Sent from the Users forum 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: Setting the value of a HiddenField from JavaScript

2011-12-09 Thread ChambreNoire
Hi there,

I'm having the same problem. Any chance of a peek at your solution?

Cheers

Anthony

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Setting-the-value-of-a-HiddenField-from-JavaScript-tp3539234p4175796.html
Sent from the Users forum 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