You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Mike Dee <md...@cardeatech.com> on 2010/09/14 00:30:14 UTC

wicket-auth-roles and additional roles

I need more than the two roles defined in wicket-auth-roles.  Was thinking
about overriding Roles and adding additional roles.  However, Roles is a
final class.  Any reason for that?  Maybe that means I'm going about it
wrong.  Any suggestions on a better way?

I'm about to go through the source of wicket-auth-roles to see if there are
any dependencies on the Roles.ADMIN and Roles.USER.  Maybe additional users
can be defined by just adding strings for new user types? Does anyone know
if there are dependencies?
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-auth-roles-and-additional-roles-tp2538164p2538164.html
Sent from the Users forum 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: wicket-auth-roles and additional roles

Posted by James Carman <ja...@carmanconsulting.com>.
Well, in case you ever need it, here are the two files that would be
of interest to you:

http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/common/security/SpringSecuritySession.java
http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/common/security/SpringSecurityWebApplication.java

You can download the entire application to see how everything is woven together:

http://svn.carmanconsulting.com/public/wicket-advanced/trunk/


On Mon, Sep 13, 2010 at 6:54 PM, Mike Dee <md...@cardeatech.com> wrote:
>
> Yes, not using Spring Security (yet).  But will keep your offer in mind.
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-auth-roles-and-additional-roles-tp2538164p2538188.html
> Sent from the Users forum 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: wicket-auth-roles and additional roles

Posted by Mike Dee <md...@cardeatech.com>.
Yes, not using Spring Security (yet).  But will keep your offer in mind.  
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-auth-roles-and-additional-roles-tp2538164p2538188.html
Sent from the Users forum 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: wicket-auth-roles and additional roles

Posted by James Carman <ja...@carmanconsulting.com>.
I didn't mean in place of auth-roles.  I meant something to adapt
auth-roles to Spring Security.  But, if you're not using Spring
Security now and you don't think you'll need it, it's one more thing
you don't have to worry about.

On Mon, Sep 13, 2010 at 6:45 PM, Mike Dee <md...@cardeatech.com> wrote:
>
> Thanks.  I'm going to try out wicket-auth-roles first.  I think it may be
> good enough.
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-auth-roles-and-additional-roles-tp2538164p2538178.html
> Sent from the Users forum 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: wicket-auth-roles and additional roles

Posted by Mike Dee <md...@cardeatech.com>.
Thanks.  I'm going to try out wicket-auth-roles first.  I think it may be
good enough.
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-auth-roles-and-additional-roles-tp2538164p2538178.html
Sent from the Users forum 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: Validating a DropDownChoice when not in a form

Posted by Igor Vaynberg <ig...@gmail.com>.
weird, set a breakpoint and see where it is failing.

-igor

