Wicket and Spring - mocking a particular bean when Wicket is in development mode?

2010-01-07 Thread Liam Clarke-Hutchinson
Hi all,

This is probably more of a Spring question than a Wicket question, but I'm
asking here in the hopes that someone else has done this before. Basically,
we have a page that uses the @SpringBean annotation to inject a credit card
validation service. At the moment, when we're developing, it's injecting the
actual service, that then goes off to our card processor and validates the
card etc. For integration testing etc. I want to avoid this, so I've created
a simple implementation of the validation service that always returns true.
Question I have, is how can I provide this bean instead of the real bean,
based on the value of WebApplication.getConfigurationType()?

The obvious solution for me would be to do it in the initialization of our
WicketApplication - we already have a if we're in development mode section
where we output component paths and turn on request logging and session size
recording etc. is there a way I can programmatically provide my bean at this
point? Or am I going about this entirely the wrong way?

Many thanks for any advice offered,

Regards,

Liam Clarke


Re: Not a Wicket question but ...

2009-04-30 Thread Liam Clarke-Hutchinson
 Hibernate forum is under upgrading right now.

For like three weeks now. So frustrating when you want to check docs.
_ Remind me to mirror them when the site's back up again.

On Thu, Apr 30, 2009 at 8:48 PM, HHB hubaghd...@yahoo.ca wrote:

 Hibernate forum is under upgrading right now.
 Any way, by appending characterEncoding to the end of the URL connection,
 things work correctly.


 nino martinez wael wrote:

 I'd goto the spring forum or hibernate, depending if you use spring
 for wiring hibernate or not... It has nothing todo with C3P0 afaik.

 2009/4/30 HHB hubaghd...@yahoo.ca:
 Hey,
 I understand this is not a Wicket question but I hope I can get some
 help.
 Our application uses c3p0 connection pooling.
 How to set the character encoding for database connection?
 Even if you aware of how to set the character encoding for Apache DBCP, I
 will
 be thankful.
 The application is built on: Spring 2.5 / Hibernate 3 / Wicket 1.3.5
 Thanks.


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



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




 --
 View this message in context: 
 http://www.nabble.com/Not-a-Wicket-question-but-...-tp23311586p23312035.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Reversing checkbox behavior or negating a property model expression

2009-04-26 Thread Liam Clarke-Hutchinson
Wrapping models in models is one of my favourite things about Wicket.
:D That said, the AbstractCheckboxModel in Wicket extensions can be
handy for one-off deviations from normal checkbox behaviour.

On 4/25/09, mallet ryanlahue...@gmail.com wrote:

 Much thanks... works like a charm.


 igor.vaynberg wrote:

 class InverseBooleanModel implements imodelboolean
  private final imodelboolean delegate;

   public inversebooleanmodel(imodelbooleandelegate) {
 this.delegate=delegate; }
   public boolean getobject() {
   return !delegate;
   }
   public void setobject(boolean o) {
delegate.setobject(!o);
   }
   public void detach() {
 delegate.detach();
   }
 }

 add(new checkbox(cb, new inversebooleanmodel(model)));

 -igor

 On Fri, Apr 24, 2009 at 8:11 AM, Ryan LaHue ryanlahue...@gmail.com
 wrote:
 I'm scratching my head trying to figure out the best way to reverse the
 behavior of a checkbox, i.e. display an unchecked box when the model
 behind
 is true, and a checked box when the model behind is false.  I don't want
 to
 negate all my domain objects' getters/setters to accomodate this.

 I was going to override the CheckBox.getConverter class to point to an
 extension of CheckBoxConverter with an overridden convertToObject method
 and
 simply reverse the:
 if (on.equals(value) || true.equals(value))
            {
                return Boolean.TRUE;
            }
            else
            {
                return Boolean.FALSE;
            }

 Unfortunately the CheckBox.getConverter method is marked final, so this
 is
 not a possibility.  I could override the onComponentTag method but I do
 not
 think it would be a good idea since there is a lot going on in there.

 Alternatively if there was a simple way to negate the value of the
 setter/getter in a PropertyModel I think that would do the trick, i.e.
 new CheckBox(checkbox, new PropertyModel(domainObject, !blue));

 Any suggestions?


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




 --
 View this message in context:
 http://www.nabble.com/Reversing-checkbox-behavior-or-negating-a-property-model-expression-tp23218428p23223605.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Reversing checkbox behavior or negating a property model expression

