PDA

View Full Version : [CLOSED] GridPanel DirectEvents - FileUploadField error



Aurelio
Mar 15, 2012, 6:06 PM
Hi, i have an FileUploadField in a TabPanel, if call a DirectEvents from the GridPanel, i get a error:BADRESPONSE: Errore di sintassi and the window of error is empty:

1)Click on the row in the GridPanel and the error appear, if delete the command DirectEvents from the page, it's work ok, if delete the component FileUploadField it's work ok.

2)If press the botton Brownser the request of file not appear, this problem appear also in the sample
http://examples2.ext.net/#/Form/FileUploadField/Basic/

Where is the code of problem 1 (in the versione 2.0 DP1 work ok):


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ARWebRevolution.WebForm1" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Ext.NET v2 Example</title>

</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" Namespace="">
</ext:ResourceManager>
<ext:Store ID="Store1" runat="server" >
<Model>
<ext:Model ID="Model1" runat="server" >
<Fields>
<ext:ModelField Name="nome" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<ext:Viewport ID="Viewport1" runat="server" Layout="border">
<Items>
<ext:Panel ID="PanelNazioni" runat="server" Region="West" Width="300" BodyPadding="3"
Layout="FitLayout" >
<Items>
<ext:GridPanel ID="GridPanelProvince" runat="server" Title="Province" StoreID="Store1">
<ColumnModel>
<Columns>

<ext:Column runat="server" ID="nome" DataIndex="nome" Align="Left" Flex="1" Text="Name" />

</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModelGruNeg" runat="server" Mode="Single">
<DirectEvents>
<Select OnEvent="CaricaNegoziGruppo">

</Select>
</DirectEvents>

</ext:RowSelectionModel>
</SelectionModel>

</ext:GridPanel>
</Items>
</ext:Panel>
<ext:Panel ID="PanelGenerale" runat="server" Region="Center" Layout="FitLayout" Title="Negozio">
<Items>
<ext:TabPanel ID="TabPanelAzienda" Region="Center" runat="server" TabPosition="Bottom">
<Items>
<ext:Panel ID="PanelAnagrafica" runat="server" Title="Anagrafica" Layout="FitLayout">
<Items>

</Items>
</ext:Panel>
<ext:Panel ID="PanelDatiFiscali" runat="server" Title="Dati fiscali" Layout="FitLayout">
<Items>

</Items>
</ext:Panel>
<ext:Panel ID="PanelLoghi" runat="server" Title="Loghi" Layout="FitLayout">
<Items>
<ext:TabPanel ID="TabPanelDoc" runat="server" TabPosition="Bottom" TabAlign="Right">
<Items>
<ext:Panel ID="PanelDocInt" runat="server" Title="Documenti interni" Layout="FitLayout">
<Items>
<ext:Image ID="ImageAziLogDocInt" runat="server" Anchor="100% 100%" ImageUrl="" />

</Items>
<BottomBar>
<ext:Toolbar runat="server" ID="ToolBarDocInt">
<Items>

<ext:ToolbarFill />
<ext:FileUploadField ID="FileUploadFieldLogInt" runat="server" ButtonOnly="true"
Disabled="false">

<ToolTips>
<ext:ToolTip ID="ToolTipDocInt" runat="server" Title="Logo interno" Html="Logo per documenti interni al negozio, deve essere nel formato grafico jpg.">
</ext:ToolTip>
</ToolTips>
</ext:FileUploadField>
<ext:Button ID="ButtonCancelDocInt" runat="server" Text="Cancella logo" Icon="Delete"
ToolTip="Cancella il logo per i documenti interni" ToolTipType="Title" Disabled="true">

</ext:Button>
</Items>
</ext:Toolbar>
</BottomBar>
</ext:Panel>
<ext:Panel ID="PanelDocEst" runat="server" Title="Documenti esterni" Layout="FitLayout">
<Items>
<ext:Image ID="ImageAziLogDocEst" runat="server" Anchor="100% 100%" ImageUrl="" />
</Items>
<BottomBar>
<ext:Toolbar runat="server" ID="ToolBarDocEst">
<Items>
<ext:ToolbarFill />

<ext:Button ID="ButtonCancelDocEst" runat="server" Text="Cancella logo" Icon="Delete"
ToolTip="Cancella il logo per i documenti esterni" ToolTipType="Title" Disabled="true">
<Listeners>
<Click Handler="DeleteDoc('DocEst',#{GridPanelNegozi}.getSelection Model().getLastSelected().get('AziId'),'Avviso','C ancello il documento esterno ? ');" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</BottomBar>
</ext:Panel>
</Items>
</ext:TabPanel>

</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
<BottomBar>
<ext:Toolbar runat="server" ID="ToolBarGruNeg" >
<Items>
<ext:Button ID="ButtonNew" runat="server" Text="Nuovo" Scale="Medium" IconUrl="Images/24/new24.png"
ToolTip="Crea un nuovo gruppo negozio." ToolTipType="Title">

</ext:Button>
<ext:Button ID="ButtonEdit" runat="server" Text="Modifica" Disabled="true" Scale="Medium"
IconUrl="Images/24/edit24.png" ToolTip="Modifica il gruppo negozio selezionato."
ToolTipType="Title">

