PDA

View Full Version : Using Panel and HTMLEditor



KCoder
Feb 15, 2010, 9:00 AM
Hi Coolite,

Can you kindly advise on what JS method to call when I want to get the value of a Panel after editing with a HTML Editor.

The code below might offer more explanation.




<ext:Panel ID="Panel1" runat="server" Width="610" Height="300" Html="Content" BodyStyle="padding:6px;"
Title="Editor panel">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:ToolbarButton ID="Button1" runat="server" Text="Edit" Icon="Pencil">
<Listeners>
<Click Handler="el.setDisabled(true);#{Button2}.setDisabled(false) ;#{Editor1}.startEdit(#{Panel1}.getBody());" />
</Listeners>
</ext:ToolbarButton>
<ext:ToolbarButton ID="Button2" runat="server" Text="Save" Icon="Disk" Disabled="true">
<Listeners>
<Click Handler="el.setDisabled(true);#{Button1}.setDisabled(false) ;#{Editor1}.completeEdit();" />
</Listeners>
</ext:ToolbarButton>
</Items>
</ext:Toolbar>
</TopBar>
</ext:Panel>

<ext:Editor ID="Editor1" runat="server" AutoSize="Fit" Shadow="None">
<Field>
<ext:HtmlEditor ID="HtmlEditor2" runat="server" />
</Field>
</ext:Editor>


<ext:Button ID="Button7" runat="server" Text="WYSIWYG">
<AjaxEvents>
<Click OnEvent="CompleteEdit3">
<ExtraParams>
<ext:Parameter Name="HTMLPanel" Value="#{Panel1}.getBody()" Mode="Raw" />
</ExtraParams>
</Click>
</AjaxEvents>
</ext:Button>


protected void CompleteEdit3(object sender, AjaxEventArgs e)
{
this.AjaxLabel.Html = "qqqq " + e.ExtraParams["HTMLPanel"];
}




On clicking the Button7, I only get "qqqq" and without the value in Panel1. I tried #{Panel1}.getText(), but that returned undefined function.

Thanks in anticipation.