PRESTASHOP cannot access carier, stock and warehouse - prestashop-1.6

I cannot access carrier, stock and warehouse from BO, it threws this kind of error and I don't understand what this error is all about. Kindly please guide me because I'm quite new with prestashop. Please refer to the image link below to see the error:
[PrestaShopDatabaseException]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 2
SELECT * FROM ps_hook_module_exceptions
WHERE id_shop IN ()
at line 791 in file classes/db/Db.php
if ($webservice_call && $errno) {
$dbg = debug_backtrace();
WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
} elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
if ($sql) {
throw new PrestaShopDatabaseException($this->getMsgError().''.$sql.'');
}
throw new PrestaShopDatabaseException($this->getMsgError());
}
}
DbCore->displayError - [line 425 - classes/db/Db.php] - [1 Arguments]
$this->result = $this->_query($sql);
}
}
if (_PS_DEBUG_SQL_) {
$this->displayError($sql);
}
return $this->result;
}
430.
Argument [0]
SELECT * FROM ps_hook_module_exceptions
WHERE id_shop IN ()
DbCore->query - [line 643 - classes/db/Db.php] - [1 Arguments]
throw new PrestaShopDatabaseException('Db->executeS() must be used only with select, show, explain or describe queries');
}
return $this->execute($sql, $use_cache);
}
$this->result = $this->query($sql);
if (!$this->result) {
$result = false;
} else {
if (!$array) {
Argument [0]
SELECT * FROM ps_hook_module_exceptions
WHERE id_shop IN ()
DbCore->executeS - [line 2142 - classes/module/Module.php] - [2 Arguments]
if (!Cache::isStored($cache_id)) {
$exceptions_cache = array();
$sql = 'SELECT * FROM '._DB_PREFIX_.'hook_module_exceptions
WHERE id_shop IN ('.implode(', ', Shop::getContextListShopID()).')';
$db = Db::getInstance();
$result = $db->executeS($sql, false);
while ($row = $db->nextRow($result)) {
if (!$row['file_name']) {
continue;
}
$key = $row['id_hook'].'-'.$row['id_module'];
Argument [0]
SELECT * FROM ps_hook_module_exceptions
WHERE id_shop IN ()
Argument 1
ModuleCore::getExceptionsStatic - [line 495 - classes/Hook.php] - [2 Arguments]
490. continue;
491. }
492.
493. // Check permissions
494. if ($check_exceptions) {
495. $exceptions = Module::getExceptionsStatic($array['id_module'], $array['id_hook']);
496.
497. $controller = Dispatcher::getInstance()->getController();
498. $controller_obj = Context::getContext()->controller;
499.
500. //check if current controller is a module controller
Argument [0]
63
Argument 1
57
HookCore::exec - [line 2749 - classes/controller/AdminController.php] - [2 Arguments]
'host_mode' => defined('_PS_HOST_MODE_') ? 1 : 0,
'stock_management' => (int)Configuration::get('PS_STOCK_MANAGEMENT')
));
if ($this->display_header) {
$this->context->smarty->assign('displayBackOfficeHeader', Hook::exec('displayBackOfficeHeader', array()));
}
$this->context->smarty->assign(array(
'displayBackOfficeTop' => Hook::exec('displayBackOfficeTop', array()),
'submit_form_ajax' => (int)Tools::getValue('submitFormAjax')
Argument [0]
displayBackOfficeHeader
Argument 1
Array
(
)
AdminControllerCore->init - [line 170 - classes/controller/Controller.php]
/**
Starts the controller process (this method should not be overridden!)
*/
public function run()
{
$this->init();
if ($this->checkAccess()) {
// setMedia MUST be called before postProcess
if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
$this->setMedia();
}
ControllerCore->run - [line 367 - classes/Dispatcher.php]
if (isset($params_hook_action_dispatcher)) {
Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
}
// Running controller
$controller->run();
} catch (PrestaShopException $e) {
$e->displayMessage();
}
}
372.
DispatcherCore->dispatch - [line 58 - admin/index.php]
if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) {
$_REQUEST['controller'] = strtolower($_REQUEST['tab']);
}
// Prepare and trigger admin dispatcher
Dispatcher::getInstance()->dispatch();

Related

Why does assignment not work the same in Dart as it does in Python?

When I run this code:
void readCard(db, [int card_id = -1]) {
if (card_id == -1) {
final ResultSet result = db.select('SELECT * FROM cards');
}
else {
final ResultSet result = db.select("""
SELECT * FROM cards
WHERE card_id=(?)
"""); // this doesn't work yet
}
for (final Row card in result) {
print(
"Card {'card_id': ${card['card_id']}, "
"'due': ${card['due']}, "
"'content': ${card['content']}}"
);
}
}
I get this error:
memotext.dart:66:25: Error: Getter not found: 'result'.
for (final Row card in result) {
^^^^^^
Because result is assigned regardless of whether the if statement or the the else statement runs shouldn't there be no error? Is this something to do with the way dart does assignment?
The result is declared in their respective blocks, it doesn't exist outside. Do this:
void readCard(db, [int card_id = -1]) {
ResultSet result;
if (card_id == -1) {
result = db.select('SELECT * FROM cards');
}
else {
result = db.select("""
SELECT * FROM cards
WHERE card_id=(?)
"""); // this doesn't work yet
}
for (final Row card in result) {
print(
"Card {'card_id': ${card['card_id']}, "
"'due': ${card['due']}, "
"'content': ${card['content']}}"
);
}
}

Is it possible to get Google Ouath2 access token without setting a redirect URI?

I am trying to implement Google Oauth2 consent screen within a popup but it says redirect URI mismatch. Is there any way where I can set up a web Ouath Client App without setting redirect uri in the dashboard?
I know setting up client type from web to others or application may solve this issue. But I want to implement it for web type only. Is this possible?
<!DOCTYPE html>
<html>
<head>
<script>
'use strict';
var GO2 = function GO2(options) {
if (!options || !options.clientId) {
throw 'You need to at least set the clientId';
}
if (typeof window != 'undefined'){
this._redirectUri = window.location.href.substr(0,
window.location.href.length -
window.location.hash.length)
.replace(/#$/, '');
}
// Save the client id
this._clientId = options.clientId;
// if scope is an array, convert it into a string.
if (options.scope) {
this._scope = Array.isArray(options.scope) ?
options.scope.join(' ') :
options.scope;
}
// rewrite redirect_uri
if (options.redirectUri) {
this._redirectUri = options.redirectUri;
}
// popup dimensions
if (options.popupHeight) {
this._popupHeight = options.popupHeight;
}
if (options.popupWidth) {
this._popupWidth = options.popupWidth;
}
if (options.responseType) {
this._responseType = options.responseType;
}
if (options.accessType) {
this._accessType = options.accessType;
}
};
GO2.receiveMessage = function GO2_receiveMessage() {
var go2;
if (window.opener && window.opener.__windowPendingGO2) {
go2 = window.opener.__windowPendingGO2;
}
if (window.parent && window.parent.__windowPendingGO2) {
go2 = window.parent.__windowPendingGO2;
}
var hash = window.location.hash;
if (go2 && hash.indexOf('access_token') !== -1) {
go2._handleMessage(
hash.replace(/^.*access_token=([^&]+).*$/, '$1'),
parseInt(hash.replace(/^.*expires_in=([^&]+).*$/, '$1'), 10),
hash.replace(/^.*state=go2_([^&]+).*$/, '$1')
);
}
if (go2 && window.location.search.indexOf('code=')) {
go2._handleMessage(
window.location.search.replace(/^.*code=([^&]+).*$/, '$1'),
null,
window.location.search.replace(/^.*state=go2_([^&]+).*$/, '$1')
);
}
if (go2 && window.location.search.indexOf('error=')) {
go2._handleMessage(false);
}
};
GO2.prototype = {
WINDOW_NAME: 'google_oauth2_login_popup',
OAUTH_URL: 'https://accounts.google.com/o/oauth2/v2/auth',
_clientId: undefined,
_scope: 'https://www.googleapis.com/auth/plus.me',
_redirectUri: '',
_popupWindow: null,
_immediateFrame: null,
_stateId: Math.random().toString(32).substr(2),
_accessToken: undefined,
_timer: undefined,
_popupWidth: 500,
_popupHeight: 400,
_responseType: 'token',
_accessType: 'online',
onlogin: null,
onlogout: null,
login: function go2_login(forceApprovalPrompt, immediate) {
if (this._accessToken) {
return;
}
this._removePendingWindows();
window.__windowPendingGO2 = this;
var url = this.OAUTH_URL +
'?response_type=' + this._responseType +
'&access_type='+ encodeURIComponent(this._accessType) +
'&redirect_uri=' + encodeURIComponent(this._redirectUri) +
'&scope=' + encodeURIComponent(this._scope) +
'&state=go2_' + this._stateId +
'&client_id=' + encodeURIComponent(this._clientId);
console.log(url);
if (!immediate && forceApprovalPrompt) {
url += '&approval_prompt=force';
}
if (immediate) {
url += '&approval_prompt=auto';
// Open up an iframe to login
// We might not be able to hear any of the callback
// because of X-Frame-Options.
var immediateFrame =
this._immediateFrame = document.createElement('iframe');
immediateFrame.src = url;
immediateFrame.hidden = true;
immediateFrame.width = immediateFrame.height = 1;
immediateFrame.name = this.WINDOW_NAME;
document.body.appendChild(immediateFrame);
return;
}
// Open the popup
var left =
window.screenX + (window.outerWidth / 2) - (this._popupWidth / 2);
var top =
window.screenY + (window.outerHeight / 2) - (this._popupHeight / 2);
var windowFeatures = 'width=' + this._popupWidth +
',height=' + this._popupHeight +
',top=' + top +
',left=' + left +
',location=no,toolbar=no,menubar=no';
this._popupWindow = window.open(url, this.WINDOW_NAME, windowFeatures);
},
logout: function go2_logout() {
if (!this._accessToken) {
return;
}
this._removePendingWindows();
clearTimeout(this._timer);
this._accessToken = undefined;
if (this.onlogout) {
this.onlogout();
}
},
getAccessToken: function go2_getAccessToken() {
return this._accessToken;
},
// receive token from popup / frame
_handleMessage: function go2_handleMessage(token, expiresIn, stateId) {
if (this._stateId !== stateId) {
return;
}
this._removePendingWindows();
// Do nothing if there is no token received.
if (!token) {
return;
}
this._accessToken = token;
if (this.onlogin) {
this.onlogin(this._accessToken);
}
if (expiresIn) {
// Remove the token if timed out.
clearTimeout(this._timer);
this._timer = setTimeout(
function tokenTimeout() {
this._accessToken = undefined;
if (this.onlogout) {
this.onlogout();
}
}.bind(this),
expiresIn * 1000
);
}
},
destory: function go2_destory() {
if (this._timer) {
clearTimeout(this._timer);
}
this._removePendingWindows();
},
_removePendingWindows: function go2_removePendingWindows() {
if (this._immediateFrame) {
document.body.removeChild(this._immediateFrame);
this._immediateFrame = null;
}
if (this._popupWindow) {
this._popupWindow.close();
this._popupWindow = null;
}
if (window.__windowPendingGO2 === this) {
delete window.__windowPendingGO2;
}
}
};
// if the context is the browser
if (typeof window !== 'undefined') {
// If the script loads in a popup matches the WINDOW_NAME,
// we need to handle the request instead.
if (window.name === GO2.prototype.WINDOW_NAME) {
GO2.receiveMessage();
}
}
// Expose the library as an AMD module
if (typeof define === 'function' && define.amd) {
define('google-oauth2-web-client', [], function () { return GO2; });
} else if (typeof module === 'object' && typeof require === 'function') {
// export GO2 in Node.js, assuming we are being browserify'd.
module.exports = GO2;
if (require.main === module) {
console.error('Error: GO2 is not meant to be executed directly.');
}
} else {
window.GO2 = GO2;
}
function test(){
var go2 = new GO2({
clientId: 'dfsdffdfgsfsdfggdgd.apps.googleusercontent.com',
redirectUri: 'http://localhost:8888/gapi/test.html',
responseType: 'code',
accessType: 'offline'
});
go2.login();
}
</script>
</head>
<body>
<a href='#' onClick='test();'> Click here to login </a>
</body>
</html>
It looks like you're using the implicit grant type which requires a redirect uri with response_type=token.
Can you use the authorization code grant type?
The redirect uri is optional for the authorization code grant type.
https://www.rfc-editor.org/rfc/rfc6749#section-4.1.1

How to set the templateUrl in a component in Angular2?

How can I set the templateUrl in code? E.g., if I have
#Component({
selector: 'search-load',
templateUrl: '/loads/search'
})
I want:
#Component({
selector: 'search-load',
templateUrl: this.language+ 'loads/search'
})
where templateUrl is a mvc path.
Thank you.
You cannot this in component declaration like this since its outside of component's scope but this is how I do something like this
In my component:
#Component({
selector: 'live-auction-stats',
templateUrl: BaseConfigurations.baseTemplatePath + '/auction-stats.html',
})
And In my BaseConfigurations.ts file, I have
export abstract class BaseConfigurations
{
public baseTemplatePath: string = location.origin + '/app/templates'; //you can configure here
....
//other base configurations..
....
}
After a long searching i found that node_modules\#angular\platform-browser-dynamic\bundles\platform-browser-dynamic.umd.js is the responsible for loading template by url
so i can add some params to url dynamically like this :
var lang = JSON.parse(localStorage.getItem("Accept-Language"));
xhr.open('GET', lang+url, true);
then the final file will be :
(function(System, SystemJS) {/**
* #license Angular v2.2.3
* (c) 2010-2016 Google, Inc. https://angular.io/
* License: MIT
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('#angular/compiler'), require('#angular/core'), require('#angular/platform-browser')) :
typeof define === 'function' && define.amd ? define(['exports', '#angular/compiler', '#angular/core', '#angular/platform-browser'], factory) :
(factory((global.ng = global.ng || {}, global.ng.platformBrowserDynamic = global.ng.platformBrowserDynamic || {}),global.ng.compiler,global.ng.core,global.ng.platformBrowser));
}(this, function (exports,_angular_compiler,_angular_core,_angular_platformBrowser) { 'use strict';
var INTERNAL_BROWSER_PLATFORM_PROVIDERS = _angular_platformBrowser.__platform_browser_private__.INTERNAL_BROWSER_PLATFORM_PROVIDERS;
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var ResourceLoaderImpl = (function (_super) {
__extends(ResourceLoaderImpl, _super);
function ResourceLoaderImpl() {
_super.apply(this, arguments);
}
ResourceLoaderImpl.prototype.get = function (url) {
var resolve;
var reject;
var promise = new Promise(function (res, rej) {
resolve = res;
reject = rej;
});
var xhr = new XMLHttpRequest();
var lang = JSON.parse(localStorage.getItem("Accept-Language"));
xhr.open('GET', lang+url, true);
xhr.responseType = 'text';
xhr.onload = function () {
// responseText is the old-school way of retrieving response (supported by IE8 & 9)
// response/responseType properties were introduced in ResourceLoader Level2 spec (supported
// by IE10)
var response = xhr.response || xhr.responseText;
// normalize IE9 bug (http://bugs.jquery.com/ticket/1450)
var status = xhr.status === 1223 ? 204 : xhr.status;
// fix status code when it is 0 (0 status is undocumented).
// Occurs when accessing file resources or on Android 4.1 stock browser
// while retrieving files from application cache.
if (status === 0) {
status = response ? 200 : 0;
}
if (200 <= status && status <= 300) {
resolve(response);
}
else {
reject("Failed to load " + url);
}
};
xhr.onerror = function () { reject("Failed to load " + url); };
xhr.send();
return promise;
};
ResourceLoaderImpl.decorators = [
{ type: _angular_core.Injectable },
];
/** #nocollapse */
ResourceLoaderImpl.ctorParameters = [];
return ResourceLoaderImpl;
}(_angular_compiler.ResourceLoader));
var INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = [
INTERNAL_BROWSER_PLATFORM_PROVIDERS,
{
provide: _angular_core.COMPILER_OPTIONS,
useValue: { providers: [{ provide: _angular_compiler.ResourceLoader, useClass: ResourceLoaderImpl }] },
multi: true
},
];
/**
* #license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var globalScope;
if (typeof window === 'undefined') {
if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
// TODO: Replace any with WorkerGlobalScope from lib.webworker.d.ts #3492
globalScope = self;
}
else {
globalScope = global;
}
}
else {
globalScope = window;
}
// Need to declare a new variable for global here since TypeScript
// exports the original value of the symbol.
var _global = globalScope;
// TODO: remove calls to assert in production environment
// Note: Can't just export this and import in in other files
// as `assert` is a reserved keyword in Dart
_global.assert = function assert(condition) {
// TODO: to be fixed properly via #2830, noop for now
};
/**
* #license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var __extends$1 = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/**
* An implementation of ResourceLoader that uses a template cache to avoid doing an actual
* ResourceLoader.
*
* The template cache needs to be built and loaded into window.$templateCache
* via a separate mechanism.
*/
var CachedResourceLoader = (function (_super) {
__extends$1(CachedResourceLoader, _super);
function CachedResourceLoader() {
_super.call(this);
this._cache = _global.$templateCache;
if (this._cache == null) {
throw new Error('CachedResourceLoader: Template cache was not found in $templateCache.');
}
}
CachedResourceLoader.prototype.get = function (url) {
if (this._cache.hasOwnProperty(url)) {
return Promise.resolve(this._cache[url]);
}
else {
return Promise.reject('CachedResourceLoader: Did not find cached template for ' + url);
}
};
return CachedResourceLoader;
}(_angular_compiler.ResourceLoader));
var __platform_browser_dynamic_private__ = {
INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
ResourceLoaderImpl: ResourceLoaderImpl
};
/**
* #experimental
*/
var RESOURCE_CACHE_PROVIDER = [{ provide: _angular_compiler.ResourceLoader, useClass: CachedResourceLoader }];
/**
* #stable
*/
var platformBrowserDynamic = _angular_core.createPlatformFactory(_angular_compiler.platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);
exports.RESOURCE_CACHE_PROVIDER = RESOURCE_CACHE_PROVIDER;
exports.platformBrowserDynamic = platformBrowserDynamic;
exports.__platform_browser_dynamic_private__ = __platform_browser_dynamic_private__;
}));
})(System, System);

