MVC FileUploadField Issue

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    MVC FileUploadField Issue

    Hello,

    If I am using FileUploadField, then I am unable to get the value of TextArea txtMessage at code behind, however, I am successfully able to set the text of txtMessage from code-behind.

    If I remove all the FileUploadField from the form, then it just work fine.

    Also, I would like to know why can't we read value of any control from a different FormPanel(). If we have two formpanel() then we cannot read value of first formpanel() textbox from the button.directeventaction of second formpanel().

    Please help with both of the queries.

    Below is the code for the first query.

    X.FormPanel().ID("PanelThread").Region(Region.Center).Title("Message Thread").Icon(Icon.TableGo).Collapsible(false).AutoScroll(true).BodyPadding(5).Frame(true).LayoutConfig(new TableLayoutConfig() { Columns = 2}).Items(           
            X.TextArea().ID("txtMessage").Width(650).Height(150),
                X.Panel().Frame(true).Items(
                    X.FileUploadField().ID("Fup1").Icon(Icon.PageAttach).Width(220).EmptyText("Select a file"),
                    X.FileUploadField().ID("Fup2").Icon(Icon.PageAttach).Width(220).EmptyText("Select a file"),
                    X.FileUploadField().ID("Fup3").Icon(Icon.PageAttach).Width(220).EmptyText("Select a file"),
                    X.FileUploadField().ID("Fup4").Icon(Icon.PageAttach).Width(220).EmptyText("Select a file"),
                    X.Toolbar().Width(250).Items(
                        X.Button().ID("btnPostMessage").Icon(Icon.TableEdit).Text("Post Message").DirectClickAction("PostMessageClicked"),                    
                        X.ToolbarSeparator(),
                        X.Checkbox().ID("chkPriceQuote").FieldLabel("Price Quote")
                    )
                ),
                X.Label().ColSpan(2).Html("<hr>"),
                X.Label().ID("lblMessageThread").ColSpan(2).Html("<hr>")
            )

    [DirectMethod]
            public ActionResult PostMessageClicked()
            {
                X.Mask.Hide();
                TextArea txtMessage = this.GetCmp<TextArea>("txtMessage");
                string Message = txtMessage.Text;
                txtMessage.Text = "Hell Lots of trouble";
                Notification.Show(new NotificationConfig
                {
                    Title = "Error",
                    Icon = Icon.Accept,
                    Html = Message,
                    AutoHide = false,
                    CloseVisible = true,
                    Closable = true,
                    Width = 500,
                    Height = 500
                });
                return this.Direct();
            }
  2. #2

    No one able to resolve ?

    It seems no one able to resolve it. :(

    I solved the value part, now having trouble with the FileUploadField only
    Last edited by GKG4; Aug 08, 2013 at 6:52 AM.

Similar Threads

  1. [CLOSED] [#55] FileUploadField Height issue
    By aisi_it_admin in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 14, 2013, 7:57 AM
  2. [CLOSED] FileUploadField layout issue using CardLayout
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jan 14, 2013, 1:09 AM
  3. [CLOSED] FileUploadField issue
    By thaianhduc in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 19, 2011, 9:06 AM
  4. [CLOSED] FileUploadField issue...
    By shahidmughal in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 29, 2010, 3:07 PM
  5. [CLOSED] FileUploadField issue
    By egodoy in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Oct 15, 2009, 12:17 PM

Tags for this Thread

Posting Permissions