cancel
Showing results for 
Search instead for 
Did you mean: 

Table selection

Former Member
0 Kudos

Hi,

I've made a table whose column contain cell variants. I'd like to show the variants in a row when that row is currently selected.

If I'm not mistaken I should use the onLeadSelection event to do this, and in particular the newRowElement and oldRowElement parameters.

If my strategy is right, the method should look like this:

- set Variant string of oldRowElement to null (go back to default cells)

- set Variant string of newRowElement to the variant id (show variants)

My questions is:

What is the type of the parameters newRowElement and oldRowElement? I can't find out how to map newRowElement and oldRowElement as the event handler's method parameters because I don't know their type.

Thank you,

Pietro

Edited by: pietro.m on Sep 16, 2010 5:25 PM

Edited by: pietro.m on Sep 17, 2010 9:50 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I've succeeded in doing the parameter mapping... I was adding the method parameters on the Method tab instead on the Action tab, and for some unknown reasons Netweaver failed to see those parameters.

Anyway, now I have on the onLeadSelect method two strings that represent the old and the new lead selection.

Can someone tell me how to get the corresponding NodeElements from that strings?

Thank you,

Pietro

Former Member
0 Kudos

Hi,

Convert both the strings to integers using:

int i = Integer.parseInt(string.trim())

and then

Use : wdcontext.nodeMyNode.getMyNodeElementAt(i);

Regards,

Himanshu

Former Member
0 Kudos

Hi Himanshu,

thank you for your reply.

The problem is that I get a string like: MIAOGGLJ.AdvancedSearchView.ConstraintTable.1

and your solution raises the exception

java.lang.NumberFormatException: For input string: "MIAOGGLJ.AdvancedSearchView.ConstraintTable.1"

because the ParseInt instruction fails. I thought taking a substring of the input string, but I can't know the number of rows in advance and so I don't know how many characters to take counting from the end.

Edited by: pietro.m on Sep 17, 2010 11:08 AM

Former Member
0 Kudos

I used this workaround. Let's hope that the path string will keep this format: X.X.X.X.INDEX

	  int newLeadIndex = Integer.parseInt((newLeadSelection.split("\\."))[newLeadSelection.split("\\.").length-1]);
	  int oldLeadIndex = Integer.parseInt((oldLeadSelection.split("\\."))[oldLeadSelection.split("\\.").length-1]);

Former Member
0 Kudos

Hi Pietro,

The parameter mapping of the newRowElement and oldRowElement will directly return you parameter of type Node Element.

First mapp the parameter as follows :

IWDTable table = (IWDTable)view.getElement("Table");

table.mappingOfOnLeadSelect().addSourceMapping(IWDTable.IWDOnLeadSelect.NEW_ROW_ELEMENT,"newElement");

table.mappingOfOnLeadSelect().addSourceMapping(IWDTable.IWDOnLeadSelect.OLD_ROW_ELEMENT,"oldElement");

now What you need to do is just create two parameter in the onLeadSelection Action( name should be newElement and oldElement ) of type IWDNodeElement or I<node name>Element ( Go to java native type and search for IWDNodeElement or I<Node name>Element and select the corresponding type).

Now in onLeadSelectAction set the value of the cell varient attribute as

if parameter is of type is IWDNodeElement then

newElement.setAttributeValue( "AttributeName" , value).

if parameter is of type is I<node name>Element then

newElement.set<attributeName>(value);

Thanks & Regards

Ravindra Singh

Former Member
0 Kudos

Thank you Ravindra!

Pietro

Answers (0)