We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1778
    • 659 Posts
    Hello
    Basic question I suppose : when exactly is 'fired' the modObjectUpdateProcessor ?


    I have a grid, and an update window (as usual)... I need to prefill my update window with values from related objects...
    To add a bit of complexity some of these related values are checkboxes dynamically generated from the other table in the many to many relationship....And of course I would like them to be prechecked if needed

    In my processor I tried 'initialize' and 'beforeSet' but all of these methods seem run only on the save of the window... So how can I prefill my update window with value not directly in the updated item ?

    Hope someone could help me on this...
    Cheers
      • 4172
      • 5,888 Posts
      with MIGXdb this would be easy done.
      you would use a checkbox-TV-type with @EVAL-binding to fill the options and get the related-table stuff by the field-processor (which creates the form for the create/update-window and sends the values to it)
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 33976 ☆ A M B ☆
        • 571 Posts
        Anso,

        AFAIK your pre-filled data come from the grid one (data).
        So i would join/query/load those related data in your getList processor (used by the table).

        Another option could be to create a new action/panel instead of a window (and a "get" processor in which you would load all those related data).

        Hope that makes sense & will help wink
          • 1778
          • 659 Posts
          Thanks Romain,
          You're probably right ... I'll try...
          Thanks
            • 40309
            • 1 Posts
            Hello, I'm having a similar issue with filling in the forms in the update window. When I first click on the update button, and the window pops up, nothing is filled in. But if I close out of the window, and then reopen it (without refreshing the page), all the fields fill in. My window is using the modx-tabs, and if I get rid of that, then the form prefills the fields properly every time, but when I add the tabs back in to the window, they don't prefill properly. What would be a possible issue of this happening?

            Thank you.
              • 1778
              • 659 Posts
              Hi
              This is probably because the modx-update-window 'preload' a panelForm.form with the prefilled values of the passed object (data passed from the grid as said Romain).
              modx-tabs, also preload a formPanel inside each tab, so when you add a tab, the form where you want to prefill your datas is not anymore the 'update-window-form'....
              Cheers
                • 1778
                • 659 Posts
                Romain you were right ! thanks again... I achieved what I wanted, by passing my checkboxes in my 'grid data object', put an 'html' part in my form with the checkboxes and voilà ^_^