2009-04-26 Thread Liam Clarke-Hutchinson
Sorry, AbstractCheckBoxModel.

On 4/26/09, Liam Clarke-Hutchinson l...@steelsky.co.nz wrote:
 Wrapping models in models is one of my favourite things about Wicket.
 :D That said, the AbstractCheckboxModel in Wicket extensions can be
 handy for one-off deviations from normal checkbox behaviour.

 On 4/25/09, mallet ryanlahue...@gmail.com wrote:

 Much thanks... works like a charm.


 igor.vaynberg wrote:

 class InverseBooleanModel implements imodelboolean
  private final imodelboolean delegate;

   public inversebooleanmodel(imodelbooleandelegate) {
 this.delegate=delegate; }
   public boolean getobject() {
   return !delegate;
   }
   public void setobject(boolean o) {
delegate.setobject(!o);
   }
   public void detach() {
 delegate.detach();
   }
 }

 add(new checkbox(cb, new inversebooleanmodel(model)));

 -igor

 On Fri, Apr 24, 2009 at 8:11 AM, Ryan LaHue ryanlahue...@gmail.com
 wrote:
 I'm scratching my head trying to figure out the best way to reverse the
 behavior of a checkbox, i.e. display an unchecked box when the model
 behind
 is true, and a checked box when the model behind is false.  I don't
 want
 to
 negate all my domain objects' getters/setters to accomodate this.

 I was going to override the CheckBox.getConverter class to point to an
 extension of CheckBoxConverter with an overridden convertToObject
 method
 and
 simply reverse the:
 if (on.equals(value) || true.equals(value))
            {
                return Boolean.TRUE;
            }
            else
            {
                return Boolean.FALSE;
            }

 Unfortunately the CheckBox.getConverter method is marked final, so this
 is
 not a possibility.  I could override the onComponentTag method but I do
 not
 think it would be a good idea since there is a lot going on in there.

 Alternatively if there was a simple way to negate the value of the
 setter/getter in a PropertyModel I think that would do the trick, i.e.
 new CheckBox(checkbox, new PropertyModel(domainObject, !blue));

 Any suggestions?


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




 --
 View this message in context:
 http://www.nabble.com/Reversing-checkbox-behavior-or-negating-a-property-model-expression-tp23218428p23223605.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




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



Re: QueryStringUrlCodingStrategy not encoding te?t - is this correct?

2009-04-25 Thread Liam Clarke-Hutchinson
Hehe, I was surprised by that too.

