1. We suggest you do NOT update to Joomla 3.8.10 until we can resolve an issue it causes with caching in Fabrik. If you do install it, you'll need to disable Joomla's "System Cache" in the global System settings.
  2. Apologies for the recent server outage, a planned migration by our host provider to a new location turned into a bit of a nightmare.

[Solved] Reload Form?

Discussion in 'Standard Support' started by aijosh, Jul 13, 2018.

  1. aijosh

    aijosh Member

    Level: Standard
    I am running a php plugin onbeforeload on a form which might require the result to add a record into the same list of the form currently loading.

    In case data was added. I need the form to load the data just added.

    I cant get it to work unless I refresh the form.

    Is it possible to get the form to refresh before loading?
     
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    So are you loading a new form, with blank rowid, then potentially creating a new row which you then need to load?

    The way I've done this in the past is to redirect to the new page once I know the ID of the row I just inserted ...

    Code (Text):

    $rowid = $db->insertid();
    $this->app->redirect('index.php?option=com_fabrik&view=form&formid=123&rowid=' . $rowid);
     
    -- hugh
     
  3. aijosh

    aijosh Member

    Level: Standard
    Thanks,

    This works fine except it doesn't load the form in the current menu so all the modules on the page dont load.

    Is there a way to allow the reload on the same menu item (I dont want to hardcode the sef url - since it might change in the future)

    I added Itemid but it still doesn't load the sef version, you see the long url in the address bar and an entirely different view
     
    Last edited: Jul 14, 2018
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    Try ...

    Code (Text):

    $rowid = $db->insertid();
    $this->app->redirect(JRoute::_('index.php?option=com_fabrik&view=form&formid=123&Itemid=123&rowid=' . $rowid));
     
     
  5. aijosh

    aijosh Member

    Level: Standard
    No Luck.

    See resulting URL

    /component/fabrik/form/26/16?Itemid=243

    26 = form
    16 = row
    243 = menu
     
  6. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    Hmmm, that should work, if that Itemid exists. Nothing to do with Fabrik, that's J!'s main JRoute::_(), which is what we (and ever6y other J! extension) calls to get SEF'ed links, with or without an Itemid.

    Did you definitely use an upper case I on Itemid?

    -- hugh
     
  7. aijosh

    aijosh Member

    Level: Standard
    Yes. Definitely.

    Its fixed though.

    Sorry I forgot to mention it was a menu item alias (If that would have helped. I dont know)

    I used the itemid for menu this alias was pointing to and it works now. Although the URL is still not the SEF url but it gets me the correct menu item

    Thanks
     
    Last edited: Jul 16, 2018 at 11:50 PM

Share This Page