Loading ...
Sorry, an error occurred while loading the content.

41752Re: [ydn-javascript] Re: YUI Layout - smooth transition

Expand Messages
  • Alex Wibowo
    Dec 1, 2008
    • 0 Attachment
      Hi Caridy...

      Thats what I thought too! I tried to get unit by the position, and replace the body attribute. But it doesnt render the fetched content.

      Maybe I was doing something wrong???



      On Tue, Dec 2, 2008 at 4:45 AM, Caridy Patino <caridy@...> wrote:

      Hey Alex,

      What do you mean with "why you cant replace the content of center unit
      in the YUI layout"???? You can do that... If you have a reference to
      the unit, or a reference to the layout object, you can do that...

      unit = layout.getUnitByPosition ('center');
      unit.body -> DOM reference

      Best Regards,
      Caridy Patino (caridy at yahoo-inc.com)
      Yahoo! LATAM

      --- In ydn-javascript@yahoogroups.com, "Alex Wibowo" <alexwibowo@...>
      wrote:


      >
      > Hi Satyam..
      >
      > Another question for you (as you are the YUI developer team).... is
      there
      > any reason why you cant replace the content of center unit in the YUI
      > layout?
      >
      >
      >
      > On Tue, Dec 2, 2008 at 12:17 AM, Alex Wibowo <alexwibowo@...> wrote:
      >
      > > Hi Satyam,
      > >
      > >
      > > What did u mean by that? The fetched code is not available at all
      in the
      > > 'script' tab in firebug.... so how can i put the breakpoint ??
      > > Did I miss something obvious here??
      > >
      > >
      > >
      > >
      > > On Mon, Dec 1, 2008 at 9:51 PM, Satyam <satyam@...> wrote:
      > >
      > >> You can place a 'debugger' statement in the loaded code and
      that will
      > >> act as a breakpoint.
      > >>
      > >>
      > >> Alex Wibowo wrote:
      > >> > Hi Caridy,
      > >> >
      > >> >
      > >> > As I mentioned... I'm trying to find the most effective way to
      debug
      > >> > the Javascript that is executed inside the fetched page.
      > >> > As you have pointed, this is not possible using Firebug (i.e. in
      > >> > firebug, the javascript debugger will go as far as the call to
      fetch()
      > >> > or addUnit()).
      > >> > My alternative strategy, is to make the fetched page as
      > >> > 'self-contained' as possible. i.e. so that it is possible to
      visit the
      > >> > fetched page by itself - so that I can do my javascript
      debugging there.
      > >> > However, this has a problem.
      > >> >
      > >> >
      > >> > Say the parent page includes yuiloader-min.js , container.js,
      etc, and
      > >> > the same javascript files are needed in the fetched page.
      > >> > I have to include it twice. Hence , the browser will try to
      fetch them
      > >> > twice. This is bad, isnt it?
      > >> > But i dont know how to solve it otherwise...
      > >> >
      > >> >
      > >> >
      > >> >
      > >> > On Mon, Dec 1, 2008 at 9:05 AM, Caridy Patino
      <caridy@...<caridy%40gmail.com>

      > >> > <mailto:caridy@... <caridy%40gmail.com>>> wrote:
      > >> >
      > >> > Hey Alex,
      > >> >
      > >> > Here are the differences these methods:
      > >> >
      > >> > YAHOO.util.Dispatcher.fetch: uses the YUI Connection Manager to
      load
      > >> > the content and places the result with in the specified element
      (ID).
      > >> >
      > >> > YAHOO.util.Dispatcher.addUnit: leaves the AJAX routine to the
      Layout
      > >> > Manager, and handles the response, executing the scripts, and
      placing
      > >> > the result inside the specified unit (unit reference or position).
      > >> >
      > >> > YAHOO.util.Dispatcher.delegate: leaves the AJAX routine to the
      > >> > Tabview, and handles the reponse, executing the scripts, and
      placing
      > >> > the result inside the specified tab (tab reference).
      > >> >
      > >> > So, you should use the addUnit all the time with your layouts,
      but if
      > >> > you want to use the fetch, it's fine, you just need to get the Unit
      > >> > DOM Element before that, to call the fetch method using the DOM
      > >> > Reference.
      > >> >
      > >> > About the errors, all these method supports error handling,
      using the
      > >> > property "error" in the configuration object, referencing to a
      > >> > function that handles the error. But there is not way to get
      the real
      > >> > error because we use an anonymous function. But we can get the
      chunk
      > >> > that generates the error, that certainly will help us to figure it
      > >> > out.
      > >> >
      > >> >
      > >> >
      > >> > Best Regards,
      > >> > Caridy Patino (caridy at yahoo-inc.com <http://yahoo-inc.com>)
      > >> > Yahoo! LATAM
      > >> >
      > >> > --- In
      ydn-javascript@yahoogroups.com<ydn-javascript%40yahoogroups.com>
      > >> >
      <mailto:ydn-javascript%40yahoogroups.com<ydn-javascript%2540yahoogroups.com>>,

      > >> "Alex Wibowo"
      > >> > <alexwibowo@>
      > >> > wrote:
      > >> >
      > >> > >
      > >> > > Totally separate question....
      > >> > > With all this Dispatcher.addUnit & Dispatcher.fetch..... what
      is the
      > >> > best
      > >> > > way to do debugging? I'm using Firefox + Firebug for my
      development,
      > >> > and the
      > >> > > fetched page (or added unit) wont get displayed in the Firebug
      > >> > javascript
      > >> > > debugger. Hence I cant put any breakpoints, etc.
      > >> > >
      > >> > >
      > >> > >
      > >> > > Thanks again, and sorry for the spam...
      > >> > >
      > >> >
      > >> >
      > >> >
      > >> >
      > >> > --
      > >> > Best regards,
      > >> >
      > >> >
      > >> > WiB
      > >> >
      > >> >
      > >> > ----------------------------------------------------------
      > >> >
      > >> >
      > >> > No virus found in this incoming message.
      > >> > Checked by AVG - http://www.avg.com
      > >> > Version: 8.0.176 / Virus Database: 270.9.12/1821 - Release Date:
      > >> 30/11/2008 17:53
      > >> >
      > >> >
      > >>
      > >>
      > >
      > >
      > >
      > > --

      > > Best regards,
      > >
      > >
      > > WiB
      > >
      > >
      >
      >
      > --
      > Best regards,
      >
      >
      > WiB
      >




      --
      Best regards,


      WiB

    • Show all 25 messages in this topic