View Full Version : [CLOSED] Question about component loader

Jan 22, 2013, 2:27 PM

I begin to play with component loader as it is a powerfull way to add component to other one, but I have a question.

I made a tabpanel with 2 tabs. Second tabs will be loaded by a component loader on first activation BUT i want to clear this tab and reload if I change a parameter.

See this code :

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TestComponentLoader.aspx.vb" Inherits="VisualManagement.TestComponentLoader" %>
<%@ 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">
<script language="javascript" type="text/javascript">
clearPanel = function ()


<form id="form1" runat="server">
<ext:ResourceManager runat="server" ID="ResourceManager">

<ext:Panel runat="server" Width="500" Height="500" Layout="FitLayout">
<ext:Toolbar runat="server">
FieldLabel="Value to seek"
<ext:Button runat="server" Text="clear Panel">
<Click Handler="#{tabHistorique}.removeAll()"></Click>
<ext:TabPanel ID="tabRMA" runat="server" Height="200" Width="350">
<ext:Panel ID="tabLast" runat="server" Border="false" Layout="FitLayout" Title="Some stuff">
<ext:Panel ID="tabHistorique" runat="server" Border="false" Title="Historique" Layout="FitLayout">
<Loader ID="Loader1" runat="server" Url="LoadHistorique.ashx" Mode="Component" >
<LoadMask ShowMask="true"></LoadMask>
<ext:Parameter Name="RMA" Value="#{txtToSeek}.value" Mode="Raw"></ext:Parameter>

when txtToSeek change I want to update the second tab as the contents will depend of value in txtToSeek field.

The ashx that made component (very basic at this time and sorry for vb code)

Imports System.Web
Imports System.Web.Services
Imports Ext.Net

Public Class LoadHistorique
Implements System.Web.IHttpHandler

Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim MyComponents As List(Of AbstractComponent) = New List(Of AbstractComponent)

Dim myTab As New TabPanel

For i As Integer = 0 To 10
Dim myPanel As New Panel
With myPanel
.Title = "Panel" + i.ToString
End With

context.Response.ContentType = "application/json"


End Sub

ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Return False
End Get
End Property

End Class

Another question, how can I get RMA param in handler? I look at context data but found nothing so far. EDIT : found : My.Request.Form(0) conatins my param.

EDIT 2 I found solution here : http://forums.ext.net/showthread.php?18879-CLOSED-How-to-reset-panel-when-autoloading-a-partialview

Jan 22, 2013, 5:22 PM
Hi @feanor91,

So, can we just mark the thread as closed?

Jan 22, 2013, 5:24 PM
Please note that if you set RemoveAll="true" for Loader then previous widgets inside container will be deleted automatically
To intiate reloading when text field is change you can use Change event of the field

<Change Handler="#{tabHistorique}.getLoader().load();"/>

Jan 22, 2013, 5:57 PM
Danii : yes you can
Vladimir: ok, I will check