cancel
Showing results for 
Search instead for 
Did you mean: 

Getting values from node

Former Member
0 Kudos

Hi,

I have a requirement where I am getting value from a RFC. That RFC is binded to a node now my requirement is to get value of an attribute of the node.

Suppose the node is weekday and an attribute day. The node is binded to structure whose one of the field is day. Now we are having days such as monday, tuesday etc in the attribute.

My requirement is that when the day is wednesday display the field with some text.

Thanks

Shantanu

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I have a requirement where I am getting value from a RFC. That RFC is binded to a node now my requirement is to get value of an attribute of the node.

Suppose the node is weekday and an attribute day. The node is binded to structure whose one of the field is day. Now we are having days such as monday, tuesday etc in the attribute.

My requirement is that when the day is wednesday display the field with some text.

Thanks

Shantanu

Hi Santanu,,

RFCvalue nodeRFCweek.

RFCvalue node attributeRFCday

supposevalue node--weekday ;

Value Attribute---day.

now you are using RFC..

you have to write some code

at time of copping all mdel node value to custom node value as weekday.

you should write code like this.

int size=wdContext.nodeRFCweek().size() //model size

for(int i=0;i<=size;i++){

IPublic<comp name>.IWeekdayElement ele=wdContext.nodeWeekday().createDayElement();

if(wdcontext.nodeRFCweek().getRFCweekElementAt(i).getRFCday().equalignorecase("wednesday"){

ele.setDay("any name according your requirement");

}

else{

ele.setDay(wdcontext.nodeRFCweek().getRFCweekElementAt(i).getRFCday());

}

}

thanks

jati

Former Member
0 Kudos

Hi,

I am facing the error of index out of bound.

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

Thanks

Shantanu

Former Member
0 Kudos

hi

IPublic<comp name>.IWeekdayElement ele=wdContext.nodeWeekday().createDayElement();

if(wdcontext.nodeRFCweek().getRFCweekElementAt(i).getRFCday().equalignorecase("wednesday"){

ele.setDay("any name according your requirement");

}

wdcontext.nodeWeekend.addelemnt(ele);

else{

ele.setDay(wdcontext.nodeRFCweek().getRFCweekElementAt(i).getRFCday());

}

}

try this and write the above code in the for loop

Former Member
0 Kudos

Hi Santanu,,

samll chaneh in you codding..just follow once again.............

and writen in component controller............

RFCvalue nodeRFCweek.

RFCvalue node attributeRFCday

supposeValue nodeweekday ;must be cardinality-0:N

Value Attribute---day.

now you are using RFC..

you have to write some code

at time of copping all mdel node value to custom node value as weekday.

you should write code like this.

int size=wdContext.nodeRFCweek().size() //model size

for(int i=0;i >size;i++){

IPublic<comp name>.IWeekdayElement ele=wdContext.nodeWeekday().createDayElement();

if(wdcontext.nodeRFCweek().getRFCweekElementAt(i).getRFCday().equalignorecase("wednesday"){

ele.setDay("any name according your requirement");

}

else{

ele.setDay(wdcontext.nodeRFCweek().getRFCweekElementAt(i).getRFCday());

}

wdContext.nodeWeek().addElement(ele);

}

Edited by: sudhir kumar on Apr 1, 2009 5:04 PM

Edited by: sudhir kumar on Apr 1, 2009 5:06 PM

Former Member
0 Kudos

HI

You have Node called Weekdays and this is Model Node and this has cardinality 0..n

and with one attribute .

get the size of the node .

for(i=0.i<wdcontext.nodeWeekDays.size();i++

{

wdcontext.nodeWeekdays.setleadSelection(i);

String day= wdcontext.nodeWeekdays.currentcontext.getDays();

if(days==Moday)

{

show the text

}

or

int n= wdcontext.nodeweekdays.getLeadselection();

for(i=0.i<wdcontext.nodeWeekDays.size();i++

{

wdcontext.nodeWeekdays.setleadSelection(n);

String day= wdcontext.nodeWeekdays.getWeekDaysElementsatindex(n).getdays();

if(days==Moday)

{

show the text

}

Former Member
0 Kudos

If the node is as below:

WeekDay -


>Node 1...1

-


Day -


>Attr

Code:

if (wdContext.currentWeekDay().getDay().equalsIgnoreCase("Monday") {

//to do populate the field with text

}

--MLS