Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Scrollgrid - differences between 1.3x and 2.3x  (Read 11441 times)
Stephen T.
Posts: 114


« on: September 08, 2011, 11:01:54 am »

I have an old system written under 1.3x that I'm trying to migrate to 2.3x and I've hit a compile error on a form containing a scrollgrid.
The compile problem is caused by labels defined within the scrollGrid. These compiled ok under 1.3x but now throw an 8082 compiler error:

-8082 The item 'name' is used in an invalid layout context.
     Description: The form item name is used in a layout part which does not support this type of form
    item. This error occurs for example when you try to define a BUTTON as a TABLE column.
   Solution: Review your form definition file and use correct item types.

I got past the compiler error by simply removing the labels (as a temp fix), but then hit a core dump on items defined as hidden within the scrollgrid.

I have spoken to support about this and was initially going to replace the scrollgrid with a standard display/input array, but I now think I want to continue with the scrollgrid. Should I resubmit this back to support, or is it something that is known and has a workaround?
Leo S.
Four Js
Posts: 126


« Reply #1 on: September 08, 2011, 12:49:28 pm »

Hi Stephen, please resubmit to the support: fglform should not coredump in this situation.
Kind Regards, Leo
Stephen T.
Posts: 114


« Reply #2 on: September 08, 2011, 01:08:31 pm »

