You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Milan Milanovic <mi...@yahoo.com> on 2008/07/24 16:17:29 UTC

[s2] Making textfield input optional

Hi,

I have one form with multiple textfields, and I want to one of that
textfield be optional for user, i.e., he doesn't need to enter information
in that particular field. Now, when user don't enter I get this in my log:

ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
ParametersInterceptor - [setParameters]: Unexpected Exception caught setting
'inValue' on 'class com.myProject.action.ViewAction: Error setting
expression 'inValue' with value '[Ljava.lang.String;@1d3ac6e'

How can I enable this but without getting this error ?

--
Thx, Milan
-- 
View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Milan Milanovic <mi...@yahoo.com>.
Hi Gabriel,

it is a BigDecimal.

--
Thx, Milan


Gabriel Belingueres-2 wrote:
> 
> Which is the data type of inValue?
> 
> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>
>> Hi,
>>
>> I have one form with multiple textfields, and I want to one of that
>> textfield be optional for user, i.e., he doesn't need to enter
>> information
>> in that particular field. Now, when user don't enter I get this in my
>> log:
>>
>> ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
>> ParametersInterceptor - [setParameters]: Unexpected Exception caught
>> setting
>> 'inValue' on 'class com.myProject.action.ViewAction: Error setting
>> expression 'inValue' with value '[Ljava.lang.String;@1d3ac6e'
>>
>> How can I enable this but without getting this error ?
>>
>> --
>> Thx, Milan
>> --
>> View this message in context:
>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633458.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Milan Milanovic <mi...@yahoo.com>.
O.K. Thanks. I've done it. But what should I do for get method? When I put
BigDecimal or String as return value for method getValue() in my action
class I get this error in loading form:

Caused by: ognl.OgnlException: value [java.lang.NullPointerException]
	at ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:935)
	at
ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:53)
	at ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:121)
	at
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.getProperty(OgnlValueStack.java:58)
	at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1643)
	at
com.opensymphony.xwork2.util.CompoundRootAccessor.getProperty(CompoundRootAccessor.java:101)
	... 171 more

--
Regards, Milan



