Hybrid View
-
19 Mar 2008 5:03 PM #1
AIR runtime security violation with sandbox issu!! plz help me.
AIR runtime security violation with sandbox issu!! plz help me.
I'm trying to convert Extjs files to AIR file. But it has a serious problem!!! When I open in html, it works well. But It shows air runtime security violation error.
Doesn't Ext2.0 support communicating data from external site?
I made an air project and downloaded ext-2.0.2.
I post here my sample codes plz help me.
Except main.js , main.html file application.xml, I used exact same files(ext-2.0.2 including AIR) with in Simple Taks V2.
This sample file shows combo box containg lists which is from specific ip address.
It shows error :
Error: Adobe AIR runtime security violation for JavaScript code in the application security sandbox (Function constructor)
- main.html-------------------------------------------------------------------------
<html>
<head>
<title>Absolute Forms</title>
<script type="text/javascript" src="AIRAliases.js"></script>
<script type="text/javascript" src="AIRIntrospector.js"></script>
<link rel="stylesheet" type="text/css" href="ext-2.0.2/resources/css/ext-all.css"/>
<link rel="stylesheet" type="text/css" href="ext-2.0.2/air/resources/ext-air.css" />
<!-- GC -->
<!-- LIBS -->
<script type="text/javascript" src="ext-2.0.2/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext-2.0.2/ext-all.js"></script>
<script type="text/javascript" src="ext-2.0.2/air/ext-air.js"></script>
<!-- ENDLIBS -->
<script type="text/javascript" src="main.js"></script>
<link rel="stylesheet" type="text/css" href="forms.css"/>
</head>
<body>
</body>
</html>
- main.js----------------------------------------------------------------------------
/*
* Ext JS Library 2.0.2
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.onReady(function() {
var dataStore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'http://165.213.147.60/air/data.php',
method:'post'
}),
baseParams:{
method:'getTableInfoList'
},
reader: new Ext.data.JsonReader(
{
root:'rows'
},
[
{name: 'title', mapping: 'title'},
{name: 'tms_tableinfo_uid', mapping: 'tms_tableinfo_uid'}
])
});
dataStore.sort('title');
dataStore.load();
comboBox = new Ext.form.ComboBox({
mode: 'local',
typeAhead: false,
triggerAction: 'all',
queryDelay: 500,
editable:false,
store: dataStore,
valueField:'tms_tableinfo_uid',
displayField: 'title',
hiddenName:'tms_tableinfo_uid',
loadingText: 'Loading Proejct',
fieldLabel: 'Item',
selectOnFocus:true,
allowBlank:false,
anchor:'50%'
});
var form = new Ext.form.FormPanel({
baseCls: 'x-plain',
layout:'absolute',
url:'save-form.php',
defaultType: 'textfield',
items: [comboBox]
});
var window = new Ext.Window({
title: 'Resize Me',
width: 500,
height:300,
minWidth: 300,
minHeight: 200,
layout: 'fit',
plain:true,
bodyStyle:'padding:5px;',
buttonAlign:'center',
items: form,
buttons: [{
text: 'Send'
},{
text: 'Cancel'
}]
});
window.show();
});
--------------------------------------------------------------------------------------
'http://165.213.147.60/air/data.php has only following texts. (You cannot access the ip address because it's a private website.)
{'rows':[{tms_tableinfo_uid:0, title:'first'},{tms_tableinfo_uid:1, title:'second'}]}
-
20 Mar 2008 12:18 AM #2
Give the ComboBox a template that isnt defined in the "onready" block.
-
24 Jun 2008 2:05 PM #3
Erica,
Did you find a solution for your app?
-
11 Feb 2009 7:59 AM #4
i have similar problem please help.
btw,
"Give the ComboBox a template that isnt defined in the "onready" block. "
- what did you mean by it and how to do it ?
-
12 Feb 2009 3:59 AM #5
Have a look at these threads regarding the template issue:
http://extjs.com/forum/showthread.php?t=45979
http://extjs.com/forum/showthread.php?t=32431
-
13 Feb 2009 7:17 AM #6
I experienced the same problem when using panels which will be rendered later on (tab panel items). This indeed seems to be a problem for the sandbox security . As a workaround I would suggest to create only the template object on initial rendering:
When creating your combobox later on you can use this template without any problems:PHP Code:Ext.onReady(function(){
mynamespace.mytpl = new Ext.XTemplate(
'<tpl for="."><div class="x-combo-list-item">{fieldname}</div></tpl>'
);
});
PHP Code:new Ext.form.ComboBox({
<attributes>
tpl: mynamespace.mytpl,
.
.


Reply With Quote