How to preprocess data form before save from backend joomla module?

119 views
Skip to first unread message

Alejandro Arroyave

unread,
Mar 24, 2018, 1:45:45 PM3/24/18
to Joomla! General Development
Hello,

I have a module with a form and a field with a JSON structure and I want that to when click to button save, a part of JSON structure is stored in a table and other part of JSON structure is stored in other table. So, the question is: How to store the form data when the Save button is clicked from admin or backend in another tables different to #_extensions? 

Is there any way to override or overwrite the Save function, similar to the behavior of the plugins?

Thanks for help.
Joomla Module process data before to save.png

Maciek Wołpiuk

unread,
Mar 24, 2018, 3:23:12 PM3/24/18
to joomla-de...@googlegroups.com
Hello

U can use function for save data in way U need. Just write in controller and add task to button.

in view.html.php

Define task for button save - 
JToolbarHelper::save('booking.save');

In controller write function save - public function save($key = NULL, $urlVar = NULL) {}

Sins
Mac


Wolny od wirusów. www.avast.com

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send email to joomla-dev-general@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

Alejandro Arroyave

unread,
Mar 24, 2018, 3:44:28 PM3/24/18
to Joomla! General Development
But I work in a module, only have a entrypoint file, a helper class and xml module manifest. 

I don't understand how to use your answer. Do you can explain me how to implement it in a module?

Thank you,

El sábado, 24 de marzo de 2018, 14:23:12 (UTC-5), Maciej Wołpiuk escribió:
Hello

U can use function for save data in way U need. Just write in controller and add task to button.

in view.html.php

Define task for button save - 
JToolbarHelper::save('booking.save');

In controller write function save - public function save($key = NULL, $urlVar = NULL) {}

Sins
Mac


Wolny od wirusów. www.avast.com
2018-03-24 18:45 GMT+01:00 Alejandro Arroyave <alejandro...@ximware.com>:
Hello,

I have a module with a form and a field with a JSON structure and I want that to when click to button save, a part of JSON structure is stored in a table and other part of JSON structure is stored in other table. So, the question is: How to store the form data when the Save button is clicked from admin or backend in another tables different to #_extensions? 

Is there any way to override or overwrite the Save function, similar to the behavior of the plugins?

Thanks for help.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send email to joomla-de...@googlegroups.com.

Maciek Wołpiuk

unread,
Mar 24, 2018, 3:51:26 PM3/24/18
to joomla-de...@googlegroups.com
Hello

Now I see that U use module.

If I good remember modules couldnt save any data. Module send data or read data from/to component. Im right?

So u must use component to save data from module.

Sins
Mac


2018-03-24 20:44 GMT+01:00 Alejandro Arroyave <alejandro...@ximware.com>:
But I work in a module, only have a entrypoint file, a helper class and xml module manifest. 

I don't understand how to use your answer. Do you can explain me how to implement it in a module?

Thank you,

El sábado, 24 de marzo de 2018, 14:23:12 (UTC-5), Maciej Wołpiuk escribió:
Hello

U can use function for save data in way U need. Just write in controller and add task to button.

in view.html.php

Define task for button save - 
JToolbarHelper::save('booking.save');

In controller write function save - public function save($key = NULL, $urlVar = NULL) {}

Sins
Mac


Wolny od wirusów. www.avast.com
2018-03-24 18:45 GMT+01:00 Alejandro Arroyave <alejandro...@ximware.com>:
Hello,

I have a module with a form and a field with a JSON structure and I want that to when click to button save, a part of JSON structure is stored in a table and other part of JSON structure is stored in other table. So, the question is: How to store the form data when the Save button is clicked from admin or backend in another tables different to #_extensions? 

Is there any way to override or overwrite the Save function, similar to the behavior of the plugins?

Thanks for help.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsubscribe@googlegroups.com.
To post to this group, send email to joomla-de...@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send email to joomla-dev-general@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages