[CLOSED] Loop through Fields iside form panel

  1. #1

    [CLOSED] Loop through Fields iside form panel

    VIEW

    @using Ext.Net.MVC
    @using Ext.Net
    @using ERP.Models
    @{
        ViewBag.Title = "Confirm MessageBox with ButtonsConfig - Ext.NET MVC Examples";
        Layout = null;
        var X = Html.X();
    }
    @X.ResourceManager()
    
    
     @(X.FormPanel()
    .ID("f")
    .BodyPadding(5)
    .Border(false)
    .Items(
    
    
    X.TextField()
    .ID("txtMaterialGroupName")
    .FieldLabel("Material Group Name")
    .AnchorHorizontal("100%")
    .EmptyText("Material Group Name")
    .AllowBlank(false)
    ,
    X.TextField()
    .ID("txtDescription")
    .FieldLabel("Description")
    .AnchorHorizontal("100%")
    .EmptyText("Description")
    .AllowBlank(false),
    X.Hidden().ID("hdfTaskID").Value(0),
    X.Button()
                                .Text("Save")
                                .ID("btnSave")
                                .DirectEvents(de =>
                                {
                                   
                                    de.Click.Action = "save";
                                    de.Click.EventMask.ShowMask = true;
                                    de.Click.EventMask.Msg = "Saving...";
                                    de.Click.EventMask.MinDelay = 100;
                                    de.Click.After = "App.GridPanel1.getStore().reload();";
    
                                })
    )
    
    )
    CONTROLLER

     public void save()
            {
                var f = X.GetCmp<Container>("f");
    
                foreach (Ext.Net.Field c in f.Items)
                {
    
                }
            }
    I am trying to get all fields from the formpanel but always Items count 0,How do I do this?
    Last edited by Daniil; Jun 20, 2014 at 4:37 AM. Reason: [CLOSED]
  2. #2
    How do I do this?
    I don't think it's possible. If you're using MVC, then there is no concept of Controls or widgets on the server-side. You need to either pass in the values that you need, or acquire the values from the form submit.
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] [1.7] Validating form if one of two fields is valid
    By lapix in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Oct 15, 2013, 11:21 AM
  2. Widths of Form fields
    By thedarklord in forum 2.x Help
    Replies: 2
    Last Post: Oct 08, 2012, 5:31 AM
  3. [CLOSED] Two form fields, one validator
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 14, 2012, 7:57 AM
  4. Replies: 7
    Last Post: Mar 09, 2011, 8:15 PM
  5. [CLOSED] Form does not show the fields
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 26, 2010, 4:00 PM

Posting Permissions