</ext:Button>
<ext:Button ID="ButtonDelete" runat="server" Text="Cancella" Disabled="true" Scale="Medium"
IconUrl="Images/24/delete24.png" ToolTip="Cancella il gruppo negozio selezionato."
ToolTipType="Title">

</ext:Button>
<ext:ToolbarFill />
<ext:Button ID="ButtonSave" runat="server" Text="Salva" Disabled="true" Scale="Medium"
Hidden="true" IconUrl="Images/24/save24.png" ToolTip="Salva le modifiche apportate"
ToolTipType="Title">

</ext:Button>
<ext:Button ID="ButtonCancel" runat="server" Text="Annulla" Scale="Medium" Hidden="true"
IconUrl="Images/24/cancel24.png" ToolTip="Annulla le modifiche apportate" ToolTipType="Title">

</ext:Button>
</Items>
</ext:Toolbar>
</BottomBar>
</ext:Panel>
</Items>
</ext:Viewport>
</form>
<script type="text/javascript" >

//Controllo Codice Fiscale

function test () {
var cf = txtRagSoc.getValue();
if (cf == 'validate') {

return 'Error Pisolo';
}
//ButtonSave.setDisabled(!FormPanelNazione.isValid() );
return true;
};

</script>
</body>
</html>




using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ARWebRevolution.Query;
using Ext.Net;

namespace ARWebRevolution
{
public partial class WebForm1 : System.Web.UI.Page
{

protected void Page_Load(object sender, EventArgs e)
{
var lista = TestData(100);
var lista2 = from t0 in lista
select new
{
t0.nome
};
Store1.DataSource = lista2;
Store1.DataBind();
}

protected void CaricaNegoziGruppo (object sender, DirectEventArgs e)
{
var a = 10;
}


private static List<Employee> TestData(int count)
{
var firstNames = new string[] { "Ed", "Tommy", "Aaron", "Abe", "Jamie", "Adam", "Dave", "David", "Jay", "Nicolas", "Nige" };
var lastNames = new string[] { "Spencer", "Maintz", "Conran", "Elias", "Avins", "Mishcon", "Kaneda", "Davis", "Robinson", "Ferrero", "White" };
var ratings = new int[] { 1, 2, 3, 4, 5 };
var salaries = new int[] { 100, 400, 900, 1500, 1000000 };

var data = new List<Employee>();
var rnd = new Random();

for (int i = 0; i < count; i++)
{
var ratingId = rnd.Next(ratings.Length);
var salaryId = rnd.Next(salaries.Length);
var firstNameId = rnd.Next(firstNames.Length);
var lastNameId = rnd.Next(lastNames.Length);

var rating = ratings[ratingId];
var salary = salaries[salaryId];
var name = String.Format("{0} {1}", firstNames[firstNameId], lastNames[lastNameId]);
var rowEmp = new Employee{nome = name,rata = rating,costo = salary};
data.Add(rowEmp);

}

return data;
}

public class Employee
{
public string nome { get; set; }
public int rata { get; set; }
public int costo { get; set; }
}
}
}


Thanks

Aurelio

Vladimir
Mar 15, 2012, 8:32 PM
Hi,

Please update from SVN and retest

Aurelio
Mar 15, 2012, 11:43 PM
HI, Vladimir....great work..it's work OK..
There is only one small problem not serious, if set disable(false) in a method Javascript, the FileUploadFieldLogInt open the browser ok, but the text of the button not change the opacity...


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ARWebRevolution.WebForm1" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Ext.NET v2 Example</title>

</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" Namespace="">
</ext:ResourceManager>
<ext:Store ID="Store1" runat="server" >
<Model>
<ext:Model ID="Model1" runat="server" >
<Fields>
<ext:ModelField Name="nome" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<ext:Viewport ID="Viewport1" runat="server" Layout="border">
<Items>
<ext:Panel ID="PanelNazioni" runat="server" Region="West" Width="300" BodyPadding="3"
Layout="FitLayout" >
<Items>
<ext:GridPanel ID="GridPanelProvince" runat="server" Title="Province" StoreID="Store1">
<ColumnModel>
<Columns>

<ext:Column runat="server" ID="nome" DataIndex="nome" Align="Left" Flex="1" Text="Name" />

</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModelGruNeg" runat="server" Mode="Single">
<Listeners>
<Select Handler="enableButton();" />
</Listeners>
</ext:RowSelectionModel>
</SelectionModel>

</ext:GridPanel>
</Items>
</ext:Panel>
<ext:Panel ID="PanelGenerale" runat="server" Region="Center" Layout="FitLayout" Title="Negozio">
<Items>
<ext:TabPanel ID="TabPanelAzienda" Region="Center" runat="server" TabPosition="Bottom">
<Items>
<ext:Panel ID="PanelAnagrafica" runat="server" Title="Anagrafica" Layout="FitLayout">
<Items>

</Items>
</ext:Panel>
<ext:Panel ID="PanelDatiFiscali" runat="server" Title="Dati fiscali" Layout="FitLayout">
<Items>

