Re: Adding HTML class=invalid after validating with IndicatingAjaxButton

2008-09-25 Thread Chris Stein
Thanks, Igor. I've been playing around with your suggestions but still doesn't 
seem to make it work.
My onSubmit is not being called when I set a breakpoint there.
Is it possible that what I am asking for is not possible? 



- Original Message 
From: Igor Vaynberg [EMAIL PROTECTED]
To: users@wicket.apache.org
Sent: Tuesday, September 23, 2008 10:48:54 PM
Subject: Re: Adding HTML class=invalid after validating with 
IndicatingAjaxButton

target.addComponent(feedback);
target.addComponent(form); // you might have to add some div that is
around the form, not sure if browsers support replacing form tag well

-igor

On Tue, Sep 23, 2008 at 1:39 PM, Chris Stein [EMAIL PROTECTED] wrote:
 Thanks, Igor. However, I tried it and it never showed up in the browser.
 Even more so, when I set a breakpoint to the onComponentTag-method, it never 
 gets called. Is that correct?
 I only get this behavior when I am using the IndicatingAjaxButton--everything 
 works fine with the regular buttons. Maybe I am missing something else here...

 Here's my code:

 /**
  * The panel with the form.
  */
 public class SignInPanel extends Panel
 {
  public SignInPanel(final String id)
  {
super(id);

feedback.setOutputMarkupId(true);
add(feedback);

add(new SignInForm(signInForm));
  }


 public final class SignInForm extends StatelessForm
 {

  private final ValueMap properties = new ValueMap();

  public SignInForm(final String id)
  {
  super(id);

  FormComponent fc;

  fc = new RequiredTextField(username, new PropertyModel(properties, 
 username));
  fc.add(new InvalidIndicator());
  fc.setOutputMarkupId(true);
  add(fc);

  fc = new PasswordTextField(password, new PropertyModel(properties, 
 password));
  fc.add(new InvalidIndicator());
  fc.setOutputMarkupId(true);
  add(fc);

  AjaxFormValidatingBehavior.addToAllFormComponents(this, onsubmit);

  this.add(new IndicatingAjaxButton(submit, this)
  {
@Override
protected void onSubmit(AjaxRequestTarget target, Form form)
{
  //perform sign in
}

@Override
protected void onError(AjaxRequestTarget target, Form form)
{
  target.addComponent(feedback);
}
  });

  }
 }


 /**
  * The validator. Thanks to Igor.
  */
 public class InvalidIndicator extends AbstractBehavior
 {
  @Override
  public void onComponentTag(final Component component, final ComponentTag tag)
  {
boolean valid = ((FormComponent)component).isValid();
if(!valid)
{
  tag.getAttributes().put(class,invalid);
}
  }
 }





 - Original Message 
 From: Igor Vaynberg [EMAIL PROTECTED]
 To: users@wicket.apache.org
 Sent: Tuesday, September 23, 2008 5:50:08 PM
 Subject: Re: Adding HTML class=invalid after validating with 
 IndicatingAjaxButton

 public class invalidindicator extends abstractbehavior {
  protected void oncomponenttag(component c, tag t) {
  boolean valid=((formcomponent)c).isvalid();
  if (!valid) {
 tag.put(class,invalid);
 }
  }
 }

 formcomponent.add(new invalidindicator());

 -igor

 On Tue, Sep 23, 2008 at 2:53 AM, cstein1206 [EMAIL PROTECTED] wrote:

 I basically want to achieve this:
 http://www.jroller.com/karthikg/entry/wicket_and_ajax
 but handle the validation only after the form has been submitted with an
 AjaxIndicatingButton instead of with the onblur as in the example.

 I think I tried too many things over the last couple of days and got totally
 confused now. Would anybody be so kind to help me out a bit? What do I need
 to add to the FormComponents so that they will be updated with an
 HTML-attribute class='invalid'? So far my form doesn't do that (I did
 setOutputMarkupId(true)).

 Thanks a ton!
 Chris
 --
 View this message in context: 
 http://www.nabble.com/Adding-HTML-class%3D%22invalid%22-after-validating-with-IndicatingAjaxButton-tp19624501p19624501.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Adding HTML class=invalid after validating with IndicatingAjaxButton

