Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-1636

Two switches cause repeated event firing

    Details

      Description

      {html}<div><p>A customer reported that they were trying to have 2 switches be
      linked to each other so that when one value changed the other
      switch changed. The below code, when run, causes many many events
      to fire when the window is opened. This was run on the iphone, sdk
      4.0.2 & 1.4.1</p>
      <p>var win = Titanium.UI.currentWindow;</p>
      <p>var sw1= Titanium.UI.createSwitch({ value:false, left:215,top:100});<br>
      win.add(sw1);</p>
      <p>var sw2= Titanium.UI.createSwitch({ value:true, left:215,top:200});<br>
      win.add(sw2);</p>
      <p>sw1.addEventListener('change',function(e){<br></p> <pre> <code>sw2.value = !sw2.value;</code> </pre> <p>});</p>
      <p>sw2.addEventListener('change',function(e){<br></p> <pre> <code>sw1.value = !sw1.value;</code> </pre> <p>});</p></div>{html}

        Attachments

          Activity

            People

            • Assignee:
              blainhamon Blain Hamon
              Reporter:
              ctredway1 ctredway
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-1482
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration