# Control Grid Content displayed

**URL:** <https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, NaturalONE, Natural-for-AJAX\
**Created:** [December 11, 2009, 10:36pm UTC](https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346 "2009-12-11T22:36:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Norm](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@Norm](https://techcommunity.softwareag.com/u/Norm)\
**Post date:** [December 11, 2009, 10:36pm UTC](https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346/1 "2009-12-11T22:36:52Z")

</div>

I have defined a Control Grid (rowtabelarea2) in my layout with the rowcount set at 10. As I load information into the lines, I would like to be able to choose via my Natural application which 10 lines will be displayed.

I can not seem to find how I can control which lines are to displayed?

Is this possible?

Thanks,

Norm

---

<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:** [December 12, 2009, 12:35am UTC](https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346/2 "2009-12-12T00:35:18Z")

</div>

Yes, this is possible, check

[http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat637unx/njx/njx-sss.htm](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat637unx/njx/njx-sss.htm)

---

<div class="post-metadata">

**Author:** ![Norm](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@Norm](https://techcommunity.softwareag.com/u/Norm)\
**Post date:** [December 14, 2009, 10:19pm UTC](https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346/3 "2009-12-14T22:19:25Z")

</div>

I’ve tried many things to get the data contents to change in my rowtabelarea2 (even tried a textgridss2), but nothing seems to work.

I have a button on my screen with a method that changes the topindex, but when the button is clicked on, the screen contents do not change. The scroll bar size and position will change but not the data content.

In looking at the NJX examples, the data is changed by a user moving the scrollbar. In the documentation, it appears that a scroll event must be recognized before the contents will change. Is this true? If this is true, is there a way to trigger a scroll event within natural code?

Thanks,

Norm

---

<div class="post-metadata">

**Author:** ![Christine\_Zimmermann](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@Christine\_Zimmermann](https://techcommunity.softwareag.com/u/Christine_Zimmermann)\
**Post date:** [December 14, 2009, 10:56pm UTC](https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346/4 "2009-12-14T22:56:39Z")

</div>

Hi Norm,

with “SSS\_N”, changing the topindex is supported for TEXTGRIDSSS2 and for ROWTABLEAREA2.

To do SSS\_N you must set the SIZE.

In the event, in which you change the topindex from within your Natural program, you also must provide the corresponding items.

Example: If you set topindex = 10 and the rowcount is 4, you must provide , , and .

The Application Designer framework will do the scrolling and corresponding rendering for you.

Best Regards,  
Christine

---

<div class="post-metadata">

**Author:** ![Norm](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@Norm](https://techcommunity.softwareag.com/u/Norm)\
**Post date:** [December 16, 2009, 4:01am UTC](https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346/5 "2009-12-16T04:01:31Z")

</div>

Hi Christine,

I’m not sure I understand what you mean by  
[b]

> [@](#):
>
> Example: If you set topindex = 10 and the rowcount is 4, you must provide , , and .

[/b]

I have defined in my natural program to update the variables in the following way:

move 1000 to linesinfo.rowcount  
move 1 to linesinfo.topindex  
move 1000 to linesinfo.size

and I have initialized values in all rows.

The adapter is set up to display 10 rows at a time. When I want to see the next rows, I am clicking a button that calls a natural subroutine that adds 10 to the topindex, and then falls through a repeat loop and re-executes the “process page using” statement, but the values in the displayed 10 rows does not get updated to reflect my desire to see rows 11 through 20.

As far as I can tell, I have provided all 1000 rows, what else do I need to do?

Thanks,

Norm

---

<div class="post-metadata">

**Author:** ![Christine\_Zimmermann](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@Christine\_Zimmermann](https://techcommunity.softwareag.com/u/Christine_Zimmermann)\
**Post date:** [December 16, 2009, 3:26pm UTC](https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346/6 "2009-12-16T15:26:08Z")

</div>

Hi Norm,

Have you seen the Serverside Scrolling samples in the njxdemos? In these samples you can see the exact code, how to implement it.

In your current code the following is not correct

> [@](#):
>
> move 1000 to linesinfo.rowcount

Instead:  
0) move 1000 to linesinfo.size is OK.

1. You can set the rowcount at design time in your page layout. At runtime the Application Designer framework will take care for the correct rowcount values. Do not change the rowcount from within your Natural Application.
2. In your Natural Application only read the rowcount value. Do not set it.
3. In your Natural Application you always fill the “lines-array” with “rowcount” items. Based on the topindex value your Natural Application will fill in different items. So for topindex = 10 and rowcount = 4 your application will fill in item10, item11, item12, item13
4. Your Natural Application can set the topindex. When you change the topindex to 20 during some server-roundtrip, you then must of course return item20, item21, item22 and item23 in this server roundtrip.

Best Regards,  
Christine

---

<div class="post-metadata">

**Author:** ![Norm](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@Norm](https://techcommunity.softwareag.com/u/Norm)\
**Post date:** [December 16, 2009, 11:10pm UTC](https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346/7 "2009-12-16T23:10:03Z")

</div>

Hi Christine,

It seems to me that you are indicating that I need two arrays. One to handle the full table, and then one designed for display in the Application Designer.

If I understand you correctly, I would add records to the larger array, and then move them to the array based on what I’d like the adapter to display.

I guess I was hoping that I could just add all the rows to the adapter array, and simply send a new topindex to the page and get the screen to show the next set of records. It sounds to me like this is not possible.

I did look at the Serverside Scrolling samples in the njxdemos, I even modified the code to use a different employee file, as we had not loaded the file that the natural programs were wanting to use. These examples however only seem to change the rows in the adapters by using the scroll bar. I will take a look at the code again, but is i recall correctly, it seems that this app is using two tables and manually moving the data from one to the other. What I was trying to achieve in essence was using one table and just having the adapter move to the forefront the rows starting from a topindex supplied.

I know how to maintain two tables and move the rows back and forth if necessary, I was just hoping to avoid the hassle of going through this effort.

Thanks,

Norm

---

<div class="post-metadata">

**Author:** ![Christine\_Zimmermann](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@Christine\_Zimmermann](https://techcommunity.softwareag.com/u/Christine_Zimmermann)\
**Post date:** [December 17, 2009, 1:43pm UTC](https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346/8 "2009-12-17T13:43:02Z")

</div>

Hi Norm,

I understand your point.

Your understanding is correct: If you want to control the topindex from within Natural you must implement SSS\_N. The current version do not support to control the topindex without SSS\_N.

However I wonder if this can be easily supported in the future. I cannot see any technical reasons why not allowing to change the topindex for “none- SSS\_N”. It really would simplify what your application wants to do.

Best Regards,  
Christine

---

<div class="post-metadata">

**Author:** ![Christine\_Zimmermann](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@Christine\_Zimmermann](https://techcommunity.softwareag.com/u/Christine_Zimmermann)\
**Post date:** [December 17, 2009, 3:03pm UTC](https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346/9 "2009-12-17T15:03:02Z")

</div>

Hi Norm,

I have good news for you:  
We plan to fix this for the next NJX update package / version.

But 2 HINTs:

1. SSS\_N still makes sense in cases, in which you have lots of data items. If you don’t do SSS\_N you have to exchange all items between Natural and the web application server in every server roundtrip to Natural.

2. For None-SSS: If you simply leave the topindex handling to the framework, server roundtrips are minimized. If your application sends “topindex change events” to Natural you always trigger a full server roundtrip to Natural. Depending on your application this might slow down performance.

Best Regards,  
Christine

---

<div class="post-metadata">

**Author:** ![Norm](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@Norm](https://techcommunity.softwareag.com/u/Norm)\
**Post date:** [December 17, 2009, 8:02pm UTC](https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346/10 "2009-12-17T20:02:36Z")

</div>

Hi Christine,

That is good news. Thanks for the update.

Norm

---

<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, 2:57pm UTC](https://techcommunity.softwareag.com/t/control-grid-content-displayed/92346/11 "2021-04-02T14:57:50Z")

</div>


