Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-1283

ActionView views with an ID cannot be found under $ because they are created after merge

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Alloy 1.6.2, alloy 1.7.17
    • Fix Version/s: Release 5.1.0, alloy 1.7.18
    • Component/s: XML
    • Labels:
      None
    • Environment:

      Alloy 1.6.2

    • Story Points:
      5
    • Sprint:
      2015 Sprint 21 Tooling

      Description

      ALOY-1175 fixed this issue for IDs set on <MenuItem> but it is still an issue for views under <ActionView>. Because they are created after the controller merges $.__views with $ you cannot access the views via $.<id>.

      index.xml

      <Alloy>
          <Window>
              <Menu>
                  <MenuItem title="Open" showAsAction="Titanium.Android.SHOW_AS_ACTION_ALWAYS">
                      <ActionView>
                          <View id="myViewInActionView" backgroundColor="red">
                          	<Button onClick="changeColor">Change Color</Button>
                          </View>
                      </ActionView>
                  </MenuItem>
              </Menu>            
          </Window>
      </Alloy>
      

      index.js

      $.index.open();
       
      function changeColor() {
        $.myViewInActionView.backgroundColor = 'green';
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                fmiao Feon Sua Xin Miao
                Reporter:
                fokkezb Fokke Zandbergen
                Reviewer:
                Fokke Zandbergen
              • Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration