cancel
Showing results for 
Search instead for 
Did you mean: 

getting the details of element in lead selection

Former Member
0 Kudos

hi experts,

please help me out with the following requirement.

I have a table displayed in my table_view with 3 feilds.if i select a row in the table and click details, then it should get the details(ie all 8 fields) in the table_details view.

I used the currentContextElement option but it gave me the details of the last row always..

thanks in advance..

jithin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

As i understand from your question is that you are getting data of the first and second view from single webservice/BAPI and you are displaying 3 columns in first view. On selection of row and button action navigation to second view and display all the details...

If above is correct then you can fetch all the details during 1st time excecution and display only the desired 3 columns in the table then set the lead selection, copy the context element into another node on this lead select. This way on second view you can bind the same node and all the details can be displayed.

Answers (5)

Answers (5)

Former Member
0 Kudos

hi.

can u please tell me how to copy the element in lead selection to the element of another node..

any code samples will be really helpful as i am new to WD java.

Former Member
0 Kudos

Hi,

suppose if u have two node node1 and node2

and u want to copy the selected element from node1 to node2,

int lead=wdContext().nodeNode1.getLeadSelection();

/////get attributes at lead selection

IPrivateView.INode1Element elem1 = wdContext().nodeNode1().getInode1ElementAt(lead);

String a =elem1.get<Attr1>();

//////create an elemnt of the node2 and set the attributes

IPrivateView.INode2Element elem2 = wdContext().nodeNode2().createNode2Element();

wdContext().nodeNode2().bind(elem2);

elem2.set<Attr1>(a);

Regards,

Satya.

Former Member
0 Kudos

hi ramesh,

i am displaying only 3 fields in my first view so how can i get all the 8 fields in my next view..??

      • i tried to display the 3 fields .. but when i trying to set the value to the dummy node .. i am getting an error as follows..

************cannot bind or add element, because it is already bound to a node

Former Member
0 Kudos

Hi,

post Context Structure here ?

Former Member
0 Kudos

i need to display the details in a different view.. so in which view should i write this..

the view in which i select the row or the view where the details are displayed.

former_member192434
Active Contributor
0 Kudos

the view in which you select the row.

Thank

jnmurthi
Participant
0 Kudos

hi,

you can write the specified code in the button action...

onActionDetailsButton();

regards,

Murthy.

Former Member
0 Kudos

HI,

if you want to display the selected data in different view follow the below steps,

1. create dummy context in component controller for holding the details of the selected row.

2.write my code in the view where you selected the row and place the selected attributes into the dummy context.

3.show the second view with the dummy context.

Regards,

ramesh

Former Member
0 Kudos

Hi,

for(int i=0;i<wdContext().node<mynode>.size();i++)

{

if(wdContext().node<mynode>.isSelected(i){

IPrivateView<myview>.I<mynode>Element>elem = wdContext.node<mynode>.get<Mynode>elementAt(i);

wdContext().node<mynide>.bind(elem);

elem.get<atr1>();

....

Regards,

Satya.

Former Member
0 Kudos

HI,


Private<name>View.I<Table node name >Node node = wdContext.node<Table node name >();

Private<name>View.I<Table node name>Element ele; 


ele = node.get<Table node>ElementAt(node.getLeadSelection);

ele.get<Att 1>();  // read the attributes at the selected row 

.......

ele.get<Att 8>();

Regards,

ramesh