[Solved] Reload Form?

aijosh

Member
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?
 
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:
$rowid = $db->insertid();
$this->app->redirect('index.php?option=com_fabrik&view=form&formid=123&rowid=' . $rowid);

-- hugh
 
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:
Try ...

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

See resulting URL

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

26 = form
16 = row
243 = menu
 
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
 
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:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top