How do I communicate between two modules in GWT - gwt

Hi I am currently facing communicating with two GWT modules.
1. enquiry.html
2. info.html
In enquiry.html i have search results on click of a hyperlink I need to open the info module. Its working fine in my development environment, but when I deploy in linux its causing issue.
Basically when the info.html is loading up, its not able to identify the info.nocache.js
Any help will be highly appreciated.

You can put parameters on the URL, like info.html?resultId=432001
Then, in your code, you can access resultId with
String resultId = com.google.gwt.user.client.Window.Location.getParameter("resultId");

Related

Material UI Tabs not rendering properly on server

I am having a problem using the "Tabs" component: https://material-ui.com/components/tabs/ In fact, when developing locally, the rendering of the component is fine. But pushing to the server, it looks weird (with differences in the borders on each side of the bar).
Moreover: when refreshing the page in which it has been embedded or browsing manually to this page, the whole template is broken all of a sudden!
I tried generating a build folder locally and launching the page from that build, and fell back on the same problem.
Thank you in advance for your help
From your description, I saw that your "build" is not work even in local development. That's mean it should not work on the production, of course.
The thing is, what is your actual "build" action? Depends on what library/framework you use, but basically with Material-UI, most popular problem comes from not load some CSS before using it's components.
Please read here first: https://material-ui.com/guides/server-rendering/#server-rendering
Just in case you use Gatsby, read here: https://www.gatsbyjs.org/packages/gatsby-plugin-material-ui/.
I'm using Gatsby and use this following config to fix some CSS issues.
stylesProvider: {
injectFirst: true,
}
Hope this help.

Get WebdriverIO multi-remote to work with Cucumber BDD

I am able to start multiple browser sessions in a single test using WebDriverIO's multiremote with mocha.
Next I'm trying to get WebDriverIO multiremote work with Cucumber BDD. My feature definition is simply to open a browser session and navigate to a url.
Here's my simple WDIO
Problem - the browser opens up but navigation does not occur. I have tried to enable the debugger and observe node-inspector but hasn't helped. What am I missing? Thanks for all the help.
My goal was to conduct multi-user scenario based testing through BDD. Although I haven't been able to resolve this directly via WebDriverIO I found Chimp (which uses WebDriverIO underneath) has its own flavour of session based automation.
Chimp's multi-browser testing does exactly what I wanted. Problem solved!
I'm able to write scenarios such as this without explicitly switching the user context.
Scenario: Able to browse independently
Given Alice goes to "/features"
And Bob go to "/bugs"
Then Alice sees "10" features
And Bob sees "1" bugs

External access to Magento instances

I've started investigating alternatives to my project and a few questions came out that I couldn't answer by myself.
The problem is: I want to create a web page able to access multiple Magento instances installed in the same server. Currently, I have one Magento instance per client and this project will access several Magneto instances to export reports from each one (for example).
The alternatives I thought til this moment are:
Have another Magento instance, create a new module within it that changes its 'database target' before triggering operations/queries;
Questions until this moment:
Can I 'change the database target' of a Magento instance?
How can I access data from a Magento instance without appeal to SOAP/REST?
I want to re-use some components (grids, tabs, forms..) from Magento, that's why I'm not considering an independent project (Zend, for instance) that can access this code from another projects. Does it make sense?
Any other idea?
==Edited==
Thanks by the tips and sorry by my ignorance. The comments let me believe that I'm able to execute something like this:
// File myScript.php
require '/home/DOMAIN1/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN1
require '/home/DOMAIN2/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN2
Is it right? Can I execute require twice (and override things from first require)?
==Edited2==
I'm still trying to connect to several Magento instances from a single third party file. Is there any tip? I'm facing several/different errors at this moment.
The only thing I know is that I can still rely on SOAP to get the information I need, but this will be expensive.
Thanks!
The easiest way would be to include Mage.php from each shop instance. You would need to use namespaces or some other trickery to be able to load more then one.
Or if that doesn't work - make your own API in a separate file to get what you want from one shop, and combine the results in the PHP-file that calls the API.
Here's a sample on how to use Magento functionality outside of Magento:
require 'app/Mage.php';
if (!Mage::isInstalled()) {
echo "Application is not installed yet, please complete install wizard first.";
exit;
}
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
// your custom code here, for example, get the product model..
$productModel = Mage::getModel('catalog/product');

LoadRunner and wicket application

Doing some research with regards to application framework used on the SUT am going to LoadTest using Loadrunner I fond the application is developed using wickets.
I have generated script using web http/html protocol against a wicket
application and there was some calls recorded in the following
format,script is failing at this URL when i ran the script in VUGen.
http://somem/nnnweb/main/ ?
wicket:interface= :1:someSearchForm :someSearchForm :searchInfo: :IActi
vePageBehaviorListener :0:&wicket: ignoreIfNotActiv e=true&random=
0.038901654740178815",
I find out like when i generate the script which has just views(
viewing tabs) is working fine, but when i edit somefileds and submit
the script is generating the above calls ( http://xxx...) and failing
This guy has explained just the same issue here:
http://tech.groups.yahoo.com/group/LoadRunner/message/27295
I hope it is ok to refer other sites in Stackoverflow?
General question. Does loadrunner support testing of wicket application and is TruClient the best choice here? I actually got it to work with TruClient, but as I understand there are drawbacks with memory footprint using TruClient, but maybe it is time to move on to next generation protocol given my project has decided to use wicket framework?

Grails + GWT - using the same Date Format

I am developing an app using Grails and GWT for a client side.
I want to use the same date format both on the client side and on the server side (preferably defined in one file).
So far i've understood that Grails got it's own mechanism for internationalization (grails-app/i18n). I know i can access these messages from any server code using app context.
I can also access any resource file inside web-app directory.
For the client side, i can use ConstantsWithLookup interface and GWT.Create(...) to get an instance of it.
But, i still haven't found good solution to integrate these two together, so i have date format defined in one place. Any ideas or tips?
Thanks,
Sergey
After digging into Grails more, i came to a solution.
I've put constant into .properties file under grails-app/i18n.
Then, i hook to eventCompileEnd and i copy resources from grails-app/i18n to specific package in target\generated-sources.
After this step is completed, i generate google I18N interfaces using copied property files.
I've put this functionality to separate plugin.
_Events.groovy:
includeTargets << new File("${myPluginDir}/scripts/_MyInternal.groovy")
eventCompileEnd = {
internalCopyMessageResources();
}
eventCopyMessageResourcesEnd = {
generateI18NInterface();
}
Now it is possible to access localized data from server side and from client side.