On Tue, Sep 14, 2010 at 12:23 PM, Chris Colman
<ch...@stepaheadsoftware.com> wrote:
> I've switched over to INullAcceptingValidator but it's still not triggering the validate method for some reason:
> I'm now also explicitly setting setRequired(false);
>
> New code:
>
>                studentList = new DropDownChoice("studentList", new PropertyModel(orderManipulator.getDispatch(), "student"), students);
>                studentList.setRequired(false);
>
>                INullAcceptingValidator<DropDownChoice> validator =
>                        new INullAcceptingValidator<DropDownChoice>()
>                        {
>                                public void validate(IValidatable<DropDownChoice> validatable)
>                                {
>                                        if ( validatable.getValue() == null )
>                                        {
>                                                logger.trace("Drop down value null");
>                                                studentSet = false;
>                                        }
>                                        else
>                                        {
>                                                logger.trace("Drop down value NOT null");
>                                                studentSet = true;
>                                        }
>                                }
>                        };
>
>                studentList.add(validator);
>                add(studentList);
>
>                attachUpdateBehavior(studentList);
>
>>-----Original Message-----
>>From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>>Sent: Wednesday, 15 September 2010 4:46 AM
>>To: users@wicket.apache.org
>>Subject: Re: Validating a DropDownChoice when not in a form
>>
>>validators do not usually handle null values, that is handled by
>>component's set/getrequired() property. if you want your validator to
>>handle nulls let it implement INullAcceptingValidator
>>
>>-igor
>>
>>On Tue, Sep 14, 2010 at 11:22 AM, Chris Colman
>><ch...@stepaheadsoftware.com> wrote:
>>> Here's the code I use to set up the DropDownChoice and its validator:
>>>
>>> Inside the panel contructor:
>>>
>>>                studentList = new DropDownChoice("studentList", new
>>> PropertyModel(orderManipulator.getDispatch(), "student"), students);
>>>
>>>                IValidator<DropDownChoice> validator =
>>>                        new IValidator<DropDownChoice>()
>>>                        {
>>>                                public void
>>> validate(IValidatable<DropDownChoice> validatable)
>>>                                {
>>>                                        if ( validatable.getValue() ==
>>> null )
>>>                                        {
>>>                                                logger.trace("Drop down
>>> value null");
>>>                                                studentSet = false;
>>>                                        }
>>>                                        else
>>>                                        {
>>>                                                logger.trace("Drop down
>>> value NOT null");
>>>                                                studentSet = true;
>>>
>>>                                        }
>>>                                }
>>>                        };
>>>
>>>                studentList.add(validator);
>>>                add(studentList);
>>>
>>>                attachUpdateBehavior(studentList);
>>>
>>>
>>> Later on when the user clicks a button the a panel validation method
>>> calls
>>>
>>>        studentList.validate();
>>>
>>> but I never see the trace messages appear.
>>>
>>> I am trying to detect whether the user has chosen an option in the Drop
>>> down rather than just left it as "Choose one".
>>>
>>> Currently I have no choices available in the drop down the validator
>>> should always show the message "Drop down value null" - theoretically
>>> according to my understanding.
>>>
>>>
>>>>-----Original Message-----
>>>>From: Chris Colman [mailto:chrisc@stepaheadsoftware.com]
>>>>Sent: Wednesday, 15 September 2010 3:39 AM
>>>>To: users@wicket.apache.org
>>>>Subject: RE: Validating a DropDownChoice when not in a form
>>>>
>>>>> validate() :)
>>>>
>>>>I've been trying that but for some reason it's not triggering the
>>>>FormComponent's validator. I must have some broken logic in there
>>>>somewhere.
>>>>
>>>>>
>>>>> -igor
>>>>>
>>>>> On Tue, Sep 14, 2010 at 3:12 AM, Chris Colman
>>>>> <ch...@stepaheadsoftware.com> wrote:
>>>>> > Is it possible to force a validate of a DropDownChoice when it's
>>> not
>>>>in
>>>>> > a form but just normal page/panel?
>>>>> >
>>>>> > If so what method(s) do we call?
>>>>> >
>>>>> >
>>>>---------------------------------------------------------------------
>>>>> > 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
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>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
>>>
>>>
>>
>>---------------------------------------------------------------------
>>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
>
>

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


RE: Validating a DropDownChoice when not in a form

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
I've switched over to INullAcceptingValidator but it's still not triggering the validate method for some reason:
I'm now also explicitly setting setRequired(false);

New code:

		studentList = new DropDownChoice("studentList", new PropertyModel(orderManipulator.getDispatch(), "student"), students);
		studentList.setRequired(false);
		
		INullAcceptingValidator<DropDownChoice> validator = 
			new INullAcceptingValidator<DropDownChoice>()
			{
				public void validate(IValidatable<DropDownChoice> validatable)
				{
					if ( validatable.getValue() == null )
					{
						logger.trace("Drop down value null");
						studentSet = false;
					}
					else
					{
						logger.trace("Drop down value NOT null");
						studentSet = true;				
					}
				}
			};

		studentList.add(validator);
		add(studentList);
		
		attachUpdateBehavior(studentList);

>-----Original Message-----
>From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>Sent: Wednesday, 15 September 2010 4:46 AM
>To: users@wicket.apache.org
>Subject: Re: Validating a DropDownChoice when not in a form
>
>validators do not usually handle null values, that is handled by
>component's set/getrequired() property. if you want your validator to
>handle nulls let it implement INullAcceptingValidator
>
>-igor
>
>On Tue, Sep 14, 2010 at 11:22 AM, Chris Colman
><ch...@stepaheadsoftware.com> wrote:
>> Here's the code I use to set up the DropDownChoice and its validator:
>>
>> Inside the panel contructor:
>>
>>                studentList = new DropDownChoice("studentList", new
>> PropertyModel(orderManipulator.getDispatch(), "student"), students);
>>
>>                IValidator<DropDownChoice> validator =
>>                        new IValidator<DropDownChoice>()
>>                        {
>>                                public void
>> validate(IValidatable<DropDownChoice> validatable)
>>                                {
>>                                        if ( validatable.getValue() ==
>> null )
>>                                        {
>>                                                logger.trace("Drop down
>> value null");
>>                                                studentSet = false;
>>                                        }
>>                                        else
>>                                        {
>>                                                logger.trace("Drop down
>> value NOT null");
>>                                                studentSet = true;
>>
>>                                        }
>>                                }
>>                        };
>>
>>                studentList.add(validator);
>>                add(studentList);
>>
>>                attachUpdateBehavior(studentList);
>>
>>
>> Later on when the user clicks a button the a panel validation method
>> calls
>>
>>        studentList.validate();
>>
>> but I never see the trace messages appear.
>>
>> I am trying to detect whether the user has chosen an option in the Drop
>> down rather than just left it as "Choose one".
>>
>> Currently I have no choices available in the drop down the validator
>> should always show the message "Drop down value null" - theoretically
>> according to my understanding.
>>
>>
>>>-----Original Message-----
>>>From: Chris Colman [mailto:chrisc@stepaheadsoftware.com]
>>>Sent: Wednesday, 15 September 2010 3:39 AM
>>>To: users@wicket.apache.org
>>>Subject: RE: Validating a DropDownChoice when not in a form
>>>
>>>> validate() :)
>>>
>>>I've been trying that but for some reason it's not triggering the
>>>FormComponent's validator. I must have some broken logic in there
>>>somewhere.
>>>
>>>>
>>>> -igor
>>>>
>>>> On Tue, Sep 14, 2010 at 3:12 AM, Chris Colman
>>>> <ch...@stepaheadsoftware.com> wrote:
>>>> > Is it possible to force a validate of a DropDownChoice when it's
>> not
>>>in
>>>> > a form but just normal page/panel?
>>>> >
>>>> > If so what method(s) do we call?
>>>> >
>>>> >
>>>---------------------------------------------------------------------
>>>> > 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
>>>
>>>
>>>---------------------------------------------------------------------
>>>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
>>
>>
>
>---------------------------------------------------------------------
>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: Validating a DropDownChoice when not in a form

Posted by Igor Vaynberg <ig...@gmail.com>.
validators do not usually handle null values, that is handled by
component's set/getrequired() property. if you want your validator to
handle nulls let it implement INullAcceptingValidator

-igor

On Tue, Sep 14, 2010 at 11:22 AM, Chris Colman
<ch...@stepaheadsoftware.com> wrote:
> Here's the code I use to set up the DropDownChoice and its validator:
>
> Inside the panel contructor:
>
>                studentList = new DropDownChoice("studentList", new
> PropertyModel(orderManipulator.getDispatch(), "student"), students);
>
>                IValidator<DropDownChoice> validator =
>                        new IValidator<DropDownChoice>()
>                        {
>                                public void
> validate(IValidatable<DropDownChoice> validatable)
>                                {
>                                        if ( validatable.getValue() ==
> null )
>                                        {
>                                                logger.trace("Drop down
> value null");
>                                                studentSet = false;
>                                        }
>                                        else
>                                        {
>                                                logger.trace("Drop down
> value NOT null");
>                                                studentSet = true;
>
>                                        }
>                                }
>                        };
>
>                studentList.add(validator);
>                add(studentList);
>
>                attachUpdateBehavior(studentList);
>
>
> Later on when the user clicks a button the a panel validation method
> calls
>
>        studentList.validate();
>
> but I never see the trace messages appear.
>
> I am trying to detect whether the user has chosen an option in the Drop
> down rather than just left it as "Choose one".
>
> Currently I have no choices available in the drop down the validator
> should always show the message "Drop down value null" - theoretically
> according to my understanding.
>
>
>>-----Original Message-----
>>From: Chris Colman [mailto:chrisc@stepaheadsoftware.com]
>>Sent: Wednesday, 15 September 2010 3:39 AM
>>To: users@wicket.apache.org
>>Subject: RE: Validating a DropDownChoice when not in a form
>>
>>> validate() :)
>>
>>I've been trying that but for some reason it's not triggering the
>>FormComponent's validator. I must have some broken logic in there
>>somewhere.
>>
>>>
>>> -igor
>>>
>>> On Tue, Sep 14, 2010 at 3:12 AM, Chris Colman
>>> <ch...@stepaheadsoftware.com> wrote:
>>> > Is it possible to force a validate of a DropDownChoice when it's
> not
>>in
>>> > a form but just normal page/panel?
>>> >
>>> > If so what method(s) do we call?
>>> >
>>> >
>>---------------------------------------------------------------------
>>> > 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
>>
>>
>>---------------------------------------------------------------------
>>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
>
>

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


RE: Validating a DropDownChoice when not in a form

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
Here's the code I use to set up the DropDownChoice and its validator:

Inside the panel contructor:

		studentList = new DropDownChoice("studentList", new
PropertyModel(orderManipulator.getDispatch(), "student"), students);

		IValidator<DropDownChoice> validator = 
			new IValidator<DropDownChoice>()
			{
				public void
validate(IValidatable<DropDownChoice> validatable)
				{
					if ( validatable.getValue() ==
null )
					{
						logger.trace("Drop down
value null");
						studentSet = false;
					}
					else
					{
						logger.trace("Drop down
value NOT null");
						studentSet = true;

					}
				}
			};

		studentList.add(validator);
		add(studentList);
		
		attachUpdateBehavior(studentList);


Later on when the user clicks a button the a panel validation method
calls

	studentList.validate();

but I never see the trace messages appear.

I am trying to detect whether the user has chosen an option in the Drop
down rather than just left it as "Choose one".

Currently I have no choices available in the drop down the validator
should always show the message "Drop down value null" - theoretically
according to my understanding.


>-----Original Message-----
>From: Chris Colman [mailto:chrisc@stepaheadsoftware.com]
>Sent: Wednesday, 15 September 2010 3:39 AM
>To: users@wicket.apache.org
>Subject: RE: Validating a DropDownChoice when not in a form
>
>> validate() :)
>
>I've been trying that but for some reason it's not triggering the
>FormComponent's validator. I must have some broken logic in there
>somewhere.
>
>>
>> -igor
>>
>> On Tue, Sep 14, 2010 at 3:12 AM, Chris Colman
>> <ch...@stepaheadsoftware.com> wrote:
>> > Is it possible to force a validate of a DropDownChoice when it's
not
>in
>> > a form but just normal page/panel?
>> >
>> > If so what method(s) do we call?
>> >
>> >
>---------------------------------------------------------------------
>> > 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
>
>
>---------------------------------------------------------------------
>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: Validating a DropDownChoice when not in a form

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
> validate() :)

I've been trying that but for some reason it's not triggering the
FormComponent's validator. I must have some broken logic in there
somewhere.

> 
> -igor
> 
> On Tue, Sep 14, 2010 at 3:12 AM, Chris Colman
> <ch...@stepaheadsoftware.com> wrote:
> > Is it possible to force a validate of a DropDownChoice when it's not
in
> > a form but just normal page/panel?
> >
> > If so what method(s) do we call?
> >
> >
---------------------------------------------------------------------
> > 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


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


Re: Validating a DropDownChoice when not in a form

Posted by Igor Vaynberg <ig...@gmail.com>.
validate() :)

-igor

On Tue, Sep 14, 2010 at 3:12 AM, Chris Colman
<ch...@stepaheadsoftware.com> wrote:
> Is it possible to force a validate of a DropDownChoice when it's not in
> a form but just normal page/panel?
>
> If so what method(s) do we call?
>
> ---------------------------------------------------------------------
> 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


Validating a DropDownChoice when not in a form

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
Is it possible to force a validate of a DropDownChoice when it's not in
a form but just normal page/panel?

If so what method(s) do we call?

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


RE: DropDownChoice - performing extra validation before model changed

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
Cool, thanks Ernesto.

>-----Original Message-----
>From: Ernesto Reinaldo Barreiro [mailto:reiern70@gmail.com]
>Sent: Tuesday, 14 September 2010 6:28 PM
>To: users@wicket.apache.org
>Subject: Re: DropDownChoice - performing extra validation before model
>changed
>
>AjaxRequestTarget .get() will return it your are in a middle of an
>AJAX request.
>
>Ernesto
>
>On Tue, Sep 14, 2010 at 10:24 AM, Chris Colman
><ch...@stepaheadsoftware.com> wrote:
>> I am trying to open up a message box inside the IValidator's validate
>> method but I need an AjaxRequestTarget to open the MessageBox.
>>
>> Is there anyway to get an AjaxRequestTarget in the validate method?
>>
>> Regards,
>> Chris
>>
>> ---------------------------------------------------------------------
>> 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


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


Re: DropDownChoice - performing extra validation before model changed

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
AjaxRequestTarget .get() will return it your are in a middle of an
AJAX request.

Ernesto

On Tue, Sep 14, 2010 at 10:24 AM, Chris Colman
<ch...@stepaheadsoftware.com> wrote:
> I am trying to open up a message box inside the IValidator's validate
> method but I need an AjaxRequestTarget to open the MessageBox.
>
> Is there anyway to get an AjaxRequestTarget in the validate method?
>
> Regards,
> Chris
>
> ---------------------------------------------------------------------
> 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: DropDownChoice - performing extra validation before model changed

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
I am trying to open up a message box inside the IValidator's validate
method but I need an AjaxRequestTarget to open the MessageBox.

Is there anyway to get an AjaxRequestTarget in the validate method?

Regards,
Chris

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


Re: DropDownChoice - performing extra validation before model changed

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Mon, Sep 13, 2010 at 10:33 PM, Chris Colman <chrisc@stepaheadsoftware.com
> wrote:

> So both form and component validators will have access to the value?
>
>
Yes


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

RE: DropDownChoice - performing extra validation before model changed

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
So both form and component validators will have access to the value?

Chris

>-----Original Message-----
>From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>Sent: Tuesday, 14 September 2010 12:55 PM
>To: users@wicket.apache.org
>Subject: Re: DropDownChoice - performing extra validation before model
>changed
>
>you can add a validator, it will have access to the value.
>
>-igor
>
>On Mon, Sep 13, 2010 at 6:32 PM, Chris Colman
><ch...@stepaheadsoftware.com> wrote:
>> Is it possible to test if an item has been selected in a
DropDownChoice
>> in an overridden validate method?
>>
>> I want to test and bring up a message box (not just rely on the
Feedback
>> panel to show an error message).
>>
>> DropDownChoice doesn't seem to have any methods to get the currently
>> selected item (or null if none is selected).
>>
>> The only way seems to be checking the model but that would not be
>> updated until after the validation process is complete (I would
tnink).
>>
>> Any ideas?
>>
>>
>> ---------------------------------------------------------------------
>> 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


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


Re: DropDownChoice - performing extra validation before model changed

Posted by Igor Vaynberg <ig...@gmail.com>.
you can add a validator, it will have access to the value.

-igor

On Mon, Sep 13, 2010 at 6:32 PM, Chris Colman
<ch...@stepaheadsoftware.com> wrote:
> Is it possible to test if an item has been selected in a DropDownChoice
> in an overridden validate method?
>
> I want to test and bring up a message box (not just rely on the Feedback
> panel to show an error message).
>
> DropDownChoice doesn't seem to have any methods to get the currently
> selected item (or null if none is selected).
>
> The only way seems to be checking the model but that would not be
> updated until after the validation process is complete (I would tnink).
>
> Any ideas?
>
>
> ---------------------------------------------------------------------
> 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


DropDownChoice - performing extra validation before model changed

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
Is it possible to test if an item has been selected in a DropDownChoice
in an overridden validate method? 

I want to test and bring up a message box (not just rely on the Feedback
panel to show an error message).

DropDownChoice doesn't seem to have any methods to get the currently
selected item (or null if none is selected).

The only way seems to be checking the model but that would not be
updated until after the validation process is complete (I would tnink).

Any ideas?


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


Re: wicket-auth-roles and additional roles

Posted by James Carman <ja...@carmanconsulting.com>.
On Mon, Sep 13, 2010 at 7:02 PM, Brian Topping <to...@codehaus.org> wrote:
> The first time I secured a Wicket app, I went through great pains to use someone else's framework.  But the fact is Wicket's security was designed by geniuses, so it's a snap to work with.  You really need to use a lot of features in Spring Security before it will save you time in the end.
>

But, if you're already using Spring Security, it's quite easy (as you
pointed out) to plug it in.

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


Re: wicket-auth-roles and additional roles

Posted by "mijnheer.spaghetti" <mi...@gmail.com>.
Brian, I don't understand what you are trying to say ?

>From your first sentence : "I use Spring Security for everything I do in
Wicket." 
=> I take it that you like Spring Security ?

Your last sentence : "You really need to use a lot of features in Spring
Security before it will save you time in the end."  
=> You think spring-security is overkill in most cases ?

Just curious whether you prefer Spring Security, Shiro or ...  in
combination with Wicket ?


Brian Topping wrote:
> 
> FWIW, I use Spring Security for everything I do in Wicket.  I was the
> original author of the Shiro-to-Wicket code on Wicket Stuff (somehow the
> attributions got lost in there), and if you don't need all the adaptors
> for stuff like LDAP (maybe Shiro has that by now), it's really worth
> looking at.
> 
> There's most of what you need for Spring Security in the Brix security
> example as well.
> 
> The first time I secured a Wicket app, I went through great pains to use
> someone else's framework.  But the fact is Wicket's security was designed
> by geniuses, so it's a snap to work with.  You really need to use a lot of
> features in Spring Security before it will save you time in the end.
> 
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-auth-roles-and-additional-roles-tp2538164p2539437.html
Sent from the Users forum 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: wicket-auth-roles and additional roles

Posted by Brian Topping <to...@codehaus.org>.
FWIW, I use Spring Security for everything I do in Wicket.  I was the original author of the Shiro-to-Wicket code on Wicket Stuff (somehow the attributions got lost in there), and if you don't need all the adaptors for stuff like LDAP (maybe Shiro has that by now), it's really worth looking at.

There's most of what you need for Spring Security in the Brix security example as well.

The first time I secured a Wicket app, I went through great pains to use someone else's framework.  But the fact is Wicket's security was designed by geniuses, so it's a snap to work with.  You really need to use a lot of features in Spring Security before it will save you time in the end.

On Sep 13, 2010, at 6:42 PM, James Carman wrote:

> If you want some example code for Spring Security, I can give you
> some.  It might save you some cycles.
> 
> On Mon, Sep 13, 2010 at 6:41 PM, Mike Dee <md...@cardeatech.com> wrote:
>> 
>> Yes, you're correct.  I was just wondering if within wicket-auth-roles there
>> were references to Roles.ADMIN or Roles.USER.  If there were, it could have
>> been problematic.  Fortunately, there are none.
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-auth-roles-and-additional-roles-tp2538164p2538173.html
>> Sent from the Users forum 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
> 
> 


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


Re: wicket-auth-roles and additional roles

Posted by James Carman <ja...@carmanconsulting.com>.
If you want some example code for Spring Security, I can give you
some.  It might save you some cycles.

On Mon, Sep 13, 2010 at 6:41 PM, Mike Dee <md...@cardeatech.com> wrote:
>
> Yes, you're correct.  I was just wondering if within wicket-auth-roles there
> were references to Roles.ADMIN or Roles.USER.  If there were, it could have
> been problematic.  Fortunately, there are none.
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-auth-roles-and-additional-roles-tp2538164p2538173.html
> Sent from the Users forum 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: wicket-auth-roles and additional roles

Posted by Mike Dee <md...@cardeatech.com>.
Yes, you're correct.  I was just wondering if within wicket-auth-roles there
were references to Roles.ADMIN or Roles.USER.  If there were, it could have
been problematic.  Fortunately, there are none.
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-auth-roles-and-additional-roles-tp2538164p2538173.html
Sent from the Users forum 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: wicket-auth-roles and additional roles

Posted by James Carman <ja...@carmanconsulting.com>.
You can use any roles you want.  They're just strings, right?  We use
auth-roles with Acegi/Spring Security and we just return whatever
roles the user has assigned to them.

On Mon, Sep 13, 2010 at 6:30 PM, Mike Dee <md...@cardeatech.com> wrote:
>
> I need more than the two roles defined in wicket-auth-roles.  Was thinking
> about overriding Roles and adding additional roles.  However, Roles is a
> final class.  Any reason for that?  Maybe that means I'm going about it
> wrong.  Any suggestions on a better way?
>
> I'm about to go through the source of wicket-auth-roles to see if there are
> any dependencies on the Roles.ADMIN and Roles.USER.  Maybe additional users
> can be defined by just adding strings for new user types? Does anyone know
> if there are dependencies?
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-auth-roles-and-additional-roles-tp2538164p2538164.html
> Sent from the Users forum 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