2008-09-25 Thread Chris Stein
Thanks Martijn!!! That worked like a charm!




- Original Message 
From: Martijn Dashorst [EMAIL PROTECTED]
To: users@wicket.apache.org
Sent: Thursday, September 25, 2008 1:59:41 PM
Subject: Re: Adding HTML class=invalid after validating with 
IndicatingAjaxButton

Override onError too

Martijn

On Thu, Sep 25, 2008 at 1:56 PM, Chris Stein [EMAIL PROTECTED] wrote:
 Thanks, Igor. I've been playing around with your suggestions but still 
 doesn't seem to make it work.
 My onSubmit is not being called when I set a breakpoint there.
 Is it possible that what I am asking for is not possible?



 - Original Message 
 From: Igor Vaynberg [EMAIL PROTECTED]
 To: users@wicket.apache.org
 Sent: Tuesday, September 23, 2008 10:48:54 PM
 Subject: Re: Adding HTML class=invalid after validating with 
 IndicatingAjaxButton

 target.addComponent(feedback);
 target.addComponent(form); // you might have to add some div that is
 around the form, not sure if browsers support replacing form tag well

 -igor

 On Tue, Sep 23, 2008 at 1:39 PM, Chris Stein [EMAIL PROTECTED] wrote:
 Thanks, Igor. However, I tried it and it never showed up in the browser.
 Even more so, when I set a breakpoint to the onComponentTag-method, it never 
 gets called. Is that correct?
 I only get this behavior when I am using the 
 IndicatingAjaxButton--everything works fine with the regular buttons. Maybe 
 I am missing something else here...

 Here's my code:

 /**
  * The panel with the form.
  */
 public class SignInPanel extends Panel
 {
  public SignInPanel(final String id)
  {
super(id);

feedback.setOutputMarkupId(true);
add(feedback);

add(new SignInForm(signInForm));
  }


 public final class SignInForm extends StatelessForm
 {

  private final ValueMap properties = new ValueMap();

  public SignInForm(final String id)
  {
  super(id);

  FormComponent fc;

  fc = new RequiredTextField(username, new PropertyModel(properties, 
 username));
  fc.add(new InvalidIndicator());
  fc.setOutputMarkupId(true);
  add(fc);

  fc = new PasswordTextField(password, new PropertyModel(properties, 
 password));
  fc.add(new InvalidIndicator());
  fc.setOutputMarkupId(true);
  add(fc);

  AjaxFormValidatingBehavior.addToAllFormComponents(this, onsubmit);

  this.add(new IndicatingAjaxButton(submit, this)
  {
@Override
protected void onSubmit(AjaxRequestTarget target, Form form)
{
  //perform sign in
}

@Override
protected void onError(AjaxRequestTarget target, Form form)
{
  target.addComponent(feedback);
}
  });

  }
 }


 /**
  * The validator. Thanks to Igor.
  */
 public class InvalidIndicator extends AbstractBehavior
 {
  @Override
  public void onComponentTag(final Component component, final ComponentTag 
 tag)
  {
boolean valid = ((FormComponent)component).isValid();
if(!valid)
{
  tag.getAttributes().put(class,invalid);
}
  }
 }





 - Original Message 
 From: Igor Vaynberg [EMAIL PROTECTED]
 To: users@wicket.apache.org
 Sent: Tuesday, September 23, 2008 5:50:08 PM
 Subject: Re: Adding HTML class=invalid after validating with 
 IndicatingAjaxButton

 public class invalidindicator extends abstractbehavior {
  protected void oncomponenttag(component c, tag t) {
  boolean valid=((formcomponent)c).isvalid();
  if (!valid) {
 tag.put(class,invalid);
 }
  }
 }

 formcomponent.add(new invalidindicator());

 -igor

 On Tue, Sep 23, 2008 at 2:53 AM, cstein1206 [EMAIL PROTECTED] wrote:

 I basically want to achieve this:
 http://www.jroller.com/karthikg/entry/wicket_and_ajax
 but handle the validation only after the form has been submitted with an
 AjaxIndicatingButton instead of with the onblur as in the example.

 I think I tried too many things over the last couple of days and got totally
 confused now. Would anybody be so kind to help me out a bit? What do I need
 to add to the FormComponents so that they will be updated with an
 HTML-attribute class='invalid'? So far my form doesn't do that (I did
 setOutputMarkupId(true)).

 Thanks a ton!
 Chris
 --
 View this message in context: 
 http://www.nabble.com/Adding-HTML-class%3D%22invalid%22-after-validating-with-IndicatingAjaxButton-tp19624501p19624501.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED

