WebToolBar buttom is duplicate submission

4 replies. Last post: June 3, 2015 1:27 AM by Yudi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Sun BennyMember

Hi, 

I want to know whether the WebToolBar has a fuction, can prevent the button is duplicate submission.

Means that when click on a button, the button is not available, when all the background code are performed, then the button becomes available.

i often received user feedback that he did not respond as first time, and then click second times. I want to avoid users to submit many times.


function wtcTray_OnClick(controlId,ToolCommand) {

                switch (ToolCommand.Name.toLowerCase()) {                    
                    case 'cmdclose':                        // close this dialog
                        var dlgName = document.getElementById('hidDlgName').value;
                        //alert(dlgName);
                        parent.closeDialog(dlgName);
                        break;

                    case 'cmdsubmit':

                        //Postback to parent to create/append booking
                        // the logic is done on the server side
                        var wgTray = ISGetObject('wgTray');

                        if (wgTray.GetChangesCount() > 0) {
                            document.getElementById('hidActionAfterBatchUpdate').value = 'ToolbarSubmitBooking';
                            wgTray.AcceptAllChanges();
                        }
                        else {
                            invokeSubmitBooking();
                        }
                        
                        break;

                    default:
                        // do Nothing
                }
               
        }







<ISWebDesktop:WebToolBar ID="wtcTray" runat="server" AllowCustomize="No" AllowExpandCollapse="No"
                        AllowFloat="No" AllowMove="No" Caption="Tray" DisplayMode="TextAndImage" FillDockingRow="Yes"
                        HeaderHeight="" IntegratedTo="None" AutoPostBack="No" Height="24px" ViewStateServerConnection="path=C:\Inetpub\CacheStorage\ViewState"
                        ViewStateStorage="FileServer"  >
                        <Commands>
                            <ISWebDesktop:ToolCommand Category="WebToolBar1" Image="~/image/gear32.png" Name="cmdSubmit"
                                Text="Submit">
                            </ISWebDesktop:ToolCommand>
                            <ISWebDesktop:ToolCommand Category="WebToolBar1" Name="sep1" Type="Separator">
                            </ISWebDesktop:ToolCommand>
                            <ISWebDesktop:ToolCommand Category="WebToolBar1" Image="~/image/stop32.png" Name="cmdClose"
                                Text="Close">
                            </ISWebDesktop:ToolCommand>
                        </Commands>
                        <CommandClientSideEvents OnClick="wtcTray_OnClick" />
                        <HeaderCaptionStyle BackColor="#2A66C9" Cursor="Move" Font-Bold="True" Font-Names="Tahoma"
                            Font-Size="8pt" ForeColor="White">
                        </HeaderCaptionStyle>
                        <CommandDisabledStyle Font-Names="Segoe UI,Tahoma" Font-Size="8pt" ForeColor="DimGray">
                            <Padding Bottom="1px" Left="3px" Right="3px" Top="1px" />
                        </CommandDisabledStyle>
                        <HeaderButtonStyle>
                            <Normal BackColor="#2A66C9" Cursor="Hand" Font-Size="8pt" ForeColor="White" Width="13px">
                                <Padding Bottom="1px" Left="1px" Right="1px" Top="1px" />
                            </Normal>
                            <Over BackColor="#FFF2C8" BaseStyle="Normal" BorderColor="#316AC5" BorderStyle="Solid"
                                BorderWidth="1px" Cursor="Hand" ForeColor="Black">
                                <Padding Bottom="0px" Left="0px" Right="0px" Top="0px" />
                            </Over>
                            <Active BackColor="#FE9855" BaseStyle="Over" BorderColor="#4B4B6F" Cursor="Hand">
                            </Active>
                        </HeaderButtonStyle>
                        <CommandStyle>
                            <Normal Font-Names="Segoe UI,Tahoma" Font-Size="8pt" Overflow="Hidden" OverflowX="Hidden"
                                OverflowY="Hidden">
                                <Padding Bottom="1px" Left="3px" Right="3px" Top="1px" />
                            </Normal>
                            <Over BackColor="#FFF5CC" BackColor2="255, 219, 117" BorderColor="#FFBD69" BorderStyle="Solid"
                                BorderWidth="1px" Cursor="Default" Font-Names="Segoe UI,Tahoma" Font-Size="8pt"
                                GradientType="Vertical" Overflow="Hidden" OverflowX="Hidden" OverflowY="Hidden">
                                <Padding Bottom="0px" Left="2px" Right="2px" Top="0px" />
                            </Over>
                            <Active BackColor="#FE9855" BaseStyle="Over">
                            </Active>
                        </CommandStyle>
                        <SeparatorStyle>
                            <BorderSettings>
                                <Left Color="154, 198, 255" Style="solid" Width="1px" />
                            </BorderSettings>
                        </SeparatorStyle>
                        <HandleStyle BackColor="#E3EFFF"  GradientType="Vertical" />
                        <BodyStyle BackColor="#E3EFFF" GradientType="Vertical" />
                        <OptionStyle BackColor="#D3E6FF" BackColor2="116, 161, 220" ForeColor="Black" GradientType="Vertical" />
                        <MenuStyleSettings BackgroundStripColor="233, 238, 238" BackgroundStripColor2=""
                            MenuAnimation="True" MenuWindowType="Normal">
                            <ItemStyle>
                                <Normal Font-Names="segoe ui,tahoma" Font-Size="8.25pt">
                                </Normal>
                                <Over BackColor="#FFE7A2" BaseStyle="Normal" BorderColor="#FFBD69" BorderStyle="Solid"
                                    BorderWidth="1px">
                                </Over>
                            </ItemStyle>
                            <DisabledItemStyle>
                                <Normal Font-Names="segoe ui,tahoma" Font-Size="8.25pt" ForeColor="Silver">
                                </Normal>
                                <Over BackColor="WhiteSmoke" BaseStyle="Normal" BorderColor="#FFBD69" BorderStyle="Solid"
                                    BorderWidth="1px" ForeColor="Gray">
                                </Over>
                            </DisabledItemStyle>
                            <CheckedItemStyle>
                                <Normal BackColor="#FFBD69" BorderColor="#FFAB3F" BorderStyle="Solid" BorderWidth="1px">
                                </Normal>
                                <Over BackColor="#FB8C3C" BorderColor="#FB8C3C" BorderStyle="Solid" BorderWidth="1px">
                                </Over>
                            </CheckedItemStyle>
                            <FrameStyle BackColor="White" BorderColor="#6593CF" BorderStyle="Solid" BorderWidth="1px">
                            </FrameStyle>
                            <SeparatorStyle>
                                <BorderSettings>
                                    <Top Color="154, 198, 255" Style="solid" Width="1px" />
                                </BorderSettings>
                            </SeparatorStyle>
                        </MenuStyleSettings>
                    </ISWebDesktop:WebToolBar>

 

All times are GMT -5. The time now is 7:29 AM.
Previous Next