3 Replies Latest reply on Aug 13, 2008 10:08 PM by Madhav Subedi

    LinkButton click attribute gives error

    wyattbiker Level 1
      Does anyone know why it would give me an error in Flex on the mx:LinkButton line that the method editGrid(( is not found, even though I created it with no syntax errors in the CDATA section of my application?

      When I remove the click="editGrid()" it compiles correctly. When I put it back I get the error.

      Thanks
        • 1. Re: LinkButton click attribute gives error
          Level 7

          "wyattbiker" <webforumsuser@macromedia.com> wrote in message
          news:g808d8$328$1@forums.macromedia.com...
          > Does anyone know why it would give me an error in Flex on the
          > mx:LinkButton
          > line that the method editGrid(( is not found, even though I created it
          > with no
          > syntax errors in the CDATA section of my application?
          >
          > When I remove the click="editGrid()" it compiles correctly. When I put it
          > back
          > I get the error.
          >
          > Thanks
          >
          > <mx:DataGrid x="21" y="300" id="adg3" width="377" editable="false"
          > dataProvider="{lst}">
          > <mx:columns>
          >
          > <mx:DataGridColumn headerText="Edit" id="edtxy"
          > editable="false" dataField="Linkx" >
          > <mx:itemRenderer>
          > <mx:Component>
          > <mx:LinkButton label="{data.Linkx}" useHandCursor="true"
          > click="editGrid()" />
          > </mx:Component>
          > </mx:itemRenderer>
          > </mx:DataGridColumn>
          >
          > </mx:columns>
          > </mx:DataGrid>
          Your component has its own scope. Try

          outerDocument.editGrid() or Application.application.editGrid()


          • 2. Re: LinkButton click attribute gives error
            wyattbiker Level 1
            That worked (outerDocument.editGrid()! The Application.application.editGrid() did not work.

            I guess component scopes only go to the component level. I must remember that. Thanks!.
            • 3. Re: LinkButton click attribute gives error
              Madhav Subedi Level 4
              you have already solved, but for your information
              this.parentApplication.editGrid()
              also works.