[CLOSED] ClientID of lazy rendered control

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] ClientID of lazy rendered control

    I`ve implemented a CheckTree extension used within an ComboTree extension for Coolite. Just recently i posted here, that i was having some problems with loading data from post (look at this post: http://forums.ext.net/showthread.php?5644).

    My current problem is that the CheckTreePanel does not have a correct ClientID assigned in PageLoad-Event. I think this is because the control performs lazy rendering.
    Is it possible to force the CheckTree to get a ClientID earlier in page lifecyle (so that it can be used in PageLoad also) ?

    I`ve attached a sample.

    Thx,
    Peter
    Last edited by geoffrey.mcgill; Feb 21, 2011 at 7:50 PM.
  2. #2

    RE: [CLOSED] ClientID of lazy rendered control

    Please re-attach sample without including the .dll's. Within your post, just let us know which version of the toolkit you are using.

    Geoffrey McGill
    Founder
  3. #3

    RE: [CLOSED] ClientID of lazy rendered control

    Hi,

    i`ve attached a sample without dlls. I last checked out Coolite trunk on the 11th November (just after this bug was fixed: http://forums.ext.net/showthread.php?5726) and the dll itself is version 0.8.2.25345. So it has to be a bit newer than trunk version 2156 which i used before the bug was fixed. But I also had the same problem with those version i think.

    Thank you !

    Thx,
    Peter
    Last edited by geoffrey.mcgill; Feb 21, 2011 at 8:05 PM.
  4. #4

    RE: [CLOSED] ClientID of lazy rendered control

    Hi,

    Page_Load fires in the page early then OnLoad in controls.
    You add CheckedTree to the controls collection in the OnLoad of ComboTree control therefore in the Page_Load that tree has no ClientID still. You have to add tree to the controls collection early (for example, try OnInit instead OnLoad)
  5. #5

    RE: [CLOSED] ClientID of lazy rendered control

    Doesn`t work either.... :-/
  6. #6

    RE: [CLOSED] ClientID of lazy rendered control

    Hi,

    What you mean 'doesn't work' ? What result do you have? Please provide more details
  7. #7

    RE: [CLOSED] ClientID of lazy rendered control

    Hello vlad,

    i`ve added the Tree-Control earlier in page lifecycle as you suggested (of course the three is still defined in page markup).



    protected override void OnInit(EventArgs e)
    {
        // now adding tree here
        this.Controls.Add(Tree[0]);
    
    
        if (!this.LazyItems.Contains(Tree[0]))
        {
            this.LazyItems.Add(Tree[0]);
        }
    
    
        base.OnInit(e);
    }
    
    
    protected override void OnLoad(EventArgs e)
    {
        InstanceOfAttribute attr = (InstanceOfAttribute)Attribute.GetCustomAttribute(Tree[0].GetType(),typeof    (InstanceOfAttribute));
        ClassOfTree = attr.ClassName;
    
        // removed adding tree to controls from here (moved to OnInit)
    
    
        base.OnLoad(e);
    }
    I also tried not to add the tree to the LazyItems-Collection but that didn`t help. The tree still does not have a valid ClientID in PageLoad-Event.

    Do you have any ideas ?

    Thx,
    Peter
  8. #8

    RE: [CLOSED] ClientID of lazy rendered control

    Hi,

    I made the same thing with your example and Tree has valid ClientID.
    What ClientID do you have?
  9. #9

    RE: [CLOSED] ClientID of lazy rendered control

    Hello vlad,

    strange, very strange. The ClientId of the tree still is unintialized (therefore it is "CheckTreePanel1"). I only modified the sample posted here as described above (in ComboTree.cs). I haven`t performed any other modifications.

    I´m using SVN build 2163 of Coolite (0.8.x).

    Thx,
    Peter
  10. #10

    RE: [CLOSED] ClientID of lazy rendered control

    Hi,

    For your example the "CheckTreePanel1" is valid ClientID because the control placed inside page only (no master page or user control).

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 6
    Last Post: Dec 07, 2011, 12:55 PM
  2. [1.2] ClientID of dynamic control changes
    By michaeld in forum 1.x Help
    Replies: 1
    Last Post: Oct 02, 2011, 11:08 AM
  3. [CLOSED] dynamically control is rendered out of masterpage
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 10, 2011, 1:16 PM
  4. [CLOSED] tab control lazy loading
    By alexp in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Aug 23, 2010, 9:39 AM
  5. Lazy Control Update
    By firebank in forum 1.x Help
    Replies: 0
    Last Post: Apr 18, 2010, 2:53 PM

Posting Permissions