Sencha Touch 2.3.1 list scroll freezing

I'm using Sencha Touch 2.3.1 and using a list defined like this :
{
xtype: 'list',
id: 'index_list',
infinite: true,
flex: 1,
scrollToTopOnRefresh: false,
disableSelection: true,
store: 'store_index'
}
List's store has got more than 300 records, that's why I put the flag "infinite" to true.
Problem is when I scroll very fastly up and down through the list, app freezes and I can't do anything else with UI.
Also tested, put infinite flag to false doesn't fix it.
Cannot reproduce if data are less than ~300 records.
Platforms : iOS 6, 7 (iPhone), not iPad.
Have you got any idea ?
Use this override works for me
Ext.define('InfiniteListScroll.override.TouchGesture', {
override: 'Ext.event.publisher.TouchGesture',
lastEventType: null,
changedTouchesId: null,
lastEventObject: null,
onEvent: function(e) {
console.log('InfiniteListScroll.override.TouchGesture - onEvent');
var type = e.type,
lastEventType = this.lastEventType,
touchList = [e];
if ( type == 'touchstart' ) {
if( this.changedTouchesId == null ) {
this.changedTouchesId = e.changedTouches[0].identifier;
this.lastEventObject = e;
}
else {
console.log('changedTouchesId NOT null, touchEnd event wasnt fired for corresponding touchStart event.');
this.onTouchEnd( this.lastEventObject );
}
}
if (this.eventProcessors[type]) {
this.eventProcessors[type].call(this, e);
return;
}
if ('button' in e && e.button > 0) {
return;
}
else {
// Temporary fix for a recent Chrome bugs where events don't seem to bubble up to document
// when the element is being animated with webkit-transition (2 mousedowns without any mouseup)
if (type === 'mousedown' && lastEventType && lastEventType !== 'mouseup') {
var fixedEvent = document.createEvent("MouseEvent");
fixedEvent.initMouseEvent('mouseup', e.bubbles, e.cancelable,
document.defaultView, e.detail, e.screenX, e.screenY, e.clientX,
e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.metaKey,
e.button, e.relatedTarget);
this.onEvent(fixedEvent);
}
if (type !== 'mousemove') {
this.lastEventType = type;
}
e.identifier = 1;
e.touches = (type !== 'mouseup') ? touchList : [];
e.targetTouches = (type !== 'mouseup') ? touchList : [];
e.changedTouches = touchList;
this.eventProcessors[this.mouseToTouchMap[type]].call(this, e);
}
},
onTouchEnd: function(e) {
console.log('InfiniteListScroll.override.TouchGesture - onTouchEnd');
if (!this.isStarted) {
return;
}
if (this.lastMoveEvent) {
this.onAnimationFrame();
}
var touchesMap = this.touchesMap,
currentIdentifiers = this.currentIdentifiers,
changedTouches = e.changedTouches,
ln = changedTouches.length,
identifier, i, touch;
this.changedTouchesId = null;
this.updateTouches(changedTouches);
changedTouches = e.changedTouches;
for (i = 0; i < ln; i++) {
Ext.Array.remove(currentIdentifiers, changedTouches[i].identifier);
}
e = this.factoryEvent(e);
for (i = 0; i < ln; i++) {
identifier = changedTouches[i].identifier;
touch = touchesMap[identifier];
delete touchesMap[identifier];
this.publish('touchend', touch.targets, e, {touch: touch});
}
this.invokeRecognizers('onTouchEnd', e);
// Only one touch currently active, and we're ending that one. So currentTouches should be 0 and clear the touchMap.
// This resolves an issue in iOS where it can sometimes not report a touchend/touchcancel
if (e.touches.length === 1 && currentIdentifiers.length) {
currentIdentifiers.length = 0;
this.touchesMap = {};
}
if (currentIdentifiers.length === 0) {
this.isStarted = false;
this.invokeRecognizers('onEnd', e);
if (this.animationQueued) {
this.animationQueued = false;
Ext.AnimationQueue.stop('onAnimationFrame', this);
}
}
}
});

