Yodlee UI closing issue - vuejs2

I'm using the yodlee for some developing purposes for my ongoing project with nuxtjs 2.I cannot close the rendered Yodlee UI by clicking the close button in top of the yodlee page. However, the back button is working as expected after selecting a bank.
The initial page
After selecting a bank and its working(the go back which is in the top of the left side)
Even no console errors and I just tried with the class of the a tag related to the button below
mounted() {
let fastLinkCloseBtn = document.getElementsByClassName(
'icon-link close-icon'
)
if (fastLinkCloseBtn) {
console.log('working')
fastLinkCloseBtn.onClick = window.fastlink.close()
} else {
console.log('not working')
}
},

Related

react-native re - ender component by clicking a button from another component

I have a list of interventions on my "first page". When I click on one, I navigate to its details, "second page", and there, is a button that allows me to start the events. When I click on that button it fills an object from a route : api/current
{
"interventionSummary": {some object}
}
When there's no intervention started :
{
"interventionSummary": null
}
When an intervention is started, it should be ended too so if the users doesn't I want to show a reminder message in the interventions list ("page 1") using: if interventionSummary !== null -> display the message to remind to end the intervention.
The problem is that my object interventionSummary is not updated when I go back on my interventionsList, unless I reload. For another page I was able to use :
this.props.navigation.addListener('focus', doStuff);
But the button and the route used were in the same page. I have tried, forceUpdate, simulate a state change : this.setState({state : this.state}) from solution on google, but nothing is working, I don't know how to make the component interventionsList see the update, or just re render after the click on the "second page"...
I hope that's clear, if anyone knows a way to do that
in your first page create your function.
myMethod() {
//function i want to call in second page
}
in your first page when navigating to second page(in my case when user presses a button) pass a function as a parameter like below:
onPress={() => this.props.navigation.navigate('SecondPage', {
rerenderOutputTitles: () => this.myMethod(),
})}
then in second page call this method wherever you want like below:
this.props.navigation.state.params.rerenderOutputTitles();

Filling form fields of a webpage opened in a web view with React Native

I'm working on a project that includes a module that helps with electricity recharge, so what happens is that the user's data is already saved in the app and when they choose to recharge, the app opens up this webpage in a web view.
Currently, I'm using WebBridgeView for opening the webpage as:-
render() {
return (
<WebViewBridge
ref="webviewbridge"
onBridgeMessage={this.onBridgeMessage.bind(this)}
source={{uri: "https://currencypin.com/PrepaidMeterPaymentsV2.0/cartwiz?c=IN&p=5&pm=tm"}}/>
);
}
}
Now, what I want is that when the webpage opens, the form fields come prefilled with the custom data that I have. So that the only field that the user needs to fill on the page is the CAPTCHA.
I was following this article for achieving the same, but it actually assumes that the website is customizable. Which is not possible in my case because it belongs to a 3rd party vendor.
What are the ways to achieve this?
You have to use the injectedJavaScript prop from WebView.
First declare a jsCode variable:
const amount = 2
const jscode = `
if (document.getElementById('txtAmount') == null) {
// field not existing, deal with the error
} else {
document.getElementById('txtAmount').value = '${amount}';
}
`
Please notice the " ` " character. Used to put variables in strings.
Then use it like so:
<WebViewBridge
ref="webviewbridge"
onBridgeMessage={this.onBridgeMessage.bind(this)}
injectedJavaScript={jsCode}

WHMCS how can I conditionally hide the primary navigation bar on the top of the client pages?

