Announcement

Collapse
No announcement yet.

[SOLVED] Dynamic menus fail when specifying parameters

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] Dynamic menus fail when specifying parameters

    Hi NetMake team,

    I just encountered a fatal bug in your dynamic menu "functionality" (using the term a bit generously here - sorry, but figuring out a) how dynamic menus were supposed to work and b) just what the hell was messing with me cost me about 2 hours and my good mood).

    Documentation
    There is no current documentation that will tell you all the steps without errors. Could you please add another menu sample in the sample kit that works and demonstrates the process? The Macro help will hide some minor matters and the video has typos that make the posted code unworkable (The latter gave me the impetus I needed to make it work ... except when used with parameters).

    The Bug (tm)
    Passing any string calculations when calling sc_appmenu_add_item will fail.
    When setting the "parameter"-parameter to a variable a php-error will break the application.
    Static text will work just fine but defeats the purpose - I need to pass parameters dynamically.
    Now I went a little through the code and nailed down the issue. Made a few screenshots of the matter to help along, too (see attached pictures).

    Workarounds
    I know there are some workarounds that would work 'almost as well' (e.g.: grid with field-links or master/detail form).
    The problem is just that in opposite to the ideal of your menu functionality, my customer's requirements aren't dynamic at all. So I'd really appreciate it if this could be made to work again.

    Cheers,
    FWN

  • #2
    Hello fwn
    Thank you for your feedback I will analyse to validate your input in comparison with our docs.
    We are slowly improving the menu and we'll take this in consideration when its time to enhance it.

    Despite that, if you have any other suggestion for the menu app, leave it here and I'll give a look later.
    Thank you.
    Regards,
    Cavadinha

    Development Team
    Netmake - IT Solutions

    Comment


    • #3
      Hi Cavadinha,

      thank you for the response. As it currently stands, I'm fairly satisfied with the features of the menu app. What I'd really appreciate though would be ...

      Bugfixes
      Smoothen the developer experience by fixing the bugs. Most of the non-default stuff is difficult enough without having to fight bug-waves (especially with your own macros). Can't use dynamic parameters for dynamic menus. Can't directly pass output of sql for parameters anywhere without breaking stuff.
      Basically, I'd expect each of your macros to handle the following types of input equivalently without breaking:
      • Plain text (e.g.: "foo")
      • PHP Variables (e.g.: $example) <-- That particular broke dynamic menus for me
      • Local variables (e.g.: {rs[$int][0]}) <-- Doesn't work for any parameter when calling sc_appmenu_add_item
      • Global Variables (e.g.: [param_foo_bar])
      Going back to the specific bug I reported: By your kindness fix it fast, not "take this in consideration when it's time to enhance it". As it is, the entire feature is broken (= non-functional). This wasn't some obscure feature request but a report on a feature your documentation promises but your product doesn't deliver due to a trivial error when building the output php. It's mission critical for me to meet our customer's requirements and given the current error, finding the location where the code is miscompiled would probably be the greater part of the task, rather than fixing it.

      Cheers,
      FWN

      Comment


      • #4
        The ScriptCase Support was able to swiftly resolve this for me:
        The specific syntax to use was like this:
        sc_appmenu_add_item("menu_skills", $id, "", $label, "form_skill", param_skill_name = {skills[$int][0]}, "", $hint, "");
        That is, do not pass a string, ScriptCase will convert it into logic for you.

        I can't say I'd ever have considered this approach using the documentation (I have requested adding this or something like it to the examples for the macro).
        Oh well, all is well again and my application works.

        Comment

        Working...
        X