on 02-16-2009 5:43 AM
Dear experts,
I am facing a problem in getting a string value from my component controller attribute value inside a for loop.
Outside the for loop i am able to get this value. Please help me out in this.
for (int i = 0; i < lead; i++) {
IPrivateQuote_ServiceDetailsView.IVn_ServicedetailsNodeElement ele = wdContext.nodeVn_ServicedetailsNode().getVn_ServicedetailsNodeElementAt(i);
boolean select = ele.getVa_select();
if (select == true)
{
String name1 = wdThis.getTheGroupName();
i am facing the problem in this last step. If i write the getTheGroupName() method ouside the for loop, then i am getting the value from my controller attribute.
thanks in advance,
Jithin.
Edited by: jithin james on Feb 16, 2009 6:43 AM
Edited by: jithin james on Feb 16, 2009 6:44 AM
code looks fine. try debug the current code for the following cases
for (int i = 0; i < lead; i++) { // what is lead value here? check loop is working proper
boolean select = ele.getVa_select(); // see the current value for select
plz update status
nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI James,
I feel its not because for loop. but its because If loop you are unable to call the method.
if (select == true)
{
String name1 = wdThis.getTheGroupName();
}
please first check what is the value of boolean select you are getting by priting its value.Or can you once remove the if block and try to call that method inside for loop.
Regards
Narendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I can't understand the reason behind not able to retrieve the value inside the for loop.
From your method implementation I feel that your value for the method always returns the same because it returns you the currentElement value.
Thus, even if you get the value outside the for loop and store it in a local variable and then use the local variable to set the value should be OK in your case.
Regards,
Murtuza
Hi,
Could you post us the code for the getTheGroupName() method?
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
9 | |
9 | |
8 | |
7 | |
7 | |
6 | |
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.