[CLOSED] Dynamic Formpanel Setvalues

  1. #1

    [CLOSED] Dynamic Formpanel Setvalues

    Hi,

    We have a requirement where dynamic formpanels will be build by a handler or service and in my mock up testing i found that the setvalues function is not setting the form values. Could you kindly point me in the correct direction?

    default.aspx:
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
        <ext:Viewport runat="server" Layout="border">
            <Items>         
                <ext:Panel runat="server" Layout="Fit" Title="Center" Region="Center">
                  <Loader DirectMethod="#{DirectMethods}.LoadPanel" runat="server" Mode="Component">
                    <LoadMask ShowMask="true" />
                  </Loader>
                </ext:Panel>
            </Items>
        </ext:Viewport>
        </form>
    </body>
    default.aspx.cs
    public partial class Default : System.Web.UI.Page
        {   
    
            [DirectMethod]
            public static string LoadPanel()
            {
                return ComponentLoader.ToConfig(GetFormPanel());
            }
    
            private static AbstractComponent GetFormPanel()
            {
                FormPanel form = new FormPanel() { ID = "FormPanel1", Title = "Tester" };
                form.Items.Add(new TextField() { FieldLabel = "test label", ID = "testname", Name = "testname", Width = Unit.Pixel(250) });
                form.SetValues(new { testname = "testing" });            
                return form;
            }
        }
    Last edited by Daniil; Oct 02, 2012 at 9:21 AM. Reason: [CLOSED]
  2. #2
    Hi @tpayn,

    Welcome to Ext.NET!

    Well, the SetValues method generates a script to be executed on client. This method and other similar ones require that a control must be added to the page controls.

    Though, even if it would be added to the page controls, it doesn't make sense, because a Loader with Component Mode expects just a component config.

    So, please initialize the fields using its Text or Value properties. In the case with TextField, please use the Text property.
  3. #3
    Hi Daniil,

    Thank you for the feedback. We are very green on the Ext.Net toolkit and we will have to rethink our approach a bit.

    Regards
    Terence
  4. #4
    Hi Terence,

    Please ask if you will be in trouble. We are here to help.

Similar Threads

  1. Dynamic formPanel Refresh / reconfigure
    By zaggle in forum 1.x Help
    Replies: 16
    Last Post: Apr 04, 2012, 4:55 AM
  2. Replies: 2
    Last Post: Mar 30, 2012, 5:52 AM
  3. Replies: 0
    Last Post: Sep 02, 2011, 10:10 PM
  4. [CLOSED] Problem with formpanel.setvalues
    By 78fede78 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 08, 2010, 1:19 PM
  5. Replies: 0
    Last Post: May 20, 2010, 7:57 AM

Posting Permissions