Feb 14, 2012, 3:47 AM
Confirmation with save button
Hi,
I am using below code.
Now my problem is that, the confirmation box appears before the messagebox in Save(Directevent).
If the IsFieldEmpty() return false then the messagebox (X.MessageBox.Alert("Error", "Please check all fields").Show();) should appear first and then confirmation box should appear but if I am using below code then confirmation box appears before.
what I have to do so that confirmationbox appears after?????
Vaishali Khatri
I am using below code.
Now my problem is that, the confirmation box appears before the messagebox in Save(Directevent).
If the IsFieldEmpty() return false then the messagebox (X.MessageBox.Alert("Error", "Please check all fields").Show();) should appear first and then confirmation box should appear but if I am using below code then confirmation box appears before.
what I have to do so that confirmationbox appears after?????
<ext:Window ID="winUsergroup" Hidden="true" runat="server" Collapsible="false" Height="225"
Width="350" Resizable="false">
<Items>
<ext:Panel ID="Panel1" runat="server" Height="300" Title="User Group" Padding="15">
<Items>
<ext:TextField ID="txtUserGroupName" runat="server" FieldLabel="User Group" AllowBlank="false" Width="300" BlankText="Required field" MsgTarget="Side" >
</ext:TextField>
<ext:TextArea ID="txtDescription" runat="server" FieldLabel="Description" Width="300" >
</ext:TextArea>
</Items>
</ext:Panel>
</Items>
<Buttons>
<ext:Button ID="btnSave" runat="server" Icon="Disk" Text="Save">
<DirectEvents>
<Click OnEvent="Save">
<Confirmation ConfirmRequest="true" Title="Confirm" Message="Are you sure you want to save the record?"/>
</Click>
</DirectEvents>
</ext:Button>
<ext:Button ID="btnUpdate" runat="server" Icon="Disk" Text="Update">
<DirectEvents>
<Click OnEvent="Update">
<Confirmation ConfirmRequest="true" Title="Confirm" Message="Are you sure you want to modify the record?" />
</Click>
</DirectEvents>
</ext:Button>
</Buttons>
</ext:Window>
private Boolean IsFieldEmpty()
{
if (txtUserGroupName.Text.Trim() == "")
return false;
else
return true;
}
protected void Save(object sender, DirectEventArgs e)
{
if (IsFieldEmpty() == true)
{
AssignData(objusergrp);
objusergrp.Insert();
this.winUsergroup.Hide();
BindGrid();
lblMessage.Text = "Record saved Successfully...";
}
else
X.MessageBox.Alert("Error", "Please check all fields").Show();
}
Vaishali Khatri