On 4/25/09, Antoine van Wel antoine.van@gmail.com wrote:
 Hi Liam,

 thanks for your response. I'm really surprised - I'll undo my fix then..


 regards,
 Antoine

 On Thu, Apr 23, 2009 at 2:34 PM, Liam Clarke-Hutchinson l...@steelsky.co.nz
 wrote:

 Unless I'm reading the RFC wrong,  the behaviour of
 QueryStringUrlCodingStrategy is correct...

 http://labs.apache.org/webarch/uri/rfc/rfc3986.html#components

 The query component contains non-hierarchical data that, along with
 data in the path component, serves to identify a resource within the
 scope of the URI's scheme and naming authority (if any). The query
 component is indicated by the first question mark (?) character and
 terminated by a number sign (#) character or by the end of the URI.

   query   = *( pchar / / / ? )

 The characters slash (/) and question mark (?) may represent data
 within the query component. Beware that some older, erroneous
 implementations may not handle such data correctly when it is used as
 the base URI for relative references (Section 5.1), apparently because
 they fail to distinguish query data from path data when looking for
 hierarchical separators. However, as query components are often used
 to carry identifying information in the form of key=value pairs and
 one frequently used value is a reference to another URI, it is
 sometimes better for usability to avoid percent-encoding those
 characters.



 On 4/23/09, Antoine van Wel antoine.van@gmail.com wrote:
  Hi all,
 
  using 1.3.5 :
  mounted a bookmarkable page using the QueryStringUrlCodingStrategy, now
 I'm
  passing in a page parameter with key search and value te?t -- the
 target
  url is
 
  ?search=te?t
 
  tracing this, turns out the QueryStringUrlCodingStrategy just applies
 UTF-8
  encoding (or whatever has been set on the application level).
 
  Are this behavior and the constructed URL correct? I would expect a URL
 like
 
  ?search=te%3Ft
 
 
  regards
  Antoine
 
  --
 
  --8--8--
  take your photos everywhere you go - http://www.memolio.com
  --8--8--
  We don't see things as they are, we see things as we are. - Anais Nin
  Whether you think you can or whether you think you can't, you're right.
  -
  Henry Ford
  --8--8--
 

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




 --

 --8--8--
 take your photos everywhere you go - http://www.memolio.com
 --8--8--
 We don't see things as they are, we see things as we are. - Anais Nin
 Whether you think you can or whether you think you can't, you're right. -
 Henry Ford
 --8--8--


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



Re: Whats the best way to do a form component validation?

2009-04-24 Thread Liam Clarke-Hutchinson
That's the one.

On 4/24/09, Jason Wang jason.w...@bulletin.net wrote:
 Liam Clarke-Hutchinson wrote:
 I use an AjaxFormComponentSubmittingBehavior onblur for each field -
 so it triggers the submission processing behaviour (including
 validation) for the given field - although it updates the model. You
 could use an applicable Ajax behaviour and then call the component's
 validate() method if you wanted to avoid the model update.

 Regards,

 Liam Clarke

 On Fri, Apr 24, 2009 at 3:50 PM, Jason Wang jason.w...@bulletin.net
 wrote:

 Hi all,

 I have a form with a couple form components, most of which have
 validators
 attached. For example, the mobile number input field has a
 patternValidator
 attached:

 mobile.add(new PatternValidator(^[1-9]([0-9]{8,14})));

 I have hooked all the validation actions with onblur events using this:

 AjaxFormValidatingBehavior.addToAllFormComponents(signUpForm, onblur,
 Duration.ONE_SECOND);

 But unfortunately all the validations are triggered as soon as the focus
 leaves any of the form component.

 Is there a way to hook the validator(like the patterValidator) with the
 event(onblur for example) on the form component(the mobile filed) rather
 than the whole form?

 It would be nice that the AjaxFormValidatingBehavior class could provide
 the
 option to trigger the validations on events on every components.

 Thanks.

 Jasonw



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




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


 Thanks for the reply. I think you meant
 AjaxFormComponentUpdatingBehavior
 http://wicket.apache.org/docs/1.4/org/apache/wicket/ajax/form/AjaxFormComponentUpdatingBehavior.html.

 I will give it a try. Any other options to discuss?

 Regards,
 Jasonw

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



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



Re: Factory for Components

2009-04-24 Thread Liam Clarke-Hutchinson
Are you using an IoC container at all?

On 4/24/09, Nick Wiedenbrück mailinglists...@googlemail.com wrote:
 Hi,

 I'm having many Components (DropDowns, ChoiceRenderers, ...) that are reused
 in different places in my application. For example I have one
 ChoiceRenderer  for persons, one for accounts and so on. I want to
 centralize the creation of these components in a factory in order to decople
 the clients. For example I'm thinking about a ChoiceRendererFactory with
 methods createPersonChoiceRenderer() and createAccountChoiceRenderer().

 Now, my question is where to put this factory. I need a central place, where
 the can find the factory. Is it a good idea to have a method
 createChoiceRendererFactory() on my Application class?

 Regards,
 Nick


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



Re: Registering 'global' Ajax listeners?

2009-04-23 Thread Liam Clarke-Hutchinson
Hi Martin,

Yeah, we've got a page that has an immediate child label that needs to
be refreshed on pretty much every Ajax request being generated by the
other children on the page..

We were trying to avoid passing a reference to the label to the other
children's constructors, as it smells bad and makes it hard to test.

Ultimately we've gone for the usual method of exposing an overrideable
method in the children for the parent to override where we can add the
label, but was just wondering if there was a way to get an event to
fire for the whole page - similar to how you can get DOM events
bubbling through various event handlers in the component hierachy.


Cheers,

Liam Clarke

On 4/23/09, Martin Funk mafulaf...@googlemail.com wrote:
 Hi Liam,

 what is it that you'd like to achieve?

 On the server side, when executing protected abstract void
 respond(AjaxRequestTarget target);
 any component can be added to the target.

 mf

 Am 23.04.2009 um 00:43 schrieb Liam Clarke-Hutchinson:

 Hi,

 I have  page with several child components, and several of the
 children update themselves using Ajax. Is it possible for the page to
 register an Ajax listener that is called on the Ajax events of the
 children?

 Regards,

 Liam Clarke

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




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



Re: Exceptions after Tomcat restart

2009-04-23 Thread Liam Clarke-Hutchinson
Our  Eclipse users have varying issues with Tomcat, and I've picked up
a couple myself today in Intellij cause by half-assed deployments,
although I suspect that's more a Maven issue. /tangent.

In Eclipse, for us, it seems to be caused by resources from a earlier
deployment still remaining, so try cleaning it and then redeploying.

On 4/23/09, Wicket Newbie Wicket Newbie wicket-new...@gmx.de wrote:
 Hi everybody,

 our wicket application behaves in a strange way. After restarting Tomcat
 server in Eclipse everything works fine. But after restarting Tomcat server
 in Eclipse for the second time, Page Expired is shown. Several Exceptions
 appear in log file, but I don't know, how to get rid of them. After the next
 restart everything is fine again. The problem does not just appear in
 combination with Eclipse.


 Hope, anybody can help.

 Betty


 These exceptions occur the most:

 2009-04-09 09:28:17,262
 [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
 org.apache.catalina.session.StandardManager::start ERROR Exception loading
 sessions from persistent storage
 java.lang.ExceptionInInitializerError
 at sun.misc.Unsafe.ensureClassInitialized(Native Method)
 at
 sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
 at
 sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
 at java.lang.reflect.Field.acquireFieldAccessor(Field.java:917)
 at java.lang.reflect.Field.getFieldAccessor(Field.java:898)
 at java.lang.reflect.Field.getLong(Field.java:527)
 at
 java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1586)
 at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52)
 at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:408)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.io.ObjectStreamClass.init(ObjectStreamClass.java:400)
 at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:297)
 at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:531)
 at
 java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552)
 at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
 at
 java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
 at
 org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.readObject(SecondLevelCacheSessionStore.java:403)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at
 java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
 at
 java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
 at
 org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1402)
 at
 org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:931)
 at
 org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:394)
 at
 org.apache.catalina.session.StandardManager.load(StandardManager.java:321)
 at
 org.apache.catalina.session.StandardManager.start(StandardManager.java:637)
 at
 org.apache.catalina.core.StandardContext.start(StandardContext.java:4166)
 at
 org.apache.catalina.core.StandardContext.reload(StandardContext.java:3025)
 at
 org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:432)
 at
 org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1278)
 at
 org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
 at
 org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
 at
 org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
 at
 org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
 at java.lang.Thread.run(Thread.java:595)
 Caused by: org.apache.wicket.WicketRuntimeException: There is no application
 attached to current thread
 ContainerBackgroundProcessor[StandardEngine[Catalina]]
 at org.apache.wicket.Application.get(Application.java:177)
 at org.apache.wicket.Component.getApplication(Component.java:1277)
 at org.apache.wicket.Component.init(Component.java:892)
 at 