I am developing a web site selling web hosting and domain registration so I am using WHMCS but I am facing a problem I want to make a custom page under WHMCS directory to allow the admin user to change product's details without showing the top navigation bar which created by WHMCS.
Not sure by Admin user, but if you mean you want to remove the primary menu from client area, add this code to a php file inside: whmcs_dir/includes/hooks (say nomenu.php)
add_hook('ClientAreaNavbars', 1, function ()
{
// Get the current navigation bars.
$primaryNavbar = Menu::primaryNavbar();
$secondaryNavbar = Menu::secondaryNavbar();
$children = $primaryNavbar->getChildren();
if (!is_null($children)) {
foreach ($children as $child) {
$primaryNavbar->removeChild($child);
}
}
$children = $secondaryNavbar->getChildren();
if (!is_null($children)) {
foreach ($children as $child) {
$secondaryNavbar->removeChild($child);
}
}
});
Also, add css code to hide the menubar remaining after removing the items:
#main-menu {display: none}
One note though: even if you hide the menu items, if logged in user knows the page link, which is not secret, he can type the URL directly in the address bar to visit it.
For example, to access my domains page in whmcs: http://whmcs-url.com/clientarea.php?action=domains
Your option to have better control is to check the API functions.

Clicking 'back' on a form unloads web resource

Say I have a form with a web resource on it, when viewing the form and clicking the web browser's 'back' button the web resource seems to unload, if I click the back button again then it behaves as I'd expect.
Has anyone else experienced this? Is there a way to prevent the web resource from unloading when a user clicks 'back'?
Note: This seems to happen in both IE (10,11) and Chrome, but not Firefox.
Had the same issue, looks like a bug.
Until Microsoft fixes it, use the following in your webresource to trap the back event and redirect it properly.
$(document).ready(function () {
if (window.history && window.history.pushState) {
$(window).on('popstate', function () {
var hashLocation = location.hash;
var hashSplit = hashLocation.split("#!/");
var hashName = hashSplit[1];
if (hashName !== '') {
var hash = window.location.hash;
window.parent.history.back();
window.parent.history.back();
}
});
window.history.pushState('forward', null, './#forward');
}
}

client web - how to get current record id at any time

I'm trying to work on the "different permissions based on workflow state" issue but I'm struggling with the fact that it seems impossible to get the id of the current object 'at any time' that is necessary in order to get the permission of that object. What I mean is that I manage to get it from the client state following jquery bbq docs like:
$.bbq.getState().id
BUT it looks like this is doable only AFTER a complete page load. I investigated this by placing some alert in the main view events, like:
openerp.web.PageView = openerp.web.PageView.extend({
on_loaded: function(data) {
this._super(data);
alert('page load ' + $.bbq.getState().id);
},
do_show: function() {
this._super();
alert('page show ' + $.bbq.getState().id);
},
reload: function() {
this._super();
alert('page reload ' + $.bbq.getState().id);
},
on_record_loaded: function(record) {
this._super(record);
alert('record loaded ' + $.bbq.getState().id);
}
});
and I found that when you open the page view (by clicking on an item in a search view, for instance) you get always "undefined".
Then, you get it into "reload" and "on_record_loaded" when passing from an object to another using paged navigation. And then, you miss it again when you click on the "edit" button.
In the form view I successfully got it only on the 1st load because it seems that some caching is in-place. So that, if I place a pdb into web client's fields_view_get and I do this into the form "init_view":
var ids = [];
if ($.bbq.getState().id){
ids = [parseInt($.bbq.getState().id)];
}
console.log(ids);
return this.rpc("/web/view/load", {
"model": this.model,
"view_id": this.view_id,
"view_type": "form",
toolbar: this.options.sidebar,
context: context,
ids: ids,
}, this.on_loaded);
I get it only the 1st time that the page gets loaded. The same happen if I take ids from
this.dataset.ids
I looked anywhere at the core web module and I can't find a proper API for this and it looks weird (above all on dataset) that we don't have a proper way for getting/working on the current record/s. Even the context and the session do not have any information about that.
Probably I should store this into the view itself on 1st load...
Thanks in advance for any pointers.
try:
this.view.datarecord.id
OpenERP 7 in form view:
debugged using google chrome
Try the combination of the
this.dataset.ids and this.dataset.index
like
curr_id = this.dataset.ids[this.dataset.index]
this might solve your problem.