PDA

View Full Version : [CLOSED] Cannot get to work Loader in VB



jamesand
Jan 14, 2014, 12:18 PM
Hi all,

I'm trying to use one of the methods used here: http://examples2.ext.net/#/Loaders/Component/Direct_Method/, but I cannot make it work in VB.

Here is a test case:


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TestLoader.aspx.vb" Inherits="EventFactoryWebAzure.TestLoader" %>

<script runat="server">

<DirectMethod>
Public Shared Function CargaControl() As String

Return ComponentLoader.ToConfig("~/Controles/GestionClientes.ascx")

End Function

</script>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="frm" runat="server" style="height: 100%;">

<ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Gray" DisableViewState="true">
</ext:ResourceManager>

<ext:Viewport ID="Viewport1" runat="server" StyleSpec="background-color: transparent;" Layout="BorderLayout">
<Items>
<ext:TabPanel
ID="TabPanel1"
Region="Center"
runat="server"
ActiveTabIndex="0"
Border="false"
BodyStyle="background-color: #4D778B; border: 1px solid #AABBCC; border-top: none;"
MarginsSummary="5 5 5 0">
<Plugins>
<ext:BoxReorderer ID="BoxReorderer1" runat="server" />
</Plugins>
<Items>
<ext:Panel
ID="pnlClientes"
runat="server"
Title="Clientes"
Icon="Group"
BodyStyle="background-color: transparent;"
AutoScroll="true"
Layout="FormLayout">
<Loader
runat="server"
AutoLoad="false"
DirectMethod="#{DirectMethods}.CargaControl()"
Mode="Component">
<LoadMask ShowMask="true" Msg="Cargando..." />
</Loader>
<Buttons>
<ext:Button runat="server" Text="Load" Icon="PluginGo">
<Listeners>
<Click Handler="this.up('panel').load();this.disable();" />
</Listeners>
</ext:Button>
</Buttons>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
</ext:Viewport>

</form>
</body>
</html>


If you debig it, CargaControl() is never called. How should I call the DirectMethod?

Thank you in advance.

Daniil
Jan 14, 2014, 12:26 PM
Hi @jamesand,

Please replace

DirectMethod="#{DirectMethods}.CargaControl()"

with

DirectMethod="#{DirectMethods}.CargaControl"

jamesand
Jan 14, 2014, 12:56 PM
Hi @jamesand,

Please replace

DirectMethod="#{DirectMethods}.CargaControl()"

with

DirectMethod="#{DirectMethods}.CargaControl"

It is curious, it works in the test case but not in my web site. We will investigate.