Leo,
What about the -8082 compilation error when you put labels  with a field definition such as in the scrollgrid - also a support issue?
The error is (from .err):
.....
            PAGE (TEXT=%'REFERENCES', ACTION = references)
                SCROLLGRID
{
 [lsa            ][sa   -  ]  [sb                            ][lsaa        ][saa      ]
 [lsc            ][sc         |sd         |se                ][cst         ][st                  ]
 [lsf            ][sf                                        ][csu         ][su                  ]
 [lsg            ][sg                   ][lsh      ][sh      ][csv         ][sv                  ]
.....
-- References Tab......
LABEL       lsa:label18,TEXT=%'Third Party Ref',JUSTIFY=LEFT,
# The item 'lsa' is used in an invalid layout context.
# See error number -8082.
                        STYLE='Label01';
BUTTONEDIT  sa  =       FORMONLY.tPartyBCode,UPSHIFT,REQUIRED,
                        ACTION=lookup,
                        STYLE='ButtonEdit01';
COMBOBOX    sb  =       FORMONLY.tPartLookUpCodesRecNo,REQUIRED,
                        TAG='tpart',INITIALIZER=init_combos,
                        STYLE='ComboBox01';
LABEL       lsc:label19,TEXT=%'Title/Initials ...',JUSTIFY=LEFT,
# The item 'lsc' is used in an invalid layout context.
# See error number -8082.
                        STYLE='Label01';

Rene S.
Four Js
Posts: 111


« Reply #3 on: September 09, 2011, 11:03:37 am »

Hello,

the compilation of "static elements" has changed.
These are items as BUTTON, LABEL, IMAGE (not being form fields. using the notation LABEL l1:TEXT = 'foo';)
Important: ':' (colon) instead of '=' right to the screen-field name in the attributes section of the per file.
 
The 1.3x compiler accepted those items if they has been defined more then once with the same name. The compiler added the attribute cloneCount. This attribute has been ignored by GDC.
The 2.3x compiler forces those items to be defined once. Otherwise you'll get the compilation error -8082 (The error message is cryptic. should be something like: LABEL 'name' must have a component size of 1.)

Read the change log:
2.20.05-1369.27
bug 10822: Form with multiple static labels compiles but cannot be displayed.

The form compiler now raises error -8082, until we fix bug #3515.

My point of view: 
- confusing error message
- partially invalid patch: A definition of static LABEL and IMAGE with a component size > 1 makes sense and is useful. Why changing the compiler, if the implementation in the clients is missing? This was a client bug, not a compiler bug! The fix should be reverted and the real  bug 3515 - Static elements not duplicated in all records of a SCROLLGRID - must be fixed.
- a definition of BUTTON and CANVAS with a component size > 1 is (perhaps, my point of view) useless. The runtime can not distinguish actions triggered by <myAction>[1] and <myAction>[2].

About the crash you've reported when compiling a form: can i/we get your form file, I could not reproduce.
Rene

Stephen T.
Posts: 114


« Reply #4 on: September 09, 2011, 02:23:11 pm »

Rene,
I'm not sure I follow that. My 'lsa' label is defined as previously shown (ie LABEL lsa:lable18, TEXT=%'....blah...... and is only defined once in the ATTRIBUTES section (although it is shown 3 times between the {...} screen layout section). So are you saying that I should define 'lsa' once between the {...} or in the ATTRIBUTES section (already done in that case)?


The crash... I tried yesterday to create a simple test case by extracting the folder page from the more complex original form, but, sod's law, that simple version works fine with the hidden fields. So, it would appear to be a combination that causing the core. The only thing I know, is that if I either remove the hidden fields (or replace them with PHANTOMs) in the 'complex' form, the core stops.

The original 1.33 form is attached (the fields that appear to cause the issue are 'ha' through 'hd') - I'm not so fussed about this, as I know I can get past the problem with a quick redef of the field type.
 

* mbuyer1_OA.per (33.29 KB - downloaded 653 times.)
Rene S.
Four Js
Posts: 111


« Reply #5 on: September 12, 2011, 11:11:08 am »

Stephen,
you say, the 'lsa' label is defined only once. This is not the issue. Review the SCROLLGRID, GRID or SCREEN definition: the screen-field lsa is define more then once there. Isn't it? (I use 'screen-field' for the definition of a position and width within a SCREEN).
LABEL screen-field-name = form-field-name, attributes ... ;

This code-fragment causes the reported error:
Code
  1. GRID
  2. {
  3. [l1 ][f1   ]
  4. [l1 ][f1   ]
  5. }
  6. ....
  7. ATTRIBUTES
  8. LABEL l1:TEXT = %"label1"; -- the screen-field l1 is defined more than once, causes error 8082
  9. EDIT f2=FORMONLY.f1; -- this defines a screen array, legal code.
   
Reuben B.
Four Js
Posts: 1047


« Reply #6 on: September 13, 2011, 02:15:45 pm »

Rene,

I'm confused.  This compiles

Code
  1. LAYOUT
  2. SCROLLGRID
  3. {
  4. Label1[f1   ]
  5.  
  6. Label1[f1   ]
  7.  
  8. Label1[f1   ]
  9. }
  10. END
  11. END
  12. ATTRIBUTES
  13.  
  14. EDIT f1=FORMONLY.f1;

This doesn't (but did prior to 2.2)

Code
  1. LAYOUT
  2. SCROLLGRID
  3. {
  4. [l1 ][f1   ]
  5.  
  6. [l1 ][f1   ]
  7.  
  8. [l1 ][f1   ]
  9. }
  10. END
  11. END
  12. ATTRIBUTES
  13. LABEL l1:TEXT = %"label1";
  14. EDIT f1=FORMONLY.f1;

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Stephen T.
Posts: 114


« Reply #7 on: September 13, 2011, 03:49:58 pm »

 Reuben,
That's basically what the mbuyer1_OA.per was showing in the attachment above. However, I went back and ran that old 1.3 version and the scrollgrid labels then only appeared on the first iteration. Whether that happened originally, I don't recall.

To get the code to work under 2.x, I had to put the label in-line as per the below.

Code:

["Third Party Ref"][sa   -  ]  [sb                            ] ["Contact Ref"    |saa      ]
 ["Title/Initials" ][sc         |sd         |se                ] [cst              |st                  ]
 ["Company Name"   ][sf                                        ] [csu              |su                  ]
 ["Property No."   ][sg                   ]["Post Code"|sh      ][csv              |sv                  ]
 ["Street"         ][si                                        ] [csw              |sw                  ]
 ["District"       ][sj                                        ] [csx              |sx                  ]
 ["Town"           ][sk                                        ] [csy              |sy                  ]
 ["County"         ][sl                                        ] [csz              |sz                  ]
 ["Reference 1"    ][sm            ]["Reference 2"]  [sn           ]
 ["Reference Fee"  ][so            ]["Fee Rcv'd Date"|sp          ]
 ["Applied Date"   ][sq          ]  ["Received Date"][sr          |"Forwarded Date"|ss          ]
-----------------------------------------------------------------------------------------------
 ["Third Party Ref"][sa   -  ]  [sb                            ] ["Contact Ref"    |saa      ]
 ["Title/Initials" ][sc         |sd         |se                ] [cst              |st                  ]
 ["Company Name"   ][sf                                        ] [csu              |su                  ]
 ["Property No."   ][sg                   ]["Post Code"|sh      ][csv              |sv                  ]
 ["Street"         ][si                                        ] [csw              |sw                  ]
 ["District"       ][sj                                        ] [csx              |sx                  ]
 ["Town"           ][sk                                        ] [csy              |sy                  ]
 ["County"         ][sl                                        ] [csz              |sz                  ]
 ["Reference 1"    ][sm            ]["Reference 2"]  [sn           ]
 ["Reference Fee"  ][so            ]["Fee Rcv'd Date"|sp          ]
 ["Applied Date"   ][sq          ]  ["Received Date"][sr          |"Forwarded Date"|ss          ]
-----------------------------------------------------------------------------------------------
Rene S.
Four Js
Posts: 111


« Reply #8 on: September 13, 2011, 05:40:47 pm »

Hello Reuben, that's the point: others will be confused too.

The first example creates 3 individual Labels. This code has always been working in a SCREEN section of per files. Nothing is exceptional.

The second example defines 1 Label with the dimension 3: you have defined 3 screen-fields with the name l1. The compiler raises since version 2.20.05-1369.27 an error. Before version 2.20.05-1369.27 the rendered result at runtime was invalid: only one label has been displayed.

The second example should be the 'natural' way to localize text within a form. The form compiler could solve this problem. But there is another problem: See this code fragment:
Code
  1. ATTRIBUTES
  2. LABEL l1:TEXT="label1";
  3. LABEL l2:my_label TEXT="label2";
Can you see the difference in the definition of these two labels? The 2nd label can be manipulated from the runtime:
Code
  1. CALL form.setElementText("my_label","newText")

Short summary:
- The compiler could accept the 2nd example. At runtime you would see 3 instances of the localized label l1.
- The compilation would fail, when defining a LABEL in the attributes section and using more than one screen field and additionally specifying an name (the identifier my_label right of the colon).

Rene



Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines