Phone Number Link

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
gstenstrom
Posts: 17
Joined: Thu Feb 16, 2017 8:35 am

Phone Number Link

Post by gstenstrom » Sat Dec 08, 2018 3:38 am

I have a Phone Number Field with a Reusable Part for the Visualization. It is setup as the default.
The Reusable Part displays the phone number in a Html container so it can be clicked within a mobile app and call the number.
'<a href="tel:' + #Value + '">' + #Value + '</a></div>'

This works okay if I put the field on a normal panel but doesn't work if I use it in a list. The number shows, but the link to call it from the phone app doesn't show.

Do I have the #PRIM_MD.ListLabel defined correctly or do I need to do something special with that?
Has anyone else got a phone number to be called from a list?

Glynn

Resusable Part OC_RP_Field_Phone

Code: Select all

Function Options(*Direct)
Begin_Com Role(*EXTENDS #PRIM_PANL) Defaultpty(PhoneNumber) Displayposition(1) Left(0) Tabposition(1) Top(0) Width(400) Layoutmanager(#Layout1) Height(23)

Define_Com Class(#PRIM_TBLO) Name(#Layout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column1) Displayposition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row1) Displayposition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem1) Alignment(TopLeft) Column(#Column1) Manage(#lbPhone) Parent(#Layout1) Row(#Row1) Sizing(None) Flow(Right) Margintop(2)
Define_Com Class(#PRIM_TBLO.Item) Name(#Layout1Item1) Manage(#htlmPhone) Parent(#Layout1) Row(#Row1) Sizing(FitToHeight) Column(#Column1) Alignment(TopLeft) Flow(Right)

Define_Com Class(#PRIM_LABL) Name(#lbPhone) Displayposition(1) Ellipses(Word) Height(21) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(2) Verticalalignment(Center) Width(150) Caption('Phone')

Define_Com Class(#PRIM_VS.Style) Name(#NoBorders) Borderbottom(0) Borderleft(0) Borderright(0) Bordertop(0) Backgroundbrush(#NoBordersBGBrush)

Define_Com Class(#PRIM_WEB.HtmlContainer) Name(#htlmPhone) Description('Phone Line') Displayposition(2) Height(23) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Width(171) Left(150)

Define_Com Class(#PRIM_VS.SolidBrush) Name(#NoBordersBGBrush) Color(Transparent)
Define_Com Class(#STD_PHONE) Name(#PhoneNbr)

* -----------------------------------------------
* Define Extra Call Property
* -----------------------------------------------
*
Define_Pty Name(CurrentCaption) Set(SetCurrentCaption) Help('Set the Caption')
*
Define_Pty Name(PhoneNumber) Get(getValue) Set(setValue) Help('Set Phone Number')

* -----------------------------------------------
* Define Event Routines
* -----------------------------------------------

* -----------------------------------------------
* Property Routines
* -----------------------------------------------
Ptyroutine Name(SetCurrentCaption)
Define_Map For(*Input) Class(#STD_NAME) Name(#Property)
#lbPhone.Caption := #Property
Endroutine


Mthroutine Name(setLabelCaption)
Define_Map For(*Input) Class(#STD_NAME) Name(#lblName)
#lbPhone.Caption := #lblName.Value
Endroutine

Ptyroutine Name(setValue)
Define_Map For(*Input) Class(#STD_PHONE) Name(#Value) Help('Anchor Phone')
#htlmPhone.Html := '<a href="tel:' + #Value + '">' + #Value + '</a></div>'
#PhoneNbr := #Value
Endroutine

Ptyroutine Name(getValue)
Define_Map For(*Output) Class(#STD_PHONE) Name(#Result) Help('Value of Phone Number')
#Result := #PhoneNbr
Endroutine

* -----------------------------------------------
* Method Routines
* -----------------------------------------------
Mthroutine Name(setLabelWidth)
Define_Map For(*Input) Class(#STD_INT) Name(#lblWidth)
#lbPhone.Width := #lblWidth.Value
Endroutine

End_Com
Field Visualization for OC32_PhoneNbr1

Code: Select all

*
Begin_Com Role(*EXTENDS #PRIM_OBJT)

Begin_Com Role(*Visual #PRIM_EVEF) Name(#VisualEdit) Usepicklist(False) Componentversion(1) Height(21) Width(458)

End_Com

Begin_Com Role(*Visual_Part #OC_RP_Field_Phone) Name(#VisualLink) Defaultvisual(True)

End_Com
End_Com
List

Code: Select all

* Controls - List
Define_Com Class(#PRIM_MD.List) Name(#List) Displayposition(2) Layoutmanager(#LayoutList) Left(0) Parent(#COM_OWNER) Rowheight(92) Tabposition(1) Top(0) Height(449) Width(633)
Define_Com Class(#PRIM_MD.ListIcon) Name(#ListImage) Displayposition(1) Icon('account_box') Left(20) Parent(#List) Tabposition(1) Top(21) Height(50) Width(50) Themedrawstyle('MediumTitle+Rounded')
Define_Com Class(#PRIM_MD.ListLabel) Name(#ListOC32_Name) Caption('Name') Displayposition(2) Height(20) Left(86) Parent(#List) Tabposition(4) Top(6) Width(531) Source(#OC32_Name)
Define_Com Class(#PRIM_MD.ListLabel) Name(#ListOC32_Class) Caption('Class') Displayposition(4) Height(20) Left(86) Parent(#List) Tabposition(5) Top(26) Width(531) Source(#OC32_Class) Themedrawstyle('ForegroundSecondary')
Define_Com Class(#PRIM_MD.ListLabel) Name(#ListOC32_Subclass) Caption('Sub-Class') Displayposition(5) Height(20) Left(86) Parent(#List) Tabposition(6) Top(46) Width(531) Source(#OC32_Subclass) Themedrawstyle('ForegroundSecondary')
Define_Com Class(#PRIM_MD.ListLabel) Name(#ListOC32_PhoneNbr1) Caption('Phone') Displayposition(6) Height(20) Left(86) Parent(#List) Tabposition(2) Top(66) Width(531) Source(#OC32_PhoneNbr1) Themedrawstyle('ForegroundSecondary')

Post Reply