on 03-11-2011 3:24 PM
Hi
I have a linkToURL in a table Col. It works fine, when clicked it opens a new window navigating to the correct link. The problem I have is that the selected row in the table is not updated e.g. If there are 5 rows in a table, Col 1 is a text col, Col 2 contains the linktoURL. if I click on row 1 col1, the row is highlighted as selected. if I click on the image, row 2, col2 then the link is opened but the row 2 is not highlighted as selected - the onLeadSelect Event is not triggered. Any suggestions how to display this row as highlighted.
ThanksAndrzej
Hi,
To change the leadSelection on click of the link, Follow the below procedure
Use LinkToAction instead of LinkToURL
Add a parameter of node element (currentUploadDataElement if UploadData is your node name) to the event handler
Do the parameter mapping for the LinkToAction UI element so that whenever link is clicked, the element (row) from which link is clicked is passed as parameter to the event handler
From the node element parameter of the event handler get the index of the row from which link is clicked and set the leadSelection to this index as
wdContext.nodeUploadData().setLeadSelection(currentUploadDataElement.index()-1);
This will solve your problem
Regards,
Amol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Amol that worked perfectly.
For the benifit of others to do the parameter mapping. In the WDJ perspective, in the Outline view navigate to the linkToURL UI component, right click and select "Parameter Mapping", here you can define the relationship between of the "row" parameter between the Action and the Event, Drag the "row" node from the Action on the right hand side to the LinkToAction on the left panel.
Hi,
What is the Compatibility Mode of the table UI? It should be auto to change the lead selection from one row and another.
Please check and confirm.
Regards
Nizamudeen SM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@ Segmentation - The only reason I want the onLeadSelection event triggered is to update the row as selected so as the user is aware of what row in the table was clicked.
@ satish / Segmentation - Clicking on the link does not alter the value of - wdContext.nodeUploadData().getLeadSelection() to point to the row that the link resides in
(the setLeadSelection event is not triggered when clicking on the link), hence this codde will not work.
@ Nizamudeen - Yes it is the default value of auto
HI,
You need to manually select the lead when selecting the second col.
wdContext.nodeUploadData().setLeadSelection(wdContext.currentUploadDataElement().index()-1);
or
wdContext.nodeUploadData().setLeadSelection(wdContext.nodeUploadData().getLeadSelection());
BR
Satish Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it really a good idea to change the lead selection when the link is clicked? Triggering two different actions (opening the URL and whatever the onLeadSelectionChange handler does) could be confusing to the user.
What could satisfy your requirement is to replace the LinkToURL by a LinkToAction, open the URL using the IWDWindowManager API and adding an onAction event handler.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.