Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

More edittable weirdness

Good morning guys

Got a weird one for you.. I'm taking the results of a procedure and slamming into an edit table. The table has 2 columns and N rows. I've tested this filling both columns and 5 or so rows. In doing this I'm both updating ATRECORD and setting DEFPROP (which equates to ARRAY).

At first it seems to display properly; but if I enter/tab around, it changes the display so that col 1, row 1 (cell 1,1) shows what it should, the contents of cell 1,2 show in cell 2,1, and rows > 1 are empty. If I keep moving around, it eventually puts cell 1,1 and 1,2 show correctly, but rows > 2 are gone. It looks like after trying to stuff everything in row 1, it truncates because there are only 2 columns.

I've never seen this before; but I've never tried stuffing multiple rows and columns simultaneously in an edit table.

Any thoughts?

Thanks!

Comments

  • I suspect that the only way to prevent this is to ensure you have the necessary number of columns pre-defined in design mode, whether that be the exact number or more than the number required. Rows are fine but columns won't get created at runtime.
  • The problem is, there are really only 2 columns and N rows. When I stuff the edittable, it's treating the rows of column 1 as columns in row 1 and truncating anything past 2.

  • Is your array really a list perhaps?
    You could use srp_rotate_array to swap it or build it differently in the first place so that your fms and vms are in the opposite places to what they are now
  • Nope, everything is being done using ARRAY (or DEFPROP, which is the same thing).

    Does Srp_Rotate_Array work on a regular OI edittable?
  • Michael, I'm pretty sure Mark was suggesting that you use SRP_Array('Rotate') against the data before you attempted to stuff it into the edit table. The SRP_Array function does not directly work with any control. However, this suggestion would only be useful if his supposition that your data was not already in an ARRAY format.

    You said that you are also using the ATRECORD property. Is this edit table databound?
  • Yes sir.. 2 columns, both databound. I originally tried just modifying ATRECORD, but that got the same result. Then I tried doing ARRAY as well.

    Should I try using LIST instead of ARRAY/DEFPROP?
  • edited March 2018
    Don interpreted my suggestion correctly.
    Michael, yes try using LIST to see how it pans out.

    My suggestion was that whilst you were populating the ARRAY format, your data may have been in LIST format.
    If that's the case, you can either
    1. use the srp_array() function to swap your data from a list format to an array or
    2. change the way you build your data so that it is an array already or
    3. populate the table using the "LIST" property instead of ARRAY/DEFPROP
    or my suggestion may be completely off the mark.
  • The data is being populated in ARRAY format, but I will try doing LIST instead.

    Thanks!
  • If you use the array property when your data is in list format or vice versa, the table will still populate, just that the data will end up in the wrong place.
    Basically what you were expecting to be columns will be rows and what you were expecting to be rows will be columns
  • I've got that.. initially it displays correctly.. then if I change cell or leave the edittable it switches.. then back if I return to the edittable. And it truncates anything after row 2 because, when it does the switch, there are only 2 columns.

    Will try using LIST instead tho
  • I strongly suspect there is more to this picture than has been disclosed. You said that this control is databound. If that is so, then what happens if you manually create a record with the same data and then allow OI to read the record and populate the control normally?
  • When Reading a record, the data is displayed correctly.
  • edited March 2018
    And after the data is read does navigating the edit table reproduce the problem?

    Just for grins and giggles, what happens if you read the record normally but then immediately do something like this from a pushbutton:

    AtRecord = Get_Property(@Window, 'ATRECORD') Set_Property(@Window, 'ATRECORD', AtRecord)
Sign In or Register to comment.