B4J Tutorial [ABMaterial] PGMenuCard - A composite Component

Discussion in 'B4J Tutorials' started by Cableguy, Jun 10, 2019.

  1. Cableguy

    Cableguy Expert Licensed User

    Hi Guys,

    In a project I've recently started working, I saw the need to create a "Custom" component... But since ABMaterial already uses this denomination for ABMCustomComponents, I decided to call this one a "CompositeComponent", mainly because it just uses already available components and makes them work as one.

    This was created to be used as a MenuItem in a Grid Like Menu.

    It is Highly customizable, and has one event... "Click"...
    BUT, in order to be able to catch this event, some changes need to be done to the Page_ParseEvent;
    If eventName = "beforeunload" Then
    Log("preparing for url refresh")
            ABM.RemoveMeFromCache(ABMShared.CachedPages, ABMPageId)
    else If eventName = "page_rowclicked" Then '# This is the block that needs to be added
            Dim MenuItemName As String = Params.Get("target"'#
            If SubExists(Me, MenuItemName & "_Clicked"Then '#
                CallSub(Me, MenuItemName & "_Clicked"'#
                LogError(MenuItemName & "_Clicked Not Found"'#
            End If '#
        End If
    This is due to the fact that the Click event is being fired by a CELL and that at page level is cannot be "individualized"... BUT it can be filtered!

    I have Commented the Subs as accurately as possible, and it should be easy enough to use...

    I leave you with the Code Module, and will gladly answer any questions, and/or requests...
    More CompositeComponents will surely follow...

    Attached Files:

    Anser, alwaysbusy, XbNnX_507 and 3 others like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice