You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Graeme Knight <gr...@gmail.com> on 2008/11/04 04:02:18 UTC

Feedback/Error message.

Hi.

Loving Wicket so far! I had a search and had trouble finding the answer to
this one, if anyone can help:

1) I have a simple form with username/password and a submit button.

2) User enters username/password and hits submit.

3) onSubmit authenticates against the database through a load on a
LoadableDetachableModel, and returns the result as the model's object.

Let's say there is an error on authenticating against the database - what is
the easiest way of giving the user feedback that his username/password was
wrong? I naively thought I might be able to do some sort of conditional
insert of a component into the page or form (similar to Tapestry).

My solution was then to add a panel (regular not feedback) to the page which
consists of an error icon and a custom message. I would like to update this
component on the re-render so it doesn't display if there isn't a problem,
but it does if there is a problem (couldn't get isVisible working this way). 

What's the Wicket way?

Many thanks, Graeme.
-- 
View this message in context: http://www.nabble.com/Feedback-Error-message.-tp20315444p20315444.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Feedback/Error message.

Posted by Igor Vaynberg <ig...@gmail.com>.
add(new feedbackpanel("feedback"));

onsubmit() {
  user u=authenticator.auth(username, password);
  if (u==null) {
      error("Invalid password");
  } else {
    if (!continuetooriginaldestination) {
setresponsepage(application.get().gethomepage()); }
  }
}

-igor

On Mon, Nov 3, 2008 at 8:02 PM, Graeme Knight <gr...@gmail.com> wrote:
>
> Hi.
>
> Loving Wicket so far! I had a search and had trouble finding the answer to
> this one, if anyone can help:
>
> 1) I have a simple form with username/password and a submit button.
>
> 2) User enters username/password and hits submit.
>
> 3) onSubmit authenticates against the database through a load on a
> LoadableDetachableModel, and returns the result as the model's object.
>
> Let's say there is an error on authenticating against the database - what is
> the easiest way of giving the user feedback that his username/password was
> wrong? I naively thought I might be able to do some sort of conditional
> insert of a component into the page or form (similar to Tapestry).
>
> My solution was then to add a panel (regular not feedback) to the page which
> consists of an error icon and a custom message. I would like to update this
> component on the re-render so it doesn't display if there isn't a problem,
> but it does if there is a problem (couldn't get isVisible working this way).
>
> What's the Wicket way?
>
> Many thanks, Graeme.
> --
> View this message in context: http://www.nabble.com/Feedback-Error-message.-tp20315444p20315444.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Feedback/Error message.

Posted by Nick Heudecker <nh...@gmail.com>.
Or just style it with CSS.

On Tue, Nov 4, 2008 at 9:46 AM, Graeme Knight <gr...@gmail.com> wrote:

>
> Hey!
>
> Cool - add a feedback panel then set error - I like that! I didn't get to
> that part in the Wicket in Action as yet but I see how it works!
>
> Actually - my authentication method is very similar to the one on the book
> (again not got to that part yet), so I'm pretty psyched I'm heading in the
> right direction!
>
> I'm assuming if I wanted a panel with an icon and an error message I just
> create a component with a feedback panel and an image and populate
> accordingly?
>
> Cheers, Graeme.
>
>
> igor.vaynberg wrote:
> >
> > On Mon, Nov 3, 2008 at 8:02 PM, Graeme Knight <gr...@gmail.com>
> > wrote:
> >> 3) onSubmit authenticates against the database through a load on a
> >> LoadableDetachableModel, and returns the result as the model's object.
> >
> > ^ sounds interesting...paste your code.
> >
> > -igor
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Feedback-Error-message.-tp20315444p20327425.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Nick Heudecker
Professional Wicket Training & Consulting
http://www.systemmobile.com

Eventful - Intelligent Event Management
http://www.eventfulhq.com

Re: Feedback/Error message.

Posted by Graeme Knight <gr...@gmail.com>.
Hey!

Cool - add a feedback panel then set error - I like that! I didn't get to
that part in the Wicket in Action as yet but I see how it works!

Actually - my authentication method is very similar to the one on the book
(again not got to that part yet), so I'm pretty psyched I'm heading in the
right direction!

I'm assuming if I wanted a panel with an icon and an error message I just
create a component with a feedback panel and an image and populate
accordingly?

Cheers, Graeme.


igor.vaynberg wrote:
> 
> On Mon, Nov 3, 2008 at 8:02 PM, Graeme Knight <gr...@gmail.com>
> wrote:
>> 3) onSubmit authenticates against the database through a load on a
>> LoadableDetachableModel, and returns the result as the model's object.
> 
> ^ sounds interesting...paste your code.
> 
> -igor
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Feedback-Error-message.-tp20315444p20327425.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Feedback/Error message.

Posted by Igor Vaynberg <ig...@gmail.com>.
On Mon, Nov 3, 2008 at 8:02 PM, Graeme Knight <gr...@gmail.com> wrote:
> 3) onSubmit authenticates against the database through a load on a
> LoadableDetachableModel, and returns the result as the model's object.

^ sounds interesting...paste your code.

-igor

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