cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownIndex

Former Member
0 Kudos

Hi,

i am creating a webdynpro application to pull out km documents. First view i having a dropdownbyindex attribute. (it has some elements). I have a table which displays the Km document name in the second view.

When i select an element in the first view(from dropdownbox), the corresponding documents should be displayed.

How can i bind the elements in the dropdownbox to table columns.

Can anyone help me in this?

Regards,

Divya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Divya,

Do u have 2 differenet views or its in single view??

In case u have u views, while navigating to 2nd view ,u can pass the values to 2nd view & in 2nd view's init method, u can fetch the data for table using the drop down value.

In case u have single view, in the onSelect event u can fetch the data for the table.

Is that ur problem or there is something else??

regards

Sumit

Former Member
0 Kudos

Hi,

I am having 2 views. from first view i have to navigate to second view. First View i select the element from drop downbox and second view the webdynpro table will be displayed.

I wrote this piece of code to enter elements into the Dropdownbox in the init() method of the first view.

try

{

String[] letters = new String []

{"Project1", "project2", "project3"};

ArrayList elements = new ArrayList();

IPrivateDocHitsCompView.IParentElement contentElem = null;

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

{

contentElem.setFolder(letters<i>);

elements.add(contentElem);

}

try

{

wdContext.nodeParent().addElement(contentElem);

}

catch(Exception e)

{

System.out.println("Error on bind");

}

}

catch(Exception e)

{

System.out.println("Error1");

}

But it is just showing me the dropdownbox and not the elements. What could be the problem?

Regards,

Divya

Former Member
0 Kudos

Hi Divya,

IPrivateDocHitsCompView.IParentElement contentElem = null;

Where r u creating the element?? without creating the element u r trying to add values to that.

put this code in ur loop

contentElem = wdContext.nodeparent.createParentElement();

contentElem.setFolder(letters);

then try.

regards

Sumit

former_member197348
Active Contributor
0 Kudos

Hi Divya,

Try with

1.<b>DropDownByKey</b> once.

Or try this

2.Create Simple type-> Enumeration tab enter key values [if you have few values and static]. Create value attribute of the type of <i>SimpleType </i>. Then Bind this to DropDownByKey [this may work for DropDownByIndex also].

regards,

Siva

Former Member
0 Kudos

Hi!

You can fill that dropdown like this:


//NODE Parent[Card: 0..n, Sele:0..1]  

for (int i = 1; i <= 4; i++)
{
	IPrivateDocHitsCompView.IParentElement contentElem = wdContext.createParentElement();
	contentElem.setFolder("Project "+ i);
	wdContext.nodeParent().addElement(contentElem);
}

from here, use the event onSelect in dropdownlist for navigating to next view, there u can check which Project was selected like this:

Get the selected Index number


	int selectedIndex = wdContext.nodeParent().getLeadSelection();

Or get the selected value


	string selectedProject = wdContext.currentParentElement().getFolder();

Then according to selected Project, load its documents on the table.

Regards

Julio Herrera

Former Member
0 Kudos

Hi Divya,

If ur problem is solved, close the thread.

regards

Sumit

Former Member
0 Kudos

Hi,

I have a rootfolder in my km repository which has few subfolders which inturn has several documents inside it. I am creating a webdynpro application where i want a UI Element which contain names of the root Folders and when i click on 1 folder it should display the subfolders in it. And when i click anyfolder inside it should display me all the documents inside it in the second view. How can i do it using webdynpro.

I tried using tree structure. But how can i pull the Km document Folders and Subfolders.

Is it possible in KM. What can i do that?

Regards,

Divya

Former Member
0 Kudos

Hi Divya,

U can check this.here instead of getting data from file system, u can get it from KM.

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/webdynpro/wd%20java/wdjava%20tutorials%20and%20articles%20archive/constructing%20a%20recursive%20and%20loadable%20web%20dynpro%20tree.pdf">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/webdynpro/wd%20java/wdjava%20tutorials%20and%20articles%20archive/constructing%20a%20recursive%20and%20loadable%20web%20dynpro%20tree.pdf</a>

P.S. - once ur problem is solved ,close the thread & for new problems ,open new threads

regards

Sumit

Former Member
0 Kudos

Hi,

Thanx for the blog. It provides a tree structure.But how can i have a tree structure in webdynpro which pulls out the KM subfolders if i click a MainFolder. Is that possible.

Regards,

Divya

Former Member
0 Kudos

Hi Divya,

In this blog values are fetched from file system , instead of that u can get the data from the KM subfolders. some code has to be changed but logic is same here.

regards

Sumit

Answers (0)