cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the next value of element in context node

Former Member
0 Kudos

Hello,

I have a context node and on a form we are displaying it's attribute value. We made one attribute as link to action so when user click on that a new popup window will be shown with the value selected. On this pop up we have 2 buttons Next and Previous. When user click on Next without closing the pop up window it should display the next value of that node on the same attribute. How Can I achieve this ? I think I can iterate through all the values and can get the elementsat(i+1) but is there any other way through which I can directly get the next element attributes.

or How Can I get the next and previous values of elements in a context node.

Regards,

MS

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

just change the lead selection of the node

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Jun and Teodor,

Thank you for your help. Sorry I could not apply the given solution.But I guess it must work. Currently the node cardinality is 1:1 which is not allowing me to move to next element. I need to call the data from other dc's controller context node. Do you have any help url for dc to dc communication.

Regards,

Mayank

govardan_raj
Contributor
0 Kudos

Dear mayank,

if the context node cardinallity is 1..1 , then it can hold only one value , so on clickof next or preivous button , call the data and set the value to this nodes attribute , then it will change ..

Regards

Govardan Raj

0 Kudos

Hello Govardan,

I guess I can not do that because I am calling that event which change the data from some other table. Can you please tell me how can I use the data from different dc context node. Can you please give me the steps for get context node from different dc with interface controllers.

Regards,

Mayank Saxena

govardan_raj
Contributor
0 Kudos

H mayank,

if that node is from differnet DC name it as A-DC , then you have to create a method in the main other dc component controller which sets the value to this node, later call this method in the interface controller , and do context mapping of this node to interface controller, and then from add these things to the publicpart of the dc,

now in the second dc name it as B-DCwhere you are having Pop up as described above , on click of next etc.. add this A-DC  as used dc in B-DC , later on click of Next button , you have an event listener in the pop up view, call a method in teh component controller , which inturn calls method of interface controller of A-DC .

eventlistnerView() --->MethodInB-DC_ComponentController()-->MethodInA-DCInterfaceController()-->MethodInA-DCComponentController() ;

MethodInA-DCComponentController () has code to set the values in the context node, and here you have to do context mapping from this component controller context node to the interface controller and then to the component controller in the B-DC and later to the pop Upview..

hope you understood ...

if any queries please post wil help you out....

Regards

Govardan Raj

Former Member
0 Kudos

Hi,

If you show the current element in the popup just use:

node.setLeadSelection(node.getLeadSelection()+1)

with a check that the node.getLeadSelection()+1 is not getting over the node.size().

That will show the next result in the popup.