Re: How to set content of an ajax enabled link?

2009-04-23 Thread Liam Clarke-Hutchinson
By content you mean the text yeah? Create your link (We use
AjaxFallbackLinks for Ajax links, but there's others), and then create
a label with an appropriate model, and add the label to the link.
You're markup would look like so:

a href=# wicket:id=ajaxLinkspan wicket:id=linkContent/span/a

How dynamic a content you're after really depends on what you're
doing. If you're not using a dynamic model (I'm a big fan of property
models over domain objects) you could easily change the Model of the
linkContent label in the ajaxLink's onUpdate method. Just make sure
you add the link to the ajaxRequestTarget to see it update.

If you want a more specific model behaviour, not too hard to knock up
a class implementing IModel that does what you need.

Regards,

Liam Clarke

On 4/23/09, HHB hubaghd...@yahoo.ca wrote:
 Hey,
 Is there a way to set the content of a link
 dynamically (the value is coming from model object)?
 The link has to be Ajax enabled for sure.
 Thanks.


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



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



Re: QueryStringUrlCodingStrategy not encoding te?t - is this correct?

2009-04-23 Thread Liam Clarke-Hutchinson
Unless I'm reading the RFC wrong,  the behaviour of
QueryStringUrlCodingStrategy is correct...

http://labs.apache.org/webarch/uri/rfc/rfc3986.html#components

