Skip to content

Instantly share code, notes, and snippets.

View jyoung's full-sized avatar

Joe Young jyoung

View GitHub Profile
@jyoung
jyoung / TOH Navigation Bar Click
Created March 15, 2018 16:18
LANSA Tour Of Heroes Navigation Bar Click Event
evtroutine handling(#NavigationBarPanel.Clicked) view(#pView)
#ApplicationController.NavigateTo( #pView )
endroutine
@jyoung
jyoung / TOH Show View
Created March 15, 2018 16:16
LANSA Tour Of Heroes Show View
mthroutine name(ShowView)
define_map for(*INPUT) class(#PRIM_ALPH) name(#pViewId)
define_com class(#PRIM_ALPH) name(#lPreviousViewId)
if (#mViews<#pViewId> *Is *NULL)
#SYS_WEB.Alert( ("Missing &1").Substitute( #pViewId ) )
return
endif
@jyoung
jyoung / TOH Copy Parameters
Created March 15, 2018 16:14
LANSA Tour Of Heroes Copy URL Parameters
* copy known query parameters to the navigation parameters
for each(#lParameter) in(#SYS_WEB.URLParameters)
case of_field(#lParameter.Name.UpperCase)
when (= TRACE)
#mParameters<#lParameter.Name> := #lParameter.Value
when (= DEVELOPER)
#mParameters<#lParameter.Name> := #lParameter.Value
when (= DEBUG)
#mParameters<#lParameter.Name> := #lParameter.Value
@jyoung
jyoung / TOH Url Changed
Created March 15, 2018 16:11
LANSA Tour Of Heroes URL Changed Event
evtroutine handling(#SYS_WEB.URLChanged)
define_com class(#PRIM_ALPH) name(#lViewId)
#lViewId := #ApplicationController.GetURLParameter( VIEW ).UpperCase
#SYS_APPLN.TraceMessageText( ("URL Changed. View: &1").Substitute( #lViewId ) )
if (#lViewId = *BLANKS)
#lViewId := TOHDSHP01
endif
@jyoung
jyoung / TOH Web Page View Panels
Created March 13, 2018 20:31
LANSA Tour Of Heroes Pt 2 View Panel Definitions
* =====================================================================================
* VIEW PANELS
* =====================================================================================
define_com class(#DashboardViewPanel2) name(#DashboardPanel) parent(#ViewContainerPanel) visible(False) displayposition(2) tabposition(2)
define_com class(#HeroesViewPanel2) name(#HeroesPanel) parent(#ViewContainerPanel) visible(False)
define_com class(#HeroDetailViewPanel2) name(#HeroDetailPanel) displayposition(3) parent(#ViewContainerPanel) visible(False) tabposition(3)
@jyoung
jyoung / TOH Web Page Create Instance
Last active March 13, 2018 20:29
LANSA Tour Of Heroes Pt 2 Adding Views to Collection
evtroutine handling(#COM_OWNER.CreateInstance)
#mViews<TOHDSHP01> <= #DashboardPanel
#mViews<TOHHROP01> <= #HeroesPanel
#mViews<TOHHROP03> <= #HeroDetailPanel
endroutine
@jyoung
jyoung / TOH Navigation Bar
Created March 13, 2018 20:10
LANSA Tour Of Heroes Pt 2 Navigation Bar
function options(*DIRECT)
begin_com role(*EXTENDS #PRIM_PANL) displayposition(1) height(57) left(0) tabposition(1) top(0) width(500) layoutmanager(#MainPanelLayout)
* =====================================================================================
* LAYOUTS
* =====================================================================================
define_com class(#PRIM_TBLO) name(#MainPanelLayout)
define_com class(#PRIM_TBLO.Row) name(#LayoutRow1) displayposition(1) parent(#MainPanelLayout)
define_com class(#PRIM_TBLO.Column) name(#LayoutColumn1) displayposition(1) parent(#MainPanelLayout)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem1) alignment(CenterLeft) column(#LayoutColumn1) manage(#DashboardLabel) parent(#MainPanelLayout) row(#LayoutRow1) sizing(ContentWidth) flow(Right) marginbottom(5) marginleft(5) marginright(5) margintop(5)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem2) alignment(CenterLeft) column(#LayoutColumn1) manage(#HeroesLabel) parent(#MainPanelLayout) row(#LayoutRow1) sizing(Co
@jyoung
jyoung / TOH Heroes View Panel
Created March 13, 2018 20:09
LANSA Tour Of Heroes Pt 2 Heroes View Panel
function options(*DIRECT)
begin_com role(*EXTENDS #ViewPanel) style(#Style1) layoutmanager(#Layout1)
define_com class(#PRIM_VS.Style) name(#Style1) borderbottom(1) borderbrush(#Brush1) borderleft(1) borderright(1) bordertop(1)
define_com class(#PRIM_VS.SolidBrush) name(#Brush1) color(0:255:58)
define_com class(#PRIM_TBLO) name(#Layout1)
define_com class(#PRIM_TBLO.Row) name(#LayoutRow1) displayposition(1) parent(#Layout1)
define_com class(#PRIM_TBLO.Column) name(#LayoutColumn1) displayposition(1) parent(#Layout1)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem1) alignment(TopLeft) column(#LayoutColumn1) manage(#Label1) parent(#Layout1) row(#LayoutRow1) sizing(None)
@jyoung
jyoung / TOH Web Page
Created March 13, 2018 19:56
LANSA Tour Of Heroes Pt 2 Web Page
begin_com role(*EXTENDS #PRIM_WEB) layoutmanager(#MainPanelLayout) theme(#PrimaryTheme)
* =====================================================================================
* STYLES
* =====================================================================================
define_com class(#PRIM_VS.Style) name(#Style1) borderbottom(1) borderbrush(#Brush1) borderleft(1) borderright(1) bordertop(1)
define_com class(#PRIM_VS.SolidBrush) name(#Brush1) color(2:255:30)
* =====================================================================================
* LAYOUTS
* =====================================================================================
@jyoung
jyoung / TOH Dashboard View Panel
Last active March 13, 2018 19:56
LANSA Tour Of Heroes Pt 2 Dashboard View Panel
function options(*DIRECT)
begin_com role(*EXTENDS #ViewPanel) style(#Style1) layoutmanager(#Layout1)
define_com class(#PRIM_VS.Style) name(#Style1) borderbottom(1) borderbrush(#Brush1) borderleft(1) borderright(1) bordertop(1)
define_com class(#PRIM_VS.SolidBrush) name(#Brush1) color(0:15:255)
define_com class(#PRIM_TBLO) name(#Layout1)
define_com class(#PRIM_TBLO.Row) name(#LayoutRow1) displayposition(1) parent(#Layout1)
define_com class(#PRIM_TBLO.Column) name(#LayoutColumn1) displayposition(1) parent(#Layout1)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem1) alignment(TopLeft) column(#LayoutColumn1) manage(#Label1) parent(#Layout1) row(#LayoutRow1) sizing(None)