on 06-21-2007 11:43 AM
Hi all,
I am getting an error.
I am using dropdownbyindex and using following code.
Iprivate<ur view name>.IEt_Fragen_output obj = wdcontect.nodeET_Fragen_output.creatEt_Fragen_outputelement();
List list1=new ArrayList();
for(int i=0;i<obj.length;i++)
{
IPrivateCompView.Idropdownnode data=wdContext.nodedropdown.createdropdownElement();
data.setvalue
->->->(wdcontext.currentcontextelment.getelementat(i).getfrange);
list1.add(data);
}
wdContext.nodedropdown.bind(list1);
now in this when i try to put (see arrows)currentcontextelment. then i do not get "getelementat(i)." method. Now how to typecast this. I need this method to use "getfrage".
plz help!!...Its urgent!!!
Cheers,
Darshna.
Hi Darshna,
Try this,
wdContext.nodeSampleFrange().getSampleFrangeElementAt(i).getFrange();
Then, did you solve your yesterday's problem (Context Exception) ? If so, Please let the viewers know. Reply to that thread, how it has been solved? It will help, not only the current viewers but also the future viwers, to know how this problem has been solved.
Thanks and Regards,
Prabhakar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Don't get confused..
->->->(wdcontext.currentcontextelment.getelementat(i).getfrange);
list1.add(data); this part of your code won't work at all. Because on wdContext you can't call the method like get Elementat(i) because it caontains single lements only...
In my code I have used value from an array.. If you want to get values from any other node then just get that value and setit in your Values frag current element and add that frag element in list object as I have done..
Thanks and Regards
Avijit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
here is your code. I am using the same structure as you said.
ValueCollection (value node)
-
Values (value node)
-
frage (value attribute)
String[] Names = new String []
{
"Monthly","Weekly"};
List monthsOrWeek = new ArrayList();
IPublic<Component Name>.IValuesElement valuesElement = null;
for (int i = 0; i < Names.length; i++)
{
valuesElement = wdContext.createValuesElement();
valuesElement.setFrage(Names<i>);
monthsOrWeek.add(valuesElement);
}
wdContext.nodeValues().bind(monthsOrWeek);
Hope it helps. Please reward points if it helps....
Thanks and Regards
Avijit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
String[] Names = new String []
{
"Monthly","Weekly"}; // Collection of your drp dwn values
List monthsOrWeek = new ArrayList(); // list onject
IPublicTpcalender.ICalIDSHDtailsElement calIDSHElem = null; // Value node towhich your drp dwn is bound
for (int i = 0; i < 2; i++)
{
calIDSHElem = wdContext.createCalIDSHDtailsElement(); // create an element for each entry
calIDSHElem.setRepFreq(Names<i>); // set the value in the element
monthsOrWeek.add(calIDSHElem); // put that element in the list
}
wdContext.nodeCalIDSHDtails().bind(monthsOrWeek); // out of loop bind that list to your element
wdContext.nodeCalIDSHDtails().setLeadSelection(1); // set a lead selection fro drp down
use this code....
please reward points if it helps...
thanks and Regards
Avijit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
String[] Names = new String []
{
"Monthly","Weekly"};
List monthsOrWeek = new ArrayList();
IPublicTpcalender.ICalIDSHDtailsElement calIDSHElem = null;
for (int i = 0; i < 2; i++)
{
calIDSHElem = wdContext.createCalIDSHDtailsElement();
calIDSHElem.setRepFreq(Names<i>);
monthsOrWeek.add(calIDSHElem);
}
wdContext.nodeCalIDSHDtails().bind(monthsOrWeek);
wdContext.nodeCalIDSHDtails().setLeadSelection(1);
wdContext.nodeSearchCALID().addElement(wdContext.nodeSearchCALID().createElement());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Here is the Link for adding element to DropDownByIndex.
http://help.sap.com/saphelp_nw04/helpdata/en/95/93fe1e71a2e44691b1f041e67f71aa/frameset.htm
An Example is shown for adding values to DropDownByIndex.
If frange is a context attribute then
there is no possibilty of using like this
wdcontext.currentcontextelment.getelementat(i).getfrange;
Because the attributes can have only one value and you cannot use getelementat(i).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can't get the the currentcontext. lementat in that way. To populate your drpydown with your value first Populate a list ( java.util) object with all your values. Now create a value node like tha following
Values
-
AllValues
and bind that list withyour value node. Now bind this value node to your drp down.
Thanks and Regard
Avijit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Considering context structure to
-NodeA
---NodeB
-
frage
List list1=new ArrayList();
for(int i=0;i<obj.length;i++)
{
IPrivateCompView.Idropdownnode data=wdContext.nodedropdown.createdropdownElement();
data.setvalue
->->->(wdcontext.NdoeB.getElementAt(i).getfrange);
list1.add(data);
}
wdContext.nodedropdown.bind(list1);
Message was edited by:
Shriram Kabra
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.