Finally I found it, apparently this does work but thows an error:
this.oListItem = oList.getItemById(1);
ctx.load(this.oListItem);
ctx.executeQueryAsync(
Function.createDelegate(
this,
function () {
console.log("scriptAddMenuToListView.js: AppWebUrl successfully retrieved from lstAppData...");
var xAppWebUrl = this.oListItem.get_item('xValue');
fxCreateMenuHTML(xAppWebUrl);
}),
function () { console.log("scriptAddMenuToListView.js: Query to obtain AppWebUrl from lstAppData failed...") }
);
and this works as well but DOES NOT throw an error:
var oListItem = oList.getItemById(1);
ctx.load(oListItem);
ctx.executeQueryAsync(
function () {
var xAppWebUrl = oListItem.get_item('xValue');
console.log("scriptAddMenuToListView.js: AppWebUrl successfully retrieved from lstAppData, xAppWebUrl==" + xAppWebUrl);
fxCreateMenuHTML(xAppWebUrl);
},
function () {
console.log("scriptAddMenuToListView: Query to obtain AppWebUrl from lstAppData failed, msg==" + args.get_message());
})
still don't knw why the first peace of code throws an error though, but happy that things are working now :)