cancel
Showing results for 
Search instead for 
Did you mean: 

Get the selected row from a Table... I need the value

Former Member
0 Kudos

Hi people

Here is my question

I have an RFC import model where one of the nodes is binded to a table. For example, the table has two columns corresponding to the attr of the conext node.

When the event is rise I put somethig like this to try to get the selected value

 int n = wdContext.nodeOutput_Transport().size();
 int leadSelection = wdContext.nodeOutput_Transport().getLeadSelection();
    
    for(int i = n-1; i>=0;--i)
    {
    	if(leadSelection==i)
    	{
    		IWDNodeElement element = wdContext.nodeOutput_Transport().getElementAt(i);
 String id = element.getAttributeAsText("Transport");

The result of this is a NullPointer Exeption

the context nodes looks like this

|_ Ztmp_Poc_Uifilter_Tra_Input (node)

|_ Output_Transport (node)

|_ T_Transport (node)

|_ Desc_Transport (attr)

|_ Transport (attr)

So... when I click in a row I want to get the selected "Transport" attribute value.

Best Regards

Juan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Juan,

Try this.

int n = wdContext.nodeOutput_Transport().size();

int leadSelection = wdContext.nodeOutput_Transport().getLeadSelection();

Iprivate<viewname>.IOutput_TransportElement transportElem;

transportElem = wdContext.nodeOutput_Transport().getOutput_TransportElementAt(leadSelection );

String id = transportElem.getTransport();

Please post your error and the line at which the error occurs.

Kindly consider rewarding points to helpful answers on SDN

Former Member
0 Kudos

Hi Bala

I try, but I can't use in the first case the

getOutput_TransportElementAt

and then the

getTransport

I only have the getElementAt and getAttributeAsText

Thanks

Juan

PD: sorry for the rewarding points but this is my first posting and I don't know how put them.

Answers (3)

Answers (3)

arun_srinivasan
Contributor
0 Kudos

hi

define a Event for leadselect. In that event handler write the following code

{

String value=wdContext.node<nodename>().current<nodeelemnt>Element().get<Attributename>();

wdcontext.currentcontextelement.set<value name>(value);

}

u try to traverse by node to element.u can get the value.

let me know if it works,

Hope this help u better,

Regards,

Arun

Former Member
0 Kudos

Hi,

Try this

Iprivate<viewname>.IOutput_TransportElement transportElem;

transportElem = (Iprivate<viewname>.IOutput_TransportElement)wdContext.nodeOutput_Transport().getElementAt(leadSelection );

Regards, Anilkumar

Former Member
0 Kudos

Hi Juan,

On ur table u will be having a property called onleadselect().Give a mtd name for that and inside that mtd try out giving this following code:

Onleadselectmtd()

{

String s=wdcontext.node<name>.get<Transportattribute>;

wdcontext.currentcontextelement.set<anotheratt>(s);

}

This should solve ur problem.

Regards,

Nagarajan.