[CLOSED] File Upload Field

  1. #1

    [CLOSED] File Upload Field

    I am trying to use the file upload button I reach the Direct Event howerver the HasFile parameter is always false

    <ext:FileUploadField runat="server" ID="FileUploadField1" Width="280" Icon="Attach">                                                                
                                                                
                                    </ext:FileUploadField>
                                    
                                    <ext:Button Text="save" runat="server">
                                    <DirectEvents>                                                                        
                                        <Click  OnEvent="DirectEvent_FileSelected"
                                              
                                             Before="if (!#{BasicForm}.getForm().isValid()) { return false; }
                                                    var v = #{FileUploadField1}.getValue(); 
                                                    Ext.Msg.wait('Uploading your file...' + v, 'Uploading');"
       
                                             
                                             Failure="Ext.Msg.show({ 
                                                        title   : 'Error', 
                                                        msg     : result.errorMessage, 
                                                        minWidth: 200, 
                                                        modal   : true, 
                                                        icon    : Ext.Msg.ERROR, 
                                                        buttons : Ext.Msg.OK 
                                                    });"
                                                
                                                
                                        >
                                            <ExtraParams>
                                                <ext:Parameter Name="File" Mode="Raw" Value="#{FileUploadField1}.getValue()"></ext:Parameter>
                                            </ExtraParams>
                                        </Click>                                   
                                    </DirectEvents>
  2. #2

    RE: [CLOSED] File Upload Field

    Hi,

    File cannot be passed as extra parameter because any file is inaccessable in the javascript (browser itself passes a file from the field).


    Why do you need extra parameter? The file from the FileUploadField automatically submitted to the form (if field inside ASP.NET form)


    If you have problems with FileUploadField then please provide test sample
  3. #3

    RE: [CLOSED] File Upload Field

    Once the person selects the file using the browse button I want to send the file to an app server however the FileUploadField.HasFile is always false


    
    <script runat="server">
    
     protected void DirectEvent_FileSelected(object sender, DirectEventArgs e)
            {
               
               if(this.FileUploadField1.HasFile)
               {
                   AttachmentData data = new AttachmentData();
                   data.Name = Path.GetFileName(FileUploadField1.PostedFile.FileName);
                   data.Data =
                        ToByteArray(FileUploadField1.PostedFile.InputStream, FileUploadField1.PostedFile.ContentLength);
                   data.Path = Path.GetFullPath(FileUploadField1.PostedFile.FileName);
                   mController.AttachFile(data); 
               }
    
           
               
            }
    </script>
    
    
    
    
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ReAssignView.ascx.cs" Inherits="SymSureMonitor.Usercontrols.Workflow.ReAssignView" %>
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    
    
    <ext:Store runat="server" ID="StoreAttachments">
                <Reader>
                    <ext:JsonReader IDProperty="ReaderAttachments">
                        <Fields>
                            <ext:RecordField Name="Image" />
                            <ext:RecordField Name="Filename" />      
                        </Fields>
                    </ext:JsonReader>
                </Reader>
    </ext:Store>  
    <ext:Store runat="server" ID="StoreTimeUnits">
        <Reader>
            <ext:JsonReader IDProperty="TimeUnit">
                <Fields>
                    <ext:RecordField Name="TimeUnit" />
                    <ext:RecordField Name="DisplayUnit" />      
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store> 
    <ext:Store runat="server" ID="StorePredefinedComments">
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="Selected" />
                    <ext:RecordField Name="PredefinedComment" />
                    <ext:RecordField Name="Description"></ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="StoreNotificationUsers">
        <Reader>
            <ext:JsonReader IDProperty="Id">
                <Fields>
                    <ext:RecordField Name="Id" />
                    <ext:RecordField Name="Username" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="StoreUsersToNotify">
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="Id" />
                    <ext:RecordField Name="Username" />
                    <ext:RecordField Name="email" Type="Boolean"  />                           
                    <ext:RecordField Name="sms" Type="Boolean" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    
    <ext:Store runat="server" ID="ReAssignUsers">
        <Reader>
            <ext:JsonReader IDProperty="UserId">
                <Fields>
                    <ext:RecordField Name="UserId" />
                    <ext:RecordField Name="Username" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="EscalateUsers">
            <Reader>
                <ext:JsonReader IDProperty="UserId">
                    <Fields>
                        <ext:RecordField Name="UserId" />
                        <ext:RecordField Name="Username" /> 
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
    
    
             <ext:TabPanel ID="TabPanelReassign"  runat ="server" LayoutOnTabChange="true">
                    <Listeners>
                        <Show Handler="#{TabPanelReassign}.doLayout();" Delay="300" Single="true"/>
                    </Listeners>
                    <Items>
                        <ext:Panel ID="TabReAssign" Title="Re-assignment" runat="server" Height="250" Width="350" Layout="Absolute">                                               
                            <Items>                        
                                <ext:Panel runat="server" ID="PanelReassignTabLeft" X="10" Y="0" Width="350"  Border="false" >
                                <Content>
                                    <div style="width:285px; float:left; text-align:left;" >
                                        <br />
                                        <ext:Label runat="server" Text="Assigning 1 of 1" ID="LabelXofX"> </ext:Label><br /><br />                                           
                                        <ext:ComboBox ID="ComboBoxReassignTo" runat="server" Width="285" 
                                        StoreID="ReAssignUsers" DataIndex="Username" Mode="Remote" ValueField="UserId"
                                        DisplayField="Username" FieldLabel="Re-assign to" LabelAlign="Top" TriggerAction="All"><DirectEvents>
                                            <Select OnEvent="DirectEvent_SelectReassignUser">
                                                <ExtraParams>
                                                    <ext:Parameter Name="user" Mode="Raw" Value="#{ComboBoxReassignTo}.getValue()"></ext:Parameter>
                                                </ExtraParams>
                                            </Select>
                                        </DirectEvents>
                                        </ext:ComboBox><br />
                                        <ext:Label ID="LabelTurnaroundTime" Text="Turnaround time:" runat="server" />
                                        
                                            <div style="width:65px; float:left;">                                                    
                                                <ext:SpinnerField runat="server" ID="SpinnerTurnaroundTime" Text="0" Width="60"></ext:SpinnerField>   
                                            
    
                                            <div style="width:220px;">
                                                <ext:ComboBox ID="ComboTurnaroundTimeUnits" StoreID="StoreTimeUnits" ValueField="TimeUnit" DisplayField="DisplayUnit" Mode="Remote"  runat="server" Width="220"/>
                                            
    
                                        
    
                                        <ext:Label runat="server" ID="LabelTimeExpired" Icon="Accept" IconAlign="Left" Html="Label" > </ext:Label>
                                        <br />
                                        <ext:Checkbox runat="server"  BoxLabel="Cannot Change Escalatioin"  LabelAlign="Right" ID="ChkboxCannotEscalate"></ext:Checkbox>
                                        <ext:Checkbox runat="server"  BoxLabel="Cannot Close"  LabelAlign="Right" ID="ChkboxCannotClose"></ext:Checkbox>
                                    
    
                                </Content>
                                </ext:Panel>
                                <ext:Panel runat="server" ID="PanelReassignTabRight" X="361" Y="0" Width="350" Border="false">
                                <Content>
                                <div style="width:285px; float:left;" >
                                    <br />
                                    <ext:Label ID="LabelAssignedBy" Text="Assigned by: " runat="server"></ext:Label><ext:Label runat="server" Text=""></ext:Label><br /><br />
                                    <ext:ComboBox ID="ComboBoxEscalateTo" runat="server" Width="285" StoreID="EscalateUsers" DataIndex="Username" DisplayField="Username"
                                    FieldLabel="Escalate to" LabelAlign="Top"  /><br /> 
                                    <ext:FormPanel ID="BasicForm" 
                                            runat="server"
                                            Width="500"
                                            Frame="true"                                        
                                            AutoHeight="true"
                                            MonitorValid="true"
                                    > 
                                    <Content>                            
                                    <ext:ListView runat="server" ID="ListViewAttachments" StoreID="StoreAttachments" EmptyText="No Files yet attached" Height="85"  LabelAlign="Top" FieldLabel="Attachments">
                                     <Columns> 
                                        <ext:ListViewColumn Header="Image" Width="0.15" DataIndex="url" Template='<img style="width:60px;height:45px;" src="{url}" />' />
                                        <ext:ListViewColumn Header="File" Width="0.35" DataIndex="name" />                                
                                    </Columns>
                                    </ext:ListView> <br />                                         
                                    <ext:FileUploadField runat="server" ID="FileUploadField1" Width="280" Icon="Attach">                                                                
                                                                
                                    </ext:FileUploadField>
                                    
                                    <ext:Button Text="save" runat="server">
                                    <DirectEvents>                                                                        
                                        <Click  OnEvent="DirectEvent_FileSelected"
                                              
                                             Before="if (!#{BasicForm}.getForm().isValid()) { return false; }
                                                    var v = #{FileUploadField1}.getValue(); 
                                                    Ext.Msg.wait('Uploading your file...' + v, 'Uploading');"
       
                                             
                                             Failure="Ext.Msg.show({ 
                                                        title   : 'Error', 
                                                        msg     : result.errorMessage, 
                                                        minWidth: 200, 
                                                        modal   : true, 
                                                        icon    : Ext.Msg.ERROR, 
                                                        buttons : Ext.Msg.OK 
                                                    });"
                                                
                                                
                                        >
                                        </Click>                                   
                                    </DirectEvents>     
                                    </ext:Button>
                                    </Content>
                                    </ext:FormPanel> 
                                
    
                                </Content>
                                </ext:Panel>                                                                                                                                               
                            </Items>
                            <Listeners>
                                <Show Handler="#{TabReAssign}.doLayout();" Delay="300" Single="true"/>
                            </Listeners>                                    
                        </ext:Panel>
                        <ext:Panel ID="TabComments" Title="Comments" runat="server" Height="250" Layout="Absolute">
                            <Items>
                                <ext:Panel ID="Panel1" runat="server" Height="120" Border="false" X="10" Y="0" Width="265" Layout="Fit" FieldLabel="Predefined comment(s)" LabelAlign="Top">
                                        <Items>
                                            <ext:GridPanel  runat="server" ID="GridPanelComments" Height="120" StoreID="StorePredefinedComments" Header="false" AutoDoLayout="true" >
                                                <ColumnModel runat="server">
                                                    <Columns>
                                                        <ext:CheckColumn DataIndex="Selected" Width="24" Editable="true" >                                                                        
                                                        </ext:CheckColumn>
                                                        <ext:CommandColumn DataIndex="PredefinedComment" Width="220"></ext:CommandColumn>                                                                        
                                                    </Columns>                                                                                               
                                                </ColumnModel>
                                                <DirectEvents>
                                                    <AfterEdit OnEvent="DirectEvent_ChkBoxClick">
                                                        <ExtraParams>
                                                            <ext:Parameter Name="Value" Mode="Raw" Value="Ext.encode(#{GridPanelComments}.getRowsValues({selectedOnly:true}))"> </ext:Parameter>
                                                        </ExtraParams>
                                                    </AfterEdit>
                                                </DirectEvents>
                                                  <SelectionModel>
                                                    <ext:RowSelectionModel ID="SelectionModelComments" SingleSelect="true">
                                                        <DirectEvents>
                                                            <RowSelect OnEvent="DirectEvent_CommentSelection">
                                                                <ExtraParams>
                                                                    <ext:Parameter Name="Value" Mode="Raw" Value="Ext.encode(#{GridPanelComments}.getRowsValues({selectedOnly:true}))"> </ext:Parameter>
                                                                </ExtraParams>
                                                            </RowSelect>
                                                        </DirectEvents>
                                                    </ext:RowSelectionModel>
                                               </SelectionModel>                                                                                                                                               
                                            </ext:GridPanel>
    
                                             </Items>
                                    </ext:Panel>
                                    
                                    <ext:TextArea Height="100" Width="265" runat="server" ID="TextAreaCommentDescription" FieldLabel="Predefined comment details" ReadOnly="true" LabelAlign="Top" X="10" Y="145"></ext:TextArea> 
              
                                    <ext:Panel runat="server"  PaddingSummary="0 10" X="290" Y="0" Border="false">
                                        <Items>
                                            <ext:TextArea runat="server" Height="240" Width="400" FieldLabel="User comment" LabelAlign="Top"></ext:TextArea>
                                        </Items>
                                    </ext:Panel>                                                                                                             
                                </Items>
                             <Listeners>
                                <Show Handler="#{TabComments}.doLayout();" Delay="300" Single="true"/>
                            </Listeners> 
                        </ext:Panel>
                        <ext:Panel ID="TabNotifications" Title="Notifications" runat="server" Height="250" Layout="Absolute">                                
                        <Items>
                            <ext:Panel ID="Panel4" runat="server" Layout="Fit" Width="240" Height="250" X="5" Y="0">
                                <Items>
                                    <ext:GridPanel ID="GridPanel2" runat="server" StoreID="StoreNotificationUsers" DDGroup="secondGridDDGroup"  EnableDragDrop="true" >
                                        <ColumnModel runat="server" ID="GridPanelAllUsers">
                                            <Columns>
                                                <ext:Column DataIndex="Username"></ext:Column>
                                            </Columns>
                                        </ColumnModel>
                                        <SelectionModel>
                                                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                                            </SelectionModel> 
                                    </ext:GridPanel>
                                </Items>
                            </ext:Panel>
                              <ext:Panel runat="server" ID="PanelAddRemoveButtons" X="247" Y="0"  Height="250" Width="50" Layout="Fit" Border="true">
                                             <Defaults>
                                                <ext:Parameter Name="margins" Value="0 5 0 0" Mode="Value" />
                                            </Defaults>
                                            <Items>
                                                <ext:VBoxLayout ID="VBoxLayout1" Align="Center" runat="server" Pack="Center" Padding="5">                                            
                                                    <BoxItems>
                                                        <ext:BoxItem>
                                                            <ext:Button ID="BtnAddNotificationUser" runat="server" Text=">" Width="25"  >
                                                            <DirectEvents>
                                                                <Click OnEvent="AddNotificationUser_DirectEvent">
                                                                    <ExtraParams>
                                                                     <ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel2}.getRowsValues({selectedOnly:true}))" Mode="Raw" />
                                                                    </ExtraParams>
                                                                </Click>
                                                            </DirectEvents>
                                                            </ext:Button>
                                                        </ext:BoxItem>
                                                        <ext:BoxItem>
                                                            <ext:Button ID="BtnAddAllNotificationUser" runat="server" Text=">>" Width="25">                                                                        
                                                            </ext:Button>
                                                        </ext:BoxItem>
                                                        <ext:BoxItem>
                                                            <ext:Button ID="BtnRemoveNotificationUser" runat="server" Text="<" Width="25"></ext:Button>
                                                        </ext:BoxItem>
                                                        <ext:BoxItem>
                                                            <ext:Button ID="BtnRemoveAllNotificationUser" runat="server" Text="<<" Width="25"></ext:Button>  
                                                        </ext:BoxItem>
                                                    </BoxItems>
                                                </ext:VBoxLayout>  
                                            </Items>
                                        </ext:Panel>
                                  <ext:Panel ID="Panel3" runat="server" Height="250" Layout="Fit" X="300" Y="0" Border="false">
                                    <Items>
                                        <ext:GridPanel ID="GridPanel1" runat="server" StoreID="StoreUsersToNotify" DDGroup="firstGridDDGroup"  EnableDragDrop="true">
                                            <ColumnModel runat="server" ID="ColumnModel1">
                                                <Columns>
                                                    <ext:ImageCommandColumn Width="25"  ></ext:ImageCommandColumn>
                                                    <ext:Column DataIndex="Username" Header="Username"></ext:Column>
                                                    <ext:CheckColumn DataIndex="email" Header="E-Mail" Editable="true" Align="Center">                                                                                                                                                                         
                                                    </ext:CheckColumn>
                                                    <ext:CheckColumn DataIndex="sms" Header="SMS" Editable="true" Align="Center" ></ext:CheckColumn>
                                                </Columns>
                                            </ColumnModel>
                                            <DirectEvents>
                                                <AfterEdit OnEvent="SetEmailSMSNotify_DirectEvent" >
                                                <ExtraParams>
                                                    <ext:Parameter Name="values" Value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOnly:true}))" Mode="Raw"></ext:Parameter>                                                
                                                </ExtraParams>
                                                </AfterEdit>
                                            </DirectEvents>                                       
                                            <SelectionModel>
                                                <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" />
                                            </SelectionModel> 
                                        </ext:GridPanel>
                                    </Items>
                                </ext:Panel>                   
                            </Items>
                            </ext:Panel>                                  
                  </Items>
             </ext:TabPanel>                     
              <ext:DropTarget ID="DropTarget1" runat="server" Target="={#{GridPanel2}.view.scroller.dom}" Group="firstGridDDGroup">
                <NotifyDrop Fn="notifyDrop1" />
            </ext:DropTarget>       
            
            <ext:DropTarget ID="DropTarget2" runat="server" Target="={#{GridPanel1}.view.scroller.dom}" Group="secondGridDDGroup">
                <NotifyDrop Fn="notifyDrop2" />
            </ext:DropTarget>
  4. #4

    RE: [CLOSED] File Upload Field

    Hi,

    Is that all code required to reproduce the problem? Can you remove unnecessary code? I cannot run it locally
    Try to set IsUpload="true" for the Click DirectEvent
  5. #5

    RE: [CLOSED] File Upload Field

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ReAssignView.ascx.cs" Inherits="SymSureMonitor.Usercontrols.Workflow.ReAssignView" %>
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    
    <script runat="server">
    
    protected void AddNotificationUser_DirectEvent(object sender, DirectEventArgs e)
            {
                
            }
    
            protected void SetEmailSMSNotify_DirectEvent(object sender, DirectEventArgs e)
            {
                       
     
            }
    
            protected  void DirectEvent_CommentSelection(object sender, DirectEventArgs e)
            {
               
            }
    
            protected  void DirectEvent_ChkBoxClick(object sender, DirectEventArgs e)
            {
                string json = e.ExtraParams["Value"];
                IDictionary<string, string>[] grd = JSON.Deserialize<Dictionary<string, string>[]>(json);
                foreach (IDictionary d in grd)
                {
                    TextAreaCommentDescription.Text = (string)d["Description"];
                }   
                
            }
            protected void DirectEvent_FileSelected(object sender, DirectEventArgs e)
            {
               
               if(this.FileUploadField1.HasFile)
               {
                   AttachmentData data = new AttachmentData();
                   data.Name = Path.GetFileName(FileUploadField1.PostedFile.FileName);
                   data.Data =
                        ToByteArray(FileUploadField1.PostedFile.InputStream, FileUploadField1.PostedFile.ContentLength);
                   data.Path = Path.GetFullPath(FileUploadField1.PostedFile.FileName);
                 //  mController.AttachFile(data); 
               }
    
           
               
            }
    
            protected void DirectEvent_SelectReassignUser(object sender, DirectEventArgs e)
            {
    
            }
    
    </script>
    
    
    <ext:Store runat="server" ID="StoreAttachments">
                <Reader>
                    <ext:JsonReader IDProperty="ReaderAttachments">
                        <Fields>
                            <ext:RecordField Name="Image" />
                            <ext:RecordField Name="Filename" />      
                        </Fields>
                    </ext:JsonReader>
                </Reader>
    </ext:Store>  
    <ext:Store runat="server" ID="StoreTimeUnits">
        <Reader>
            <ext:JsonReader IDProperty="TimeUnit">
                <Fields>
                    <ext:RecordField Name="TimeUnit" />
                    <ext:RecordField Name="DisplayUnit" />      
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store> 
    <ext:Store runat="server" ID="StorePredefinedComments">
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="Selected" />
                    <ext:RecordField Name="PredefinedComment" />
                    <ext:RecordField Name="Description"></ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="StoreNotificationUsers">
        <Reader>
            <ext:JsonReader IDProperty="Id">
                <Fields>
                    <ext:RecordField Name="Id" />
                    <ext:RecordField Name="Username" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="StoreUsersToNotify">
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="Id" />
                    <ext:RecordField Name="Username" />
                    <ext:RecordField Name="email" Type="Boolean"  />                           
                    <ext:RecordField Name="sms" Type="Boolean" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    
    <ext:Store runat="server" ID="ReAssignUsers">
        <Reader>
            <ext:JsonReader IDProperty="UserId">
                <Fields>
                    <ext:RecordField Name="UserId" />
                    <ext:RecordField Name="Username" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Store runat="server" ID="EscalateUsers">
            <Reader>
                <ext:JsonReader IDProperty="UserId">
                    <Fields>
                        <ext:RecordField Name="UserId" />
                        <ext:RecordField Name="Username" /> 
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
    
    
             <ext:TabPanel ID="TabPanelReassign"  runat ="server" LayoutOnTabChange="true">
                    <Listeners>
                        <Show Handler="#{TabPanelReassign}.doLayout();" Delay="300" Single="true"/>
                    </Listeners>
                    <Items>
                        <ext:Panel ID="TabReAssign" Title="Re-assignment" runat="server" Height="250" Width="350" Layout="Absolute">                                               
                            <Items>                        
                                <ext:Panel runat="server" ID="PanelReassignTabLeft" X="10" Y="0" Width="350"  Border="false" >
                                <Content>
                                    <div style="width:285px; float:left; text-align:left;" >
                                        <br />
                                        <ext:Label runat="server" Text="Assigning 1 of 1" ID="LabelXofX"> </ext:Label><br /><br />                                           
                                        <ext:ComboBox ID="ComboBoxReassignTo" runat="server" Width="285" 
                                        StoreID="ReAssignUsers" DataIndex="Username" Mode="Remote" ValueField="UserId"
                                        DisplayField="Username" FieldLabel="Re-assign to" LabelAlign="Top" TriggerAction="All"><DirectEvents>
                                            <Select OnEvent="DirectEvent_SelectReassignUser">
                                                <ExtraParams>
                                                    <ext:Parameter Name="user" Mode="Raw" Value="#{ComboBoxReassignTo}.getValue()"></ext:Parameter>
                                                </ExtraParams>
                                            </Select>
                                        </DirectEvents>
                                        </ext:ComboBox><br />
                                        <ext:Label ID="LabelTurnaroundTime" Text="Turnaround time:" runat="server" />
                                        
                                            <div style="width:65px; float:left;">                                                    
                                                <ext:SpinnerField runat="server" ID="SpinnerTurnaroundTime" Text="0" Width="60"></ext:SpinnerField>   
                                            
    
                                            <div style="width:220px;">
                                                <ext:ComboBox ID="ComboTurnaroundTimeUnits" StoreID="StoreTimeUnits" ValueField="TimeUnit" DisplayField="DisplayUnit" Mode="Remote"  runat="server" Width="220"/>
                                            
    
                                        
    
                                        <ext:Label runat="server" ID="LabelTimeExpired" Icon="Accept" IconAlign="Left" Html="Label" > </ext:Label>
                                        <br />
                                        <ext:Checkbox runat="server"  BoxLabel="Cannot Change Escalatioin"  LabelAlign="Right" ID="ChkboxCannotEscalate"></ext:Checkbox>
                                        <ext:Checkbox runat="server"  BoxLabel="Cannot Close"  LabelAlign="Right" ID="ChkboxCannotClose"></ext:Checkbox>
                                    
    
                                </Content>
                                </ext:Panel>
                                <ext:Panel runat="server" ID="PanelReassignTabRight" X="361" Y="0" Width="350" Border="false">
                                <Content>
                                <div style="width:285px; float:left;" >
                                    <br />
                                    <ext:Label ID="LabelAssignedBy" Text="Assigned by: " runat="server"></ext:Label><ext:Label runat="server" Text=""></ext:Label><br /><br />
                                    <ext:ComboBox ID="ComboBoxEscalateTo" runat="server" Width="285" StoreID="EscalateUsers" DataIndex="Username" DisplayField="Username"
                                    FieldLabel="Escalate to" LabelAlign="Top"  /><br /> 
                                    <ext:FormPanel ID="BasicForm" 
                                            runat="server"
                                            Width="500"
                                            Frame="true"                                        
                                            AutoHeight="true"
                                            MonitorValid="true"
                                    > 
                                    <Content>                            
                                    <ext:ListView runat="server" ID="ListViewAttachments" StoreID="StoreAttachments" EmptyText="No Files yet attached" Height="85"  LabelAlign="Top" FieldLabel="Attachments">
                                     <Columns> 
                                        <ext:ListViewColumn Header="Image" Width="0.15" DataIndex="url" Template='<img style="width:60px;height:45px;" src="{url}" />' />
                                        <ext:ListViewColumn Header="File" Width="0.35" DataIndex="name" />                                
                                    </Columns>
                                    </ext:ListView> <br />                                         
                                    <ext:FileUploadField runat="server" ID="FileUploadField1" Width="280" Icon="Attach">                                                                
                                                                
                                    </ext:FileUploadField>
                                    
                                    <ext:Button Text="save" runat="server">
                                    <DirectEvents>                                                                        
                                        <Click IsUpload="true"  OnEvent="DirectEvent_FileSelected"
                                              
                                             Before="if (!#{BasicForm}.getForm().isValid()) { return false; }
                                                    var v = #{FileUploadField1}.getValue(); 
                                                    Ext.Msg.wait('Uploading your file...' + v, 'Uploading');"
       
                                             
                                             Failure="Ext.Msg.show({ 
                                                        title   : 'Error', 
                                                        msg     : result.errorMessage, 
                                                        minWidth: 200, 
                                                        modal   : true, 
                                                        icon    : Ext.Msg.ERROR, 
                                                        buttons : Ext.Msg.OK 
                                                    });"
                                                
                                                
                                        >
                                        </Click>                                   
                                    </DirectEvents>     
                                    </ext:Button>
                                    </Content>
                                    </ext:FormPanel> 
                                
    
                                </Content>
                                </ext:Panel>                                                                                                                                               
                            </Items>
                            <Listeners>
                                <Show Handler="#{TabReAssign}.doLayout();" Delay="300" Single="true"/>
                            </Listeners>                                    
                        </ext:Panel>
                        <ext:Panel ID="TabComments" Title="Comments" runat="server" Height="250" Layout="Absolute">
                            <Items>
                                <ext:Panel ID="Panel1" runat="server" Height="120" Border="false" X="10" Y="0" Width="265" Layout="Fit" FieldLabel="Predefined comment(s)" LabelAlign="Top">
                                        <Items>
                                            <ext:GridPanel  runat="server" ID="GridPanelComments" Height="120" StoreID="StorePredefinedComments" Header="false" AutoDoLayout="true" >
                                                <ColumnModel runat="server">
                                                    <Columns>
                                                        <ext:CheckColumn DataIndex="Selected" Width="24" Editable="true" >                                                                        
                                                        </ext:CheckColumn>
                                                        <ext:CommandColumn DataIndex="PredefinedComment" Width="220"></ext:CommandColumn>                                                                        
                                                    </Columns>                                                                                               
                                                </ColumnModel>
                                                <DirectEvents>
                                                    <AfterEdit OnEvent="DirectEvent_ChkBoxClick">
                                                        <ExtraParams>
                                                            <ext:Parameter Name="Value" Mode="Raw" Value="Ext.encode(#{GridPanelComments}.getRowsValues({selectedOnly:true}))"> </ext:Parameter>
                                                        </ExtraParams>
                                                    </AfterEdit>
                                                </DirectEvents>
                                                  <SelectionModel>
                                                    <ext:RowSelectionModel ID="SelectionModelComments" SingleSelect="true">
                                                        <DirectEvents>
                                                            <RowSelect OnEvent="DirectEvent_CommentSelection">
                                                                <ExtraParams>
                                                                    <ext:Parameter Name="Value" Mode="Raw" Value="Ext.encode(#{GridPanelComments}.getRowsValues({selectedOnly:true}))"> </ext:Parameter>
                                                                </ExtraParams>
                                                            </RowSelect>
                                                        </DirectEvents>
                                                    </ext:RowSelectionModel>
                                               </SelectionModel>                                                                                                                                               
                                            </ext:GridPanel>
    
                                             </Items>
                                    </ext:Panel>
                                    
                                    <ext:TextArea Height="100" Width="265" runat="server" ID="TextAreaCommentDescription" FieldLabel="Predefined comment details" ReadOnly="true" LabelAlign="Top" X="10" Y="145"></ext:TextArea> 
              
                                    <ext:Panel runat="server"  PaddingSummary="0 10" X="290" Y="0" Border="false">
                                        <Items>
                                            <ext:TextArea runat="server" Height="240" Width="400" FieldLabel="User comment" LabelAlign="Top"></ext:TextArea>
                                        </Items>
                                    </ext:Panel>                                                                                                             
                                </Items>
                             <Listeners>
                                <Show Handler="#{TabComments}.doLayout();" Delay="300" Single="true"/>
                            </Listeners> 
                        </ext:Panel>
                        <ext:Panel ID="TabNotifications" Title="Notifications" runat="server" Height="250" Layout="Absolute">                                
                        <Items>
                            <ext:Panel ID="Panel4" runat="server" Layout="Fit" Width="240" Height="250" X="5" Y="0">
                                <Items>
                                    <ext:GridPanel ID="GridPanel2" runat="server" StoreID="StoreNotificationUsers" DDGroup="secondGridDDGroup"  EnableDragDrop="true" >
                                        <ColumnModel runat="server" ID="GridPanelAllUsers">
                                            <Columns>
                                                <ext:Column DataIndex="Username"></ext:Column>
                                            </Columns>
                                        </ColumnModel>
                                        <SelectionModel>
                                                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                                            </SelectionModel> 
                                    </ext:GridPanel>
                                </Items>
                            </ext:Panel>
                              <ext:Panel runat="server" ID="PanelAddRemoveButtons" X="247" Y="0"  Height="250" Width="50" Layout="Fit" Border="true">
                                             <Defaults>
                                                <ext:Parameter Name="margins" Value="0 5 0 0" Mode="Value" />
                                            </Defaults>
                                            <Items>
                                                <ext:VBoxLayout ID="VBoxLayout1" Align="Center" runat="server" Pack="Center" Padding="5">                                            
                                                    <BoxItems>
                                                        <ext:BoxItem>
                                                            <ext:Button ID="BtnAddNotificationUser" runat="server" Text=">" Width="25"  >
                                                            <DirectEvents>
                                                                <Click OnEvent="AddNotificationUser_DirectEvent">
                                                                    <ExtraParams>
                                                                     <ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel2}.getRowsValues({selectedOnly:true}))" Mode="Raw" />
                                                                    </ExtraParams>
                                                                </Click>
                                                            </DirectEvents>
                                                            </ext:Button>
                                                        </ext:BoxItem>
                                                        <ext:BoxItem>
                                                            <ext:Button ID="BtnAddAllNotificationUser" runat="server" Text=">>" Width="25">                                                                        
                                                            </ext:Button>
                                                        </ext:BoxItem>
                                                        <ext:BoxItem>
                                                            <ext:Button ID="BtnRemoveNotificationUser" runat="server" Text="<" Width="25"></ext:Button>
                                                        </ext:BoxItem>
                                                        <ext:BoxItem>
                                                            <ext:Button ID="BtnRemoveAllNotificationUser" runat="server" Text="<<" Width="25"></ext:Button>  
                                                        </ext:BoxItem>
                                                    </BoxItems>
                                                </ext:VBoxLayout>  
                                            </Items>
                                        </ext:Panel>
                                  <ext:Panel ID="Panel3" runat="server" Height="250" Layout="Fit" X="300" Y="0" Border="false">
                                    <Items>
                                        <ext:GridPanel ID="GridPanel1" runat="server" StoreID="StoreUsersToNotify" DDGroup="firstGridDDGroup"  EnableDragDrop="true">
                                            <ColumnModel runat="server" ID="ColumnModel1">
                                                <Columns>
                                                    <ext:ImageCommandColumn Width="25"  ></ext:ImageCommandColumn>
                                                    <ext:Column DataIndex="Username" Header="Username"></ext:Column>
                                                    <ext:CheckColumn DataIndex="email" Header="E-Mail" Editable="true" Align="Center">                                                                                                                                                                         
                                                    </ext:CheckColumn>
                                                    <ext:CheckColumn DataIndex="sms" Header="SMS" Editable="true" Align="Center" ></ext:CheckColumn>
                                                </Columns>
                                            </ColumnModel>
                                            <DirectEvents>
                                                <AfterEdit OnEvent="SetEmailSMSNotify_DirectEvent" >
                                                <ExtraParams>
                                                    <ext:Parameter Name="values" Value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOnly:true}))" Mode="Raw"></ext:Parameter>                                                
                                                </ExtraParams>
                                                </AfterEdit>
                                            </DirectEvents>                                       
                                            <SelectionModel>
                                                <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" />
                                            </SelectionModel> 
                                        </ext:GridPanel>
                                    </Items>
                                </ext:Panel>                   
                            </Items>
                            </ext:Panel>                                  
                  </Items>
             </ext:TabPanel>                     
              <ext:DropTarget ID="DropTarget1" runat="server" Target="={#{GridPanel2}.view.scroller.dom}" Group="firstGridDDGroup">
                <NotifyDrop Fn="notifyDrop1" />
            </ext:DropTarget>       
            
            <ext:DropTarget ID="DropTarget2" runat="server" Target="={#{GridPanel1}.view.scroller.dom}" Group="secondGridDDGroup">
                <NotifyDrop Fn="notifyDrop2" />
            </ext:DropTarget>
  6. #6

    RE: [CLOSED] File Upload Field

    Hi,

    For me HasFile gives true. Please create simple solution, zip it and post (do not include assemblies)
  7. #7

    RE: [CLOSED] File Upload Field

    Hi

    The is upload="true" on the direct event worked.

    However the wait dialog will not go away.
  8. #8

    RE: [CLOSED] File Upload Field

    Hi,

    You show wait dialog manually therefore you have to hide it manually. Call on server side
    X.Msg.Hide();

    or in the success handler of the direct event
    Ext.Msg.hide();

Similar Threads

  1. File Upload Field - Multiple files?
    By peter.campbell in forum 1.x Help
    Replies: 2
    Last Post: Jul 04, 2012, 11:40 AM
  2. File Upload Field Browse not Open ?
    By nazmulrockon in forum 2.x Help
    Replies: 9
    Last Post: Jun 21, 2012, 9:01 AM
  3. [CLOSED] Clone Upload File Field
    By imaa in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 17, 2011, 2:29 AM
  4. File Upload Field Problem
    By OSSAGHO in forum 1.x Help
    Replies: 0
    Last Post: Sep 19, 2011, 1:09 PM
  5. [CLOSED] File upload field in multifield.
    By pank in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 30, 2009, 9:09 PM

Posting Permissions