Form in a Joomla Module - html

Is it a good idea to put a none-AJAX form into a Joomla module and process the form not in a component's controller but in the module itself? Is there a cooking recipe for this?

That's completely fine.
Components shouldn't use used to process a modules data, unless the module has been specifically developed to be part of the component.
Take com_users for example. This component is used to do all processing for registration, login, logout, profile and reminder/reset of passwords. The login module then simply displays the form and performs a few checks.

Related

How can I pass a data element that has been bound on one HTML file to another HTML file in an AngularJS app

I am using this statement in the Index.html file to bind the element: Show Products.
I see that is is bound in the Index fie by displaying its value there. But when the products1.html file opens, the bound field does not display. I want to use it in as a placeholder in an input box in products1.html.
I am thinking of re-creating index.html as an SPA, but not sure this will work. if I add products1.html as a template into the view. I expect I might have the same problem.
Yes I am a Angularjs newbie after 2 years of experience.
Assuming that you have different controllers for the two pages, it seems that your problem is that you are not sharing the data between those controllers. Each of the controllers define a scope. It looks like the information that you want to show is well loaded in the "Index.html" controller scope, but then is not passed to the "products1.html" controller. If that is the case, there is several solutions to share data between Angular controllers:
Using services
Using $state.go services
Using stateparams
using rootscope
You can check how to do it in: Share data between AngularJS controllers

When to create a module in Yii2 Advanced template?

I am little confused before starting a new project in Yii2 advanced template. So, i am asking this question.
I have done some projects in "Yii2 basic" app in which we use modules for different parts of our application like for adminpanel, api we create different folders in 'modules folder'.
I had also done a project in Yii2 advanced template it was multiapp project so we used advanced template. As we already had 'backend' and 'frontend' separated in Yii2 advanced template so we didn't created any module in 'modules' folder.
Now, i want to ask what is right approach. like in my new project we have users and products in backend so is it appropriate to create different modules for them in 'modules' folder or will it be ok if i create there controllers and models directly in backend folder.
what are the advantages of using modules folder in advanced template?
Thanks for answers in advance.
The advantage of module's use is primarly the possibilities of a resue of this components in several diffferente project. you can easly separate you common repetative functionalities in several modules and use the same code in different prject indipendently of the "template" or scaffolding you use for the single applicazione or group of applications.
Do the fact the modules are self-contained software units that consist of models, views, controllers, and other supporting components
modules are, not only usable as a sort of mini-applications, but also as a easy way for code organization and reuse.
Modules are used to reduce our work.
Example:
In most of projects have user login function like login , signup ,
forget passsword ,password reset.
If you write code for these functions as module . You can use any
project
So there is know need to write one code again and again.

How load and access yii2 modules dynamically in Frontend?

I have module stored in /common/modules/gopay/GopayModule.php and I am dynamically loading it via Yii::$app->setModule('gopayModule', ['class' => '\common\modules\gopay\GopayModule']); in CommonController which is child of yii\web\Controller and parent of all my FE and BE controllers.
I did not put any configuration for module into config files as Im loading it dynamically.
How can I access this module from frontend, so that it creates application based on FE config and so on? What decides which part of Yii2, BE or FE should be called when calling module route? Traditional routes as /index.php?r=gopayModule/default/index or /gopayModule/default/index are not working even when url manager is none.
thx :)
:D easy peasy, I was setting module late, I changed code to load/set module in my CommonRequest class init() method and everything working like a charm, so logically I need to load module before UrlManager is processing URL ;-)

Recording UI performance of Applet on a webpage

I have created an applet which is a java swing based messenger which runs fine on browsers. Now i have to host this applet on a webpage and allow users to test my applet. I need to record time they take for each task using the messenger and and the errors they commit. After the study is complete the user has to be displayed the time and the no of errors.
I am not able to figure out how to record times for each task that the user has to do in my messenger application. one way would be to record time on click of right buttons I can do it programmatically in Java Swing for correct click on buttons, but how do i send this info to HTML Page from an applet.
I don't have any clue how i would capture errors.
Suggestions needed
For storing exception and the info you can use a Logger.
From doc,
A Logger object is used to log messages for a specific system or application component.
So when you get any exception write it to the Logger file. It has all the set of required methods to log the information.
Example:
When you are entering a method use Logger.entering to log the method entry. Similarly you have to write all the actions using respective methods provided by Logger class which may either be message or exceptions or errors which ever you want to show to the user through this log file.
P.S: We use it in our application and it is very handy.

Send custom event from one module to another module (Parsley)

I have created a modular application. I have two modules, for example Module1 and Module2.
I have loaded these modules in my application. I am using Parsley in my application. I have loaded separate different context builder in both modules.
But when I am dispatching event from Module1, I am able to listen that event in that Module1 but I am trying to listen that event in another Module2. I am not able to listen that event in that Module2 through Parsley. Please help me.
I think it has something to do with you loading 2 different contexts for each module. Art gave out a really good tutorial on the matter: Art's Flex Notes - Nested Contexts.
I had done it by settings same application domain of all the modules...