# Control Grid Selection Problems

**URL:** <https://techcommunity.softwareag.com/t/control-grid-selection-problems/99032>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, NaturalONE, Natural-for-AJAX\
**Created:** [November 23, 2011, 4:14pm UTC](https://techcommunity.softwareag.com/t/control-grid-selection-problems/99032 "2011-11-23T16:14:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitchamm1](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@mitchamm1](https://techcommunity.softwareag.com/u/mitchamm1)\
**Post date:** [November 23, 2011, 4:14pm UTC](https://techcommunity.softwareag.com/t/control-grid-selection-problems/99032/1 "2011-11-23T16:14:58Z")

</div>

I’m having some problems with Control Grids and the Popup help and knowing which field has been clicked to fire the help popup.

I have a simple example which is highlights my problem, here is a simple page with a Control Grid with 1 Column of Fields which have the popupmethod set to ‘openIdValueComboOrPopup’

and the program which runs this is here and will display three items in the Popup ComboBox

/\*\* Main program generated for  
/\*\* adapter \<:link MMIT/TEST\>.  
/\*  
/\*\* :author mmit  
/\*\* :version Generated by Natural for Ajax.  
/\*  
DEFINE DATA LOCAL  
1 LINES (1:_)  
2 FLDGRIDFIELD (A) DYNAMIC  
2 SELECTED (L)  
END-DEFINE  
\*  
EXPAND ARRAY LINES TO (1:3)  
PROCESS PAGE USING “TEST”  
\*  
DECIDE ON FIRST PAGE-EVENT  
VALUE U’nat:page.end’  
/ Page closed.  
IGNORE  
VALUE U’lines.findValidValuesForFldGridField’  
/_ TODO: Implement event code.  
PROCESS PAGE UPDATE FULL AND SEND EVENT ‘nat:page.valueList’  
WITH PARAMETERS  
NAME ‘id’ value ‘1;2;3’  
NAME ‘text’ VALUE ‘Option 1;Option 2;Option 3’  
END-PARAMETERS  
PROCESS PAGE UPDATE FULL  
VALUE U’onExit’  
/\* TODO: Implement event code.  
PROCESS PAGE UPDATE FULL  
NONE VALUE  
/\* Unhandled events.  
PROCESS PAGE UPDATE  
END-DECIDE

When I click on one of the help buttons next to one of the fields a combobox correctly appears with the values. The problem is when a value is then selected, and the Field is updated I cannot tell which one of the Fields has actually been updated as the Selected property does not got set. How can I get round this?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [November 23, 2011, 5:29pm UTC](https://techcommunity.softwareag.com/t/control-grid-selection-problems/99032/2 "2011-11-23T17:29:20Z")

</div>

> [@mitchamm](#):
>
> When I click on one of the help buttons next to one of the fields a combobox correctly appears with the values. The problem is when a value is then selected, and the Field is updated I cannot tell which one of the Fields has actually been updated as the Selected property does not got set. How can I get round this?

When a value is selected from the dropdown no event is sent, so the user can  
select a value for any / all dropdowns and still no event is sent to Natural,  
so one or more fields have been modified, but none “selected”.

You will need to set the flushmethod for fldGridField, this will trigger an event,  
but be aware that the format of the event actually sent is a bit strange, for  
example when you set flushmethod=onFieldChanged the method sent will be

```auto
lines.items[n].onFieldChanged
```

where ‘n’ is the actual index of the modified field.

Hth, best regards,

&nbsp;&nbsp;&nbsp;Wolfgang

---

<div class="post-metadata">

**Author:** ![Jan\_Van\_Achter](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/jan_van_achter/32/164_2.png) [@Jan\_Van\_Achter](https://techcommunity.softwareag.com/u/Jan_Van_Achter)\
**Post date:** [December 6, 2011, 4:23pm UTC](https://techcommunity.softwareag.com/t/control-grid-selection-problems/99032/3 "2011-12-06T16:23:37Z")

</div>

Hi Mitchamm,

To find the line that is selected you need to loop your list and test if selected(i) is true.  
Another way is to use the NJX:EVENTDATA.  
This returns the index of the line on which you have clicked. Look this up in the documentation.

Best regards,

Jan

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:01pm UTC](https://techcommunity.softwareag.com/t/control-grid-selection-problems/99032/4 "2021-04-02T15:01:14Z")

</div>