action script 2.0

Hi I have a small flash as below
public function startApp () : Void
{
mcWindowRoot.refToClass = this;
mcNext = mcWindowRoot;
_oLogoutDelegate = Delegate.create (this, onLogoutHandler);
_oWindowManagerRef.addEventListener ("onLogout", _oLogoutDelegate);
loadWhatNext ();
}
/**
* Enter description here
*
*/
function loadWhatNext (mc : MovieClip) : Void
{
var doneFinish = mcNext.container.attachMovie ("done", "done", mcNext.container.getNextHighestDepth ());
//var returnPage = mcNext.container.attachMovie ("item", "item", mcNext.container.getNextHighestDepth () ,
//{
//_x : 135, _y : 230
//});
var miRefTemp = _oWindowManagerRef;
//returnPage.item_txt.htmlText = _level0.account_Return;
//returnPage.onPress =
doneFinish.onPress = function ()
{
trace ("AccountNext returnPage.onPress doneFinish.onPress" )
trace ("AccountNext miRefTemp " + miRefTemp)
trace ("AccountNext this.refToClass " + this._parent._parent.refToClass)
trace ("AccountNext this " + this)
this._parent._parent.refToClass.closeWindow ();
_oShell.loadWindow( "", null);
}
if (aNextdata != undefined && aNextdata.length > 0)
{
for (var i = 0 ; i < 3; i ++)
{
if (aNextdata [i].text != undefined)
{
var tempItem = mcNext.copy.attachMovie ("item", "item" + i, i,
{
_x : 143, _y : 150 + (i * 20)
});
tempItem.item_txt.htmlText = aNextdata [i].text;
tempItem.url = aNextdata [i].link;
tempItem.refToClass = _refWindow;
var asInterpreter = new asFunctionInterpreter (_oWindowManagerRef._oWindowManagerRef.oController.propertiesMap.get ("BaseURL") , this);
var deepLinks : Object = new Object ();
deepLinks = asInterpreter.getAsSingleURL ( aNextdata [i].link );
tempItem.deepLinks = deepLinks;
trace("Next :: LINKS : " + tempItem.wModule );
tempItem.oShell = _oShell;
tempItem.onPress = function ()
{
if (this.deepLinks.type == "internal")
{
this.oShell.loadWindow( this.deepLinks.wModule , this.deepLinks.wParams);
}
else
{
getURL (this.deepLinks.link, "_blank");
}
this.refToClass.closeWindow ();
}
}
}
} else
{
trace ("end tab " + _refWindow);
}
}
/**
* Enter description here
*
* #param evt
*/
private function onLogoutHandler (evt : Object) : Void
{
_oWindowManagerRef.removeEventListener ("onLogout", _oLogoutDelegate);
closeWindow ();
}
/**
* Enter description here
*
*/
public function closeMyWindow () : Void
{
_global._doNav ('windowType:wclose')
}
/**
* Enter description here
*
*/
public function removeMyWindow () : Void
{
_oWindowManagerRef.removeWindow (idWindow);
}
}
If you can see from this part of the code
if (aNextdata != undefined && aNextdata.length > 0)
I am getting three links one below the other but my problem is only the first link is opening in a new page which is supposed to open in the same page so what should I do for this Please help me thankyou.
Hard to say from your question, but it could be the getUrl-call that is causing your link to open in a new window. The second, optional, parameter to getUrl specifies the window in which the link should open. If you replace
getURL (this.deepLinks.link, "_blank");
with
getURL (this.deepLinks.link);
Your link should open in the same window.

Resources