Re: Wicket critique

2008-09-23 Thread Chris Stein
I tried many different frameworks in the past and Wicket was probably one of 
the easiest to set up and integrate into Eclipse. I have to admit that the 
learning curve is quite steep here. It helped me being familiar with Eclipse 
and the Tomcat integration to get things going quickly. Besides: I don't use 
Maven.



- Original Message 
From: Yiannis Mavroukakis [EMAIL PROTECTED]
To: users@wicket.apache.org
Sent: Tuesday, September 23, 2008 10:44:40 AM
Subject: Wicket critique

http://stackoverflow.com/questions/116978/can-anyone-recommend-a-simple-java-web-app-framework

Anyone interested in replying to this?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Adding HTML class=invalid after validating with IndicatingAjaxButton

2008-09-23 Thread Chris Stein
Thanks, Igor. However, I tried it and it never showed up in the browser.
Even more so, when I set a breakpoint to the onComponentTag-method, it never 
gets called. Is that correct?
I only get this behavior when I am using the IndicatingAjaxButton--everything 
works fine with the regular buttons. Maybe I am missing something else here...

Here's my code:

/**
 * The panel with the form.
 */
public class SignInPanel extends Panel
{
  public SignInPanel(final String id)
  {
super(id);

feedback.setOutputMarkupId(true);
add(feedback);

add(new SignInForm(signInForm));
  }


public final class SignInForm extends StatelessForm
{

  private final ValueMap properties = new ValueMap();

  public SignInForm(final String id)
  {
  super(id);

  FormComponent fc;

  fc = new RequiredTextField(username, new PropertyModel(properties, 
username));
  fc.add(new InvalidIndicator());
  fc.setOutputMarkupId(true);
  add(fc);

  fc = new PasswordTextField(password, new PropertyModel(properties, 
password));
  fc.add(new InvalidIndicator());
  fc.setOutputMarkupId(true);
  add(fc);

  AjaxFormValidatingBehavior.addToAllFormComponents(this, onsubmit);

  this.add(new IndicatingAjaxButton(submit, this)
  {
@Override
protected void onSubmit(AjaxRequestTarget target, Form form)
{
  //perform sign in
}

@Override
protected void onError(AjaxRequestTarget target, Form form)
{
  target.addComponent(feedback);
}
  });

  }
}


/**
 * The validator. Thanks to Igor.
 */
public class InvalidIndicator extends AbstractBehavior
{
  @Override
  public void onComponentTag(final Component component, final ComponentTag tag)
  {
boolean valid = ((FormComponent)component).isValid();
if(!valid)
{
  tag.getAttributes().put(class,invalid);
}
  }
}





- Original Message 
From: Igor Vaynberg [EMAIL PROTECTED]
To: users@wicket.apache.org
Sent: Tuesday, September 23, 2008 5:50:08 PM
Subject: Re: Adding HTML class=invalid after validating with 
IndicatingAjaxButton

public class invalidindicator extends abstractbehavior {
  protected void oncomponenttag(component c, tag t) {
  boolean valid=((formcomponent)c).isvalid();
  if (!valid) {
 tag.put(class,invalid);
 }
  }
}

formcomponent.add(new invalidindicator());

-igor

On Tue, Sep 23, 2008 at 2:53 AM, cstein1206 [EMAIL PROTECTED] wrote:

