You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jonas <ba...@gmail.com> on 2010/03/11 13:10:52 UTC
Application#get in WicketSessionFilter
Hi all,
we're using WicketSessionFilter in our product to access
our custom WebSession, which works fine. Now we've tried
to also access the org.apache.wicket.Application (e.g. using
Session#getApplication or Application#get), which doesn't seem
to work, because the application isn't bound to the ThreadLocal.
After searching in nabble I found some old threads ([1], [2]) suggesting
this should actually work fine, but that doesn't seem to be the case.
Is there any special configuration trick I have to apply to make this
work, or are those old posts just (no longer) true?
If anybody could confirm this is actually a bug, I'd create an issue
in JIRA to have this fixed.
Regards,
Jonas
[1] http://old.nabble.com/Accessing-Wicket-Application-from-custom-servlet-ts24814177.html#a24815786
[2] http://old.nabble.com/WicketFilter-td25205475.html#a25210469
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Application#get in WicketSessionFilter
Posted by Jonas <ba...@gmail.com>.
I create a JIRA issue for this:
https://issues.apache.org/jira/browse/WICKET-2778
cheers,
Jonas
On Thu, Mar 11, 2010 at 1:10 PM, Jonas <ba...@gmail.com> wrote:
> Hi all,
>
> we're using WicketSessionFilter in our product to access
> our custom WebSession, which works fine. Now we've tried
> to also access the org.apache.wicket.Application (e.g. using
> Session#getApplication or Application#get), which doesn't seem
> to work, because the application isn't bound to the ThreadLocal.
> After searching in nabble I found some old threads ([1], [2]) suggesting
> this should actually work fine, but that doesn't seem to be the case.
> Is there any special configuration trick I have to apply to make this
> work, or are those old posts just (no longer) true?
> If anybody could confirm this is actually a bug, I'd create an issue
> in JIRA to have this fixed.
>
> Regards,
> Jonas
>
> [1] http://old.nabble.com/Accessing-Wicket-Application-from-custom-servlet-ts24814177.html#a24815786
> [2] http://old.nabble.com/WicketFilter-td25205475.html#a25210469
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Replace "Choose one" from DropDownChoice?
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
It's just a localization property <dropdownchoice-id>.null or
<dropdownchoice-id>.nullValid if that's what you want to change?
**
Martin
2010/3/17 David Chang <da...@yahoo.com>:
>
> Hello, I understand that there must be a solution for this. I googled for some time and found one or two results that seem to match what I am looking but they did not answer my question. Tried myself, not successful. So I want to ask folks here. I have a form and it has a dropdown list. Here are my requirements:
>
> 1. Replace "Choose one" with a blank line
>
> 2. This blank line is the first option and it is always listed no matter whether a value is selected or not, no matter whether the form field of this dropdown list is required or not.
>
> 3. I am using ChoiceRenderer to convert between selection and objects.
>
> 4. This behavior is applicable to all DropDownChoice.
>
> How can meet these requirement?
>
> Thanks for your help!
>
> Regards.
>
>
>
>
> ---------------------------------------------------------------------
> 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: Application#get in WicketSessionFilter
Posted by Igor Vaynberg <ig...@gmail.com>.
whats the use of having an application object if there is no session object?
-igor
On Wed, Mar 17, 2010 at 6:03 AM, Jonas <ba...@gmail.com> wrote:
> I just reviewed the code Igor for the fix Igor implemented [1], and I
> don't think
> it will be a drop-in replacement for the code in the wiki, since it only exposes
> the application if there's an active HttpSession. The code from the wiki on the
> other hand always exposes the Application.
> In the patch I proposed, I also always exposed the Application. Unfortunately,
> my patch didn't properly handle exceptions (I should have put it all
> into a try finally
> block), I guess that's why Igor didn't use it, but chose to do a
> different implementation.
> I'm not sure why the Application isn't always exposed - I don't think
> it should have
> any side effects, since the Application is already shared between
> multiple threads,
> but I'm not aware of all wicket internals. Maybe Igor can shed some
> light on this issue?
>
> cheers,
> Jonas
>
>
> [1] <http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java?revision=922335&view=markup>
>
> On Wed, Mar 17, 2010 at 1:37 PM, Erik van Oosten <e....@grons.nl> wrote:
>> That sounds great. Could you update the wiki page with the specifics for
>> Wicket 1.4.8?
>>
>> Regards,
>> Erik.
>>
>>
>> Op 17-03-10 08:20, Jonas schreef:
>>>
>>> Thanks, Erik, that code would do the trick, too. I've implemented
>>> a different workaround, though. In the next release of wicket (1.4.8),
>>> WicketSessionFilter will 'expose' both the session and the application,
>>> Igor
>>> already resolved my JIRA Issue [1]. BTW: Thanks to Igor for picking that
>>> up so quickly!
>>>
>>> cheers,
>>> Jonas
>>>
>>>
>>> [1] https://issues.apache.org/jira/browse/WICKET-2778
>>>
>>> On Tue, Mar 16, 2010 at 9:05 PM, Erik van Oosten<e....@grons.nl>
>>> wrote:
>>>
>>>>
>>>> Hi Jonas,
>>>>
>>>> Perhaps this is what you need:
>>>> http://cwiki.apache.org/WICKET/springbean-outside-wicket.html
>>>>
>>>> Regards,
>>>> Erik.
>>>>
>>>>
>>>> Jonas wrote:
>>>>
>>>>>
>>>>> Hi all,
>>>>>
>>>>> we're using WicketSessionFilter in our product to access
>>>>> our custom WebSession, which works fine. Now we've tried
>>>>> to also access the org.apache.wicket.Application (e.g. using
>>>>> Session#getApplication or Application#get), which doesn't seem
>>>>> to work, because the application isn't bound to the ThreadLocal.
>>>>> After searching in nabble I found some old threads ([1], [2]) suggesting
>>>>> this should actually work fine, but that doesn't seem to be the case.
>>>>> Is there any special configuration trick I have to apply to make this
>>>>> work, or are those old posts just (no longer) true?
>>>>> If anybody could confirm this is actually a bug, I'd create an issue
>>>>> in JIRA to have this fixed.
>>>>>
>>>>> Regards,
>>>>> Jonas
>>>>>
>>>>> [1]
>>>>>
>>>>> http://old.nabble.com/Accessing-Wicket-Application-from-custom-servlet-ts24814177.html#a24815786
>>>>> [2] http://old.nabble.com/WicketFilter-td25205475.html#a25210469
>>>>>
>>>>>
>>
>> --
>> Erik van Oosten
>> http://www.day-to-day-stuff.blogspot.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: Application#get in WicketSessionFilter
Posted by Jonas <ba...@gmail.com>.
I just reviewed the code Igor for the fix Igor implemented [1], and I
don't think
it will be a drop-in replacement for the code in the wiki, since it only exposes
the application if there's an active HttpSession. The code from the wiki on the
other hand always exposes the Application.
In the patch I proposed, I also always exposed the Application. Unfortunately,
my patch didn't properly handle exceptions (I should have put it all
into a try finally
block), I guess that's why Igor didn't use it, but chose to do a
different implementation.
I'm not sure why the Application isn't always exposed - I don't think
it should have
any side effects, since the Application is already shared between
multiple threads,
but I'm not aware of all wicket internals. Maybe Igor can shed some
light on this issue?
cheers,
Jonas
[1] <http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java?revision=922335&view=markup>
On Wed, Mar 17, 2010 at 1:37 PM, Erik van Oosten <e....@grons.nl> wrote:
> That sounds great. Could you update the wiki page with the specifics for
> Wicket 1.4.8?
>
> Regards,
> Erik.
>
>
> Op 17-03-10 08:20, Jonas schreef:
>>
>> Thanks, Erik, that code would do the trick, too. I've implemented
>> a different workaround, though. In the next release of wicket (1.4.8),
>> WicketSessionFilter will 'expose' both the session and the application,
>> Igor
>> already resolved my JIRA Issue [1]. BTW: Thanks to Igor for picking that
>> up so quickly!
>>
>> cheers,
>> Jonas
>>
>>
>> [1] https://issues.apache.org/jira/browse/WICKET-2778
>>
>> On Tue, Mar 16, 2010 at 9:05 PM, Erik van Oosten<e....@grons.nl>
>> wrote:
>>
>>>
>>> Hi Jonas,
>>>
>>> Perhaps this is what you need:
>>> http://cwiki.apache.org/WICKET/springbean-outside-wicket.html
>>>
>>> Regards,
>>> Erik.
>>>
>>>
>>> Jonas wrote:
>>>
>>>>
>>>> Hi all,
>>>>
>>>> we're using WicketSessionFilter in our product to access
>>>> our custom WebSession, which works fine. Now we've tried
>>>> to also access the org.apache.wicket.Application (e.g. using
>>>> Session#getApplication or Application#get), which doesn't seem
>>>> to work, because the application isn't bound to the ThreadLocal.
>>>> After searching in nabble I found some old threads ([1], [2]) suggesting
>>>> this should actually work fine, but that doesn't seem to be the case.
>>>> Is there any special configuration trick I have to apply to make this
>>>> work, or are those old posts just (no longer) true?
>>>> If anybody could confirm this is actually a bug, I'd create an issue
>>>> in JIRA to have this fixed.
>>>>
>>>> Regards,
>>>> Jonas
>>>>
>>>> [1]
>>>>
>>>> http://old.nabble.com/Accessing-Wicket-Application-from-custom-servlet-ts24814177.html#a24815786
>>>> [2] http://old.nabble.com/WicketFilter-td25205475.html#a25210469
>>>>
>>>>
>
> --
> Erik van Oosten
> http://www.day-to-day-stuff.blogspot.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: Replace "Choose one" from DropDownChoice?
Posted by David Chang <da...@yahoo.com>.
Martin,
Very sorry for being confusing to you. Here is what I want:
I want blank line is always there, no matter whether a value is selected or not, no matter whether the field is required or not.
I am using ChoiceRenderer to convert a selected option to objects.
Thanks, David
--- On Wed, 3/17/10, Martin Asenov <mA...@velti.com> wrote:
> From: Martin Asenov <mA...@velti.com>
> Subject: RE: Replace "Choose one" from DropDownChoice?
> To: "users@wicket.apache.org" <us...@wicket.apache.org>
> Date: Wednesday, March 17, 2010, 10:34 AM
> David, please describe the use case
> in more depths.
>
> 1)
> You want a dropdownchoice with null selection, which is "
> "?
>
> 2)
> You don't want a null selection to be there at all, but
> show the first element.
>
> Best,
> Martin
>
> -----Original Message-----
> From: David Chang [mailto:david_q_zhang@yahoo.com]
>
> Sent: Wednesday, March 17, 2010 4:31 PM
> To: users@wicket.apache.org
> Subject: Re: Replace "Choose one" from DropDownChoice?
>
> Martin,
>
> According to what you said, do I need to add special
> processing in ChoiceRenderer if this blank line is the
> selected and I need to convert selected value to object?
>
> Thanks,
> David
>
> --- On Wed, 3/17/10, Martin Phee <mp...@objectivearts.com>
> wrote:
>
> > From: Martin Phee <mp...@objectivearts.com>
> > Subject: Re: Replace "Choose one" from
> DropDownChoice?
> > To: users@wicket.apache.org
> > Date: Wednesday, March 17, 2010, 10:05 AM
> > You have to add a selection choice
> > that is just a blank line option.
> >
> > This is a typical requirement for any dropdown if you
> wan
> > the use to be able to clear their choice.
> >
> >
> > On Mar 17, 2010, at 8:47 AM, David Chang wrote:
> >
> > > Martin,
> > >
> > > Thanks so much for chiming in. I tried the
> > >
> > > null=
> > >
> > > approach. The blank line in the dropdown list
> simply
> > disappears. As I said in my requirements, I hope to
> have it
> > there no matter whether a value is selected or not,
> no
> > matter whether it is a required field or not.
> > >
> > > Again, thanks for help!
> > > Best,
> > > David
> > >
> > > --- On Wed, 3/17/10, Martin Asenov <mA...@velti.com>
> > wrote:
> >
> >
> >
> ---------------------------------------------------------------------
> > 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: Replace "Choose one" from DropDownChoice?
Posted by Martin Asenov <mA...@velti.com>.
David, please describe the use case in more depths.
1)
You want a dropdownchoice with null selection, which is " "?
2)
You don't want a null selection to be there at all, but show the first element.
Best,
Martin
-----Original Message-----
From: David Chang [mailto:david_q_zhang@yahoo.com]
Sent: Wednesday, March 17, 2010 4:31 PM
To: users@wicket.apache.org
Subject: Re: Replace "Choose one" from DropDownChoice?
Martin,
According to what you said, do I need to add special processing in ChoiceRenderer if this blank line is the selected and I need to convert selected value to object?
Thanks,
David
--- On Wed, 3/17/10, Martin Phee <mp...@objectivearts.com> wrote:
> From: Martin Phee <mp...@objectivearts.com>
> Subject: Re: Replace "Choose one" from DropDownChoice?
> To: users@wicket.apache.org
> Date: Wednesday, March 17, 2010, 10:05 AM
> You have to add a selection choice
> that is just a blank line option.
>
> This is a typical requirement for any dropdown if you wan
> the use to be able to clear their choice.
>
>
> On Mar 17, 2010, at 8:47 AM, David Chang wrote:
>
> > Martin,
> >
> > Thanks so much for chiming in. I tried the
> >
> > null=
> >
> > approach. The blank line in the dropdown list simply
> disappears. As I said in my requirements, I hope to have it
> there no matter whether a value is selected or not, no
> matter whether it is a required field or not.
> >
> > Again, thanks for help!
> > Best,
> > David
> >
> > --- On Wed, 3/17/10, Martin Asenov <mA...@velti.com>
> wrote:
>
>
> ---------------------------------------------------------------------
> 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: Replace "Choose one" from DropDownChoice?
Posted by David Chang <da...@yahoo.com>.
Martin,
According to what you said, do I need to add special processing in ChoiceRenderer if this blank line is the selected and I need to convert selected value to object?
Thanks,
David
--- On Wed, 3/17/10, Martin Phee <mp...@objectivearts.com> wrote:
> From: Martin Phee <mp...@objectivearts.com>
> Subject: Re: Replace "Choose one" from DropDownChoice?
> To: users@wicket.apache.org
> Date: Wednesday, March 17, 2010, 10:05 AM
> You have to add a selection choice
> that is just a blank line option.
>
> This is a typical requirement for any dropdown if you wan
> the use to be able to clear their choice.
>
>
> On Mar 17, 2010, at 8:47 AM, David Chang wrote:
>
> > Martin,
> >
> > Thanks so much for chiming in. I tried the
> >
> > null=
> >
> > approach. The blank line in the dropdown list simply
> disappears. As I said in my requirements, I hope to have it
> there no matter whether a value is selected or not, no
> matter whether it is a required field or not.
> >
> > Again, thanks for help!
> > Best,
> > David
> >
> > --- On Wed, 3/17/10, Martin Asenov <mA...@velti.com>
> wrote:
>
>
> ---------------------------------------------------------------------
> 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: Replace "Choose one" from DropDownChoice?
Posted by Martin Phee <mp...@objectivearts.com>.
You have to add a selection choice that is just a blank line option.
This is a typical requirement for any dropdown if you wan the use to
be able to clear their choice.
On Mar 17, 2010, at 8:47 AM, David Chang wrote:
> Martin,
>
> Thanks so much for chiming in. I tried the
>
> null=
>
> approach. The blank line in the dropdown list simply disappears. As
> I said in my requirements, I hope to have it there no matter whether
> a value is selected or not, no matter whether it is a required field
> or not.
>
> Again, thanks for help!
> Best,
> David
>
> --- On Wed, 3/17/10, Martin Asenov <mA...@velti.com> wrote:
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: SV: Replace "Choose one" from DropDownChoice?
Posted by David Chang <da...@yahoo.com>.
I tried this one. It works. Summarized what I did based on input from folks here:
1. set null = "" in property file (remove "" properties file)
2. call setNullValid(true) on the DropDownChoice object.
Thanks for help!!!
Regards.
--- On Wed, 3/17/10, Wilhelmsen Tor Iver <To...@arrive.no> wrote:
> From: Wilhelmsen Tor Iver <To...@arrive.no>
> Subject: SV: Replace "Choose one" from DropDownChoice?
> To: "users@wicket.apache.org" <us...@wicket.apache.org>
> Date: Wednesday, March 17, 2010, 10:23 AM
> Also setNullValid(true) otherwise the
> blank option will disappear once you have made a choice or
> the model has a value.
>
> - Tor I.
>
>
> > -----Opprinnelig melding-----
> > Fra: Martin Asenov [mailto:mAsenov@velti.com]
> > Sendt: 17. mars 2010 15:23
> > Til: users@wicket.apache.org
> > Emne: RE: Replace "Choose one" from DropDownChoice?
> >
> > I don't understand , Chang...
> >
> > If you want non selection to be " ", then say
> >
> > null=" " (without the quotes)
> >
> > Otherwise if you don't want null selection, you say
> > component.setNullValid(false); and you're fine
> >
> > Best,
> > Martin
> >
> > -----Original Message-----
> > From: David Chang [mailto:david_q_zhang@yahoo.com]
> > Sent: Wednesday, March 17, 2010 3:48 PM
> > To: users@wicket.apache.org
> > Subject: RE: Replace "Choose one" from
> DropDownChoice?
> >
> > Martin,
> >
> > Thanks so much for chiming in. I tried the
> >
> > null=
> >
> > approach. The blank line in the dropdown list simply
> disappears. As I
> > said in my requirements, I hope to have it there no
> matter whether a
> > value is selected or not, no matter whether it is a
> required field or
> > not.
> >
> > Again, thanks for help!
> > Best,
> > David
> >
> > --- On Wed, 3/17/10, Martin Asenov <mA...@velti.com>
> wrote:
> >
> > > From: Martin Asenov <mA...@velti.com>
> > > Subject: RE: Replace "Choose one" from
> DropDownChoice?
> > > To: "users@wicket.apache.org"
> <us...@wicket.apache.org>
> > > Date: Wednesday, March 17, 2010, 9:08 AM
> > > Hi, David!
> > >
> > > Let's presume your webapplication class is
> called
> > > WebApp.java. In the same directory where it is
> present,
> > > create WebApp.properties with the following
> line:
> > >
> > > null=
> > >
> > > that way every single 'choose one' label will be
> replaced
> > > with "".
> > >
> > > P.S. Don't forget to include the props files in
> the pom as
> > > a resource.
> > >
> > > Best,
> > > Martin
> > >
> > > -----Original Message-----
> > > From: David Chang [mailto:david_q_zhang@yahoo.com]
> > >
> > > Sent: Wednesday, March 17, 2010 3:03 PM
> > > To: users@wicket.apache.org
> > > Subject: Replace "Choose one" from
> DropDownChoice?
> > >
> > >
> > > Hello, I understand that there must be a solution
> for this.
> > > I googled for some time and found one or two
> results that
> > > seem to match what I am looking but they did not
> answer my
> > > question. Tried myself, not successful. So I want
> to ask
> > > folks here. I have a form and it has a dropdown
> list. Here
> > > are my requirements:
> > >
> > > 1. Replace "Choose one" with a blank line
> > >
> > > 2. This blank line is the first option and it is
> always
> > > listed no matter whether a value is selected or
> not, no
> > > matter whether the form field of this dropdown
> list is
> > > required or not.
> > >
> > > 3. I am using ChoiceRenderer to convert between
> selection
> > > and objects.
> > >
> > > 4. This behavior is applicable to all
> DropDownChoice.
> > >
> > > How can meet these requirement?
> > >
> > > Thanks for your help!
> > >
> > > Regards.
> > >
> > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > 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
SV: Replace "Choose one" from DropDownChoice?
Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
Also setNullValid(true) otherwise the blank option will disappear once you have made a choice or the model has a value.
- Tor I.
> -----Opprinnelig melding-----
> Fra: Martin Asenov [mailto:mAsenov@velti.com]
> Sendt: 17. mars 2010 15:23
> Til: users@wicket.apache.org
> Emne: RE: Replace "Choose one" from DropDownChoice?
>
> I don't understand , Chang...
>
> If you want non selection to be " ", then say
>
> null=" " (without the quotes)
>
> Otherwise if you don't want null selection, you say
> component.setNullValid(false); and you're fine
>
> Best,
> Martin
>
> -----Original Message-----
> From: David Chang [mailto:david_q_zhang@yahoo.com]
> Sent: Wednesday, March 17, 2010 3:48 PM
> To: users@wicket.apache.org
> Subject: RE: Replace "Choose one" from DropDownChoice?
>
> Martin,
>
> Thanks so much for chiming in. I tried the
>
> null=
>
> approach. The blank line in the dropdown list simply disappears. As I
> said in my requirements, I hope to have it there no matter whether a
> value is selected or not, no matter whether it is a required field or
> not.
>
> Again, thanks for help!
> Best,
> David
>
> --- On Wed, 3/17/10, Martin Asenov <mA...@velti.com> wrote:
>
> > From: Martin Asenov <mA...@velti.com>
> > Subject: RE: Replace "Choose one" from DropDownChoice?
> > To: "users@wicket.apache.org" <us...@wicket.apache.org>
> > Date: Wednesday, March 17, 2010, 9:08 AM
> > Hi, David!
> >
> > Let's presume your webapplication class is called
> > WebApp.java. In the same directory where it is present,
> > create WebApp.properties with the following line:
> >
> > null=
> >
> > that way every single 'choose one' label will be replaced
> > with "".
> >
> > P.S. Don't forget to include the props files in the pom as
> > a resource.
> >
> > Best,
> > Martin
> >
> > -----Original Message-----
> > From: David Chang [mailto:david_q_zhang@yahoo.com]
> >
> > Sent: Wednesday, March 17, 2010 3:03 PM
> > To: users@wicket.apache.org
> > Subject: Replace "Choose one" from DropDownChoice?
> >
> >
> > Hello, I understand that there must be a solution for this.
> > I googled for some time and found one or two results that
> > seem to match what I am looking but they did not answer my
> > question. Tried myself, not successful. So I want to ask
> > folks here. I have a form and it has a dropdown list. Here
> > are my requirements:
> >
> > 1. Replace "Choose one" with a blank line
> >
> > 2. This blank line is the first option and it is always
> > listed no matter whether a value is selected or not, no
> > matter whether the form field of this dropdown list is
> > required or not.
> >
> > 3. I am using ChoiceRenderer to convert between selection
> > and objects.
> >
> > 4. This behavior is applicable to all DropDownChoice.
> >
> > How can meet these requirement?
> >
> > Thanks for your help!
> >
> > Regards.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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: Replace "Choose one" from DropDownChoice?
Posted by Martin Asenov <mA...@velti.com>.
I don't understand , Chang...
If you want non selection to be " ", then say
null=" " (without the quotes)
Otherwise if you don't want null selection, you say
component.setNullValid(false); and you're fine
Best,
Martin
-----Original Message-----
From: David Chang [mailto:david_q_zhang@yahoo.com]
Sent: Wednesday, March 17, 2010 3:48 PM
To: users@wicket.apache.org
Subject: RE: Replace "Choose one" from DropDownChoice?
Martin,
Thanks so much for chiming in. I tried the
null=
approach. The blank line in the dropdown list simply disappears. As I said in my requirements, I hope to have it there no matter whether a value is selected or not, no matter whether it is a required field or not.
Again, thanks for help!
Best,
David
--- On Wed, 3/17/10, Martin Asenov <mA...@velti.com> wrote:
> From: Martin Asenov <mA...@velti.com>
> Subject: RE: Replace "Choose one" from DropDownChoice?
> To: "users@wicket.apache.org" <us...@wicket.apache.org>
> Date: Wednesday, March 17, 2010, 9:08 AM
> Hi, David!
>
> Let's presume your webapplication class is called
> WebApp.java. In the same directory where it is present,
> create WebApp.properties with the following line:
>
> null=
>
> that way every single 'choose one' label will be replaced
> with "".
>
> P.S. Don't forget to include the props files in the pom as
> a resource.
>
> Best,
> Martin
>
> -----Original Message-----
> From: David Chang [mailto:david_q_zhang@yahoo.com]
>
> Sent: Wednesday, March 17, 2010 3:03 PM
> To: users@wicket.apache.org
> Subject: Replace "Choose one" from DropDownChoice?
>
>
> Hello, I understand that there must be a solution for this.
> I googled for some time and found one or two results that
> seem to match what I am looking but they did not answer my
> question. Tried myself, not successful. So I want to ask
> folks here. I have a form and it has a dropdown list. Here
> are my requirements:
>
> 1. Replace "Choose one" with a blank line
>
> 2. This blank line is the first option and it is always
> listed no matter whether a value is selected or not, no
> matter whether the form field of this dropdown list is
> required or not.
>
> 3. I am using ChoiceRenderer to convert between selection
> and objects.
>
> 4. This behavior is applicable to all DropDownChoice.
>
> How can meet these requirement?
>
> Thanks for your help!
>
> Regards.
>
>
>
>
> ---------------------------------------------------------------------
> 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: Replace "Choose one" from DropDownChoice?
Posted by David Chang <da...@yahoo.com>.
Martin,
Thanks so much for chiming in. I tried the
null=
approach. The blank line in the dropdown list simply disappears. As I said in my requirements, I hope to have it there no matter whether a value is selected or not, no matter whether it is a required field or not.
Again, thanks for help!
Best,
David
--- On Wed, 3/17/10, Martin Asenov <mA...@velti.com> wrote:
> From: Martin Asenov <mA...@velti.com>
> Subject: RE: Replace "Choose one" from DropDownChoice?
> To: "users@wicket.apache.org" <us...@wicket.apache.org>
> Date: Wednesday, March 17, 2010, 9:08 AM
> Hi, David!
>
> Let's presume your webapplication class is called
> WebApp.java. In the same directory where it is present,
> create WebApp.properties with the following line:
>
> null=
>
> that way every single 'choose one' label will be replaced
> with "".
>
> P.S. Don't forget to include the props files in the pom as
> a resource.
>
> Best,
> Martin
>
> -----Original Message-----
> From: David Chang [mailto:david_q_zhang@yahoo.com]
>
> Sent: Wednesday, March 17, 2010 3:03 PM
> To: users@wicket.apache.org
> Subject: Replace "Choose one" from DropDownChoice?
>
>
> Hello, I understand that there must be a solution for this.
> I googled for some time and found one or two results that
> seem to match what I am looking but they did not answer my
> question. Tried myself, not successful. So I want to ask
> folks here. I have a form and it has a dropdown list. Here
> are my requirements:
>
> 1. Replace "Choose one" with a blank line
>
> 2. This blank line is the first option and it is always
> listed no matter whether a value is selected or not, no
> matter whether the form field of this dropdown list is
> required or not.
>
> 3. I am using ChoiceRenderer to convert between selection
> and objects.
>
> 4. This behavior is applicable to all DropDownChoice.
>
> How can meet these requirement?
>
> Thanks for your help!
>
> Regards.
>
>
>
>
> ---------------------------------------------------------------------
> 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: Replace "Choose one" from DropDownChoice?
Posted by Martin Asenov <mA...@velti.com>.
Hi, David!
Let's presume your webapplication class is called WebApp.java. In the same directory where it is present, create WebApp.properties with the following line:
null=
that way every single 'choose one' label will be replaced with "".
P.S. Don't forget to include the props files in the pom as a resource.
Best,
Martin
-----Original Message-----
From: David Chang [mailto:david_q_zhang@yahoo.com]
Sent: Wednesday, March 17, 2010 3:03 PM
To: users@wicket.apache.org
Subject: Replace "Choose one" from DropDownChoice?
Hello, I understand that there must be a solution for this. I googled for some time and found one or two results that seem to match what I am looking but they did not answer my question. Tried myself, not successful. So I want to ask folks here. I have a form and it has a dropdown list. Here are my requirements:
1. Replace "Choose one" with a blank line
2. This blank line is the first option and it is always listed no matter whether a value is selected or not, no matter whether the form field of this dropdown list is required or not.
3. I am using ChoiceRenderer to convert between selection and objects.
4. This behavior is applicable to all DropDownChoice.
How can meet these requirement?
Thanks for your help!
Regards.
---------------------------------------------------------------------
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
Replace "Choose one" from DropDownChoice?
Posted by David Chang <da...@yahoo.com>.
Hello, I understand that there must be a solution for this. I googled for some time and found one or two results that seem to match what I am looking but they did not answer my question. Tried myself, not successful. So I want to ask folks here. I have a form and it has a dropdown list. Here are my requirements:
1. Replace "Choose one" with a blank line
2. This blank line is the first option and it is always listed no matter whether a value is selected or not, no matter whether the form field of this dropdown list is required or not.
3. I am using ChoiceRenderer to convert between selection and objects.
4. This behavior is applicable to all DropDownChoice.
How can meet these requirement?
Thanks for your help!
Regards.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Application#get in WicketSessionFilter
Posted by Erik van Oosten <e....@grons.nl>.
That sounds great. Could you update the wiki page with the specifics for
Wicket 1.4.8?
Regards,
Erik.
Op 17-03-10 08:20, Jonas schreef:
> Thanks, Erik, that code would do the trick, too. I've implemented
> a different workaround, though. In the next release of wicket (1.4.8),
> WicketSessionFilter will 'expose' both the session and the application, Igor
> already resolved my JIRA Issue [1]. BTW: Thanks to Igor for picking that
> up so quickly!
>
> cheers,
> Jonas
>
>
> [1] https://issues.apache.org/jira/browse/WICKET-2778
>
> On Tue, Mar 16, 2010 at 9:05 PM, Erik van Oosten<e....@grons.nl> wrote:
>
>> Hi Jonas,
>>
>> Perhaps this is what you need:
>> http://cwiki.apache.org/WICKET/springbean-outside-wicket.html
>>
>> Regards,
>> Erik.
>>
>>
>> Jonas wrote:
>>
>>> Hi all,
>>>
>>> we're using WicketSessionFilter in our product to access
>>> our custom WebSession, which works fine. Now we've tried
>>> to also access the org.apache.wicket.Application (e.g. using
>>> Session#getApplication or Application#get), which doesn't seem
>>> to work, because the application isn't bound to the ThreadLocal.
>>> After searching in nabble I found some old threads ([1], [2]) suggesting
>>> this should actually work fine, but that doesn't seem to be the case.
>>> Is there any special configuration trick I have to apply to make this
>>> work, or are those old posts just (no longer) true?
>>> If anybody could confirm this is actually a bug, I'd create an issue
>>> in JIRA to have this fixed.
>>>
>>> Regards,
>>> Jonas
>>>
>>> [1]
>>> http://old.nabble.com/Accessing-Wicket-Application-from-custom-servlet-ts24814177.html#a24815786
>>> [2] http://old.nabble.com/WicketFilter-td25205475.html#a25210469
>>>
>>>
--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Application#get in WicketSessionFilter
Posted by Jonas <ba...@gmail.com>.
Thanks, Erik, that code would do the trick, too. I've implemented
a different workaround, though. In the next release of wicket (1.4.8),
WicketSessionFilter will 'expose' both the session and the application, Igor
already resolved my JIRA Issue [1]. BTW: Thanks to Igor for picking that
up so quickly!
cheers,
Jonas
[1] https://issues.apache.org/jira/browse/WICKET-2778
On Tue, Mar 16, 2010 at 9:05 PM, Erik van Oosten <e....@grons.nl> wrote:
> Hi Jonas,
>
> Perhaps this is what you need:
> http://cwiki.apache.org/WICKET/springbean-outside-wicket.html
>
> Regards,
> Erik.
>
>
> Jonas wrote:
>>
>> Hi all,
>>
>> we're using WicketSessionFilter in our product to access
>> our custom WebSession, which works fine. Now we've tried
>> to also access the org.apache.wicket.Application (e.g. using
>> Session#getApplication or Application#get), which doesn't seem
>> to work, because the application isn't bound to the ThreadLocal.
>> After searching in nabble I found some old threads ([1], [2]) suggesting
>> this should actually work fine, but that doesn't seem to be the case.
>> Is there any special configuration trick I have to apply to make this
>> work, or are those old posts just (no longer) true?
>> If anybody could confirm this is actually a bug, I'd create an issue
>> in JIRA to have this fixed.
>>
>> Regards,
>> Jonas
>>
>> [1]
>> http://old.nabble.com/Accessing-Wicket-Application-from-custom-servlet-ts24814177.html#a24815786
>> [2] http://old.nabble.com/WicketFilter-td25205475.html#a25210469
>>
>
> --
> Sent from my SMTP compliant software
> Erik van Oosten
> http://day-to-day-stuff.blogspot.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: Application#get in WicketSessionFilter
Posted by Erik van Oosten <e....@grons.nl>.
Hi Jonas,
Perhaps this is what you need:
http://cwiki.apache.org/WICKET/springbean-outside-wicket.html
Regards,
Erik.
Jonas wrote:
> Hi all,
>
> we're using WicketSessionFilter in our product to access
> our custom WebSession, which works fine. Now we've tried
> to also access the org.apache.wicket.Application (e.g. using
> Session#getApplication or Application#get), which doesn't seem
> to work, because the application isn't bound to the ThreadLocal.
> After searching in nabble I found some old threads ([1], [2]) suggesting
> this should actually work fine, but that doesn't seem to be the case.
> Is there any special configuration trick I have to apply to make this
> work, or are those old posts just (no longer) true?
> If anybody could confirm this is actually a bug, I'd create an issue
> in JIRA to have this fixed.
>
> Regards,
> Jonas
>
> [1] http://old.nabble.com/Accessing-Wicket-Application-from-custom-servlet-ts24814177.html#a24815786
> [2] http://old.nabble.com/WicketFilter-td25205475.html#a25210469
>
--
Sent from my SMTP compliant software
Erik van Oosten
http://day-to-day-stuff.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org