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

iOS: regression: button created in require()d unit won't fire click event

    Details

      Description

      Problem

      There is a regression in SDK 3.0.0.GA that prevents a button's click event from firing when the button is created in a require()d unit.

      Works in SDK 2.1.4.GA
      Broken in SDK 3.0.0.GA

      Note that this works fine on Android under SDK 3.0.0.GA (and SDK 2.1.4.GA)...the problem only exists on iOS.

      Testcase

      Run the following code and click the button. A console message should appear when the button is clicked, and the button's title should change to "Clicked!", but under SDK 3.0.0.GA this does not happen.

      Note that this testcase is reduced down to the smallest reproducable code from a very large app.

      app.js

      var win1=Ti.UI.createWindow({url:'win1.js',
                                   fullscreen:false,
                                   navBarHidden:false});
      win1.ButtonMaker=require('ButtonMaker');
      win1.open();
      

      win1.js

      var MainWin=Ti.UI.currentWindow;
       
      var ButtonMaker=MainWin.ButtonMaker;
       
      function NewButtonClick(evt)
      {
        Ti.API.info('Button was clicked');
        Button1.title='Clicked!';
      }
      var Button1=ButtonMaker.NewButton(MainWin,'Click Me',NewButtonClick);
      

      ButtonMaker.js

      exports.NewButton=function(Parent,Caption,ClkEvent)
      {
        var AButton=Ti.UI.createButton({title:Caption,
                                        width:'122dp',
                                        height:'44dp'
                                       });
        Parent.add(AButton);
        AButton.addEventListener('click',ClkEvent);
        return AButton;
      };
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                bitshftr Shawn Lipscomb
                Reviewer:
                Max Stepanov
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration