Aug 25, 2015, 9:28 AM
Update handler for button
Hello. I have the following markup:
...
Where is a problem?
PS. It looks like handler doesn't exist in the response, only disabled/enabled properties (I skipped some strings for brevity):
{script:"Ext.net.ResourceMgr.registerIcon([\"FolderPicture\"]);ShowChildButton.setDisabled(false); ... }
...
<ext:Button ID="RefreshDoc" runat="server" Icon="Reload" >
<DirectEvents>
<Click OnEvent="RefreshDocument" Type="Load" Method="POST" Success="doStuffAfterSuccess();">
<ExtraParams>
<ext:Parameter Name="Id" Value="#{Id}.getValue()" Mode="Raw" />
</ExtraParams>
<EventMask ShowMask="true" MinDelay="500" />
</Click>
</DirectEvents>
</ext:Button>
<ext:Button ID="ShowChildButton" runat="server" Icon="ClockGo" Text="Show Child" >
</ext:Button>
This is the RefreshDocument method:public void RefreshDocument(object sender, DirectEventArgs e)
{
var id = e.ExtraParams.ToDictionary(o => o.Name, v => v.Value).ToGuidId();
if (id == Guid.Empty)
{
this.ShowChildButton.Disabled = true;
return;
}
// skip url building for brevity
this.ShowChildButton.Disabled = false;
this.ShowChildButton.Listeners.Click.Handler ="console.log(1);"
}
As you can see, I send Id, sometimes it can be empty. And when it's empty then button is disabled. After some other actions Id can be filled and when I click `RefreshDoc` button then `ShowChildButton` shows and clickable, but the handler doesn't call.Where is a problem?
PS. It looks like handler doesn't exist in the response, only disabled/enabled properties (I skipped some strings for brevity):
{script:"Ext.net.ResourceMgr.registerIcon([\"FolderPicture\"]);ShowChildButton.setDisabled(false); ... }
Last edited by sharok; Aug 25, 2015 at 10:31 AM.