Control Grid Content displayed

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

Yes, this is possible, check

http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat637unx/njx/njx-sss.htm

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

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

Hi Christine,

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

[/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

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

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

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

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

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

Hi Christine,

That is good news. Thanks for the update.

Norm