on 12-04-2008 8:56 AM
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
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);
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
84 | |
24 | |
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.