Visualizations - Visual Host & TabStop

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
moymike
Posts: 6
Joined: Fri Apr 08, 2016 2:54 am

Visualizations - Visual Host & TabStop

Post by moymike » Fri Apr 29, 2016 11:13 pm

I am playing with a visualization that simply formats a phone number field. I made it my DefaultVisual, and it all works great except for the TabStop. My program is a Web Page and I am using version 14 of Lansa.

The behavior I get is that there appears to be a TabStop set on the VisualHost itself. My VisualHost has a single Edit Box in it. The result is that as you tab through a form, one tab is "eaten" when you attempt to tab into the custom visualized field. I prepared a simple example, hoping somebody can give me a solution.

AddressLine1VisualHost -- Visual Host Code (switches vowels to uppercase, just for fun)

Code: Select all

Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_PANL *implements #Prim_dc.iMonitorSubject #Prim_dc.iContextualSubject) Defaultpty(Value) Displayposition(1) Height(17) Layoutmanager(#Layout) Left(0) Tabposition(1) Top(0) Width(170) Tabstop(False)

* Replace all references to #Edit1 with your field name

Define_Com Class(#PRIM_ATLM) Name(#Layout)
Define_Com Class(#PRIM_ATLI) Name(#AttachItem1) Attachment(Center) Manage(#Edit1) Parent(#Layout)

Define_Com Class(#PRIM_EDIT) Name(#Edit1) Displayposition(1) Height(17) Left(0) Parent(#COM_OWNER) Showselection(False) Showselectionhilight(False) Tabposition(1) Top(0) Width(170)

Define_Pty Name(Value) Get(GetPropertyValue) Set(SetPropertyValue)

Ptyroutine Name(GetPropertyValue)
Define_Map For(*Output) Class(#AddressLine1) Name(#Property)
#Property := #Edit1
Endroutine

Ptyroutine Name(SetPropertyValue)
Define_Map For(*Input) Class(#AddressLine1) Name(#Property)
#Edit1 := #Property
Endroutine

Mthroutine Name(OnContextChanged) Options(*redefine)
If (#Context *Is #prim_evp)
#Edit1.ReadOnly := (#Context *As #prim_evp).ReadOnly
#Edit1.ShowError := (#Context *As #prim_evp).ShowError
Endif
Endroutine

Evtroutine Handling(#Edit1.Changed)
Signal Event(ValueChanged)
Endroutine

Evtroutine Handling(#Edit1.LostFocus)
#Edit1 := #Edit1.value.replace( 'a' 'A' )
#Edit1 := #Edit1.value.replace( 'e' 'E' )
#Edit1 := #Edit1.value.replace( 'i' 'I' )
#Edit1 := #Edit1.value.replace( 'o' 'O' )
#Edit1 := #Edit1.value.replace( 'u' 'U' )
Endroutine
End_Com
Added this VisualHost as a custom Visualization of my AddressLine1 field.

TestWebPage1 -- Has a Name Edit Box / Address1 (visualhost- Edit Box) / City Edit Box

Code: Select all

Begin_Com Role(*EXTENDS #PRIM_WEB) Layoutmanager(#TableLayout1)
Define_Com Class(#PRIM_TBLO) Name(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column1) Displayposition(1) Parent(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row1) Displayposition(1) Parent(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem3) Alignment(TopLeft) Column(#Column1) Flow(Down) Parent(#TableLayout1) Row(#Row1) Sizing(None) Margintop(10) Marginleft(20)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem6) Alignment(TopLeft) Column(#Column1) Flow(Down) Manage(#AddressLine1) Parent(#TableLayout1) Row(#Row1) Sizing(None) Margintop(10) Marginleft(20)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem1) Alignment(TopLeft) Column(#Column1) Flow(Down) Manage(#STD_TEXT) Parent(#TableLayout1) Row(#Row1) Sizing(None) Margintop(10) Marginleft(20)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem2) Alignment(TopLeft) Column(#Column1) Flow(Down) Manage(#STD_TEXT1) Parent(#TableLayout1) Row(#Row1) Sizing(None) Margintop(10) Marginleft(20)

Define_Com Class(#AddressLine1.Visual) Name(#AddressLine1) Displayposition(2) Parent(#COM_OWNER) Tabposition(2) Top(41) Left(20) Tabstop(True) Width(509)
Define_Com Class(#STD_TEXT.Visual) Name(#STD_TEXT) Componentversion(1) Displayposition(1) Height(21) Parent(#COM_OWNER) Tabposition(1) Top(10) Usepicklist(False) Width(509) Left(20) Caption('Name') Labeltype(Caption)
Define_Com Class(#STD_TEXT.Visual) Name(#STD_TEXT1) Componentversion(1) Displayposition(3) Height(21) Parent(#COM_OWNER) Tabposition(3) Top(72) Usepicklist(False) Width(509) Left(20) Caption('City') Labeltype(Caption)

End_Com

User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Visualizations - Visual Host & TabStop

Post by Stewart Marshall » Sat Apr 30, 2016 10:45 am

Sounds like a bug in VL to me.

Please report it to you regional support centre

Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au

Post Reply