Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16225] Support unsetting properties

GitHub Issuen/a
TypeNew Feature
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsCore
Labelsalloy, tss
ReporterMauro Parra-Miranda
AssigneeUnknown
Created2014-01-17T17:59:26.000+0000
Updated2018-02-28T20:04:05.000+0000

Description

moved to timob

The below ticket originally came in as an ALOY ticket, and is still referenced as ALOY-822. The developer wants the ability to unset properties on a Titanium UI proxy. While I will be addressing the fact that undefined can't be used in TSS, the rest of the scope of the ticket is outside that of ALOY and needs to be handled at the platform level.

Use case

I would like to be able to *un*set properties via TSS (and XML). I want all windows to be heavyweight by default so my app.tss has:
"Window": {
  modal: false
}
But I have one widget which absolutely needs its window to be lightweight. Right now there is no way to do this. I can set modal to a different value like true, but even setting it to null won't make the window lightweight again. I tried setting modal to undefined but it throws a syntax error:
Expected "Alloy", "L", "Ti", "Titanium", "WPATH", "[", "false", "null", "true", "{", comment, end of line, number, string or whitespace but "u" found.

Proposed solution

My suggestion is to accept undefined as a valid value, but instead of actually setting it, use it to trigger removing the property. That way, for that specific window I can set modal to undefined which would remove that property from the dictionary passed to Ti.UI.createWindow.

Comments

No comments

JSON Source