w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

Bug: Deleting a js variable after having it connected to a service response parameter, actually doesn't delete it!

1) In "data view - edit mappings" i created a javascript variable (with a second option being to create a local storage variable).
2) I connected a response parameter with this javascript variable.
3) "Edit js" with the javascript variable, I put in code to show an alert window.
4) Saved and tested the application. Showing me the alert window.
5) deleted the javascript variable in the "data view - edit mappings" view.
6) Saved and tested: application STILL SHOWS me the alert window that i created in the javascript variable, but which i deleted.

When i look into the browser source code, the code is still there in the Tiggzi created code:

/*************************
* NONVISUAL COMPONENTS *
*************************/
var datasources = [];
contacts1 = new Tiggr.DataSource(ContactsService, {
'onComplete': function(jqXHR, textStatus) {
$t.refreshScreenFormElements("j_31");
},
'onSuccess': function(data) {},
'onError': function(jqXHR, textStatus, errorThrown) {},
'responseMapping': [{
'PATH': ['$'],
'TRANSFORMATION': function(value, element) {
if (value.id == localStorage.getItem("ID")) {
alert("ja");
}

So behind the screens in the source, Tiggzi is still using this deleted javascript variable, still connected to the service response (I connected a response parameter '$' to the javascript variable).

Deleting the browser cache, using a completely different browser, logging in and out, does not help.

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

Bug: Deleting a js variable after having it connected to a service response parameter, actually doesn't delete it!

I'm trying to recreate the problem with a new page, but now i cannot visually connect the "$" response parameter of the ContactsService to a javascript or localStorage variable anymore.

Complete part of the source code of the tiggzi page involving the service:

/*************************
* NONVISUAL COMPONENTS *
************************/
var datasources = [];
contacts1 = new Tiggr.DataSource(ContactsService, {
'onComplete': function(jqXHR, textStatus) {
$t.refreshScreenFormElements("j_31");
},
'onSuccess': function(data) {},
'onError': function(jqXHR, textStatus, errorThrown) {},
'responseMapping': [{
'PATH': ['$'],
'TRANSFORMATION': function(value, element) {
if (value.id == localStorage.getItem("ID")) {
alert("ja");
}
/
if (value.id == localStorage.getItem("ID") ) {
alert(value.displayName);
}
}
/
return true;
},
'SET': []
}],
'requestMapping': [{
'PATH': ['options', 'filter'],
'ID': 'local_storage',
'ATTR': 'Naam'
}, {
'PATH': ['options', 'multiple'],
'ATTR': 'true'
}, {
'PATH': ['params', 'fields'],
'ATTR': ''
}]
});
datasources.push(contacts1);

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

Bug: Deleting a js variable after having it connected to a service response parameter, actually doesn't delete it!

This is my screen: https://dl.dropbox.com/u/3971241/js-s...

As you can see, is it normal that some localStorage variables can be edited to add javascript, and others not? "Edit js" button not available.

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

Bug: Deleting a js variable after having it connected to a service response parameter, actually doesn't delete it!

I was able to recreate the problem.

I deleted the page, created a new page, on page load invoke service.
New device service - contactsService. Edit mappings. Create new javascript variable. Edit this javascript variable to contain this:

if (value.id == localStorage.getItem("ID") ) {
alert(value.displayName);
}

Then connect the "$" of the response Parameter of the contactsService2 with the javascript variable.

Save and test: alert window is called.

Delete javascript variable.

Save and test: alert window is still called.

I shared this project now with a href="mailto:support@tiggzi.com" rel="nofollow"support@tiggzi.com/a . You leave the first page blank when testing, second page just click "search contacts" and then select a contact. (it is getting it from echo). This brings you to the ContactDetail page. This shows the alert, and after that IT STAYS BLANK. So it DOESN'T SHOW ANYTHING of the ContactDetail page, even if the ContactDetail page only contains a header and footer.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Bug: Deleting a js variable after having it connected to a service response parameter, actually doesn't delete it!

Thank you for sharing, i've already reproduced that problem with alert and created bug in our bug tracking system, we'll fix it.

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

Bug: Deleting a js variable after having it connected to a service response parameter, actually doesn't delete it!

Is it occurring only when creating an alert inside the javascript variable? Or would any code stay active after deleting the variable?

Return to “Issues”