Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1055] iOS: build fails using a ScrollableView that contains a ListView using Templates

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-06-30T20:25:01.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.5.0
ComponentsXML
Labelsqe-3.3.0, qe-closed-3.4.0, qe-manualtest, qe-testadded
ReporterMatej
AssigneeTim Poulsen
Created2014-06-17T18:02:40.000+0000
Updated2014-08-20T09:47:16.000+0000

Description

It is not possible to put ListView with Templates inside a ScrollableView. Application will throw an error:
[ERROR] :  Script Error {
[ERROR] :      backtrace = "#0 () at file:///.../myApp.app/alloy.js:231";
[ERROR] :      line = 58;
[ERROR] :      message = "-[NSNull krollObjectForBridge:]: unrecognized selector sent to instance 0x45c3068";
[ERROR] :      sourceId = 301210048;
[ERROR] :      sourceURL = "file:///.../myApp.app/alloy/controllers/index.js";
[ERROR] :  }
index.xml
<Alloy>
    <Window>
        <ScrollableView>
            <ListView defaultItemTemplate="template">
                <Templates> <!-- Does work without Templates-->
                    <ItemTemplate name="template">
                        <ImageView bindId="pic" id="icon"/>
                        <Label bindId="info" id="title"/>
                        <Label bindId="es_info" id="subtitle"/>
                    </ItemTemplate>
                </Templates>
            </ListView>
        </ScrollableView>
    </Window>
</Alloy>
Discussion: http://developer.appcelerator.com/question/175229/-nsnull-krollobjectforbridge-unrecognized-selector-sent-to-instance-0x45c3068

Attachments

FileDateSize
Screen Shot 2014-06-18 at 2.24.27 PM.png2014-06-18T23:11:35.000+000076093

Comments

  1. Shuo Liang 2014-06-18

    seems a small bug here. For now, you'd better use view as the parent level, and I will notice to our engineer team to take care of this bug.
  2. Shuo Liang 2014-06-18

    I can reproduce this problem with: Ti 3.3.0.RC, iOS Simulator 7.1
  3. Eric Merriman 2014-06-18

    [~fcasali] Could you take a look and see if you can narrow down root cause? I asked if you could determine if regression, but Sam mentions he can see it with 3.3.0, so that combined with the reported affected version of 3.2.3 (assuming alloy 1.3.1 here) makes me think not a regression in the SDK nor Alloy, but not sure before 3.2.3 or 1.3.1.
  4. Federico Casali 2014-06-18

  5. Tim Poulsen 2014-06-27

    PR: https://github.com/appcelerator/alloy/pull/464 Test app: https://github.com/skypanther/alloy/tree/ALOY-1055/test/apps/testing/ALOY-1055 Plus, also test using the ui/listview test app Both should run without error and display the listviews. The 1055 test app should display the listview (which has templates) within the scrollable view, swipe right for the second view, which also contains a listview (without a template).
  6. Matej 2014-06-28

    I have got one question. If I do something like this:
       <Alloy>
           <Window>
               <Widget src="xxx">
                   <ListView>
                       <Templates>
                           <ItemTemplate name="first">
                              <!-- ... ... ... -->
                           </ItemTemplate>
       
                            <ItemTemplate name="second">
                              <!-- ... ... ... -->
                           </ItemTemplate>
                       </Templates>
                   </ListView>
              </Widget>
           </Window>
       </Alloy>
       
    And then in the widget I'll check arguments[0].children it contains ItemTemplates and as the last thing is the ListView. Is it normal? It shouldn't work like this or am I wrong?
  7. Tim Poulsen 2014-06-30

    [~sko] That appears to be an unrelated issue with the ListView parser. I've added ALOY-1064 to describe and track the issue you noted. On that ticket, I noted a workaround: reference the children array like this:
       var kids = _.compact(arguments[0].children);
       Ti.API.info(JSON.stringify(kids));
       
  8. Matej 2014-06-30

    Tim Poulsen, yes I know sorry for that I just wanted to know if that's really an issue or normal behaviour.
  9. Tim Poulsen 2014-06-30

    PR merged
  10. Dhirendra Jha 2014-08-20

    Environment - Appc Studio - 3.4.0.201408180158 SDK - 3.4.0.v20140819094113 acs - 1.0.16 alloy - 1.5.0-dev npm - 1.3.2 titanium - 3.4.0-dev titanium-code-processor - 1.1.1 OS - mavericks (v10.9.4) Xcode - 6Beta5 Device - iPhone5(v7.1.2), Nexus5(v54.4.4) Result - Tested both the apps (test/apps/testing/ALOY-1055 and ui/listview). Both apps run without error and display the listviews. Hence closing this issue.

JSON Source