[CLOSED] Adding FileUploadField to Container dynamically and Getting on DirectEvent Issue

  1. #1

    [CLOSED] Adding FileUploadField to Container dynamically and Getting on DirectEvent Issue

    Hi, we are adding fileUploadFields to a container dynamically.
    But we are not getting the controls which are created dynamically on DirectEvent,
    How can we do this ?

    Thanks in advance.


    var i = 4;
    var addFieldUploadField = function()
    {
    Container3.add(
    {
    id: "FileUploadField" + ++i,
    xtype: "fileuploadfield",
    width: 300,
    iconCls: "icon-attach",
    buttonText: "Attach"
    }
    );
    Container3.doLayout();
    }
    Last edited by Daniil; May 02, 2012 at 10:02 PM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi,

    Please ensure the code is wrapped in [CODE ] tags, it will make it more readable.

    Please use the "Edit Post" button to avoid a new post.
  3. #3
    Quote Originally Posted by kemalyigit View Post
    Hi, we are adding fileUploadFields to a container dynamically.
    But we are not getting the controls which are created dynamically on DirectEvent,
    How can we do this ?
    Well, if you create widgets client side, a page server control knows nothing about them and, respectively, they are absent on server side.

    In you case you can use a DirectMethod to upload a file. You can get a file directly from Request.Files.
  4. #4
    Quote Originally Posted by Daniil View Post
    Well, if you create widgets client side, a page server control knows nothing about them and, respectively, they are absent on server side.

    In you case you can use a DirectMethod to upload a file. You can get a file directly from Request.Files.
    Thanks, but we are trying to find the control which was added dynamically by clientside or serverside.
    We tried to add a fileuploadfield control to a container in a directMethod, and tried to reach the control (Container.Controls), but we could not.
  5. #5
    Well, the controls created during DirectEvent are not re-created automatically.

    You should re-create the controls manually during each DirectEvent/DirectMethod request if you need server instances of these controls.

    It came from ASP.NET which doesn't re-create any controls automatically.
    http://weblogs.asp.net/infinitiesloop/archive/2006/08/25/TRULY-Understanding-Dynamic-Controls-_2800_Part-1_2900_.aspx
    http://forums.asp.net/t/1186195.aspx

Similar Threads

  1. [CLOSED] Adding a dynamically created textfield below fileuploadfield
    By wisdomchuck in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 29, 2012, 4:09 PM
  2. [CLOSED] Getting error while adding custom control to container
    By AnulekhaK in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 20, 2012, 12:59 PM
  3. [CLOSED] Adding a button directevent in a directevent method
    By ogokgol in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 31, 2011, 10:29 AM
  4. Replies: 2
    Last Post: Mar 22, 2011, 4:33 PM
  5. [CLOSED] [1.0] Issue adding Ext.Net Toolbar dynamically
    By r_honey in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 02, 2010, 10:06 AM

Tags for this Thread

Posting Permissions