 I basically want to achieve this:
 http://www.jroller.com/karthikg/entry/wicket_and_ajax
 but handle the validation only after the form has been submitted with an
 AjaxIndicatingButton instead of with the onblur as in the example.

 I think I tried too many things over the last couple of days and got totally
 confused now. Would anybody be so kind to help me out a bit? What do I need
 to add to the FormComponents so that they will be updated with an
 HTML-attribute class='invalid'? So far my form doesn't do that (I did
 setOutputMarkupId(true)).

 Thanks a ton!
 Chris
 --
 View this message in context: 
 http://www.nabble.com/Adding-HTML-class%3D%22invalid%22-after-validating-with-IndicatingAjaxButton-tp19624501p19624501.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Adding HTML class=invalid after validating with IndicatingAjaxButton

2008-09-23 Thread Chris Stein
Thanks, Igor. However, I tried it and it never showed up in the browser.
Even more so, when I set a breakpoint to the onComponentTag-method, it never 
gets called. Is that correct?
I only get this behavior when I am using the IndicatingAjaxButton--everything 
works fine with the regular buttons. Maybe I am missing something else here...

Here's my code:

/**
 * The panel with the form.
 */
public class SignInPanel extends Panel
{
  public SignInPanel(final String id)
  {
super(id);

feedback.setOutputMarkupId(true);
add(feedback);

add(new SignInForm(signInForm));
  }


public final class SignInForm extends StatelessForm
{

  private final ValueMap properties = new ValueMap();

  public SignInForm(final String id)
  {
  super(id);

  FormComponent fc;

  fc = new RequiredTextField(username, new PropertyModel(properties, 
username));
  fc.add(new InvalidIndicator());
  fc.setOutputMarkupId(true);
  add(fc);

  fc = new PasswordTextField(password, new PropertyModel(properties, 
password));
  fc.add(new InvalidIndicator());
  fc.setOutputMarkupId(true);
  add(fc);

  AjaxFormValidatingBehavior.addToAllFormComponents(this, onsubmit);

  this.add(new IndicatingAjaxButton(submit, this)
  {
@Override
protected void onSubmit(AjaxRequestTarget target, Form form)
{
  //perform sign in
}

@Override
protected void onError(AjaxRequestTarget target, Form form)
{
  target.addComponent(feedback);
}
  });

  }
}


/**
 * The validator. Thanks to Igor.
 */
public class InvalidIndicator extends AbstractBehavior
{
  @Override
  public void onComponentTag(final Component component, final ComponentTag tag)
  {
boolean valid = ((FormComponent)component).isValid();
if(!valid)
{
  tag.getAttributes().put(class,invalid);
}
  }
}





- Original Message 
From: Igor Vaynberg [EMAIL PROTECTED]
To: users@wicket.apache.org
Sent: Tuesday, September 23, 2008 5:50:08 PM
Subject: Re: Adding HTML class=invalid after validating with 
IndicatingAjaxButton

public class invalidindicator extends abstractbehavior {
  protected void oncomponenttag(component c, tag t) {
  boolean valid=((formcomponent)c).isvalid();
  if (!valid) {
 tag.put(class,invalid);
 }
  }
}

formcomponent.add(new invalidindicator());

-igor

On Tue, Sep 23, 2008 at 2:53 AM, cstein1206 [EMAIL PROTECTED] wrote:

 I basically want to achieve this:
 http://www.jroller.com/karthikg/entry/wicket_and_ajax
 but handle the validation only after the form has been submitted with an
 AjaxIndicatingButton instead of with the onblur as in the example.

 I think I tried too many things over the last couple of days and got totally
 confused now. Would anybody be so kind to help me out a bit? What do I need
 to add to the FormComponents so that they will be updated with an
 HTML-attribute class='invalid'? So far my form doesn't do that (I did
 setOutputMarkupId(true)).

 Thanks a ton!
 Chris
 --
 View this message in context: 
 http://www.nabble.com/Adding-HTML-class%3D%22invalid%22-after-validating-with-IndicatingAjaxButton-tp19624501p19624501.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Google Chrome Wicket