The query component contains non-hierarchical data that, along with
data in the path component, serves to identify a resource within the
scope of the URI's scheme and naming authority (if any). The query
component is indicated by the first question mark (?) character and
terminated by a number sign (#) character or by the end of the URI.

   query   = *( pchar / / / ? )

The characters slash (/) and question mark (?) may represent data
within the query component. Beware that some older, erroneous
implementations may not handle such data correctly when it is used as
the base URI for relative references (Section 5.1), apparently because
they fail to distinguish query data from path data when looking for
hierarchical separators. However, as query components are often used
to carry identifying information in the form of key=value pairs and
one frequently used value is a reference to another URI, it is
sometimes better for usability to avoid percent-encoding those
characters.



On 4/23/09, Antoine van Wel antoine.van@gmail.com wrote:
 Hi all,

 using 1.3.5 :
 mounted a bookmarkable page using the QueryStringUrlCodingStrategy, now I'm
 passing in a page parameter with key search and value te?t -- the target
 url is

 ?search=te?t

 tracing this, turns out the QueryStringUrlCodingStrategy just applies UTF-8
 encoding (or whatever has been set on the application level).

 Are this behavior and the constructed URL correct? I would expect a URL like

 ?search=te%3Ft


 regards
 Antoine

 --

 --8--8--
 take your photos everywhere you go - http://www.memolio.com
 --8--8--
 We don't see things as they are, we see things as we are. - Anais Nin
 Whether you think you can or whether you think you can't, you're right. -
 Henry Ford
 --8--8--


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



Re: Registering 'global' Ajax listeners?

2009-04-23 Thread Liam Clarke-Hutchinson
Thanks Peter, that looks like what I was after, albeit at an even
higher level. :)

On Fri, Apr 24, 2009 at 12:05 AM, Peter Ertl pe...@gmx.org wrote:
 Maybe these help...

 - you can override WebApplication.newAjaxRequestTarget(Page page)
 - you can use AjaxRequestTarget.addListener() to add listeners



 Am 23.04.2009 um 13:45 schrieb Liam Clarke-Hutchinson:

 Hi Martin,

 Yeah, we've got a page that has an immediate child label that needs to
 be refreshed on pretty much every Ajax request being generated by the
 other children on the page..

 We were trying to avoid passing a reference to the label to the other
 children's constructors, as it smells bad and makes it hard to test.

 Ultimately we've gone for the usual method of exposing an overrideable
 method in the children for the parent to override where we can add the
 label, but was just wondering if there was a way to get an event to
 fire for the whole page - similar to how you can get DOM events
 bubbling through various event handlers in the component hierachy.


 Cheers,

 Liam Clarke

 On 4/23/09, Martin Funk mafulaf...@googlemail.com wrote:

 Hi Liam,

 what is it that you'd like to achieve?

 On the server side, when executing protected abstract void
 respond(AjaxRequestTarget target);
 any component can be added to the target.

 mf

 Am 23.04.2009 um 00:43 schrieb Liam Clarke-Hutchinson:

 Hi,

 I have  page with several child components, and several of the
 children update themselves using Ajax. Is it possible for the page to
 register an Ajax listener that is called on the Ajax events of the
 children?

 Regards,

 Liam Clarke

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




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


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



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



