Renaming <Content> to <Body>

  1. #1

    Renaming to



    The next public build (v0.7) is shaping up to be another monster release. The <ext:TreePanel>, <ext:Menu> and new AjaxEvent features will be included.

    But... I come to you now looking for your opinion.

    Ever since the first release, the "Content" region of the any Panel type Control (Panel, Window, Tab, etc) has been called <Content>. I was never really 100% happy with the name "Content", but couldn't think of a better label. That is until yesterday when I had a head-slap moment (doah!) and realized it should have been called <Body>.

    I'm proposing a change from <Content> to <Body>.</p>


    Example (Existing)
    <ext:Panel ID="Panel1" runat="server" Title="Title">
    *** <Content>
    ******* Add Controls Here...
    *** </Content>
    </ext:Panel>
    </p>


    Example (New)
    <ext:Panel ID="Panel1" runat="server" Title="Title">
    *** <Body>
    ******* Add Controls Here...
    *** </Body>
    </ext:Panel>
    </p>


    With existing functionality, on the client/browser, if you want to get an instance of the Panel's "body" element using JavaScript, you call the .getBody() function. The following example demonstrates how to get the body of a Panel during an <ext:Button> <Click> Listener and update the text. </p>


    Example
    <ext:Button ID="Button1" runat="server" Text="Update Panel Body">
    *** <Listeners>
    ******* <Click Handler="Panel1.getBody().update('I just updated the Panel Body!')" />
    *** </Listeners>
    </ext:Button>
    </p>


    I was also always bothered by the symantics of adding "Layout" controls to the "Content" area. Adding "Layout" controls to the "Body" makes for a better paradigm and just reads better.

    The renaming would create a breaking change if upgrading from v0.6 (or earlier), although the functionality and logic of the <Content>/<Body> would remain unchanged.

    I think for most (if not all projects) just a simple search-and-replace would be required to upgrade. The change would affect the following properties.</p>


    In Markup
    1. <Content> changed to <Body>

    In CodeBehind
    1. .Content changed to .Body
    2. .ContentControls changed to .BodyControls
    3. .ContentContainer change to .BodyContainer

    I ran a couple tests and was able to update all our Coolite Toolkit projects (including Examples Explorer) took only a couple minutes using the four simple search-and-replace routines as outlined above. Everything recompiled and ran perfectly.

    Please let me know what you think.
    </p>
    Geoffrey McGill
    Founder
  2. #2

    RE: Renaming to

    Hi Geoff,

    yes it's true, changing the tag name to Body is the right choice considering the js getBody() function.

    ... ready for 'search-and-replace' !!

    Matteo
  3. #3

    RE: Renaming <Content> to <Body>

    I just can't resist any longer. I'm changing everything over to <Body>.

    The new <Body> code will drop into SVN later today and will be included with the v0.7 release.

    Please see V0.7 Breaking Changes for more information,*http://forums.ext.net/showthread.php?586
    Last edited by geoffrey.mcgill; Jan 19, 2011 at 5:25 AM.
    Geoffrey McGill
    Founder
  4. #4

    RE: Renaming to

    Changing <Content> to <Body> uncovered an unfortunate parsing bug in Visual Studio 2005 design-time.

    With the upcoming v1.0 release our goal was to once again fully support Visual Studio 2005. We've made the decision to roll-back the change and go back to <Content>.

    I apologize for the breaking change.

    Converting back to <Content> is a relatively simple process using a Visual Studio case-sensitive search. Just search for and replace the following string...

    Body>

    ... with ...

    Content>

    Including the closing ">" angle-bracket will pick up both opening and closing tags.

    This change is only included as of the v1.0 release.

    Geoffrey McGill
    Founder
  5. #5

    RE: Renaming to

    Isn't your instruction the opposite of what we are trying to do? I thought we are replacing Body> with Content> ????
  6. #6

    RE: Renaming to

    jchau (10/19/2009) Isn't your instruction the opposite of what we are trying to do? I thought we are replacing Body> with Content> ????
    Ya, you're right. Sorry about that. I'll fix the above post.

    Geoffrey McGill
    Founder
  7. #7

    RE: Renaming to

    I added the following note to the CHANGELOG.txt under item #45.

    Renaming all <Body> tags in a project to <Content> can be easily
    accomplished with a case-sensitive search and replace within Visual
    Studio. Please search for the following (remove double quotes) and
    ensure you have the "Match case" option checked.

    Find what: "Body>"
    Replace with: "Content>"
    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 7
    Last Post: Mar 28, 2011, 4:51 PM
  2. Get Window Body Content?
    By Tbaseflug in forum 1.x Help
    Replies: 2
    Last Post: Mar 26, 2010, 1:18 PM
  3. Replies: 5
    Last Post: Jan 06, 2010, 2:01 PM
  4. Different between "Body" and "Html"?
    By dbassett74 in forum 1.x Help
    Replies: 1
    Last Post: Apr 23, 2009, 2:01 PM
  5. load mask for body
    By [WP]joju in forum 1.x Help
    Replies: 7
    Last Post: Mar 16, 2009, 4:29 AM

Posting Permissions