2008-09-03 Thread Chris Stein
I was trying to follow Matej's suggestion and build the latest version from 
trunk.

When running Maven with mvn package, I was getting test errors. The Auth Roles 
doesn't complete the tests due to an incorrect Apache License header in 
/wicket-auth-roles/src/main/java/org/apache/wicket/authentication/panel/SignInPanel_ja.html
 (see output below). Am I the only one getting this error?

After fixing this, everything builds fine. But when I tried to deploy the 
wicket-examples.war, I was getting startup errors (due to 
java.lang.IllegalArgumentException: Class 
[org.springframework.jms.config.JmsNamespaceHandler] does not implement the 
NamespaceHandler interface, see output below). I'm stuck.

I'm running JDK build 1.6.0_07 and Tomcat 6.0.16.

--Chris


=TOMCAT STARTUP ERROR LOG=

03.09.2008 12:18:44 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive wicket-examples.war
03.09.2008 12:18:45 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener org.springframework.web.context.ContextLoaderListener is al
ready configured for this context. The duplicate definition has been ignored.
INFO  - ContextLoader  - Root WebApplicationContext: initialization
started
INFO  - CollectionFactory  - JDK 1.4+ collections available
INFO  - CollectionFactory  - Commons Collections 3.x available
INFO  - XmlBeanDefinitionReader- Loading XML bean definitions from class pat
h resource [applicationContext.xml]
ERROR - ContextLoader  - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected excep
tion parsing XML document from class path resource [applicationContext.xml]; nes
ted exception is java.lang.IllegalArgumentException: Class [org.springframework.
jms.config.JmsNamespaceHandler] does not implement the NamespaceHandler interfac
e
Caused by:
java.lang.IllegalArgumentException: Class [org.springframework.jms.config.JmsNam
espaceHandler] does not implement the NamespaceHandler interface
at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
..initHandlerMappings(DefaultNamespaceHandlerResolver.java:119)
at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
..init(DefaultNamespaceHandlerResolver.java:96)
at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
..init(DefaultNamespaceHandlerResolver.java:82)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.createD
efaultNamespaceHandlerResolver(XmlBeanDefinitionReader.java:530)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.createR
eaderContext(XmlBeanDefinitionReader.java:519)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registe
rBeanDefinitions(XmlBeanDefinitionReader.java:499)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:407)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:357)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
at org.springframework.web.context.support.XmlWebApplicationContext.load
BeanDefinitions(XmlWebApplicationContext.java:123)
at org.springframework.web.context.support.XmlWebApplicationContext.load
BeanDefinitions(XmlWebApplicationContext.java:91)
at org.springframework.context.support.AbstractRefreshableApplicationCon
text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94)
at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:294)
at org.springframework.web.context.support.AbstractRefreshableWebApplica
tionContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
at org.springframework.web.context.ContextLoader.createWebApplicationCon
text(ContextLoader.java:246)
at org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(ContextLoader.java:184)


=MAVEN BUILD ERROR LOG=

[INFO] 
[INFO] Building Wicket Auth Roles
[INFO]task-segment: [install]
[INFO] 
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 16 source files to 
/temp/wicket-trunk/wicket-auth-roles/target/classes
[INFO] [bundle:manifest {execution: bundle-manifest}]
[INFO] 

Show/hide WebMarkupContainer

2008-09-03 Thread Chris Stein
I am having trouble understanding how to achieve the following:
Similar to Xing or Google Mail, I want to show a form with AJAX when the user 
clicks a link on the same page. I first thought that I can achieve this with 
the AjaxLazyLoadPanel. By now I got the gist that I need to play with an empty 
WebMarkupContainer in order to achieve this. However, I seem unable to figure 
out how this is actually going to work.
Can somebody please give me a head start on this?

Sorry if this might be a stupid question and thanks a lot for your help!
--Chris



  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]