Re: anchor links

2009-04-23 Thread Liam Clarke-Hutchinson
That's a normal anchor link...

This bit:
http://localhost:8080/audit/app/inbox.1?wicket:bookmarkablePage=:com.xyz.pages.stg.audit.AfmsReviewNewAssignmentPagePARAM_PROCESS_INSTANCE_ID=1232

Is the URL for your generated page

This bit:
#

Is your anchor. It's normal behaviour.  Try it on here:
http://www.w3schools.com/HTML/tryit.asp?filename=tryhtml_links Add a
link like so: a href=#foofoo/a and when you hover over it,
you'll get http://www.w3schools.com/HTML/tryit_view.asp#foo as the
displayed link.

On Fri, Apr 24, 2009 at 3:04 AM, tubin gen fachh...@gmail.com wrote:
 I created a simple link    for java script to open a client side popup
 window  and not for    server processing.


 here is the code

                div class=model_test
                    p a href=# class=model_anchorView/a /p
                /div

 when   i see generated html source   the code    it is the same no
 difference

 but when I put my mouse on the anchor   the browser status bar shows a
 different url

 http://localhost:8080/audit/app/inbox.1?wicket:bookmarkablePage=:com.xyz.pages.stg.audit.AfmsReviewNewAssignmentPagePARAM_PROCESS_INSTANCE_ID=1232#

 because of this my java script function is not responding , Please tell me
 how can I have   anchor tag untouched by wicket ?


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



Re: Whats the best way to do a form component validation?

2009-04-23 Thread Liam Clarke-Hutchinson
I use an AjaxFormComponentSubmittingBehavior onblur for each field -
so it triggers the submission processing behaviour (including
validation) for the given field - although it updates the model. You
could use an applicable Ajax behaviour and then call the component's
validate() method if you wanted to avoid the model update.

Regards,

Liam Clarke

On Fri, Apr 24, 2009 at 3:50 PM, Jason Wang jason.w...@bulletin.net wrote:
 Hi all,

 I have a form with a couple form components, most of which have validators
 attached. For example, the mobile number input field has a patternValidator
 attached:

 mobile.add(new PatternValidator(^[1-9]([0-9]{8,14})));

 I have hooked all the validation actions with onblur events using this:

 AjaxFormValidatingBehavior.addToAllFormComponents(signUpForm, onblur,
 Duration.ONE_SECOND);

 But unfortunately all the validations are triggered as soon as the focus
 leaves any of the form component.

 Is there a way to hook the validator(like the patterValidator) with the
 event(onblur for example) on the form component(the mobile filed) rather
 than the whole form?

 It would be nice that the AjaxFormValidatingBehavior class could provide the
 option to trigger the validations on events on every components.

 Thanks.

 Jasonw



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



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



Registering 'global' Ajax listeners?

2009-04-22 Thread Liam Clarke-Hutchinson
Hi,

I have  page with several child components, and several of the
children update themselves using Ajax. Is it possible for the page to
register an Ajax listener that is called on the Ajax events of the
children?

Regards,

Liam Clarke

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



Re: Mutually dependent component and how to update a textfield when a link is clicked

2009-04-22 Thread Liam Clarke-Hutchinson
Thanks John, that page was very useful. :)

