how to delete a connection in draw2d? - javascript

I want to know how I delete a connection in draw2d. I tried disconnect() method but dose not seems to be work. This is my code
menu.appendMenuItem(new draw2d.MenuItem("Disconnect", null, function() {
//draw2d.Connection.workflow.removeFigure(draw2d.Connection.prototype);
var cmd = new draw2d.CommandDelete(oThis);
oThis.workflow.getCommandStack().excute(cmd);
}));
here oThis is of type "draw2d.Connection".
please help.

Did you ever open the firebug error console?
PLEASE check this before you create every day a lot of messages
Replace "excute" with "execute" and everythingis working well.
...sorry for this ....butIhaveread your other postings and I think you didn' try to solve your problems first by open the examples,jsdoc or the error console.

Related

How to properly use jQuery.sap.log.debug instead of console.log in SAPUI5 v.1.38.39?

About environment:
The used framework: SAPUI5
version: 1.38.39
development environment: sap web-ide
reproductible with OpenUI5 v.1.38
About Issue :
Recommendation from UI5 : to don't use console.log("message")
Proposition from UI5: use jQuery.sap.log.debug("message") instead, documentation here
expected result : see the "message" in the console from chrome debugger"
actual result : Don't see the "message" in the console"
Code part :
on my controller :
onInit: function(){
jQuery.sap.log.debug('onInit fired'); // display nothing in chrome console
console.log('onInit fired'); // display "onInit fired" in chrome console
},
Question:
Does someone has a solution or idea for solve this problem ?
Remark:
My question is probably simple, but i didn't find any solution
nowhere, and I am new to UI5, so I am asking here, thank you for your help and
comprehension.
If someone also can tell me why this question (the only one I asked so far) lock me to ask further questions, I think the post respect this ? Thank you for your feedback
Did you set the log level to DEBUG?
If not try to add :
jQuery.sap.log.setLevel(jQuery.sap.log.Level.DEBUG)
Also, is there any particular reason you are using 1.38 and not something more recent?

Using mobile data causes unexpected results

we are currently working on an application that works fine with wifi and has an offline version and once they have finished the user can upload the results to the online database. The issue were experiencing is that so of the ids are not matching up when using mobile data (3G/4G). Has anyone else experienced this similar problem using HTTPClient, below is an example of my httpclient, am i missing something that will help prevent this or any other suggestions?
I know NETWORK_ENABLED will still perform the sync as mobile data is under the NETWORK_ENABLED, but is there a way to see if connection is lost?
this.sendToServer = function(params, httpParams) {
if (Alloy.Globals.NETWORK_ENABLED){
var xhr = Ti.Network.createHTTPClient(params);
xhr.validatesSecureCertificate = false;
xhr.open('POST', this.url, true);
xhr.send(httpParams);
} else {
params.onload();
}
};
The only thing I can recommend is this module here: https://github.com/benbahrenburg/Pinger
But I've never used it. Checking the example .js file, seems to only ping www.apple.com and give you a "yes" or "no".
Could be quite useful actually =)

Nightwatch-friendly command or javascript function to reload a page

I have been trying the various suggestions for reloading a page.
Reload a page manually
With Nightwatch magellan testarmada. The error I see is "TypeError: Cannot read property 'apply' of undefined"
Has anyone else run into this problem/ solved it?
EDIT: client.navigate().refresh(); does not work.
Embarrassingly obvious, once I fixed it. I was calling it in an external function but the problem amounted to this:
module.exports = new Test({
'#disabled': false,
"test page that needs a reload" : function(client){
client
// set url
.url(this.url)
.pause(this.timeout)
.navigate().refresh() // does not work
.refresh() // does work.
},
});
Refrain yourself from using navigate here. Use the mentioned code below:
return client.refresh();

Error "validate_display:255 error 3008 (EGL_BAD_DISPLAY)" by Toutorial

I'm new to javascript and android and I want to program a multi page app with SAPUI5. For this I found a tutorial:
https://sapui5.hana.ondemand.com/sdk/#docs/guide/df86bfbeab0645e5b764ffa488ed57dc.html
which works fine, up to Walk through - Step 8. I have exactly the same source code in my project, but it doesn't work. I get following errors:
E/Zygote: MountEmulatedStorage()
E/Zygote: v2
E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
E/SysUtils: ApplicationContext is null in ApplicationStatus
E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/i18n/i18n_de_DE.properties
I know the first and the second, but I don't find information for the rest.
Does anybody know where they come from and how to solve it?
Answere:
I don't know what the problem actually was. I tried with the SDK-versions and get many many gradle errors. After I solved it, I used the code out of Step 7 an added only the yellow colored lines and delete what was to delete.
Not related to sapui
Don't know whether it will help others or not.
I've got this error when I was trying to open a pdf file in webview by using google docs.
I've changed
webView.loadUrl(url);
to
webView.loadUrl("http://docs.google.com/gview?embedded=true&url=" + url);
and it worked.
The last error seems to occur because the file /android_asset/i18n/i18n_de_DE.properties is either not there or maybe locked?
Maybe you misspelled it?
The EGL_BAD_DISPLAY error could have something to do with the DPI. Maybe this link helps:
http://forum.xda-developers.com/showthread.php?t=2212632
I had the same issue when I tried to load webview on Dialog. If I load webview on activity, it works well.
I had the same problem, some time pdf load or some time not.
try this solved my problem.
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
if(view.getContentHeight() == 0){
view.reload();
} else {
pDialog.dismiss();
}
}

Javascript Alert box not displaying on Firefox

Okay,
so I have this script which works fine with IE but won't work with Firefox. So I was wondering if anyone has had this problem and maybe got a solution.
$.ajax({
type : "POST",
url : "../php/insertUser.php",
data : dataString,
success : function(msg, status)
{
var reply = parseInt(msg);
if(reply==1)
{
alert('Email address already exists in our members database.\n'+
'Please try another address and then submit it again!');
}
else if(reply==2)
{
}
else if(reply==0)
{
$('#pForm').hide('fast');
$('#accForm').show('slow');
}
}
});
So, the alerts are working fine on IE but I can't get them to work on Firefox (3.6 or earlier). Any ideas as why this might happen?
EDIT: Thanks to TJ for referring me to the Firebug, now I see that the alerts are not the problem. The problem lies in that Firefox is not reading the "success:" clause. Any ideas?
There's nothing wrong with the alert as far as one can see (once I reformatted the code to make it readable! ;-) ). My suggestion is to get Firebug and step through the code, seeing where it's failing. For instance, the most likely reasons you're not seeing the alert are that the Ajax call is failing or you're never getting reply = 1 from parsing msg.

Categories

Resources