Hi everyone
I recently downloaded the latest svn jsLinb4.0.
I tested the following code on jsLinb3.0 and that works fine, (Note the backend is a simple html file), but version 4 only returns false.
Is this a bug or am I missing something?
I am pretty new to this so it maybe me.
Many Thanks
Anthony
// The default code is a com class (inherited from linb.Com)
Class('App', 'linb.Com',{
// Ensure that all the value of "key/value pair" does not refer to external variables
Instance:{
// To initialize instance(e.g. properties)
initialize : function(){
// To determine whether or not the com will be destroyed, when the first UI control be destroyed
this.autoDestroy = true;
// To initialize properties
this.properties = {};
},
// To initialize internal components (mostly UI controls)
// *** If you're not a skilled, dont modify this function manually ***
iniComponents : function(){
// [[code created by jsLinb UI Builder
var host=this, children=[], append=function(child){children.push(child.get(0))};
append(
(new linb.UI.SButton)
.setHost(host,"ctl_sbutton1")
.setLeft(130)
.setTop(240)
.setCaption("click me")
.onClick("_ctl_sbutton1_onclick")
);
append(
(new linb.UI.Dialog)
.setHost(host,"ctl_dialog1")
.setLeft(410)
.setTop(140)
.setCaption("ctl_dialog1")
);
return children;
// ]]code created by jsLinb UI Builder
},
// Give a chance to load other com
iniExComs : function(com, threadid){
},
// Give a chance to determine which UI controls will be appended to parent container
customAppend : function(parent, subId, left, top){
// "return false" will cause all the internal UI controls will be added to the parent panel
return false;
},
// This instance's events
events : {},
_ctl_sbutton1_onclick : function (profile, e, src, value) {
var uictrl = profile.boxing();
var me = this;
var params = {name:34, rnd:Math.random() * 1000}
linb.request("
http://localhost/web_tcmcare/hello.html",
params,
function (rsp){
me.ctl_dialog1.setHtml(rsp);
},
function(rsp){
linb.alert("Error");
},null,null);
}
}
});