On Wed, Apr 22, 2009 at 2:57 AM, John Krasnay j...@krasnay.ca wrote:
 Hi Liam,

 Check out this page:

 http://cwiki.apache.org/WICKET/conditional-validation.html

 It has a bunch of recipes for interactions between components, e.g.
 requiring a text field only if a checkbox is checked or a certain submit
 button was used. Sounds similar to what you need to do.

 jk

 On Tue, Apr 21, 2009 at 09:40:09AM -0500, Jeremy Thomerson wrote:
 As far as sharing models - just make sure both components' model reads from
 the same backing object - be it the component itself or a domain object.

 As far as submitting the value - basically there are two ways - just like if
 you had a plain HTML page - form submission or javascript that appends the
 value to the end of a GET url.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Apr 21, 2009 at 5:21 AM, Liam Clarke-Hutchinson l...@steelsky.co.nz
  wrote:

  Hi,
 
  Come across a few situations where there are two components are
  reliant on each other, say a checkbox's model value that a textfield
  uses in its isDisabled method, and the textfield needs the
  abstractCheckboxModel to re-evaluate a particular value on a given
  response.
 
  For the first bit, we tend to just move the dependency onto a local
  variable or field, and for the second, we've decided to make the
  changes on the underlying entity model that they were all holding
  models on instead, as a workaround, but it's getting a bit dicey - I
  get the feeling this is the sort of thing that CPMs can help well with
  - where you've got multiple components needing to share state between
  them?
 
  One last thing, if I have a textfield that I want to post the value to
  the server of when a link is clicked, and only that textfield for only
  that link, how do I model this? So far using a small form for each
  pair and then calling submit only on that form seems to be the way to
  do it?
 
  Regards,
 
  Liam Clarke
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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



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



Re: AjaxLink causing a redirect

2009-04-22 Thread Liam Clarke-Hutchinson
What do you mean by processing? Form processing? Normal rendering?

On Thu, Apr 23, 2009 at 2:25 PM, Matthew Welch matt...@welchkin.net wrote:
 I've been playing around with URL rewriting a bit and have run across some
 promising techniques. While testing these techniques, I've been slowly
 loading up my pages with a number of different kinds of actions and links.
 Everything was working pretty smoothly until I got put my first AjaxLink on
 the page. For some reason, just the presence of an AjaxLink causes a
 redirect during the processing of the page. Remove the AjaxLink; no
 redirect.

 I'm not questioning the necessity of this as I'm sure there's a good reason.
 I am curious though. Why does this happen?

 Matt


divbr/div

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



Mutually dependent component and how to update a textfield when a link is clicked

2009-04-21 Thread Liam Clarke-Hutchinson
Hi,

Come across a few situations where there are two components are
reliant on each other, say a checkbox's model value that a textfield
uses in its isDisabled method, and the textfield needs the
abstractCheckboxModel to re-evaluate a particular value on a given
response.

For the first bit, we tend to just move the dependency onto a local
variable or field, and for the second, we've decided to make the
changes on the underlying entity model that they were all holding
models on instead, as a workaround, but it's getting a bit dicey - I
get the feeling this is the sort of thing that CPMs can help well with
- where you've got multiple components needing to share state between
them?

One last thing, if I have a textfield that I want to post the value to
the server of when a link is clicked, and only that textfield for only
that link, how do I model this? So far using a small form for each
pair and then calling submit only on that form seems to be the way to
do it?

Regards,

Liam Clarke

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



Re: Plugin panel integration

2009-04-21 Thread Liam Clarke-Hutchinson
I'm not sure I understand fully, are these optional plugins from a
third party that you need to use?

If not, if they're just components you're coding yourself to use on
your own pages then they should be included in the WAR file by your
build script.

Regards,

Liam Clarke

On 4/21/09, Tomáš Mihok tomas.mi...@cnl.tuke.sk wrote:
 Hello,

 I'm currently developing a wicket application and I would like to ask a
 question. Someone in this mailing list advised me to create plugins to
 my page as panels. Question here is: What form should these be saved as?

 Thing I cannot understand is how the page handles them. Should they be
 saved as WAR archive? Does the server deploy them automatically?

 Thank you for answers, this is the first time Im using wicket for
 creating modular application and Im trying to find the right way to do
 it. If anyone has any material about this topic I would be more than
 grateful for it.

 Tom Mihok

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



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