right click textgridsss2

From the documentation and examples (see attached pdf doc) it seems that it MIGHT be possible to have a submenu appear when a user right clicks on a row in a grid.

For example if I have a grid and the user right clicks, can I show a sub menu that gives him a few choices.
example.pdf (162 KB)

To work with contextmenus in NATPAGES do the following:

  1. Add an xcipopupmenu control to your page. (For instance as last control).
  2. Add an njx:eventdata control to your page. This control is described in the NJX documentation.
  3. For instance in your grid: set the oncontextmenumethod=“myevent”
  4. In your Natural code react to the *reactOnContextMenuRequest and *reactOnSelect events correspondingly. (Fill the xcipopupmenu structure / react to the selection).

Best Regards,
Christine

I could not find any reference to the njx:eventdata control anywhere in application designer. I am sure I must be missing something, but could you please give me an idea of where to find the control?

Natural for AJAX comes with 2 documentations:

  1. The general Applicatio Designer documentation: In Development Workplace under Tools & Documentation.
  2. A Natural specific part: This contains controls which are specific for Natural. It is directly accessible in the NJX installation, not via the Development Workplace.

NJX:EVENTDATA is a Natural specific control. You’ll find it in the chapter Working with Controls / Natural for Ajax Controls.

In the control palette you’ll find it in the tab Natural Extensions.

Best Regards,
Christine

On my version of Application Designer the eventdata control does not exist (see attached screenprint). Perhaps there is some setup problem. However, I edited the XML file and added the control that way (saw an example in the documentation).

I am still not sure how to get the context menu to appear once I right click. I know how to interpret the click, but don’t know how to make the menu appear.

Thanks
eventdata.pdf (231 KB)

You have an NJX installation do you? This control is only available in the Natural For Ajax product, not in the Java version of Application Designer.
Which version have you installed?

It is also only visible for a NATPAGE. If you create a PAGE ist is not available. Did you create a NATPAGE?

Best Regards,
Christine

Hi,
This is information I also tried to find in the documentation. Can you point me out where I can find documentation on how to use (fill) the XCIPOPUPMENU.
It also seems to me that the event reactonselect is not in the generated adapter.
Best regards,
Jan

Hi Jan

I eventually got the popupmenu to work after much experimenting. Attached is a program with selected code snippets that I used.

Regards

Demos
progex.txt (2.57 KB)

Thanks, Demos!

Meanwhile, I managed to make it work myself.
By the way if you use the xcieventdata, you don’t have to loop to see which row is selected.
Following code in your example:
FOR #INDEX 1 100
IF TASKPROP.SELECTED (#INDEX) = TRUE
MOVE #TASK-ISN-TABLE (#INDEX) TO TASKNUMBER
ESCAPE BOTTOM
END-IF
END-FOR
Could be changed in:
#INDEX := XCIEVENTDATA.XCIINDEX
MOVE #TASK-ISN-TABLE (#INDEX) TO TASKNUMBER

Thanks again.