on 06-18-2008 11:29 AM
hiii,
I have a jdbc query from where i get the value of a field called IS_CHARGEABLE.
The logic is , if the value is "Y", the checkbox shud b ticked, if "N",then unticked, if null, then also unticked.
In the 'checked' property of checkbox i have bound it to the value attribute ischargeable.
my code is :
while(group_rs.next())
{
is_Chargeable =group_rs.getString(1);
}
boolean ischargeable=false;
if(is_Chargeable.equalsIgnoreCase("Y"))
{
ischargeable=true;
wdComponentAPI.getMessageManager().reportSuccess("Y");
}
else if(is_Chargeable.equalsIgnoreCase("N"))
{
ischargeable=false;
}
else if(is_Chargeable.equalsIgnoreCase(null))
else
{
ischargeable=false;
}
goElement.setIsChargeable(ischargeable);
NB : group_rs--> IS the resultset
goElement-->the element of the concerned node.
But in the output i get the check-box unticked under all circumstances....Please do suggest.
Hi,
just make sure that is_Chargeable is not null before checking
it into if condition add the below loop.
before ur condition.
if(is_Chargeable!=null)
regards
Surender Dahiya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Just make sure that u have properly bound IsChargeable to ur
checkbox.
regards
Surender Dahiya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Check if you have binded the checked property of the check box to IsChargeable attribute.
you can simplify your coding also .. as your logic is if the value is "Y" checked and if "N" or null unchecked
boolean ischargeable=false;
if(is_Chargeable.equalsIgnoreCase("Y"))
{
ischargeable=true;
wdComponentAPI.getMessageManager().reportSuccess("Y");
}
else
{
ischargeable=false;
}
Regards,
Sunitha Hari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.