cancel
Showing results for 
Search instead for 
Did you mean: 

retrive a value stored in SQL if checkboxgroup

Former Member
0 Kudos

Hi,

I am trying to store some values in SQL of checked values of checkbox. it is in the format of "cricket,football, " like this

for this i have written code like this

for(int i=0;i<wdContext.nodeSport().size();i++)
		{			
			IPrivateEntryview.ISportElement ele=wdContext.nodeSport().getSportElementAt(i);
				IPrivateEntryview.ISportNode nade=wdContext.nodeSport();
				if(nade.isMultiSelected(i)){
				String batch="";
				batch=ele.getSport(); 
				name3+=batch+",";
				wdComponentAPI.getMessageManager().reportSuccess(name3);
		}	}

I want retrive that value and check the checkboxes depends on the value i retrive.

can any one tell me how to write the code for this.

Regards,

H.V.Swathi

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I have written code like this to Set the values to Checkbox after retrieving.

String stri=rs.getString(9);

String[] arr=stri.split(",");

for(int i=0;i<arr.length;i++)

{

for(int j=0;j<wdContext.nodeSport().size();j++)

{

IPrivateEditView.ISportElement ele=wdContext.nodeSport().getSportElementAt(j);

if(arr<i>.equalsIgnoreCase(ele.getSport()))

{

wdContext.nodeSport().setSelected(j,true);

wdComponentAPI.getMessageManager().reportSuccess(ele.getSport()+j);

}

}

}

Former Member
0 Kudos

Hi

Using the check box group

Checkbox group properties

-


texts :Sport.vaSport

onToggle :Checked -


> some action name this method contains nothing

-


Properties of Node

-


node name : Sport

Valu attribute : vaSport

Cardinality : 0..n

Selection : 1...n

code in doInit method

-


IPrivateTestAppWebView.ISportElement eleCrick = wdContext.nodeSport().createSportElement();

eleCrick.setVaSport("Cricket");

wdContext.nodeSport().addElement(eleCrick);

IPrivateTestAppWebView.ISportElement eleFootball = wdContext.nodeSport().createSportElement();

eleFootball.setVaSport("Football");

wdContext.nodeSport().addElement(eleFootball);

-


code in doModify method

-


ArrayList list = new ArrayList();

for(int i=0;i<wdContext.nodeSport().size();i++)

{

if(wdContext.nodeSport().isMultiSelected(i))

{

list.add(wdContext.nodeSport().getSportElementAt(i).getVaSport());

}

}

for(int i=0;i<list.size();i++)

{

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("value ::: "+(String)list.get(i));

}

-


The values you want to store in excel will be now in ArrayList object

Regards

Prasad.

Former Member
0 Kudos

Thanks for your reply . But I am able to store the values to database in format of "cricket,football, " like this but i want to retrieve I am able to retrieve in the same format only. And i have written the code to split it also. now i want to check the respective checkbox after the splitting the values. can u tell the code for that.

Regards,

H.V.Swathi