cancel
Showing results for 
Search instead for 
Did you mean: 

getting selected row from the table in modal window

Former Member
0 Kudos

hi

i have a scenario where a table contains

multiple rows and on select of a particular row

and click a button i need to get model window

which has data in input fields with that particular rows

selection

here iam not using onLeadSelect()

just click on the partucular row or select a particular

row then click a button , i need to get the select row

data on the pop-up window input fields

how can this be achieved .

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

first create another window named(second) and embedd the view for showing the selected table data.

the view is taking data from same component controller so it will automatically reflect in this view when u select table.

for creating model window u can use this pice of code in lead selction property of table

IWDWindowManager winMgr= wdThis.wdGetAPI().getComponent().getWindowManager();

IWDWindowInfo winInfo=wdThis.wdGetAPI().getComponent().getComponentInfo().

findInWindows("second");

IWDWindow changeFontWindow=winMgr.createModalWindow(winInfo);

changeFontWindow.setWindowPosition(WDWindowPos.CENTER);

changeFontWindow.setTitle("Title");

changeFontWindow.show();

Regards

Trilochan

nikhil_bose
Active Contributor
0 Kudos

I)

wdContext.currentTableNodeElement().get<Value>() will give you current LeadSelected Element attribute Value.

you can use this in OnAction button to create the modal window and pass the attributes to it.

II)

Or if the view is available in the same component, just map that value and show the window on OnAction of button will give you currently selected row details on other window.

nikhiL

Former Member
0 Kudos

Hi,

Is this button part of the table row?

Regards

Ayyapparaj

Former Member
0 Kudos

hi

thanks for the reply

this button is part of the table .

exclusively used to show the selected row in the

pop-up window

and i dont want onLeadselect to be used

i need to select a particular row in the table

then click the button which is part of the table

and populate the selected row int he input fields

any suggestion?

Former Member
0 Kudos

Hi,

Add a paramter "nodeElement" of type IWDNodeelement or <IPublicYour Element> to the action onAction of the button.

Do the following in the wdDomodify

if(firstTime)

IWDButton button = (IWDButton) view.getElement("<BUtton>");

button.mappingOfOnAction().addSourceMapping("nodeElement", "nodeElement");

now in the action hadler you can access the entire attributes using the

nodeElement.get<YourAttribute>

Or

nodeElement.getAttributeValue("<yourattribute>");

Populate this values to the context which is mapped to the input fields

Rest to show the popup already the code is posted in this thread.

Regards

Ayyapparaj

Former Member
0 Kudos

hi

thanks for response

iam not going with dynammic programming

procedure ,

i have declared the table by under the

transparent container by applytemplate ,

now whats the procedure i need to follow .

any suggestions .

Former Member
0 Kudos

Hi,

If you are on CE you can do parameter mapping other wise you have to do the approach what i have suggested

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

if u want the selected row record in next window on action of button then u can get value from table source node attribute and make all attribute which u want to show in second window view and set these attributes by getting value from first window view.

in onAction write this

wdContext.currentContextElement().setNewFirst(wdContext.currentAddressElement().getFirst());

wdContext.currentContextElement().setNewSecond(wdContext.currentAddressElement().getSecond());

IWDWindowManager winMgr = wdComponentAPI.getWindowManager();

IWDWindowInfo winInfo = wdComponentAPI.getComponentInfo().getWindow("Second");

IWDWindow win = winMgr.createModalWindow(winInfo);

win.setWindowPosition(WDWindowPos.CENTER);

win.setTitle("Model Window");

win.show();

Regards

Trilochan