on 12-03-2007 11:39 AM
Hi all,
I have a particular InputField.
When i dont enter the Number in one particular field,the system should take 1 as the value by default .
Can anyone help me out in this regard.
Thanks and regards,
Chandrashekar.
Hi,
Do it manually using this
if(wdContext.currentContextElement().get<InpField>()==null ||
wdContext.currentContextElement().get<InpField>().length==0)
{
wdContext.currentContextElement().set<InpFields>("1");
}
Regards
LakshmiNarayana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should set it's value to 1 by default then, as Siva Rama Krushna said.
The problem i see is, that if you leave empty an inputfield bound to a numeric context, dynpro framework will activate its automatic validation, and will paralyze your action code execution until a valid number has been entered.
So again, set 1 as default value, and change it if needed.
Regards,
Julio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chandra,
If your context attribute bound to the field is int. Just do like this.
if ( wdContext.wdCurrentContextElement().get<attrbute>()==0 )
{
wdContext.wdCurrentContextElement().set<attrbute>("1");
}
But if it is a String do like the following.
if ( wdContext.wdCurrentContextElement().get<attrbute>()== null || wdContext.wdCurrentContextElement().get<attrbute>().trim().length()==0 )
{
wdContext.wdCurrentContextElement().set<attrbute>("1");
}
One more suggestion:
Using this in wdDoInit() wdContext.wdCurrentContextElement().set<attrbute>("1");
if you set all attributes to "1" default. Then it will be more easy.
Hope this is helpful.
regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.