Gabriel Belingueres-2 wrote:
> 
> Yes, you need to write this setter in your action class.
> 
> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>
>> Dear Gabriel,
>>
>> You mean in my action class ?
>>
>> --
>> Milan
>>
>>
>> Gabriel Belingueres-2 wrote:
>>>
>>> You don't need to modify your model, just delegate to it:
>>>        public void setValue(String s) {
>>>                if (!StringUtils.isBlank(s)) {
>>>                    try {
>>>                        model.setValue(new BigDecimal(s));
>>>                    catch(NumberFormatException e) {
>>>                        model.setValue(null);
>>>                    }
>>>                }
>>>        }
>>>
>>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>>
>>>> Dear Gabriel,
>>>>
>>>> thank you. I tried without my Converter class for BigDecimal and it is
>>>> the
>>>> same, when user doesn't enter value I got that error in a log.
>>>>
>>>> I'm using S2 2.0.11.1. This solution is good, but my value that is set
>>>> comes
>>>> from model where I have class and attribute (BigDecimal) with its
>>>> get/set
>>>> methods, by putting this set(String) instead of set(BigDecimal) I'm
>>>> violating class semantics ?
>>>>
>>>> The other solution is O.K., but I've already used it with Dates and
>>>> datetimepicker. Can I change in some way this BigDecimal converter to
>>>> avoid
>>>> this error:
>>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>>
>>>> --
>>>> Regards, Milan.
>>>>
>>>>
>>>>
>>>>
>>>> Gabriel Belingueres-2 wrote:
>>>>>
>>>>> I'm using S2.1.2 (are you using the same version?), and it will throw
>>>>> a NumberFormatException when setting an empty string, but this
>>>>> workaround will make ParameterInterceptor to think it is setting a
>>>>> String parameter:
>>>>>
>>>>>       public void setValue(String s) {
>>>>>               if (!StringUtils.isBlank(s)) {
>>>>>                     try {
>>>>>                       this.value= new BigDecimal(s);
>>>>>                     catch(NumberFormatException e) {
>>>>>                         this.value = null;
>>>>>                     }
>>>>>               }
>>>>>       }
>>>>>
>>>>> of course you still need a validator so that the string doesn't
>>>>> violate the BigDecimal grammar.
>>>>>
>>>>> Other option (may be more clean) is the action having both the string
>>>>> instance and the real BigDecimal instance, then the form will only set
>>>>> the string instance.
>>>>>
>>>>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>>>>
>>>>>> Dear Newton,
>>>>>>
>>>>>> Yes, I'm using BigDecimal type converter given here:
>>>>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>>>> .
>>>>>>
>>>>>> --
>>>>>> Thx, Milan
>>>>>>
>>>>>>
>>>>>> newton.dave wrote:
>>>>>>>
>>>>>>> Are you using a BigDecimal type converter (one of which was just
>>>>>>> posted)?
>>>>>>>
>>>>>>> AFAIK it won't work w/o the converter, but I could be remembering
>>>>>>> incorrectly.
>>>>>>>
>>>>>>> Dave
>>>>>>>
>>>>>>> --- On Thu, 7/24/08, Milan Milanovic <mi...@yahoo.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> From: Milan Milanovic <mi...@yahoo.com>
>>>>>>>> Subject: Re: [s2] Making textfield input optional
>>>>>>>> To: user@struts.apache.org
>>>>>>>> Date: Thursday, July 24, 2008, 11:36 AM
>>>>>>>> Dear Gabriel,
>>>>>>>>
>>>>>>>> no, my actual question is related to the issue when user
>>>>>>>> doesn't enter
>>>>>>>> anything to the textfield which is connected to BigDecimal
>>>>>>>> in my action
>>>>>>>> class.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Thx, Milan
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Gabriel Belingueres-2 wrote:
>>>>>>>> >
>>>>>>>> > Please make sure that the input string is according
>>>>>>>> the BigDecimal format:
>>>>>>>> >
>>>>>>>> http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)
>>>>>>>> >
>>>>>>>> > 2008/7/24 Milan Milanovic
>>>>>>>> <mi...@yahoo.com>:
>>>>>>>> >>
>>>>>>>> >> Hi Gabriel,
>>>>>>>> >>
>>>>>>>> >> no I cannot do this because my field is of type
>>>>>>>> BigDecimal and I must
>>>>>>>> >> have
>>>>>>>> >> get/set methods for it.
>>>>>>>> >>
>>>>>>>> >> --
>>>>>>>> >> Thx, Milan
>>>>>>>> >>
>>>>>>>> >>
>>>>>>>> >> Gabriel Belingueres-2 wrote:
>>>>>>>> >>>
>>>>>>>> >>> instead of:
>>>>>>>> >>>
>>>>>>>> >>> public vlid setInValue(BigDecimal x) {
>>>>>>>> >>>   this.x = x;
>>>>>>>> >>> }
>>>>>>>> >>>
>>>>>>>> >>> test with this:
>>>>>>>> >>>
>>>>>>>> >>> public vlid setInValue(String s) {
>>>>>>>> >>>   this.x = new BigDecimal(s);
>>>>>>>> >>> }
>>>>>>>> >>>
>>>>>>>> >>>
>>>>>>>> >>> 2008/7/24 Milan Milanovic
>>>>>>>> <mi...@yahoo.com>:
>>>>>>>> >>>>
>>>>>>>> >>>> Hi Jim,
>>>>>>>> >>>>
>>>>>>>> >>>> no, I have that method.
>>>>>>>> >>>>
>>>>>>>> >>>> --
>>>>>>>> >>>> Thx, Milan
>>>>>>>> >>>>
>>>>>>>> >>>>
>>>>>>>> >>>> Jim Kiley wrote:
>>>>>>>> >>>>>
>>>>>>>> >>>>> Doesn't that exception usually get
>>>>>>>> thrown when, in this case,
>>>>>>>> >>>>> ViewAction
>>>>>>>> >>>>> doesn't have a setInValue()
>>>>>>>> method?
>>>>>>>> >>>>>
>>>>>>>> >>>>> jk
>>>>>>>> >>>>>
>>>>>>>> >>>>> On Thu, Jul 24, 2008 at 10:31 AM,
>>>>>>>> Gabriel Belingueres
>>>>>>>> >>>>> <be...@gmail.com>
>>>>>>>> >>>>> wrote:
>>>>>>>> >>>>>
>>>>>>>> >>>>>> Which is the data type of inValue?
>>>>>>>> >>>>>>
>>>>>>>> >>>>>> 2008/7/24 Milan Milanovic
>>>>>>>> <mi...@yahoo.com>:
>>>>>>>> >>>>>> >
>>>>>>>> >>>>>> > Hi,
>>>>>>>> >>>>>> >
>>>>>>>> >>>>>> > I have one form with multiple
>>>>>>>> textfields, and I want to one of that
>>>>>>>> >>>>>> > textfield be optional for
>>>>>>>> user, i.e., he doesn't need to enter
>>>>>>>> >>>>>> information
>>>>>>>> >>>>>> > in that particular field.
>>>>>>>> Now, when user don't enter I get this in
>>>>>>>> >>>>>> my
>>>>>>>> >>>>>> log:
>>>>>>>> >>>>>> >
>>>>>>>> >>>>>> > ERROR
>>>>>>>> com.opensymphony.xwork2.interceptor.ParametersInterceptor:204
>>>>>>>> >>>>>> -
>>>>>>>> >>>>>> > ParametersInterceptor -
>>>>>>>> [setParameters]: Unexpected Exception
>>>>>>>> >>>>>> caught
>>>>>>>> >>>>>> setting
>>>>>>>> >>>>>> > 'inValue' on
>>>>>>>> 'class com.myProject.action.ViewAction: Error setting
>>>>>>>> >>>>>> > expression 'inValue'
>>>>>>>> with value '[Ljava.lang.String;@1d3ac6e'
>>>>>>>> >>>>>> >
>>>>>>>> >>>>>> > How can I enable this but
>>>>>>>> without getting this error ?
>>>>>>>> >>>>>> >
>>>>>>>> >>>>>> > --
>>>>>>>> >>>>>> > Thx, Milan
>>>>>>>> >>>>>> > --
>>>>>>>> >>>>>> > View this message in context:
>>>>>>>> >>>>>>
>>>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>>>>>>>> >>>>>> > Sent from the Struts - User
>>>>>>>> mailing list archive at Nabble.com.
>>>>>>>> >>>>>> >
>>>>>>>> >>>>>> >
>>>>>>>> >>>>>> >
>>>>>>>> >>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> >>>>>> > To unsubscribe, e-mail:
>>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>>> >>>>>> > For additional commands,
>>>>>>>> e-mail: user-help@struts.apache.org
>>>>>>>> >>>>>> >
>>>>>>>> >>>>>> >
>>>>>>>> >>>>>>
>>>>>>>> >>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> >>>>>> To unsubscribe, e-mail:
>>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>>> >>>>>> For additional commands, e-mail:
>>>>>>>> user-help@struts.apache.org
>>>>>>>> >>>>>>
>>>>>>>> >>>>>>
>>>>>>>> >>>>>
>>>>>>>> >>>>>
>>>>>>>> >>>>> --
>>>>>>>> >>>>> Jim Kiley
>>>>>>>> >>>>> Technical Consultant | Summa
>>>>>>>> >>>>> [p] 412.258.3346 [m] 412.445.1729
>>>>>>>> >>>>> http://www.summa-tech.com
>>>>>>>> >>>>>
>>>>>>>> >>>>>
>>>>>>>> >>>>
>>>>>>>> >>>> --
>>>>>>>> >>>> View this message in context:
>>>>>>>> >>>>
>>>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
>>>>>>>> >>>> Sent from the Struts - User mailing list
>>>>>>>> archive at Nabble.com.
>>>>>>>> >>>>
>>>>>>>> >>>>
>>>>>>>> >>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> >>>> To unsubscribe, e-mail:
>>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>>> >>>> For additional commands, e-mail:
>>>>>>>> user-help@struts.apache.org
>>>>>>>> >>>>
>>>>>>>> >>>>
>>>>>>>> >>>
>>>>>>>> >>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> >>> To unsubscribe, e-mail:
>>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>>> >>> For additional commands, e-mail:
>>>>>>>> user-help@struts.apache.org
>>>>>>>> >>>
>>>>>>>> >>>
>>>>>>>> >>>
>>>>>>>> >>
>>>>>>>> >> --
>>>>>>>> >> View this message in context:
>>>>>>>> >>
>>>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633888.html
>>>>>>>> >> Sent from the Struts - User mailing list archive
>>>>>>>> at Nabble.com.
>>>>>>>> >>
>>>>>>>> >>
>>>>>>>> >>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> >> To unsubscribe, e-mail:
>>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>>> >> For additional commands, e-mail:
>>>>>>>> user-help@struts.apache.org
>>>>>>>> >>
>>>>>>>> >>
>>>>>>>> >
>>>>>>>> >
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> > To unsubscribe, e-mail:
>>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>>> > For additional commands, e-mail:
>>>>>>>> user-help@struts.apache.org
>>>>>>>> >
>>>>>>>> >
>>>>>>>> >
>>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634541.html
>>>>>>>> Sent from the Struts - User mailing list archive at
>>>>>>>> Nabble.com.
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>>>> For additional commands, e-mail:
>>>>>>>> user-help@struts.apache.org
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634840.html
>>>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18635312.html
>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18635560.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18652176.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [s2] Making textfield input optional

Posted by Jishnu Viswanath <ji...@tavant.com>.
Ignore my last mail on this thread. I did not see the replies.

Regards,

Jishnu Viswanath

Software Engineer

*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll

Tavant Technologies Inc.,

www.tavant.com

PEOPLE :: PASSION :: EXCELLENCE


-----Original Message-----
From: Gabriel Belingueres [mailto:belingueres@gmail.com] 
Sent: Thursday, July 24, 2008 10:08 PM
To: Struts Users Mailing List
Subject: Re: [s2] Making textfield input optional

Yes, you need to write this setter in your action class.

2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>
> Dear Gabriel,
>
> You mean in my action class ?
>
> --
> Milan
>
>
> Gabriel Belingueres-2 wrote:
>>
>> You don't need to modify your model, just delegate to it:
>>        public void setValue(String s) {
>>                if (!StringUtils.isBlank(s)) {
>>                    try {
>>                        model.setValue(new BigDecimal(s));
>>                    catch(NumberFormatException e) {
>>                        model.setValue(null);
>>                    }
>>                }
>>        }
>>
>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>
>>> Dear Gabriel,
>>>
>>> thank you. I tried without my Converter class for BigDecimal and it
is
>>> the
>>> same, when user doesn't enter value I got that error in a log.
>>>
>>> I'm using S2 2.0.11.1. This solution is good, but my value that is
set
>>> comes
>>> from model where I have class and attribute (BigDecimal) with its
get/set
>>> methods, by putting this set(String) instead of set(BigDecimal) I'm
>>> violating class semantics ?
>>>
>>> The other solution is O.K., but I've already used it with Dates and
>>> datetimepicker. Can I change in some way this BigDecimal converter
to
>>> avoid
>>> this error:
>>>
http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>
http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>
>>> --
>>> Regards, Milan.
>>>
>>>
>>>
>>>
>>> Gabriel Belingueres-2 wrote:
>>>>
>>>> I'm using S2.1.2 (are you using the same version?), and it will
throw
>>>> a NumberFormatException when setting an empty string, but this
>>>> workaround will make ParameterInterceptor to think it is setting a
>>>> String parameter:
>>>>
>>>>       public void setValue(String s) {
>>>>               if (!StringUtils.isBlank(s)) {
>>>>                     try {
>>>>                       this.value= new BigDecimal(s);
>>>>                     catch(NumberFormatException e) {
>>>>                         this.value = null;
>>>>                     }
>>>>               }
>>>>       }
>>>>
>>>> of course you still need a validator so that the string doesn't
>>>> violate the BigDecimal grammar.
>>>>
>>>> Other option (may be more clean) is the action having both the
string
>>>> instance and the real BigDecimal instance, then the form will only
set
>>>> the string instance.
>>>>
>>>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>>>
>>>>> Dear Newton,
>>>>>
>>>>> Yes, I'm using BigDecimal type converter given here:
>>>>>
http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>>>
http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>>> .
>>>>>
>>>>> --
>>>>> Thx, Milan
>>>>>
>>>>>
>>>>> newton.dave wrote:
>>>>>>
>>>>>> Are you using a BigDecimal type converter (one of which was just
>>>>>> posted)?
>>>>>>
>>>>>> AFAIK it won't work w/o the converter, but I could be remembering
>>>>>> incorrectly.
>>>>>>
>>>>>> Dave
>>>>>>
>>>>>> --- On Thu, 7/24/08, Milan Milanovic <mi...@yahoo.com>
>>>>>> wrote:
>>>>>>
>>>>>>> From: Milan Milanovic <mi...@yahoo.com>
>>>>>>> Subject: Re: [s2] Making textfield input optional
>>>>>>> To: user@struts.apache.org
>>>>>>> Date: Thursday, July 24, 2008, 11:36 AM
>>>>>>> Dear Gabriel,
>>>>>>>
>>>>>>> no, my actual question is related to the issue when user
>>>>>>> doesn't enter
>>>>>>> anything to the textfield which is connected to BigDecimal
>>>>>>> in my action
>>>>>>> class.
>>>>>>>
>>>>>>> --
>>>>>>> Thx, Milan
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Gabriel Belingueres-2 wrote:
>>>>>>> >
>>>>>>> > Please make sure that the input string is according
>>>>>>> the BigDecimal format:
>>>>>>> >
>>>>>>>
http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDec
imal(java.lang.String)
>>>>>>> >
>>>>>>> > 2008/7/24 Milan Milanovic
>>>>>>> <mi...@yahoo.com>:
>>>>>>> >>
>>>>>>> >> Hi Gabriel,
>>>>>>> >>
>>>>>>> >> no I cannot do this because my field is of type
>>>>>>> BigDecimal and I must
>>>>>>> >> have
>>>>>>> >> get/set methods for it.
>>>>>>> >>
>>>>>>> >> --
>>>>>>> >> Thx, Milan
>>>>>>> >>
>>>>>>> >>
>>>>>>> >> Gabriel Belingueres-2 wrote:
>>>>>>> >>>
>>>>>>> >>> instead of:
>>>>>>> >>>
>>>>>>> >>> public vlid setInValue(BigDecimal x) {
>>>>>>> >>>   this.x = x;
>>>>>>> >>> }
>>>>>>> >>>
>>>>>>> >>> test with this:
>>>>>>> >>>
>>>>>>> >>> public vlid setInValue(String s) {
>>>>>>> >>>   this.x = new BigDecimal(s);
>>>>>>> >>> }
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>> 2008/7/24 Milan Milanovic
>>>>>>> <mi...@yahoo.com>:
>>>>>>> >>>>
>>>>>>> >>>> Hi Jim,
>>>>>>> >>>>
>>>>>>> >>>> no, I have that method.
>>>>>>> >>>>
>>>>>>> >>>> --
>>>>>>> >>>> Thx, Milan
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>> Jim Kiley wrote:
>>>>>>> >>>>>
>>>>>>> >>>>> Doesn't that exception usually get
>>>>>>> thrown when, in this case,
>>>>>>> >>>>> ViewAction
>>>>>>> >>>>> doesn't have a setInValue()
>>>>>>> method?
>>>>>>> >>>>>
>>>>>>> >>>>> jk
>>>>>>> >>>>>
>>>>>>> >>>>> On Thu, Jul 24, 2008 at 10:31 AM,
>>>>>>> Gabriel Belingueres
>>>>>>> >>>>> <be...@gmail.com>
>>>>>>> >>>>> wrote:
>>>>>>> >>>>>
>>>>>>> >>>>>> Which is the data type of inValue?
>>>>>>> >>>>>>
>>>>>>> >>>>>> 2008/7/24 Milan Milanovic
>>>>>>> <mi...@yahoo.com>:
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > Hi,
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > I have one form with multiple
>>>>>>> textfields, and I want to one of that
>>>>>>> >>>>>> > textfield be optional for
>>>>>>> user, i.e., he doesn't need to enter
>>>>>>> >>>>>> information
>>>>>>> >>>>>> > in that particular field.
>>>>>>> Now, when user don't enter I get this in
>>>>>>> >>>>>> my
>>>>>>> >>>>>> log:
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > ERROR
>>>>>>> com.opensymphony.xwork2.interceptor.ParametersInterceptor:204
>>>>>>> >>>>>> -
>>>>>>> >>>>>> > ParametersInterceptor -
>>>>>>> [setParameters]: Unexpected Exception
>>>>>>> >>>>>> caught
>>>>>>> >>>>>> setting
>>>>>>> >>>>>> > 'inValue' on
>>>>>>> 'class com.myProject.action.ViewAction: Error setting
>>>>>>> >>>>>> > expression 'inValue'
>>>>>>> with value '[Ljava.lang.String;@1d3ac6e'
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > How can I enable this but
>>>>>>> without getting this error ?
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > --
>>>>>>> >>>>>> > Thx, Milan
>>>>>>> >>>>>> > --
>>>>>>> >>>>>> > View this message in context:
>>>>>>> >>>>>>
>>>>>>>
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
632806.html
>>>>>>> >>>>>> > Sent from the Struts - User
>>>>>>> mailing list archive at Nabble.com.
>>>>>>> >>>>>> >
>>>>>>> >>>>>> >
>>>>>>> >>>>>> >
>>>>>>> >>>>>>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> >>>>>> > To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>> >>>>>> > For additional commands,
>>>>>>> e-mail: user-help@struts.apache.org
>>>>>>> >>>>>> >
>>>>>>> >>>>>> >
>>>>>>> >>>>>>
>>>>>>> >>>>>>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> >>>>>> To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>> >>>>>> For additional commands, e-mail:
>>>>>>> user-help@struts.apache.org
>>>>>>> >>>>>>
>>>>>>> >>>>>>
>>>>>>> >>>>>
>>>>>>> >>>>>
>>>>>>> >>>>> --
>>>>>>> >>>>> Jim Kiley
>>>>>>> >>>>> Technical Consultant | Summa
>>>>>>> >>>>> [p] 412.258.3346 [m] 412.445.1729
>>>>>>> >>>>> http://www.summa-tech.com
>>>>>>> >>>>>
>>>>>>> >>>>>
>>>>>>> >>>>
>>>>>>> >>>> --
>>>>>>> >>>> View this message in context:
>>>>>>> >>>>
>>>>>>>
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
633474.html
>>>>>>> >>>> Sent from the Struts - User mailing list
>>>>>>> archive at Nabble.com.
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> >>>> To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>> >>>> For additional commands, e-mail:
>>>>>>> user-help@struts.apache.org
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>
>>>>>>> >>>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> >>> To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>> >>> For additional commands, e-mail:
>>>>>>> user-help@struts.apache.org
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>
>>>>>>> >> --
>>>>>>> >> View this message in context:
>>>>>>> >>
>>>>>>>
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
633888.html
>>>>>>> >> Sent from the Struts - User mailing list archive
>>>>>>> at Nabble.com.
>>>>>>> >>
>>>>>>> >>
>>>>>>> >>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> >> To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>> >> For additional commands, e-mail:
>>>>>>> user-help@struts.apache.org
>>>>>>> >>
>>>>>>> >>
>>>>>>> >
>>>>>>> >
>>>>>>>
---------------------------------------------------------------------
>>>>>>> > To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>> > For additional commands, e-mail:
>>>>>>> user-help@struts.apache.org
>>>>>>> >
>>>>>>> >
>>>>>>> >
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>>
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
634541.html
>>>>>>> Sent from the Struts - User mailing list archive at
>>>>>>> Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>>> For additional commands, e-mail:
>>>>>>> user-help@struts.apache.org
>>>>>>
>>>>>>
---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>>
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
634840.html
>>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>>
---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>
>>>>
---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>>
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
635312.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> --
> View this message in context:
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
635560.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may 
contain confidential and/or privileged material. If you have received this in error, please contact the 
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies 
may be subject to our monitoring procedures.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Gabriel Belingueres <be...@gmail.com>.
Yes, you need to write this setter in your action class.

2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>
> Dear Gabriel,
>
> You mean in my action class ?
>
> --
> Milan
>
>
> Gabriel Belingueres-2 wrote:
>>
>> You don't need to modify your model, just delegate to it:
>>        public void setValue(String s) {
>>                if (!StringUtils.isBlank(s)) {
>>                    try {
>>                        model.setValue(new BigDecimal(s));
>>                    catch(NumberFormatException e) {
>>                        model.setValue(null);
>>                    }
>>                }
>>        }
>>
>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>
>>> Dear Gabriel,
>>>
>>> thank you. I tried without my Converter class for BigDecimal and it is
>>> the
>>> same, when user doesn't enter value I got that error in a log.
>>>
>>> I'm using S2 2.0.11.1. This solution is good, but my value that is set
>>> comes
>>> from model where I have class and attribute (BigDecimal) with its get/set
>>> methods, by putting this set(String) instead of set(BigDecimal) I'm
>>> violating class semantics ?
>>>
>>> The other solution is O.K., but I've already used it with Dates and
>>> datetimepicker. Can I change in some way this BigDecimal converter to
>>> avoid
>>> this error:
>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>
>>> --
>>> Regards, Milan.
>>>
>>>
>>>
>>>
>>> Gabriel Belingueres-2 wrote:
>>>>
>>>> I'm using S2.1.2 (are you using the same version?), and it will throw
>>>> a NumberFormatException when setting an empty string, but this
>>>> workaround will make ParameterInterceptor to think it is setting a
>>>> String parameter:
>>>>
>>>>       public void setValue(String s) {
>>>>               if (!StringUtils.isBlank(s)) {
>>>>                     try {
>>>>                       this.value= new BigDecimal(s);
>>>>                     catch(NumberFormatException e) {
>>>>                         this.value = null;
>>>>                     }
>>>>               }
>>>>       }
>>>>
>>>> of course you still need a validator so that the string doesn't
>>>> violate the BigDecimal grammar.
>>>>
>>>> Other option (may be more clean) is the action having both the string
>>>> instance and the real BigDecimal instance, then the form will only set
>>>> the string instance.
>>>>
>>>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>>>
>>>>> Dear Newton,
>>>>>
>>>>> Yes, I'm using BigDecimal type converter given here:
>>>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>>> .
>>>>>
>>>>> --
>>>>> Thx, Milan
>>>>>
>>>>>
>>>>> newton.dave wrote:
>>>>>>
>>>>>> Are you using a BigDecimal type converter (one of which was just
>>>>>> posted)?
>>>>>>
>>>>>> AFAIK it won't work w/o the converter, but I could be remembering
>>>>>> incorrectly.
>>>>>>
>>>>>> Dave
>>>>>>
>>>>>> --- On Thu, 7/24/08, Milan Milanovic <mi...@yahoo.com>
>>>>>> wrote:
>>>>>>
>>>>>>> From: Milan Milanovic <mi...@yahoo.com>
>>>>>>> Subject: Re: [s2] Making textfield input optional
>>>>>>> To: user@struts.apache.org
>>>>>>> Date: Thursday, July 24, 2008, 11:36 AM
>>>>>>> Dear Gabriel,
>>>>>>>
>>>>>>> no, my actual question is related to the issue when user
>>>>>>> doesn't enter
>>>>>>> anything to the textfield which is connected to BigDecimal
>>>>>>> in my action
>>>>>>> class.
>>>>>>>
>>>>>>> --
>>>>>>> Thx, Milan
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Gabriel Belingueres-2 wrote:
>>>>>>> >
>>>>>>> > Please make sure that the input string is according
>>>>>>> the BigDecimal format:
>>>>>>> >
>>>>>>> http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)
>>>>>>> >
>>>>>>> > 2008/7/24 Milan Milanovic
>>>>>>> <mi...@yahoo.com>:
>>>>>>> >>
>>>>>>> >> Hi Gabriel,
>>>>>>> >>
>>>>>>> >> no I cannot do this because my field is of type
>>>>>>> BigDecimal and I must
>>>>>>> >> have
>>>>>>> >> get/set methods for it.
>>>>>>> >>
>>>>>>> >> --
>>>>>>> >> Thx, Milan
>>>>>>> >>
>>>>>>> >>
>>>>>>> >> Gabriel Belingueres-2 wrote:
>>>>>>> >>>
>>>>>>> >>> instead of:
>>>>>>> >>>
>>>>>>> >>> public vlid setInValue(BigDecimal x) {
>>>>>>> >>>   this.x = x;
>>>>>>> >>> }
>>>>>>> >>>
>>>>>>> >>> test with this:
>>>>>>> >>>
>>>>>>> >>> public vlid setInValue(String s) {
>>>>>>> >>>   this.x = new BigDecimal(s);
>>>>>>> >>> }
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>> 2008/7/24 Milan Milanovic
>>>>>>> <mi...@yahoo.com>:
>>>>>>> >>>>
>>>>>>> >>>> Hi Jim,
>>>>>>> >>>>
>>>>>>> >>>> no, I have that method.
>>>>>>> >>>>
>>>>>>> >>>> --
>>>>>>> >>>> Thx, Milan
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>> Jim Kiley wrote:
>>>>>>> >>>>>
>>>>>>> >>>>> Doesn't that exception usually get
>>>>>>> thrown when, in this case,
>>>>>>> >>>>> ViewAction
>>>>>>> >>>>> doesn't have a setInValue()
>>>>>>> method?
>>>>>>> >>>>>
>>>>>>> >>>>> jk
>>>>>>> >>>>>
>>>>>>> >>>>> On Thu, Jul 24, 2008 at 10:31 AM,
>>>>>>> Gabriel Belingueres
>>>>>>> >>>>> <be...@gmail.com>
>>>>>>> >>>>> wrote:
>>>>>>> >>>>>
>>>>>>> >>>>>> Which is the data type of inValue?
>>>>>>> >>>>>>
>>>>>>> >>>>>> 2008/7/24 Milan Milanovic
>>>>>>> <mi...@yahoo.com>:
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > Hi,
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > I have one form with multiple
>>>>>>> textfields, and I want to one of that
>>>>>>> >>>>>> > textfield be optional for
>>>>>>> user, i.e., he doesn't need to enter
>>>>>>> >>>>>> information
>>>>>>> >>>>>> > in that particular field.
>>>>>>> Now, when user don't enter I get this in
>>>>>>> >>>>>> my
>>>>>>> >>>>>> log:
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > ERROR
>>>>>>> com.opensymphony.xwork2.interceptor.ParametersInterceptor:204
>>>>>>> >>>>>> -
>>>>>>> >>>>>> > ParametersInterceptor -
>>>>>>> [setParameters]: Unexpected Exception
>>>>>>> >>>>>> caught
>>>>>>> >>>>>> setting
>>>>>>> >>>>>> > 'inValue' on
>>>>>>> 'class com.myProject.action.ViewAction: Error setting
>>>>>>> >>>>>> > expression 'inValue'
>>>>>>> with value '[Ljava.lang.String;@1d3ac6e'
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > How can I enable this but
>>>>>>> without getting this error ?
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > --
>>>>>>> >>>>>> > Thx, Milan
>>>>>>> >>>>>> > --
>>>>>>> >>>>>> > View this message in context:
>>>>>>> >>>>>>
>>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>>>>>>> >>>>>> > Sent from the Struts - User
>>>>>>> mailing list archive at Nabble.com.
>>>>>>> >>>>>> >
>>>>>>> >>>>>> >
>>>>>>> >>>>>> >
>>>>>>> >>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> >>>>>> > To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>> >>>>>> > For additional commands,
>>>>>>> e-mail: user-help@struts.apache.org
>>>>>>> >>>>>> >
>>>>>>> >>>>>> >
>>>>>>> >>>>>>
>>>>>>> >>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> >>>>>> To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>> >>>>>> For additional commands, e-mail:
>>>>>>> user-help@struts.apache.org
>>>>>>> >>>>>>
>>>>>>> >>>>>>
>>>>>>> >>>>>
>>>>>>> >>>>>
>>>>>>> >>>>> --
>>>>>>> >>>>> Jim Kiley
>>>>>>> >>>>> Technical Consultant | Summa
>>>>>>> >>>>> [p] 412.258.3346 [m] 412.445.1729
>>>>>>> >>>>> http://www.summa-tech.com
>>>>>>> >>>>>
>>>>>>> >>>>>
>>>>>>> >>>>
>>>>>>> >>>> --
>>>>>>> >>>> View this message in context:
>>>>>>> >>>>
>>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
>>>>>>> >>>> Sent from the Struts - User mailing list
>>>>>>> archive at Nabble.com.
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> >>>> To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>> >>>> For additional commands, e-mail:
>>>>>>> user-help@struts.apache.org
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> >>> To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>> >>> For additional commands, e-mail:
>>>>>>> user-help@struts.apache.org
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>
>>>>>>> >> --
>>>>>>> >> View this message in context:
>>>>>>> >>
>>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633888.html
>>>>>>> >> Sent from the Struts - User mailing list archive
>>>>>>> at Nabble.com.
>>>>>>> >>
>>>>>>> >>
>>>>>>> >>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> >> To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>> >> For additional commands, e-mail:
>>>>>>> user-help@struts.apache.org
>>>>>>> >>
>>>>>>> >>
>>>>>>> >
>>>>>>> >
>>>>>>> ---------------------------------------------------------------------
>>>>>>> > To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@struts.apache.org
>>>>>>> > For additional commands, e-mail:
>>>>>>> user-help@struts.apache.org
>>>>>>> >
>>>>>>> >
>>>>>>> >
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634541.html
>>>>>>> Sent from the Struts - User mailing list archive at
>>>>>>> Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>>> For additional commands, e-mail:
>>>>>>> user-help@struts.apache.org
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634840.html
>>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18635312.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18635560.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Milan Milanovic <mi...@yahoo.com>.
Dear Gabriel,

You mean in my action class ?

--
Milan


Gabriel Belingueres-2 wrote:
> 
> You don't need to modify your model, just delegate to it:
>        public void setValue(String s) {
>                if (!StringUtils.isBlank(s)) {
>                    try {
>                        model.setValue(new BigDecimal(s));
>                    catch(NumberFormatException e) {
>                        model.setValue(null);
>                    }
>                }
>        }
> 
> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>
>> Dear Gabriel,
>>
>> thank you. I tried without my Converter class for BigDecimal and it is
>> the
>> same, when user doesn't enter value I got that error in a log.
>>
>> I'm using S2 2.0.11.1. This solution is good, but my value that is set
>> comes
>> from model where I have class and attribute (BigDecimal) with its get/set
>> methods, by putting this set(String) instead of set(BigDecimal) I'm
>> violating class semantics ?
>>
>> The other solution is O.K., but I've already used it with Dates and
>> datetimepicker. Can I change in some way this BigDecimal converter to
>> avoid
>> this error:
>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>
>> --
>> Regards, Milan.
>>
>>
>>
>>
>> Gabriel Belingueres-2 wrote:
>>>
>>> I'm using S2.1.2 (are you using the same version?), and it will throw
>>> a NumberFormatException when setting an empty string, but this
>>> workaround will make ParameterInterceptor to think it is setting a
>>> String parameter:
>>>
>>>       public void setValue(String s) {
>>>               if (!StringUtils.isBlank(s)) {
>>>                     try {
>>>                       this.value= new BigDecimal(s);
>>>                     catch(NumberFormatException e) {
>>>                         this.value = null;
>>>                     }
>>>               }
>>>       }
>>>
>>> of course you still need a validator so that the string doesn't
>>> violate the BigDecimal grammar.
>>>
>>> Other option (may be more clean) is the action having both the string
>>> instance and the real BigDecimal instance, then the form will only set
>>> the string instance.
>>>
>>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>>
>>>> Dear Newton,
>>>>
>>>> Yes, I'm using BigDecimal type converter given here:
>>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>> .
>>>>
>>>> --
>>>> Thx, Milan
>>>>
>>>>
>>>> newton.dave wrote:
>>>>>
>>>>> Are you using a BigDecimal type converter (one of which was just
>>>>> posted)?
>>>>>
>>>>> AFAIK it won't work w/o the converter, but I could be remembering
>>>>> incorrectly.
>>>>>
>>>>> Dave
>>>>>
>>>>> --- On Thu, 7/24/08, Milan Milanovic <mi...@yahoo.com>
>>>>> wrote:
>>>>>
>>>>>> From: Milan Milanovic <mi...@yahoo.com>
>>>>>> Subject: Re: [s2] Making textfield input optional
>>>>>> To: user@struts.apache.org
>>>>>> Date: Thursday, July 24, 2008, 11:36 AM
>>>>>> Dear Gabriel,
>>>>>>
>>>>>> no, my actual question is related to the issue when user
>>>>>> doesn't enter
>>>>>> anything to the textfield which is connected to BigDecimal
>>>>>> in my action
>>>>>> class.
>>>>>>
>>>>>> --
>>>>>> Thx, Milan
>>>>>>
>>>>>>
>>>>>>
>>>>>> Gabriel Belingueres-2 wrote:
>>>>>> >
>>>>>> > Please make sure that the input string is according
>>>>>> the BigDecimal format:
>>>>>> >
>>>>>> http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)
>>>>>> >
>>>>>> > 2008/7/24 Milan Milanovic
>>>>>> <mi...@yahoo.com>:
>>>>>> >>
>>>>>> >> Hi Gabriel,
>>>>>> >>
>>>>>> >> no I cannot do this because my field is of type
>>>>>> BigDecimal and I must
>>>>>> >> have
>>>>>> >> get/set methods for it.
>>>>>> >>
>>>>>> >> --
>>>>>> >> Thx, Milan
>>>>>> >>
>>>>>> >>
>>>>>> >> Gabriel Belingueres-2 wrote:
>>>>>> >>>
>>>>>> >>> instead of:
>>>>>> >>>
>>>>>> >>> public vlid setInValue(BigDecimal x) {
>>>>>> >>>   this.x = x;
>>>>>> >>> }
>>>>>> >>>
>>>>>> >>> test with this:
>>>>>> >>>
>>>>>> >>> public vlid setInValue(String s) {
>>>>>> >>>   this.x = new BigDecimal(s);
>>>>>> >>> }
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> 2008/7/24 Milan Milanovic
>>>>>> <mi...@yahoo.com>:
>>>>>> >>>>
>>>>>> >>>> Hi Jim,
>>>>>> >>>>
>>>>>> >>>> no, I have that method.
>>>>>> >>>>
>>>>>> >>>> --
>>>>>> >>>> Thx, Milan
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> Jim Kiley wrote:
>>>>>> >>>>>
>>>>>> >>>>> Doesn't that exception usually get
>>>>>> thrown when, in this case,
>>>>>> >>>>> ViewAction
>>>>>> >>>>> doesn't have a setInValue()
>>>>>> method?
>>>>>> >>>>>
>>>>>> >>>>> jk
>>>>>> >>>>>
>>>>>> >>>>> On Thu, Jul 24, 2008 at 10:31 AM,
>>>>>> Gabriel Belingueres
>>>>>> >>>>> <be...@gmail.com>
>>>>>> >>>>> wrote:
>>>>>> >>>>>
>>>>>> >>>>>> Which is the data type of inValue?
>>>>>> >>>>>>
>>>>>> >>>>>> 2008/7/24 Milan Milanovic
>>>>>> <mi...@yahoo.com>:
>>>>>> >>>>>> >
>>>>>> >>>>>> > Hi,
>>>>>> >>>>>> >
>>>>>> >>>>>> > I have one form with multiple
>>>>>> textfields, and I want to one of that
>>>>>> >>>>>> > textfield be optional for
>>>>>> user, i.e., he doesn't need to enter
>>>>>> >>>>>> information
>>>>>> >>>>>> > in that particular field.
>>>>>> Now, when user don't enter I get this in
>>>>>> >>>>>> my
>>>>>> >>>>>> log:
>>>>>> >>>>>> >
>>>>>> >>>>>> > ERROR
>>>>>> com.opensymphony.xwork2.interceptor.ParametersInterceptor:204
>>>>>> >>>>>> -
>>>>>> >>>>>> > ParametersInterceptor -
>>>>>> [setParameters]: Unexpected Exception
>>>>>> >>>>>> caught
>>>>>> >>>>>> setting
>>>>>> >>>>>> > 'inValue' on
>>>>>> 'class com.myProject.action.ViewAction: Error setting
>>>>>> >>>>>> > expression 'inValue'
>>>>>> with value '[Ljava.lang.String;@1d3ac6e'
>>>>>> >>>>>> >
>>>>>> >>>>>> > How can I enable this but
>>>>>> without getting this error ?
>>>>>> >>>>>> >
>>>>>> >>>>>> > --
>>>>>> >>>>>> > Thx, Milan
>>>>>> >>>>>> > --
>>>>>> >>>>>> > View this message in context:
>>>>>> >>>>>>
>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>>>>>> >>>>>> > Sent from the Struts - User
>>>>>> mailing list archive at Nabble.com.
>>>>>> >>>>>> >
>>>>>> >>>>>> >
>>>>>> >>>>>> >
>>>>>> >>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> >>>>>> > To unsubscribe, e-mail:
>>>>>> user-unsubscribe@struts.apache.org
>>>>>> >>>>>> > For additional commands,
>>>>>> e-mail: user-help@struts.apache.org
>>>>>> >>>>>> >
>>>>>> >>>>>> >
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> >>>>>> To unsubscribe, e-mail:
>>>>>> user-unsubscribe@struts.apache.org
>>>>>> >>>>>> For additional commands, e-mail:
>>>>>> user-help@struts.apache.org
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> --
>>>>>> >>>>> Jim Kiley
>>>>>> >>>>> Technical Consultant | Summa
>>>>>> >>>>> [p] 412.258.3346 [m] 412.445.1729
>>>>>> >>>>> http://www.summa-tech.com
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>
>>>>>> >>>> --
>>>>>> >>>> View this message in context:
>>>>>> >>>>
>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
>>>>>> >>>> Sent from the Struts - User mailing list
>>>>>> archive at Nabble.com.
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> >>>> To unsubscribe, e-mail:
>>>>>> user-unsubscribe@struts.apache.org
>>>>>> >>>> For additional commands, e-mail:
>>>>>> user-help@struts.apache.org
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>
>>>>>> >>>
>>>>>> ---------------------------------------------------------------------
>>>>>> >>> To unsubscribe, e-mail:
>>>>>> user-unsubscribe@struts.apache.org
>>>>>> >>> For additional commands, e-mail:
>>>>>> user-help@struts.apache.org
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>
>>>>>> >> --
>>>>>> >> View this message in context:
>>>>>> >>
>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633888.html
>>>>>> >> Sent from the Struts - User mailing list archive
>>>>>> at Nabble.com.
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> ---------------------------------------------------------------------
>>>>>> >> To unsubscribe, e-mail:
>>>>>> user-unsubscribe@struts.apache.org
>>>>>> >> For additional commands, e-mail:
>>>>>> user-help@struts.apache.org
>>>>>> >>
>>>>>> >>
>>>>>> >
>>>>>> >
>>>>>> ---------------------------------------------------------------------
>>>>>> > To unsubscribe, e-mail:
>>>>>> user-unsubscribe@struts.apache.org
>>>>>> > For additional commands, e-mail:
>>>>>> user-help@struts.apache.org
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634541.html
>>>>>> Sent from the Struts - User mailing list archive at
>>>>>> Nabble.com.
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> For additional commands, e-mail:
>>>>>> user-help@struts.apache.org
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634840.html
>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18635312.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18635560.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Milan Milanovic <mi...@yahoo.com>.
Does anyone has solution for making textfield optional ? When I define method
such as show below then I don't get ERROR in log when user don't enter any
value, but in this case my custom converter for this field is overriden and
value in textfield is not formatted at all.

--
Thanks, Milan


Gabriel Belingueres-2 wrote:
> 
> You don't need to modify your model, just delegate to it:
>        public void setValue(String s) {
>                if (!StringUtils.isBlank(s)) {
>                    try {
>                        model.setValue(new BigDecimal(s));
>                    catch(NumberFormatException e) {
>                        model.setValue(null);
>                    }
>                }
>        }
> 
> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>
>> Dear Gabriel,
>>
>> thank you. I tried without my Converter class for BigDecimal and it is
>> the
>> same, when user doesn't enter value I got that error in a log.
>>
>> I'm using S2 2.0.11.1. This solution is good, but my value that is set
>> comes
>> from model where I have class and attribute (BigDecimal) with its get/set
>> methods, by putting this set(String) instead of set(BigDecimal) I'm
>> violating class semantics ?
>>
>> The other solution is O.K., but I've already used it with Dates and
>> datetimepicker. Can I change in some way this BigDecimal converter to
>> avoid
>> this error:
>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>
>> --
>> Regards, Milan.
>>
>>
>>
>>
>> Gabriel Belingueres-2 wrote:
>>>
>>> I'm using S2.1.2 (are you using the same version?), and it will throw
>>> a NumberFormatException when setting an empty string, but this
>>> workaround will make ParameterInterceptor to think it is setting a
>>> String parameter:
>>>
>>>       public void setValue(String s) {
>>>               if (!StringUtils.isBlank(s)) {
>>>                     try {
>>>                       this.value= new BigDecimal(s);
>>>                     catch(NumberFormatException e) {
>>>                         this.value = null;
>>>                     }
>>>               }
>>>       }
>>>
>>> of course you still need a validator so that the string doesn't
>>> violate the BigDecimal grammar.
>>>
>>> Other option (may be more clean) is the action having both the string
>>> instance and the real BigDecimal instance, then the form will only set
>>> the string instance.
>>>
>>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>>
>>>> Dear Newton,
>>>>
>>>> Yes, I'm using BigDecimal type converter given here:
>>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>> .
>>>>
>>>> --
>>>> Thx, Milan
>>>>
>>>>
>>>> newton.dave wrote:
>>>>>
>>>>> Are you using a BigDecimal type converter (one of which was just
>>>>> posted)?
>>>>>
>>>>> AFAIK it won't work w/o the converter, but I could be remembering
>>>>> incorrectly.
>>>>>
>>>>> Dave
>>>>>
>>>>> --- On Thu, 7/24/08, Milan Milanovic <mi...@yahoo.com>
>>>>> wrote:
>>>>>
>>>>>> From: Milan Milanovic <mi...@yahoo.com>
>>>>>> Subject: Re: [s2] Making textfield input optional
>>>>>> To: user@struts.apache.org
>>>>>> Date: Thursday, July 24, 2008, 11:36 AM
>>>>>> Dear Gabriel,
>>>>>>
>>>>>> no, my actual question is related to the issue when user
>>>>>> doesn't enter
>>>>>> anything to the textfield which is connected to BigDecimal
>>>>>> in my action
>>>>>> class.
>>>>>>
>>>>>> --
>>>>>> Thx, Milan
>>>>>>
>>>>>>
>>>>>>
>>>>>> Gabriel Belingueres-2 wrote:
>>>>>> >
>>>>>> > Please make sure that the input string is according
>>>>>> the BigDecimal format:
>>>>>> >
>>>>>> http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)
>>>>>> >
>>>>>> > 2008/7/24 Milan Milanovic
>>>>>> <mi...@yahoo.com>:
>>>>>> >>
>>>>>> >> Hi Gabriel,
>>>>>> >>
>>>>>> >> no I cannot do this because my field is of type
>>>>>> BigDecimal and I must
>>>>>> >> have
>>>>>> >> get/set methods for it.
>>>>>> >>
>>>>>> >> --
>>>>>> >> Thx, Milan
>>>>>> >>
>>>>>> >>
>>>>>> >> Gabriel Belingueres-2 wrote:
>>>>>> >>>
>>>>>> >>> instead of:
>>>>>> >>>
>>>>>> >>> public vlid setInValue(BigDecimal x) {
>>>>>> >>>   this.x = x;
>>>>>> >>> }
>>>>>> >>>
>>>>>> >>> test with this:
>>>>>> >>>
>>>>>> >>> public vlid setInValue(String s) {
>>>>>> >>>   this.x = new BigDecimal(s);
>>>>>> >>> }
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> 2008/7/24 Milan Milanovic
>>>>>> <mi...@yahoo.com>:
>>>>>> >>>>
>>>>>> >>>> Hi Jim,
>>>>>> >>>>
>>>>>> >>>> no, I have that method.
>>>>>> >>>>
>>>>>> >>>> --
>>>>>> >>>> Thx, Milan
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> Jim Kiley wrote:
>>>>>> >>>>>
>>>>>> >>>>> Doesn't that exception usually get
>>>>>> thrown when, in this case,
>>>>>> >>>>> ViewAction
>>>>>> >>>>> doesn't have a setInValue()
>>>>>> method?
>>>>>> >>>>>
>>>>>> >>>>> jk
>>>>>> >>>>>
>>>>>> >>>>> On Thu, Jul 24, 2008 at 10:31 AM,
>>>>>> Gabriel Belingueres
>>>>>> >>>>> <be...@gmail.com>
>>>>>> >>>>> wrote:
>>>>>> >>>>>
>>>>>> >>>>>> Which is the data type of inValue?
>>>>>> >>>>>>
>>>>>> >>>>>> 2008/7/24 Milan Milanovic
>>>>>> <mi...@yahoo.com>:
>>>>>> >>>>>> >
>>>>>> >>>>>> > Hi,
>>>>>> >>>>>> >
>>>>>> >>>>>> > I have one form with multiple
>>>>>> textfields, and I want to one of that
>>>>>> >>>>>> > textfield be optional for
>>>>>> user, i.e., he doesn't need to enter
>>>>>> >>>>>> information
>>>>>> >>>>>> > in that particular field.
>>>>>> Now, when user don't enter I get this in
>>>>>> >>>>>> my
>>>>>> >>>>>> log:
>>>>>> >>>>>> >
>>>>>> >>>>>> > ERROR
>>>>>> com.opensymphony.xwork2.interceptor.ParametersInterceptor:204
>>>>>> >>>>>> -
>>>>>> >>>>>> > ParametersInterceptor -
>>>>>> [setParameters]: Unexpected Exception
>>>>>> >>>>>> caught
>>>>>> >>>>>> setting
>>>>>> >>>>>> > 'inValue' on
>>>>>> 'class com.myProject.action.ViewAction: Error setting
>>>>>> >>>>>> > expression 'inValue'
>>>>>> with value '[Ljava.lang.String;@1d3ac6e'
>>>>>> >>>>>> >
>>>>>> >>>>>> > How can I enable this but
>>>>>> without getting this error ?
>>>>>> >>>>>> >
>>>>>> >>>>>> > --
>>>>>> >>>>>> > Thx, Milan
>>>>>> >>>>>> > --
>>>>>> >>>>>> > View this message in context:
>>>>>> >>>>>>
>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>>>>>> >>>>>> > Sent from the Struts - User
>>>>>> mailing list archive at Nabble.com.
>>>>>> >>>>>> >
>>>>>> >>>>>> >
>>>>>> >>>>>> >
>>>>>> >>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> >>>>>> > To unsubscribe, e-mail:
>>>>>> user-unsubscribe@struts.apache.org
>>>>>> >>>>>> > For additional commands,
>>>>>> e-mail: user-help@struts.apache.org
>>>>>> >>>>>> >
>>>>>> >>>>>> >
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> >>>>>> To unsubscribe, e-mail:
>>>>>> user-unsubscribe@struts.apache.org
>>>>>> >>>>>> For additional commands, e-mail:
>>>>>> user-help@struts.apache.org
>>>>>> >>>>>>
>>>>>> >>>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> --
>>>>>> >>>>> Jim Kiley
>>>>>> >>>>> Technical Consultant | Summa
>>>>>> >>>>> [p] 412.258.3346 [m] 412.445.1729
>>>>>> >>>>> http://www.summa-tech.com
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>
>>>>>> >>>> --
>>>>>> >>>> View this message in context:
>>>>>> >>>>
>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
>>>>>> >>>> Sent from the Struts - User mailing list
>>>>>> archive at Nabble.com.
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> >>>> To unsubscribe, e-mail:
>>>>>> user-unsubscribe@struts.apache.org
>>>>>> >>>> For additional commands, e-mail:
>>>>>> user-help@struts.apache.org
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>
>>>>>> >>>
>>>>>> ---------------------------------------------------------------------
>>>>>> >>> To unsubscribe, e-mail:
>>>>>> user-unsubscribe@struts.apache.org
>>>>>> >>> For additional commands, e-mail:
>>>>>> user-help@struts.apache.org
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>
>>>>>> >> --
>>>>>> >> View this message in context:
>>>>>> >>
>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633888.html
>>>>>> >> Sent from the Struts - User mailing list archive
>>>>>> at Nabble.com.
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> ---------------------------------------------------------------------
>>>>>> >> To unsubscribe, e-mail:
>>>>>> user-unsubscribe@struts.apache.org
>>>>>> >> For additional commands, e-mail:
>>>>>> user-help@struts.apache.org
>>>>>> >>
>>>>>> >>
>>>>>> >
>>>>>> >
>>>>>> ---------------------------------------------------------------------
>>>>>> > To unsubscribe, e-mail:
>>>>>> user-unsubscribe@struts.apache.org
>>>>>> > For additional commands, e-mail:
>>>>>> user-help@struts.apache.org
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634541.html
>>>>>> Sent from the Struts - User mailing list archive at
>>>>>> Nabble.com.
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> For additional commands, e-mail:
>>>>>> user-help@struts.apache.org
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634840.html
>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18635312.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p21301535.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Gabriel Belingueres <be...@gmail.com>.
You don't need to modify your model, just delegate to it:
       public void setValue(String s) {
               if (!StringUtils.isBlank(s)) {
                   try {
                       model.setValue(new BigDecimal(s));
                   catch(NumberFormatException e) {
                       model.setValue(null);
                   }
               }
       }

2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>
> Dear Gabriel,
>
> thank you. I tried without my Converter class for BigDecimal and it is the
> same, when user doesn't enter value I got that error in a log.
>
> I'm using S2 2.0.11.1. This solution is good, but my value that is set comes
> from model where I have class and attribute (BigDecimal) with its get/set
> methods, by putting this set(String) instead of set(BigDecimal) I'm
> violating class semantics ?
>
> The other solution is O.K., but I've already used it with Dates and
> datetimepicker. Can I change in some way this BigDecimal converter to avoid
> this error:
> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>
> --
> Regards, Milan.
>
>
>
>
> Gabriel Belingueres-2 wrote:
>>
>> I'm using S2.1.2 (are you using the same version?), and it will throw
>> a NumberFormatException when setting an empty string, but this
>> workaround will make ParameterInterceptor to think it is setting a
>> String parameter:
>>
>>       public void setValue(String s) {
>>               if (!StringUtils.isBlank(s)) {
>>                     try {
>>                       this.value= new BigDecimal(s);
>>                     catch(NumberFormatException e) {
>>                         this.value = null;
>>                     }
>>               }
>>       }
>>
>> of course you still need a validator so that the string doesn't
>> violate the BigDecimal grammar.
>>
>> Other option (may be more clean) is the action having both the string
>> instance and the real BigDecimal instance, then the form will only set
>> the string instance.
>>
>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>
>>> Dear Newton,
>>>
>>> Yes, I'm using BigDecimal type converter given here:
>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html .
>>>
>>> --
>>> Thx, Milan
>>>
>>>
>>> newton.dave wrote:
>>>>
>>>> Are you using a BigDecimal type converter (one of which was just
>>>> posted)?
>>>>
>>>> AFAIK it won't work w/o the converter, but I could be remembering
>>>> incorrectly.
>>>>
>>>> Dave
>>>>
>>>> --- On Thu, 7/24/08, Milan Milanovic <mi...@yahoo.com> wrote:
>>>>
>>>>> From: Milan Milanovic <mi...@yahoo.com>
>>>>> Subject: Re: [s2] Making textfield input optional
>>>>> To: user@struts.apache.org
>>>>> Date: Thursday, July 24, 2008, 11:36 AM
>>>>> Dear Gabriel,
>>>>>
>>>>> no, my actual question is related to the issue when user
>>>>> doesn't enter
>>>>> anything to the textfield which is connected to BigDecimal
>>>>> in my action
>>>>> class.
>>>>>
>>>>> --
>>>>> Thx, Milan
>>>>>
>>>>>
>>>>>
>>>>> Gabriel Belingueres-2 wrote:
>>>>> >
>>>>> > Please make sure that the input string is according
>>>>> the BigDecimal format:
>>>>> >
>>>>> http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)
>>>>> >
>>>>> > 2008/7/24 Milan Milanovic
>>>>> <mi...@yahoo.com>:
>>>>> >>
>>>>> >> Hi Gabriel,
>>>>> >>
>>>>> >> no I cannot do this because my field is of type
>>>>> BigDecimal and I must
>>>>> >> have
>>>>> >> get/set methods for it.
>>>>> >>
>>>>> >> --
>>>>> >> Thx, Milan
>>>>> >>
>>>>> >>
>>>>> >> Gabriel Belingueres-2 wrote:
>>>>> >>>
>>>>> >>> instead of:
>>>>> >>>
>>>>> >>> public vlid setInValue(BigDecimal x) {
>>>>> >>>   this.x = x;
>>>>> >>> }
>>>>> >>>
>>>>> >>> test with this:
>>>>> >>>
>>>>> >>> public vlid setInValue(String s) {
>>>>> >>>   this.x = new BigDecimal(s);
>>>>> >>> }
>>>>> >>>
>>>>> >>>
>>>>> >>> 2008/7/24 Milan Milanovic
>>>>> <mi...@yahoo.com>:
>>>>> >>>>
>>>>> >>>> Hi Jim,
>>>>> >>>>
>>>>> >>>> no, I have that method.
>>>>> >>>>
>>>>> >>>> --
>>>>> >>>> Thx, Milan
>>>>> >>>>
>>>>> >>>>
>>>>> >>>> Jim Kiley wrote:
>>>>> >>>>>
>>>>> >>>>> Doesn't that exception usually get
>>>>> thrown when, in this case,
>>>>> >>>>> ViewAction
>>>>> >>>>> doesn't have a setInValue()
>>>>> method?
>>>>> >>>>>
>>>>> >>>>> jk
>>>>> >>>>>
>>>>> >>>>> On Thu, Jul 24, 2008 at 10:31 AM,
>>>>> Gabriel Belingueres
>>>>> >>>>> <be...@gmail.com>
>>>>> >>>>> wrote:
>>>>> >>>>>
>>>>> >>>>>> Which is the data type of inValue?
>>>>> >>>>>>
>>>>> >>>>>> 2008/7/24 Milan Milanovic
>>>>> <mi...@yahoo.com>:
>>>>> >>>>>> >
>>>>> >>>>>> > Hi,
>>>>> >>>>>> >
>>>>> >>>>>> > I have one form with multiple
>>>>> textfields, and I want to one of that
>>>>> >>>>>> > textfield be optional for
>>>>> user, i.e., he doesn't need to enter
>>>>> >>>>>> information
>>>>> >>>>>> > in that particular field.
>>>>> Now, when user don't enter I get this in
>>>>> >>>>>> my
>>>>> >>>>>> log:
>>>>> >>>>>> >
>>>>> >>>>>> > ERROR
>>>>> com.opensymphony.xwork2.interceptor.ParametersInterceptor:204
>>>>> >>>>>> -
>>>>> >>>>>> > ParametersInterceptor -
>>>>> [setParameters]: Unexpected Exception
>>>>> >>>>>> caught
>>>>> >>>>>> setting
>>>>> >>>>>> > 'inValue' on
>>>>> 'class com.myProject.action.ViewAction: Error setting
>>>>> >>>>>> > expression 'inValue'
>>>>> with value '[Ljava.lang.String;@1d3ac6e'
>>>>> >>>>>> >
>>>>> >>>>>> > How can I enable this but
>>>>> without getting this error ?
>>>>> >>>>>> >
>>>>> >>>>>> > --
>>>>> >>>>>> > Thx, Milan
>>>>> >>>>>> > --
>>>>> >>>>>> > View this message in context:
>>>>> >>>>>>
>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>>>>> >>>>>> > Sent from the Struts - User
>>>>> mailing list archive at Nabble.com.
>>>>> >>>>>> >
>>>>> >>>>>> >
>>>>> >>>>>> >
>>>>> >>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> >>>>>> > To unsubscribe, e-mail:
>>>>> user-unsubscribe@struts.apache.org
>>>>> >>>>>> > For additional commands,
>>>>> e-mail: user-help@struts.apache.org
>>>>> >>>>>> >
>>>>> >>>>>> >
>>>>> >>>>>>
>>>>> >>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> >>>>>> To unsubscribe, e-mail:
>>>>> user-unsubscribe@struts.apache.org
>>>>> >>>>>> For additional commands, e-mail:
>>>>> user-help@struts.apache.org
>>>>> >>>>>>
>>>>> >>>>>>
>>>>> >>>>>
>>>>> >>>>>
>>>>> >>>>> --
>>>>> >>>>> Jim Kiley
>>>>> >>>>> Technical Consultant | Summa
>>>>> >>>>> [p] 412.258.3346 [m] 412.445.1729
>>>>> >>>>> http://www.summa-tech.com
>>>>> >>>>>
>>>>> >>>>>
>>>>> >>>>
>>>>> >>>> --
>>>>> >>>> View this message in context:
>>>>> >>>>
>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
>>>>> >>>> Sent from the Struts - User mailing list
>>>>> archive at Nabble.com.
>>>>> >>>>
>>>>> >>>>
>>>>> >>>>
>>>>> ---------------------------------------------------------------------
>>>>> >>>> To unsubscribe, e-mail:
>>>>> user-unsubscribe@struts.apache.org
>>>>> >>>> For additional commands, e-mail:
>>>>> user-help@struts.apache.org
>>>>> >>>>
>>>>> >>>>
>>>>> >>>
>>>>> >>>
>>>>> ---------------------------------------------------------------------
>>>>> >>> To unsubscribe, e-mail:
>>>>> user-unsubscribe@struts.apache.org
>>>>> >>> For additional commands, e-mail:
>>>>> user-help@struts.apache.org
>>>>> >>>
>>>>> >>>
>>>>> >>>
>>>>> >>
>>>>> >> --
>>>>> >> View this message in context:
>>>>> >>
>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633888.html
>>>>> >> Sent from the Struts - User mailing list archive
>>>>> at Nabble.com.
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> ---------------------------------------------------------------------
>>>>> >> To unsubscribe, e-mail:
>>>>> user-unsubscribe@struts.apache.org
>>>>> >> For additional commands, e-mail:
>>>>> user-help@struts.apache.org
>>>>> >>
>>>>> >>
>>>>> >
>>>>> >
>>>>> ---------------------------------------------------------------------
>>>>> > To unsubscribe, e-mail:
>>>>> user-unsubscribe@struts.apache.org
>>>>> > For additional commands, e-mail:
>>>>> user-help@struts.apache.org
>>>>> >
>>>>> >
>>>>> >
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634541.html
>>>>> Sent from the Struts - User mailing list archive at
>>>>> Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail:
>>>>> user-help@struts.apache.org
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634840.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18635312.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Milan Milanovic <mi...@yahoo.com>.
Dear Gabriel,

thank you. I tried without my Converter class for BigDecimal and it is the
same, when user doesn't enter value I got that error in a log.

I'm using S2 2.0.11.1. This solution is good, but my value that is set comes
from model where I have class and attribute (BigDecimal) with its get/set
methods, by putting this set(String) instead of set(BigDecimal) I'm
violating class semantics ?

The other solution is O.K., but I've already used it with Dates and
datetimepicker. Can I change in some way this BigDecimal converter to avoid
this error: 
http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html 

--
Regards, Milan.




Gabriel Belingueres-2 wrote:
> 
> I'm using S2.1.2 (are you using the same version?), and it will throw
> a NumberFormatException when setting an empty string, but this
> workaround will make ParameterInterceptor to think it is setting a
> String parameter:
> 
> 	public void setValue(String s) {
> 		if (!StringUtils.isBlank(s)) {
>                     try {
> 			this.value= new BigDecimal(s);
>                     catch(NumberFormatException e) {
>                         this.value = null;
>                     }
> 		}
> 	}
> 
> of course you still need a validator so that the string doesn't
> violate the BigDecimal grammar.
> 
> Other option (may be more clean) is the action having both the string
> instance and the real BigDecimal instance, then the form will only set
> the string instance.
> 
> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>
>> Dear Newton,
>>
>> Yes, I'm using BigDecimal type converter given here:
>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html .
>>
>> --
>> Thx, Milan
>>
>>
>> newton.dave wrote:
>>>
>>> Are you using a BigDecimal type converter (one of which was just
>>> posted)?
>>>
>>> AFAIK it won't work w/o the converter, but I could be remembering
>>> incorrectly.
>>>
>>> Dave
>>>
>>> --- On Thu, 7/24/08, Milan Milanovic <mi...@yahoo.com> wrote:
>>>
>>>> From: Milan Milanovic <mi...@yahoo.com>
>>>> Subject: Re: [s2] Making textfield input optional
>>>> To: user@struts.apache.org
>>>> Date: Thursday, July 24, 2008, 11:36 AM
>>>> Dear Gabriel,
>>>>
>>>> no, my actual question is related to the issue when user
>>>> doesn't enter
>>>> anything to the textfield which is connected to BigDecimal
>>>> in my action
>>>> class.
>>>>
>>>> --
>>>> Thx, Milan
>>>>
>>>>
>>>>
>>>> Gabriel Belingueres-2 wrote:
>>>> >
>>>> > Please make sure that the input string is according
>>>> the BigDecimal format:
>>>> >
>>>> http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)
>>>> >
>>>> > 2008/7/24 Milan Milanovic
>>>> <mi...@yahoo.com>:
>>>> >>
>>>> >> Hi Gabriel,
>>>> >>
>>>> >> no I cannot do this because my field is of type
>>>> BigDecimal and I must
>>>> >> have
>>>> >> get/set methods for it.
>>>> >>
>>>> >> --
>>>> >> Thx, Milan
>>>> >>
>>>> >>
>>>> >> Gabriel Belingueres-2 wrote:
>>>> >>>
>>>> >>> instead of:
>>>> >>>
>>>> >>> public vlid setInValue(BigDecimal x) {
>>>> >>>   this.x = x;
>>>> >>> }
>>>> >>>
>>>> >>> test with this:
>>>> >>>
>>>> >>> public vlid setInValue(String s) {
>>>> >>>   this.x = new BigDecimal(s);
>>>> >>> }
>>>> >>>
>>>> >>>
>>>> >>> 2008/7/24 Milan Milanovic
>>>> <mi...@yahoo.com>:
>>>> >>>>
>>>> >>>> Hi Jim,
>>>> >>>>
>>>> >>>> no, I have that method.
>>>> >>>>
>>>> >>>> --
>>>> >>>> Thx, Milan
>>>> >>>>
>>>> >>>>
>>>> >>>> Jim Kiley wrote:
>>>> >>>>>
>>>> >>>>> Doesn't that exception usually get
>>>> thrown when, in this case,
>>>> >>>>> ViewAction
>>>> >>>>> doesn't have a setInValue()
>>>> method?
>>>> >>>>>
>>>> >>>>> jk
>>>> >>>>>
>>>> >>>>> On Thu, Jul 24, 2008 at 10:31 AM,
>>>> Gabriel Belingueres
>>>> >>>>> <be...@gmail.com>
>>>> >>>>> wrote:
>>>> >>>>>
>>>> >>>>>> Which is the data type of inValue?
>>>> >>>>>>
>>>> >>>>>> 2008/7/24 Milan Milanovic
>>>> <mi...@yahoo.com>:
>>>> >>>>>> >
>>>> >>>>>> > Hi,
>>>> >>>>>> >
>>>> >>>>>> > I have one form with multiple
>>>> textfields, and I want to one of that
>>>> >>>>>> > textfield be optional for
>>>> user, i.e., he doesn't need to enter
>>>> >>>>>> information
>>>> >>>>>> > in that particular field.
>>>> Now, when user don't enter I get this in
>>>> >>>>>> my
>>>> >>>>>> log:
>>>> >>>>>> >
>>>> >>>>>> > ERROR
>>>> com.opensymphony.xwork2.interceptor.ParametersInterceptor:204
>>>> >>>>>> -
>>>> >>>>>> > ParametersInterceptor -
>>>> [setParameters]: Unexpected Exception
>>>> >>>>>> caught
>>>> >>>>>> setting
>>>> >>>>>> > 'inValue' on
>>>> 'class com.myProject.action.ViewAction: Error setting
>>>> >>>>>> > expression 'inValue'
>>>> with value '[Ljava.lang.String;@1d3ac6e'
>>>> >>>>>> >
>>>> >>>>>> > How can I enable this but
>>>> without getting this error ?
>>>> >>>>>> >
>>>> >>>>>> > --
>>>> >>>>>> > Thx, Milan
>>>> >>>>>> > --
>>>> >>>>>> > View this message in context:
>>>> >>>>>>
>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>>>> >>>>>> > Sent from the Struts - User
>>>> mailing list archive at Nabble.com.
>>>> >>>>>> >
>>>> >>>>>> >
>>>> >>>>>> >
>>>> >>>>>>
>>>> ---------------------------------------------------------------------
>>>> >>>>>> > To unsubscribe, e-mail:
>>>> user-unsubscribe@struts.apache.org
>>>> >>>>>> > For additional commands,
>>>> e-mail: user-help@struts.apache.org
>>>> >>>>>> >
>>>> >>>>>> >
>>>> >>>>>>
>>>> >>>>>>
>>>> ---------------------------------------------------------------------
>>>> >>>>>> To unsubscribe, e-mail:
>>>> user-unsubscribe@struts.apache.org
>>>> >>>>>> For additional commands, e-mail:
>>>> user-help@struts.apache.org
>>>> >>>>>>
>>>> >>>>>>
>>>> >>>>>
>>>> >>>>>
>>>> >>>>> --
>>>> >>>>> Jim Kiley
>>>> >>>>> Technical Consultant | Summa
>>>> >>>>> [p] 412.258.3346 [m] 412.445.1729
>>>> >>>>> http://www.summa-tech.com
>>>> >>>>>
>>>> >>>>>
>>>> >>>>
>>>> >>>> --
>>>> >>>> View this message in context:
>>>> >>>>
>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
>>>> >>>> Sent from the Struts - User mailing list
>>>> archive at Nabble.com.
>>>> >>>>
>>>> >>>>
>>>> >>>>
>>>> ---------------------------------------------------------------------
>>>> >>>> To unsubscribe, e-mail:
>>>> user-unsubscribe@struts.apache.org
>>>> >>>> For additional commands, e-mail:
>>>> user-help@struts.apache.org
>>>> >>>>
>>>> >>>>
>>>> >>>
>>>> >>>
>>>> ---------------------------------------------------------------------
>>>> >>> To unsubscribe, e-mail:
>>>> user-unsubscribe@struts.apache.org
>>>> >>> For additional commands, e-mail:
>>>> user-help@struts.apache.org
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>
>>>> >> --
>>>> >> View this message in context:
>>>> >>
>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633888.html
>>>> >> Sent from the Struts - User mailing list archive
>>>> at Nabble.com.
>>>> >>
>>>> >>
>>>> >>
>>>> ---------------------------------------------------------------------
>>>> >> To unsubscribe, e-mail:
>>>> user-unsubscribe@struts.apache.org
>>>> >> For additional commands, e-mail:
>>>> user-help@struts.apache.org
>>>> >>
>>>> >>
>>>> >
>>>> >
>>>> ---------------------------------------------------------------------
>>>> > To unsubscribe, e-mail:
>>>> user-unsubscribe@struts.apache.org
>>>> > For additional commands, e-mail:
>>>> user-help@struts.apache.org
>>>> >
>>>> >
>>>> >
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634541.html
>>>> Sent from the Struts - User mailing list archive at
>>>> Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail:
>>>> user-help@struts.apache.org
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634840.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18635312.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Gabriel Belingueres <be...@gmail.com>.
I'm using S2.1.2 (are you using the same version?), and it will throw
a NumberFormatException when setting an empty string, but this
workaround will make ParameterInterceptor to think it is setting a
String parameter:

	public void setValue(String s) {
		if (!StringUtils.isBlank(s)) {
                    try {
			this.value= new BigDecimal(s);
                    catch(NumberFormatException e) {
                        this.value = null;
                    }
		}
	}

of course you still need a validator so that the string doesn't
violate the BigDecimal grammar.

Other option (may be more clean) is the action having both the string
instance and the real BigDecimal instance, then the form will only set
the string instance.

2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>
> Dear Newton,
>
> Yes, I'm using BigDecimal type converter given here:
> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
> http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html .
>
> --
> Thx, Milan
>
>
> newton.dave wrote:
>>
>> Are you using a BigDecimal type converter (one of which was just posted)?
>>
>> AFAIK it won't work w/o the converter, but I could be remembering
>> incorrectly.
>>
>> Dave
>>
>> --- On Thu, 7/24/08, Milan Milanovic <mi...@yahoo.com> wrote:
>>
>>> From: Milan Milanovic <mi...@yahoo.com>
>>> Subject: Re: [s2] Making textfield input optional
>>> To: user@struts.apache.org
>>> Date: Thursday, July 24, 2008, 11:36 AM
>>> Dear Gabriel,
>>>
>>> no, my actual question is related to the issue when user
>>> doesn't enter
>>> anything to the textfield which is connected to BigDecimal
>>> in my action
>>> class.
>>>
>>> --
>>> Thx, Milan
>>>
>>>
>>>
>>> Gabriel Belingueres-2 wrote:
>>> >
>>> > Please make sure that the input string is according
>>> the BigDecimal format:
>>> >
>>> http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)
>>> >
>>> > 2008/7/24 Milan Milanovic
>>> <mi...@yahoo.com>:
>>> >>
>>> >> Hi Gabriel,
>>> >>
>>> >> no I cannot do this because my field is of type
>>> BigDecimal and I must
>>> >> have
>>> >> get/set methods for it.
>>> >>
>>> >> --
>>> >> Thx, Milan
>>> >>
>>> >>
>>> >> Gabriel Belingueres-2 wrote:
>>> >>>
>>> >>> instead of:
>>> >>>
>>> >>> public vlid setInValue(BigDecimal x) {
>>> >>>   this.x = x;
>>> >>> }
>>> >>>
>>> >>> test with this:
>>> >>>
>>> >>> public vlid setInValue(String s) {
>>> >>>   this.x = new BigDecimal(s);
>>> >>> }
>>> >>>
>>> >>>
>>> >>> 2008/7/24 Milan Milanovic
>>> <mi...@yahoo.com>:
>>> >>>>
>>> >>>> Hi Jim,
>>> >>>>
>>> >>>> no, I have that method.
>>> >>>>
>>> >>>> --
>>> >>>> Thx, Milan
>>> >>>>
>>> >>>>
>>> >>>> Jim Kiley wrote:
>>> >>>>>
>>> >>>>> Doesn't that exception usually get
>>> thrown when, in this case,
>>> >>>>> ViewAction
>>> >>>>> doesn't have a setInValue()
>>> method?
>>> >>>>>
>>> >>>>> jk
>>> >>>>>
>>> >>>>> On Thu, Jul 24, 2008 at 10:31 AM,
>>> Gabriel Belingueres
>>> >>>>> <be...@gmail.com>
>>> >>>>> wrote:
>>> >>>>>
>>> >>>>>> Which is the data type of inValue?
>>> >>>>>>
>>> >>>>>> 2008/7/24 Milan Milanovic
>>> <mi...@yahoo.com>:
>>> >>>>>> >
>>> >>>>>> > Hi,
>>> >>>>>> >
>>> >>>>>> > I have one form with multiple
>>> textfields, and I want to one of that
>>> >>>>>> > textfield be optional for
>>> user, i.e., he doesn't need to enter
>>> >>>>>> information
>>> >>>>>> > in that particular field.
>>> Now, when user don't enter I get this in
>>> >>>>>> my
>>> >>>>>> log:
>>> >>>>>> >
>>> >>>>>> > ERROR
>>> com.opensymphony.xwork2.interceptor.ParametersInterceptor:204
>>> >>>>>> -
>>> >>>>>> > ParametersInterceptor -
>>> [setParameters]: Unexpected Exception
>>> >>>>>> caught
>>> >>>>>> setting
>>> >>>>>> > 'inValue' on
>>> 'class com.myProject.action.ViewAction: Error setting
>>> >>>>>> > expression 'inValue'
>>> with value '[Ljava.lang.String;@1d3ac6e'
>>> >>>>>> >
>>> >>>>>> > How can I enable this but
>>> without getting this error ?
>>> >>>>>> >
>>> >>>>>> > --
>>> >>>>>> > Thx, Milan
>>> >>>>>> > --
>>> >>>>>> > View this message in context:
>>> >>>>>>
>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>>> >>>>>> > Sent from the Struts - User
>>> mailing list archive at Nabble.com.
>>> >>>>>> >
>>> >>>>>> >
>>> >>>>>> >
>>> >>>>>>
>>> ---------------------------------------------------------------------
>>> >>>>>> > To unsubscribe, e-mail:
>>> user-unsubscribe@struts.apache.org
>>> >>>>>> > For additional commands,
>>> e-mail: user-help@struts.apache.org
>>> >>>>>> >
>>> >>>>>> >
>>> >>>>>>
>>> >>>>>>
>>> ---------------------------------------------------------------------
>>> >>>>>> To unsubscribe, e-mail:
>>> user-unsubscribe@struts.apache.org
>>> >>>>>> For additional commands, e-mail:
>>> user-help@struts.apache.org
>>> >>>>>>
>>> >>>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>> --
>>> >>>>> Jim Kiley
>>> >>>>> Technical Consultant | Summa
>>> >>>>> [p] 412.258.3346 [m] 412.445.1729
>>> >>>>> http://www.summa-tech.com
>>> >>>>>
>>> >>>>>
>>> >>>>
>>> >>>> --
>>> >>>> View this message in context:
>>> >>>>
>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
>>> >>>> Sent from the Struts - User mailing list
>>> archive at Nabble.com.
>>> >>>>
>>> >>>>
>>> >>>>
>>> ---------------------------------------------------------------------
>>> >>>> To unsubscribe, e-mail:
>>> user-unsubscribe@struts.apache.org
>>> >>>> For additional commands, e-mail:
>>> user-help@struts.apache.org
>>> >>>>
>>> >>>>
>>> >>>
>>> >>>
>>> ---------------------------------------------------------------------
>>> >>> To unsubscribe, e-mail:
>>> user-unsubscribe@struts.apache.org
>>> >>> For additional commands, e-mail:
>>> user-help@struts.apache.org
>>> >>>
>>> >>>
>>> >>>
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633888.html
>>> >> Sent from the Struts - User mailing list archive
>>> at Nabble.com.
>>> >>
>>> >>
>>> >>
>>> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail:
>>> user-unsubscribe@struts.apache.org
>>> >> For additional commands, e-mail:
>>> user-help@struts.apache.org
>>> >>
>>> >>
>>> >
>>> >
>>> ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail:
>>> user-unsubscribe@struts.apache.org
>>> > For additional commands, e-mail:
>>> user-help@struts.apache.org
>>> >
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634541.html
>>> Sent from the Struts - User mailing list archive at
>>> Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail:
>>> user-help@struts.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634840.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Milan Milanovic <mi...@yahoo.com>.
Dear Newton,

Yes, I'm using BigDecimal type converter given here: 
http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html .

--
Thx, Milan


newton.dave wrote:
> 
> Are you using a BigDecimal type converter (one of which was just posted)?
> 
> AFAIK it won't work w/o the converter, but I could be remembering
> incorrectly.
> 
> Dave
> 
> --- On Thu, 7/24/08, Milan Milanovic <mi...@yahoo.com> wrote:
> 
>> From: Milan Milanovic <mi...@yahoo.com>
>> Subject: Re: [s2] Making textfield input optional
>> To: user@struts.apache.org
>> Date: Thursday, July 24, 2008, 11:36 AM
>> Dear Gabriel,
>> 
>> no, my actual question is related to the issue when user
>> doesn't enter
>> anything to the textfield which is connected to BigDecimal
>> in my action
>> class.
>> 
>> --
>> Thx, Milan
>> 
>> 
>> 
>> Gabriel Belingueres-2 wrote:
>> > 
>> > Please make sure that the input string is according
>> the BigDecimal format:
>> >
>> http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)
>> > 
>> > 2008/7/24 Milan Milanovic
>> <mi...@yahoo.com>:
>> >>
>> >> Hi Gabriel,
>> >>
>> >> no I cannot do this because my field is of type
>> BigDecimal and I must
>> >> have
>> >> get/set methods for it.
>> >>
>> >> --
>> >> Thx, Milan
>> >>
>> >>
>> >> Gabriel Belingueres-2 wrote:
>> >>>
>> >>> instead of:
>> >>>
>> >>> public vlid setInValue(BigDecimal x) {
>> >>>   this.x = x;
>> >>> }
>> >>>
>> >>> test with this:
>> >>>
>> >>> public vlid setInValue(String s) {
>> >>>   this.x = new BigDecimal(s);
>> >>> }
>> >>>
>> >>>
>> >>> 2008/7/24 Milan Milanovic
>> <mi...@yahoo.com>:
>> >>>>
>> >>>> Hi Jim,
>> >>>>
>> >>>> no, I have that method.
>> >>>>
>> >>>> --
>> >>>> Thx, Milan
>> >>>>
>> >>>>
>> >>>> Jim Kiley wrote:
>> >>>>>
>> >>>>> Doesn't that exception usually get
>> thrown when, in this case,
>> >>>>> ViewAction
>> >>>>> doesn't have a setInValue()
>> method?
>> >>>>>
>> >>>>> jk
>> >>>>>
>> >>>>> On Thu, Jul 24, 2008 at 10:31 AM,
>> Gabriel Belingueres
>> >>>>> <be...@gmail.com>
>> >>>>> wrote:
>> >>>>>
>> >>>>>> Which is the data type of inValue?
>> >>>>>>
>> >>>>>> 2008/7/24 Milan Milanovic
>> <mi...@yahoo.com>:
>> >>>>>> >
>> >>>>>> > Hi,
>> >>>>>> >
>> >>>>>> > I have one form with multiple
>> textfields, and I want to one of that
>> >>>>>> > textfield be optional for
>> user, i.e., he doesn't need to enter
>> >>>>>> information
>> >>>>>> > in that particular field.
>> Now, when user don't enter I get this in
>> >>>>>> my
>> >>>>>> log:
>> >>>>>> >
>> >>>>>> > ERROR
>> com.opensymphony.xwork2.interceptor.ParametersInterceptor:204
>> >>>>>> -
>> >>>>>> > ParametersInterceptor -
>> [setParameters]: Unexpected Exception
>> >>>>>> caught
>> >>>>>> setting
>> >>>>>> > 'inValue' on
>> 'class com.myProject.action.ViewAction: Error setting
>> >>>>>> > expression 'inValue'
>> with value '[Ljava.lang.String;@1d3ac6e'
>> >>>>>> >
>> >>>>>> > How can I enable this but
>> without getting this error ?
>> >>>>>> >
>> >>>>>> > --
>> >>>>>> > Thx, Milan
>> >>>>>> > --
>> >>>>>> > View this message in context:
>> >>>>>>
>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>> >>>>>> > Sent from the Struts - User
>> mailing list archive at Nabble.com.
>> >>>>>> >
>> >>>>>> >
>> >>>>>> >
>> >>>>>>
>> ---------------------------------------------------------------------
>> >>>>>> > To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> >>>>>> > For additional commands,
>> e-mail: user-help@struts.apache.org
>> >>>>>> >
>> >>>>>> >
>> >>>>>>
>> >>>>>>
>> ---------------------------------------------------------------------
>> >>>>>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> >>>>>> For additional commands, e-mail:
>> user-help@struts.apache.org
>> >>>>>>
>> >>>>>>
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> Jim Kiley
>> >>>>> Technical Consultant | Summa
>> >>>>> [p] 412.258.3346 [m] 412.445.1729
>> >>>>> http://www.summa-tech.com
>> >>>>>
>> >>>>>
>> >>>>
>> >>>> --
>> >>>> View this message in context:
>> >>>>
>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
>> >>>> Sent from the Struts - User mailing list
>> archive at Nabble.com.
>> >>>>
>> >>>>
>> >>>>
>> ---------------------------------------------------------------------
>> >>>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> >>>> For additional commands, e-mail:
>> user-help@struts.apache.org
>> >>>>
>> >>>>
>> >>>
>> >>>
>> ---------------------------------------------------------------------
>> >>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> >>> For additional commands, e-mail:
>> user-help@struts.apache.org
>> >>>
>> >>>
>> >>>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633888.html
>> >> Sent from the Struts - User mailing list archive
>> at Nabble.com.
>> >>
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail:
>> user-help@struts.apache.org
>> >>
>> >>
>> > 
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail:
>> user-help@struts.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634541.html
>> Sent from the Struts - User mailing list archive at
>> Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634840.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Dave Newton <ne...@yahoo.com>.
Are you using a BigDecimal type converter (one of which was just posted)?

AFAIK it won't work w/o the converter, but I could be remembering incorrectly.

Dave

--- On Thu, 7/24/08, Milan Milanovic <mi...@yahoo.com> wrote:

> From: Milan Milanovic <mi...@yahoo.com>
> Subject: Re: [s2] Making textfield input optional
> To: user@struts.apache.org
> Date: Thursday, July 24, 2008, 11:36 AM
> Dear Gabriel,
> 
> no, my actual question is related to the issue when user
> doesn't enter
> anything to the textfield which is connected to BigDecimal
> in my action
> class.
> 
> --
> Thx, Milan
> 
> 
> 
> Gabriel Belingueres-2 wrote:
> > 
> > Please make sure that the input string is according
> the BigDecimal format:
> >
> http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)
> > 
> > 2008/7/24 Milan Milanovic
> <mi...@yahoo.com>:
> >>
> >> Hi Gabriel,
> >>
> >> no I cannot do this because my field is of type
> BigDecimal and I must
> >> have
> >> get/set methods for it.
> >>
> >> --
> >> Thx, Milan
> >>
> >>
> >> Gabriel Belingueres-2 wrote:
> >>>
> >>> instead of:
> >>>
> >>> public vlid setInValue(BigDecimal x) {
> >>>   this.x = x;
> >>> }
> >>>
> >>> test with this:
> >>>
> >>> public vlid setInValue(String s) {
> >>>   this.x = new BigDecimal(s);
> >>> }
> >>>
> >>>
> >>> 2008/7/24 Milan Milanovic
> <mi...@yahoo.com>:
> >>>>
> >>>> Hi Jim,
> >>>>
> >>>> no, I have that method.
> >>>>
> >>>> --
> >>>> Thx, Milan
> >>>>
> >>>>
> >>>> Jim Kiley wrote:
> >>>>>
> >>>>> Doesn't that exception usually get
> thrown when, in this case,
> >>>>> ViewAction
> >>>>> doesn't have a setInValue()
> method?
> >>>>>
> >>>>> jk
> >>>>>
> >>>>> On Thu, Jul 24, 2008 at 10:31 AM,
> Gabriel Belingueres
> >>>>> <be...@gmail.com>
> >>>>> wrote:
> >>>>>
> >>>>>> Which is the data type of inValue?
> >>>>>>
> >>>>>> 2008/7/24 Milan Milanovic
> <mi...@yahoo.com>:
> >>>>>> >
> >>>>>> > Hi,
> >>>>>> >
> >>>>>> > I have one form with multiple
> textfields, and I want to one of that
> >>>>>> > textfield be optional for
> user, i.e., he doesn't need to enter
> >>>>>> information
> >>>>>> > in that particular field.
> Now, when user don't enter I get this in
> >>>>>> my
> >>>>>> log:
> >>>>>> >
> >>>>>> > ERROR
> com.opensymphony.xwork2.interceptor.ParametersInterceptor:204
> >>>>>> -
> >>>>>> > ParametersInterceptor -
> [setParameters]: Unexpected Exception
> >>>>>> caught
> >>>>>> setting
> >>>>>> > 'inValue' on
> 'class com.myProject.action.ViewAction: Error setting
> >>>>>> > expression 'inValue'
> with value '[Ljava.lang.String;@1d3ac6e'
> >>>>>> >
> >>>>>> > How can I enable this but
> without getting this error ?
> >>>>>> >
> >>>>>> > --
> >>>>>> > Thx, Milan
> >>>>>> > --
> >>>>>> > View this message in context:
> >>>>>>
> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
> >>>>>> > Sent from the Struts - User
> mailing list archive at Nabble.com.
> >>>>>> >
> >>>>>> >
> >>>>>> >
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >>>>>> > For additional commands,
> e-mail: user-help@struts.apache.org
> >>>>>> >
> >>>>>> >
> >>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >>>>>> For additional commands, e-mail:
> user-help@struts.apache.org
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>> Jim Kiley
> >>>>> Technical Consultant | Summa
> >>>>> [p] 412.258.3346 [m] 412.445.1729
> >>>>> http://www.summa-tech.com
> >>>>>
> >>>>>
> >>>>
> >>>> --
> >>>> View this message in context:
> >>>>
> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
> >>>> Sent from the Struts - User mailing list
> archive at Nabble.com.
> >>>>
> >>>>
> >>>>
> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >>>> For additional commands, e-mail:
> user-help@struts.apache.org
> >>>>
> >>>>
> >>>
> >>>
> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >>> For additional commands, e-mail:
> user-help@struts.apache.org
> >>>
> >>>
> >>>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633888.html
> >> Sent from the Struts - User mailing list archive
> at Nabble.com.
> >>
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail:
> user-help@struts.apache.org
> >>
> >>
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634541.html
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Milan Milanovic <mi...@yahoo.com>.
Dear Gabriel,

no, my actual question is related to the issue when user doesn't enter
anything to the textfield which is connected to BigDecimal in my action
class.

--
Thx, Milan



Gabriel Belingueres-2 wrote:
> 
> Please make sure that the input string is according the BigDecimal format:
> http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)
> 
> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>
>> Hi Gabriel,
>>
>> no I cannot do this because my field is of type BigDecimal and I must
>> have
>> get/set methods for it.
>>
>> --
>> Thx, Milan
>>
>>
>> Gabriel Belingueres-2 wrote:
>>>
>>> instead of:
>>>
>>> public vlid setInValue(BigDecimal x) {
>>>   this.x = x;
>>> }
>>>
>>> test with this:
>>>
>>> public vlid setInValue(String s) {
>>>   this.x = new BigDecimal(s);
>>> }
>>>
>>>
>>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>>
>>>> Hi Jim,
>>>>
>>>> no, I have that method.
>>>>
>>>> --
>>>> Thx, Milan
>>>>
>>>>
>>>> Jim Kiley wrote:
>>>>>
>>>>> Doesn't that exception usually get thrown when, in this case,
>>>>> ViewAction
>>>>> doesn't have a setInValue() method?
>>>>>
>>>>> jk
>>>>>
>>>>> On Thu, Jul 24, 2008 at 10:31 AM, Gabriel Belingueres
>>>>> <be...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Which is the data type of inValue?
>>>>>>
>>>>>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>>>> >
>>>>>> > Hi,
>>>>>> >
>>>>>> > I have one form with multiple textfields, and I want to one of that
>>>>>> > textfield be optional for user, i.e., he doesn't need to enter
>>>>>> information
>>>>>> > in that particular field. Now, when user don't enter I get this in
>>>>>> my
>>>>>> log:
>>>>>> >
>>>>>> > ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor:204
>>>>>> -
>>>>>> > ParametersInterceptor - [setParameters]: Unexpected Exception
>>>>>> caught
>>>>>> setting
>>>>>> > 'inValue' on 'class com.myProject.action.ViewAction: Error setting
>>>>>> > expression 'inValue' with value '[Ljava.lang.String;@1d3ac6e'
>>>>>> >
>>>>>> > How can I enable this but without getting this error ?
>>>>>> >
>>>>>> > --
>>>>>> > Thx, Milan
>>>>>> > --
>>>>>> > View this message in context:
>>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>>>>>> > Sent from the Struts - User mailing list archive at Nabble.com.
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> ---------------------------------------------------------------------
>>>>>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> > For additional commands, e-mail: user-help@struts.apache.org
>>>>>> >
>>>>>> >
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Jim Kiley
>>>>> Technical Consultant | Summa
>>>>> [p] 412.258.3346 [m] 412.445.1729
>>>>> http://www.summa-tech.com
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633888.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18634541.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Gabriel Belingueres <be...@gmail.com>.
Please make sure that the input string is according the BigDecimal format:
http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)

2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>
> Hi Gabriel,
>
> no I cannot do this because my field is of type BigDecimal and I must have
> get/set methods for it.
>
> --
> Thx, Milan
>
>
> Gabriel Belingueres-2 wrote:
>>
>> instead of:
>>
>> public vlid setInValue(BigDecimal x) {
>>   this.x = x;
>> }
>>
>> test with this:
>>
>> public vlid setInValue(String s) {
>>   this.x = new BigDecimal(s);
>> }
>>
>>
>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>
>>> Hi Jim,
>>>
>>> no, I have that method.
>>>
>>> --
>>> Thx, Milan
>>>
>>>
>>> Jim Kiley wrote:
>>>>
>>>> Doesn't that exception usually get thrown when, in this case, ViewAction
>>>> doesn't have a setInValue() method?
>>>>
>>>> jk
>>>>
>>>> On Thu, Jul 24, 2008 at 10:31 AM, Gabriel Belingueres
>>>> <be...@gmail.com>
>>>> wrote:
>>>>
>>>>> Which is the data type of inValue?
>>>>>
>>>>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>>> >
>>>>> > Hi,
>>>>> >
>>>>> > I have one form with multiple textfields, and I want to one of that
>>>>> > textfield be optional for user, i.e., he doesn't need to enter
>>>>> information
>>>>> > in that particular field. Now, when user don't enter I get this in my
>>>>> log:
>>>>> >
>>>>> > ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
>>>>> > ParametersInterceptor - [setParameters]: Unexpected Exception caught
>>>>> setting
>>>>> > 'inValue' on 'class com.myProject.action.ViewAction: Error setting
>>>>> > expression 'inValue' with value '[Ljava.lang.String;@1d3ac6e'
>>>>> >
>>>>> > How can I enable this but without getting this error ?
>>>>> >
>>>>> > --
>>>>> > Thx, Milan
>>>>> > --
>>>>> > View this message in context:
>>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>>>>> > Sent from the Struts - User mailing list archive at Nabble.com.
>>>>> >
>>>>> >
>>>>> > ---------------------------------------------------------------------
>>>>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> > For additional commands, e-mail: user-help@struts.apache.org
>>>>> >
>>>>> >
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Jim Kiley
>>>> Technical Consultant | Summa
>>>> [p] 412.258.3346 [m] 412.445.1729
>>>> http://www.summa-tech.com
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633888.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Milan Milanovic <mi...@yahoo.com>.
Hi Gabriel,

no I cannot do this because my field is of type BigDecimal and I must have
get/set methods for it.

--
Thx, Milan


Gabriel Belingueres-2 wrote:
> 
> instead of:
> 
> public vlid setInValue(BigDecimal x) {
>   this.x = x;
> }
> 
> test with this:
> 
> public vlid setInValue(String s) {
>   this.x = new BigDecimal(s);
> }
> 
> 
> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>
>> Hi Jim,
>>
>> no, I have that method.
>>
>> --
>> Thx, Milan
>>
>>
>> Jim Kiley wrote:
>>>
>>> Doesn't that exception usually get thrown when, in this case, ViewAction
>>> doesn't have a setInValue() method?
>>>
>>> jk
>>>
>>> On Thu, Jul 24, 2008 at 10:31 AM, Gabriel Belingueres
>>> <be...@gmail.com>
>>> wrote:
>>>
>>>> Which is the data type of inValue?
>>>>
>>>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>>> >
>>>> > Hi,
>>>> >
>>>> > I have one form with multiple textfields, and I want to one of that
>>>> > textfield be optional for user, i.e., he doesn't need to enter
>>>> information
>>>> > in that particular field. Now, when user don't enter I get this in my
>>>> log:
>>>> >
>>>> > ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
>>>> > ParametersInterceptor - [setParameters]: Unexpected Exception caught
>>>> setting
>>>> > 'inValue' on 'class com.myProject.action.ViewAction: Error setting
>>>> > expression 'inValue' with value '[Ljava.lang.String;@1d3ac6e'
>>>> >
>>>> > How can I enable this but without getting this error ?
>>>> >
>>>> > --
>>>> > Thx, Milan
>>>> > --
>>>> > View this message in context:
>>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>>>> > Sent from the Struts - User mailing list archive at Nabble.com.
>>>> >
>>>> >
>>>> > ---------------------------------------------------------------------
>>>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> > For additional commands, e-mail: user-help@struts.apache.org
>>>> >
>>>> >
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>>
>>> --
>>> Jim Kiley
>>> Technical Consultant | Summa
>>> [p] 412.258.3346 [m] 412.445.1729
>>> http://www.summa-tech.com
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633888.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Gabriel Belingueres <be...@gmail.com>.
instead of:

public vlid setInValue(BigDecimal x) {
  this.x = x;
}

test with this:

public vlid setInValue(String s) {
  this.x = new BigDecimal(s);
}


2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>
> Hi Jim,
>
> no, I have that method.
>
> --
> Thx, Milan
>
>
> Jim Kiley wrote:
>>
>> Doesn't that exception usually get thrown when, in this case, ViewAction
>> doesn't have a setInValue() method?
>>
>> jk
>>
>> On Thu, Jul 24, 2008 at 10:31 AM, Gabriel Belingueres
>> <be...@gmail.com>
>> wrote:
>>
>>> Which is the data type of inValue?
>>>
>>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>>> >
>>> > Hi,
>>> >
>>> > I have one form with multiple textfields, and I want to one of that
>>> > textfield be optional for user, i.e., he doesn't need to enter
>>> information
>>> > in that particular field. Now, when user don't enter I get this in my
>>> log:
>>> >
>>> > ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
>>> > ParametersInterceptor - [setParameters]: Unexpected Exception caught
>>> setting
>>> > 'inValue' on 'class com.myProject.action.ViewAction: Error setting
>>> > expression 'inValue' with value '[Ljava.lang.String;@1d3ac6e'
>>> >
>>> > How can I enable this but without getting this error ?
>>> >
>>> > --
>>> > Thx, Milan
>>> > --
>>> > View this message in context:
>>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>>> > Sent from the Struts - User mailing list archive at Nabble.com.
>>> >
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> > For additional commands, e-mail: user-help@struts.apache.org
>>> >
>>> >
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>> --
>> Jim Kiley
>> Technical Consultant | Summa
>> [p] 412.258.3346 [m] 412.445.1729
>> http://www.summa-tech.com
>>
>>
>
> --
> View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Milan Milanovic <mi...@yahoo.com>.
Hi Jim,

no, I have that method.

--
Thx, Milan


Jim Kiley wrote:
> 
> Doesn't that exception usually get thrown when, in this case, ViewAction
> doesn't have a setInValue() method?
> 
> jk
> 
> On Thu, Jul 24, 2008 at 10:31 AM, Gabriel Belingueres
> <be...@gmail.com>
> wrote:
> 
>> Which is the data type of inValue?
>>
>> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>> >
>> > Hi,
>> >
>> > I have one form with multiple textfields, and I want to one of that
>> > textfield be optional for user, i.e., he doesn't need to enter
>> information
>> > in that particular field. Now, when user don't enter I get this in my
>> log:
>> >
>> > ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
>> > ParametersInterceptor - [setParameters]: Unexpected Exception caught
>> setting
>> > 'inValue' on 'class com.myProject.action.ViewAction: Error setting
>> > expression 'inValue' with value '[Ljava.lang.String;@1d3ac6e'
>> >
>> > How can I enable this but without getting this error ?
>> >
>> > --
>> > Thx, Milan
>> > --
>> > View this message in context:
>> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
>> > Sent from the Struts - User mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> -- 
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
> 
> 

-- 
View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18633474.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Making textfield input optional

Posted by Jim Kiley <jh...@summa-tech.com>.
Doesn't that exception usually get thrown when, in this case, ViewAction
doesn't have a setInValue() method?

jk

On Thu, Jul 24, 2008 at 10:31 AM, Gabriel Belingueres <be...@gmail.com>
wrote:

> Which is the data type of inValue?
>
> 2008/7/24 Milan Milanovic <mi...@yahoo.com>:
> >
> > Hi,
> >
> > I have one form with multiple textfields, and I want to one of that
> > textfield be optional for user, i.e., he doesn't need to enter
> information
> > in that particular field. Now, when user don't enter I get this in my
> log:
> >
> > ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
> > ParametersInterceptor - [setParameters]: Unexpected Exception caught
> setting
> > 'inValue' on 'class com.myProject.action.ViewAction: Error setting
> > expression 'inValue' with value '[Ljava.lang.String;@1d3ac6e'
> >
> > How can I enable this but without getting this error ?
> >
> > --
> > Thx, Milan
> > --
> > View this message in context:
> http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

Re: [s2] Making textfield input optional

Posted by Gabriel Belingueres <be...@gmail.com>.
Which is the data type of inValue?

2008/7/24 Milan Milanovic <mi...@yahoo.com>:
>
> Hi,
>
> I have one form with multiple textfields, and I want to one of that
> textfield be optional for user, i.e., he doesn't need to enter information
> in that particular field. Now, when user don't enter I get this in my log:
>
> ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
> ParametersInterceptor - [setParameters]: Unexpected Exception caught setting
> 'inValue' on 'class com.myProject.action.ViewAction: Error setting
> expression 'inValue' with value '[Ljava.lang.String;@1d3ac6e'
>
> How can I enable this but without getting this error ?
>
> --
> Thx, Milan
> --
> View this message in context: http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18632806.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [s2] Making textfield input optional

Posted by Jishnu Viswanath <ji...@tavant.com>.
Hey if you are using int, float, or double instead of them use Wrapper
Classes id Integer, Float, Double former does not allow null value while
later does allow.

Regards,

Jishnu Viswanath

Software Engineer

*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll

Tavant Technologies Inc.,

www.tavant.com

PEOPLE :: PASSION :: EXCELLENCE


-----Original Message-----
From: Milan Milanovic [mailto:milanmilanovich@yahoo.com] 
Sent: Thursday, July 24, 2008 7:47 PM
To: user@struts.apache.org
Subject: [s2] Making textfield input optional


Hi,

I have one form with multiple textfields, and I want to one of that
textfield be optional for user, i.e., he doesn't need to enter
information
in that particular field. Now, when user don't enter I get this in my
log:

ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting
'inValue' on 'class com.myProject.action.ViewAction: Error setting
expression 'inValue' with value '[Ljava.lang.String;@1d3ac6e'

How can I enable this but without getting this error ?

--
Thx, Milan
-- 
View this message in context:
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
632806.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may 
contain confidential and/or privileged material. If you have received this in error, please contact the 
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies 
may be subject to our monitoring procedures.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org