</Items>
</ext:Panel>
<ext:Panel ID="PanelLoghi" runat="server" Title="Loghi" Layout="FitLayout">
<Items>
<ext:TabPanel ID="TabPanelDoc" runat="server" TabPosition="Bottom" TabAlign="Right">
<Items>
<ext:Panel ID="PanelDocInt" runat="server" Title="Documenti interni" Layout="FitLayout">
<Items>
<ext:Image ID="ImageAziLogDocInt" runat="server" Anchor="100% 100%" ImageUrl="" />

</Items>
<BottomBar>
<ext:Toolbar runat="server" ID="ToolBarDocInt">
<Items>

<ext:ToolbarFill />
<ext:FileUploadField ID="FileUploadFieldLogInt" runat="server" ButtonOnly="True"
Icon="DiskUpload" ButtonText="Carica logo..." Disabled="true">

<ToolTips>
<ext:ToolTip ID="ToolTipDocInt" runat="server" Title="Logo interno" Html="Logo per documenti interni al negozio, deve essere nel formato grafico jpg.">
</ext:ToolTip>
</ToolTips>
</ext:FileUploadField>
<ext:Button ID="ButtonCancelDocInt" runat="server" Text="Cancella logo" Icon="Delete"
ToolTip="Cancella il logo per i documenti interni" ToolTipType="Title" Disabled="true">

</ext:Button>
</Items>
</ext:Toolbar>
</BottomBar>
</ext:Panel>
<ext:Panel ID="PanelDocEst" runat="server" Title="Documenti esterni" Layout="FitLayout">
<Items>
<ext:Image ID="ImageAziLogDocEst" runat="server" Anchor="100% 100%" ImageUrl="" />
</Items>
<BottomBar>
<ext:Toolbar runat="server" ID="ToolBarDocEst">
<Items>
<ext:ToolbarFill />

<ext:Button ID="ButtonCancelDocEst" runat="server" Text="Cancella logo" Icon="Delete"
ToolTip="Cancella il logo per i documenti esterni" ToolTipType="Title" Disabled="true">
<Listeners>
<Click Handler="DeleteDoc('DocEst',#{GridPanelNegozi}.getSelection Model().getLastSelected().get('AziId'),'Avviso','C ancello il documento esterno ? ');" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</BottomBar>
</ext:Panel>
</Items>
</ext:TabPanel>

</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
<BottomBar>
<ext:Toolbar runat="server" ID="ToolBarGruNeg" >
<Items>
<ext:Button ID="ButtonNew" runat="server" Text="Nuovo" Scale="Medium" IconUrl="Images/24/new24.png"
ToolTip="Crea un nuovo gruppo negozio." ToolTipType="Title">

</ext:Button>
<ext:Button ID="ButtonEdit" runat="server" Text="Modifica" Disabled="true" Scale="Medium"
IconUrl="Images/24/edit24.png" ToolTip="Modifica il gruppo negozio selezionato."
ToolTipType="Title">

</ext:Button>
<ext:Button ID="ButtonDelete" runat="server" Text="Cancella" Disabled="true" Scale="Medium"
IconUrl="Images/24/delete24.png" ToolTip="Cancella il gruppo negozio selezionato."
ToolTipType="Title">

</ext:Button>
<ext:ToolbarFill />
<ext:Button ID="ButtonSave" runat="server" Text="Salva" Disabled="true" Scale="Medium"
Hidden="true" IconUrl="Images/24/save24.png" ToolTip="Salva le modifiche apportate"
ToolTipType="Title">

</ext:Button>
<ext:Button ID="ButtonCancel" runat="server" Text="Annulla" Scale="Medium" Hidden="true"
IconUrl="Images/24/cancel24.png" ToolTip="Annulla le modifiche apportate" ToolTipType="Title">

</ext:Button>
</Items>
</ext:Toolbar>
</BottomBar>
</ext:Panel>
</Items>
</ext:Viewport>
</form>
<script type="text/javascript" >

//Controllo Codice Fiscale

function enableButton () {
FileUploadFieldLogInt.setDisabled(false);
};

</script>
</body>
</html>


The code is same as above

Thanks
Aurelio

Daniil
Mar 16, 2012, 10:49 AM
Thanks for the report. Here is the sample to test with.

We are investigating.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager runat="server" />

<ext:FileUploadField
ID="FileUploadField1"
runat="server"
ButtonOnly="True"
Icon="DiskUpload"
Disabled="true" />

<ext:Button runat="server" Text="Enable">
<Listeners>
<Click Handler="App.FileUploadField1.enable();" />
</Listeners>
</ext:Button>

<ext:Button runat="server" Text="Disable">
<Listeners>
<Click Handler="App.FileUploadField1.disable();" />
</Listeners>
</ext:Button>

<br />
Not disabled initially:

<ext:FileUploadField
runat="server"
ButtonOnly="True"
Icon="DiskUpload" />
</body>
</html>

Daniil
Mar 16, 2012, 1:10 PM
The fix has been added to SVN, please update.

Aurelio
Mar 16, 2012, 1:52 PM
Hi, Daniil...ok

Thanks