Page 1 of 1
subforms in Visual Lansa version - templates?
Posted: Sat Nov 09, 2013 6:39 am
by jimoreilly
With the new offline techniques, is there a way in the Longrange for Lansa version to get the same effect as templates and the .CLASS property of the RPG version?
Can you reference an offline form when building the screen presentation for an online form?
Re: subforms in Visual Lansa version - templates?
Posted: Mon Nov 11, 2013 9:24 am
by MarkDuignan
Anything that RPG can do LANSA can do – and vice versa.
Sometimes LongRange low level properties are not published as LANSA high level properties or methods – but you can always use them using this approach
http://www.longrangemobile.com/docs/lan ... inglon.htm
You can reference an offline form template as a predefined online form layout - noting that this is new and still largely undocumented capability.
Re: subforms in Visual Lansa version - templates?
Posted: Tue Nov 12, 2013 6:47 am
by jimoreilly
I tried to figure this out, but I am still lost.
The response indicates that there is an equivalent Lansa option for the RPG routine of LRNG_SENDTEMPLATE, and the item property - Class. So using the Lansa version how do you create the definition of a subform that can be referred to later by the Class property, and from what I have tried 'CLASS' does not seem to be recognized by the low level SET procedure.
Re: subforms in Visual Lansa version - templates?
Posted: Tue Nov 12, 2013 10:03 am
by MarkDuignan
Sorry – we have crossed wires about what ‘template’ means.
The RPG LRNG_SendTemplate is redundant. It was made redundant by two factors:
(1). Visually - The use of ‘tables of forms’ effectively replaced it for most situations some time ago.
There are several examples in the shipped in the longrangedemo.lxp RPG examples.
(2). Functionally – the new offline forms capability takes the idea of templating much further.
The new offline (or local) form capability introduced in RV15 works because at schema refresh time local forms are called to send down their local ‘templates’. This is known as the ‘&TEMPLATE’ call – because &TEMPLATE is what appears in the RequestACTION variable.
This has nothing to do with the redundant RPG LRNG_SendTemplate procedure and the dual use of the word ‘template’ is confusing.
Once the form template (or some other smaller resuable ‘visual component’) is stored locally it can be referenced by online forms and used to dynamically build displays. The advantages are reuse and that the only the form’s data content now needs to be sent to the client.
The problem is that the RV15 local form focus has been entirely on ‘offline’ forms so far.
The use of local forms as reusable templates for ‘online’ forms has not been documented yet and no examples exist – so you would probably need to work through offline foundation tutorials to establish a starting point for using this new capability.
Re: subforms in Visual Lansa version - templates?
Posted: Wed Nov 13, 2013 9:24 am
by jimoreilly
The 'table of forms' method appears to be what I am looking for, but I still cannot figure out the correct syntax for the RDMLX version of LR. We are not an RPG shop and do not have the RPG version of LR installed. The RDMLX version does not have the examples you referenced - EXAM0076 and EXAM0077 or any equivalents as far as I can see. In looking at the source for the RPG examples through the demo pointing at a LANSA server, the EXAM0076 program uses DDS to setup the table with subforms, I cannot determine how to do that with RDMLX? The EXAM0077 version uses Forms within Forms which forces each row to send an individual form definition.
I can get this far:
#COM_OWNER.Set_Table Name(Table1) Layout_Width(Fill) Border_Thickness(1) Border_Cornerradius(10) Layout_Col(1) Layout_Row(1)
#COM_OWNER.Set_Table Name(Table1) Col_N(1) Col_Name(MINIFORM) Col_Width(Fill) Col_Type(FORM)
Which should define a subform in column one of the table, but how do I setup the labels and text boxes on that form?
Re: subforms in Visual Lansa version - templates?
Posted: Wed Nov 13, 2013 11:13 am
by Paul
A good RDMLX example of sub forms in tables is LRDM0003 - Incidents List.
It sets up the table column like so.
Code: Select all
#COM_OWNER.Set_Table Name(LIST_TABLE) Col_N(1) Col_Name(ROWFORM) Col_Width(Fill)
And uses the Set_Form method to set up the sub form to be used in the table column.
Code: Select all
#COM_OWNER.Set_Form Name('LIST_TABLE.Col%1.CONTENT') Grid_Col_N(2) Grid_Col_Width(Fill)
Note that the name of the sub form is set to the fully qualified property name of column 1's content. This tells LongRange how the form is to be used. Also the type is set to 'FORM' automatically by the method.
Elements for the sub form are then set up using the appropriate Set method and the fully qualified property name.
Code: Select all
#COM_OWNER.Set_Label Name('LIST_TABLE.Col%1.CONTENT.FIELDS.NUMBER') Layout_Row(1) Layout_Col(1) Font_Bold(True) Color(Blue)
#COM_OWNER.Set_Label Name('LIST_TABLE.Col%1.CONTENT.FIELDS.DATE') Layout_Row(2) Layout_Col(1) Layout_Cols(2) Font_Size(12)
#COM_OWNER.Set_Label Name('LIST_TABLE.Col%1.CONTENT.FIELDS.DESC') Layout_Row(1) Layout_Col(2) Layout_Cols(4)
#COM_OWNER.Set_Label Name('LIST_TABLE.Col%1.CONTENT.FIELDS.CONTACT') Layout_Row(2) Layout_Col(2) Layout_Cols(4) Font_Size(14)
Remember, Using statements can be used to simplify fully qualified names.
I hope this helps.
Re: subforms in Visual Lansa version - templates?
Posted: Thu Nov 14, 2013 1:48 am
by jimoreilly
Thank you!
Using your sample and LRDM003 as an guide, I was able to get a working version.
With the definition:
#COM_OWNER.Set_Table Name(LIST_TABLE) Col_N(1) Col_Name(ROWFORM) Col_Width(Fill)
#COM_OWNER.Set_Form Name('LIST_TABLE.Col%1.CONTENT') Grid_Col_N(1) Grid_Col_Width(Fill)
I was misunderstanding the appropriate using statements:
for building the form - #com_Owner.using Element('LIST_TABLE.Col%1.CONTENT.FIELDS') - referencing the Form in the column
and then later for loading the data - #com_Owner.Using Element('LIST_TABLE.Row%' + #uEntry.AsString + '.ROWFORM.FIELDS') Alwaysrememberlast(True) - referencing the Column Name in the row.
The performance improvement over Forms in a Form is very noticeable - much appreciated.