View Full Version : Update centerpanel body

Filip Beunens
Mar 31, 2009, 4:33 AM
Hi, I'm started with coolite for a few weeks in VB.net and now I've already managed tot contruct a page a page with a viewport layout (west,north, south & center). I'v also made a custom control that create & acoordion menu in code behind and the control is working fine, see code below :

Dim mAccor = New ext.Accordion
mAccor.ID = "Accordion"

For Each DataRow In menuDATA.GetData()
Dim MenuSort As String = Convert.ToString(DataRow("sort"))
Dim MenuName As String = DataRow("name")
Dim MenuURL As String = DataRow("href")
If DataRow("depth") = 0 Then
mPanel = New ext.MenuPanel
mPanel.Title = MenuName
mPanel.ID = "MenuPanel" & MenuSort
mPanel.Border = False
ElseIf DataRow("depth") = 1 Then
Dim mitem = New ext.MenuItem
mitem.ID = "Menuitem" & MenuSort
mitem.Text = DataRow("name")
mitem.Icon = ext.Icon.BulletRight
mitem.Listeners.Click.Fn = "MenuItemClick"
End If

But the next step I'm having problems.. .the URL for the page that has to display in the center panel is in the MenuURL value how can I asign this value to every menuitem & how must my MenuItemClick javascript function look like to achieve the update.

De URL is a .aspx page itself with forms & grids on it, is this the right way to work or do I have to build my site structure in another way

Every help welcome !!!


Mar 31, 2009, 5:16 AM

You can use CustomConfig for MenuItem

<ext:MenuItem runat="server" >
<ext:ConfigItem Name="url" Value="mypage.aspx" Mode="Value" />

Then you can use Click listener of MenuItem

<Click Handler="#{CenterPanel}.load({url:this.url, mode:'iframe'});"/>

Or ItemClick of MenuPanel

<ItemClick Handler="#{CenterPanel}.load({url:menuItem.url, mode:'iframe'});"/>

Filip Beunens
Mar 31, 2009, 5:41 AM
Thanks for your FAST response !!! I'm on track again