Results 1 to 8 of 8

Thread: WebRegisterPath too inflexible

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Beekdaelen-Nuth, Netherlands
    Posts
    1,221

    Default WebRegisterPath too inflexible

    Hi All,

    DF19.1 introduced WebRegisterPath
    You need to add it to your webobject (cWebButton)

    I have two problems with it.
    - it gives an runtime-error during loading when the object referred to does not exist. Annoying but to overcome.
    - it is fixed. I have buttons that need to open different zoom objects depending on where i am on the screen. As far as i can see this is not possible. Am i wrong?

    Roel

  2. #2
    Join Date
    Feb 2009
    Location
    Birmingham, UK
    Posts
    1,232

    Default Re: WebRegisterPath too inflexible

    Quote Originally Posted by Roel Westhoff [W4] View Post

    - ... I have buttons that need to open different zoom objects depending on where i am on the screen. As far as i can see this is not possible. Am i wrong?
    You can do this. The only thing you cannot use in this case is NavigatePath.

    Use WebRegisterPath for all the different possible zooms that your button click might need to take you to, but then within OnClick, instead of NavigatePath (which is really just a nifty shorthand way of navigating where there's only one option) you go back to using Send NavigateForward (or whatever)

    Code:
    WebRegisterPath ntNavigateForward       oZoomOne
    WebRegisterPath ntNavigateForwardCustom oZoomTwo
    WebRegisterPath ntNavigateForwardCustom oZoomThree
    
    
    Procedure OnClick
        If (some condition) Begin
            Send NavigateForward of oZoomOne Self
        End
        Else if (some other condition) Begin
            Send NavigateForwardCustom of oZoomTwoSelf Self
        End
        Else Begin
            Send NavigateForwardCustom of oZoomThree Self
        End
    End_Procedure
    Last edited by Peter Bragg; 23-Jul-2019 at 07:28 AM. Reason: missing callback object in example
    "My wife thinks I over-analyse our marriage, which, to be frank completely contradicts the findings of my report." - @MooseAllain

  3. #3
    Join Date
    Feb 2009
    Location
    Beekdaelen-Nuth, Netherlands
    Posts
    1,221

    Default Re: WebRegisterPath too inflexible

    Hello Peter,

    Thank you for the new information.
    Could work although difficult in some situations

    Roel

  4. #4
    Join Date
    Feb 2009
    Location
    Beekdaelen-Nuth, Netherlands
    Posts
    1,221

    Default Re: WebRegisterPath too inflexible

    Hello Peter,

    As i said adding webregisterpath's is an option.

    But: I have a central placed button that executes a zoom from whatever location the program is in.
    In that case i shoud place ALL the zoom objects that are in the application (about 150).

    Code:
        Object oNewButton is a cW4WebMenuItem
            Set psCaption to "New"
            Set psCSSClass to "WebButtonIcon icon-u  icon-size-20-20 icon-font-size-20 icon-color-white"
            Set psToolTip to "New"
            
            WebRegisterPath nfNavigateForward oGDPRemployeeZoom
            WebRegisterPath nfNavigateForward oGDPRStatusZoom
            //etc. etc 
            
            Procedure OnClick
              Handle hoZoom
              Get phoZoom of ghoWebSessionManager to hoZoom
              Send NavigateForward to hoZoom Self
            End_Procedure
            
            Procedure OnGetNavigateForwardData tWebNavigateData ByRef NavigateData Handle hoToView
               Get NamedValueAdd NavigateData.NamedValues "task" "zoom" to NavigateData.NamedValues
               Move True to NavigateData.bNewRecord
            End_Procedure
            
        End_Object
    As you can see this is not really an option. Or is it?
    The button is placed in an (use) oActionGroup (cWebGroup) at the end of each SelectView

  5. #5
    Join Date
    Feb 2009
    Location
    Adelaide, South Australia
    Posts
    2,863

    Default Re: WebRegisterPath too inflexible

    Perhaps build a self registering option.

    The reason for registering a navigation is obviously security. With the deep linking, the user can determine the screens and records as they like, just by
    Playing with the url.

    The registration of valid navigations is what protects you from this.

    So what about having your zoom pages announce in want situations they can be navigated to (into a server struct array property) then have a mechanism that registers the navigation property in / near your button?
    Marco Kuipers
    DataFlex Consultant
    28 IT Pty Ltd - DataFlex Specialist Consultancy
    DataFlex Channel Partner for Australia and Pacific region
    Adelaide, South Australia
    www.28it.com.au

  6. #6
    Join Date
    Feb 2009
    Location
    Beekdaelen-Nuth, Netherlands
    Posts
    1,221

    Default Re: WebRegisterPath too inflexible

    Marco,

    MMM, sounds like a direction of a solution but not really a quick fix.

    Started the conversation so that DAW could see what kind of problems the webregisterpath command is producing.
    Hopefully they come up with a solution.

    Roel

  7. #7
    Join Date
    Feb 2009
    Location
    The Netherlands
    Posts
    4,674

    Default Re: WebRegisterPath too inflexible

    Marco explains it pretty well. The idea behind WebRegisterPath is that each process after starting up knows all possible navigation paths so that it can validate URL's and doesn't allow random paths to be generated by end users (which would be a security concern because in some cases data is constrained based on the path).

    So in your case you somehow need to register all these paths. An alternative to the command that might provide some flexibility is to use the RegisterNavigateForwardPath procedure. This procedure is private but likely to become public in future revisions. This procedure can be called when the view object and the invoking object are created (which is a limitation compared to the command) but can be called from inside functions / procedures. It should be called on the invoking view or the webapp object.

  8. #8
    Join Date
    Feb 2009
    Location
    Beekdaelen-Nuth, Netherlands
    Posts
    1,221

    Default Re: WebRegisterPath too inflexible

    Hallo Harm,

    Thanks for the tip on RegisterNavigateForwardPath. Works like a charm.
    You can put it in the documentation.

    Roel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •