Aug 22, 2014, 7:06 PM
Buttons created dynamically don't appear
Hi, i'm trying to create buttons on code behind, all is well, but when i run the code, the buttons are not displayed
*the foreach it's ok the ws returns the strings that i expect
<ext:Window ID="windowSucesoEnSistema" runat="server"
Width="600"
BodyStyle="height: auto;"
Resizable="false"
Modal="true"
AutoRender="false">
<Items>
<ext:FormPanel runat="server" ID="formPanelSS" Width="600" BodyPadding="10" DefaultAnchor="100%" >
<Items>
<ext:Container runat="server" ID="ContainerBotonesArchivosSS" Layout="ColumnLayout" />
</Items>
<Listeners>
<ValidityChange Handler="#{btnAceptarTicketSuceso}.setDisabled(!valid);" />
</Listeners>
</ext:FormPanel>
</Items>
<Buttons>
<ext:Button ID="btnImprimeTicket1" runat="server" OnClientClick="window.open('/ImpresionTicket.aspx')" Icon="Printer" Text="Imprimir"></ext:Button>
<ext:Button ID="btnEnviaTicket1" runat="server" OnDirectClick="btnEnviaTicket_DirectClick" Icon="Email" Text="Enviar por correo"></ext:Button>
<ext:Button ID="btnCerrarSucesoSistema" runat="server" Text="Cerrar" Icon="StopBlue" AutoPostBack="false" Hidden="true" OnDirectClick="Close_Edition_Of_Ticket">
</ext:Button>
<ext:Button ID="btnGuardarSucesoSistema" runat="server" Text="Guardar" Icon="Disk" AutoPostBack="false" Hidden="true" OnDirectClick="Update_Ticket" Visible="false">
</ext:Button>
</Buttons>
</ext:Window>
on code behindprivate void MuestraTicket()
{
wsSSIP.Ticket ticketR = (wsSSIP.Ticket)Session["TicketActualRev"];
List<string> archivos = ws.DameArchivosTicket(ticketR.ID_Ticket).Cast<string>().ToList();
int i = 0;
foreach (string archivo in archivos)
{
Session.Add("filename" + i.ToString(), archivo);
string extension = archivo.Substring(archivo.LastIndexOf("."));
if (extension == "zip" || extension == "rar" || extension == "msg")
{
Session.Add("path" + i.ToString(), "Documentos/" + archivo);
}
Ext.Net.Button boton = new Ext.Net.Button()
{
ColumnWidth = 0.2,
Text = "Muestra archivo " + i.ToString(),
Icon = Icon.Attach,
ID = archivo
};
ContainerBotonesArchivosSS.Items.Add(boton);
}
windowSucesoEnSistema.Show();
}
*the foreach it's ok the ws returns the strings that i expect
Last edited by Prybe; Aug 22, 2014 at 7:13 PM.
Reason: bad redaction