5 Replies Latest reply on Dec 1, 2006 8:19 AM by davidmedifit

    Restaurant Finder sample help

    davidmedifit Level 1
      This is a little off-topc (I think!), but I was looking through the code of the restaurant Finder example (Application: http://examples.adobe.com/flex2/inproduct/sdk/restaurant/finder.html - right click and "View Source" for the code), and I am a little perplexed as to how the restaurant details change when the user selects from the datagrid.

      In "finder.mxml" there is a datagrid, with no "change" events. The panel to show restaurant info, is a component, and is called as follows: <RestaurantDetails restaurantId="{dg.selectedItem.restaurantId}"/>

      In view/restaurantDetails.mxml, there is the following function:
      public function set restaurantId(restaurantId:int):void
      I am sure that this is where the variable "Restaurant" is getting set, with a call to the "getRestaurantResult" function.

      Does the "restaurantId" in the component call refer to the function, or the function parameter, or both?

      I see what's happening, but I can't quite see why. I could just copy this method, but I would be doing so blindly.

      Any insight would be apprecaited.

      Cheers,

      David