|
Rank: Advanced Member Groups: Member
Joined: 6/6/2007 Posts: 37
|
good afternoon,
I have a toolbar with buttons and a dropdownlist. I made it autopostback how can I achieve that when I click the dropdownlist the postback waits until I 've chosen an item in the dropdownlist.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
I am not exactly sure you mean the toolbar is AutoPostBack or the DropDownList is AutoPostBack. For the former, the page posts back when you click a tool bar item; for the latter, the page posts back when you select a list item. If you want to perform anything else before the postback or even cancel the postback, you would be looking for onsubmit event, which is standard HTML/JavaScript stuff, you can find a lot of information about it online.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 6/6/2007 Posts: 37
|
The toolbar is autopostback and it postsback before I can make a selection in the dropdownlist
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
I see, you can do this:
Code: HTML/ASPX
<eo:ToolBarItem Type="Custom">
<CustomItem>
<div onclick="eo_CancelBubble(event)">
<asp:DropDownList Runat="server"
AutoPostBack="True" ID="DropDownList1">
<asp:ListItem Value="- Select One -"></asp:ListItem>
<asp:ListItem Value="Option 1"></asp:ListItem>
<asp:ListItem Value="Option 2"></asp:ListItem>
<asp:ListItem Value="Option 3"></asp:ListItem>
</asp:DropDownList>
</div>
</CustomItem>
</eo:ToolBarItem>
Note the additional div element with onclick="eo_CancelBubble(event)", that will prevent the click event to be picked up by the toolbar. Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 6/6/2007 Posts: 37
|
it works, I can select an item, but after that I have to click on another button to proceed with the result of the selected item. the autopostback of the dropdownlist doesn't work.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi, We tried this ToolBar and it works fine:
Code: HTML/ASPX
<eo:ToolBar id="ToolBar1" runat="server" BackgroundImageRight="00100202" Width="400px" BackgroundImage="00100203"
SeparatorImage="00100204" BackgroundImageLeft="00100201" AutoPostBack="True">
<DownStyle CssText="BORDER-RIGHT: #335ea8 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #335ea8 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 1px; BORDER-LEFT: #335ea8 1px solid; CURSOR: hand; PADDING-TOP: 3px; BORDER-BOTTOM: #335ea8 1px solid; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #ffe1ac"></DownStyle>
<HoverStyle CssText="BORDER-RIGHT: #335ea8 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #335ea8 1px solid; PADDING-LEFT: 3px; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; BORDER-LEFT: #335ea8 1px solid; CURSOR: hand; PADDING-TOP: 2px; BORDER-BOTTOM: #335ea8 1px solid; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #ffe1ac"></HoverStyle>
<NormalStyle CssText="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-SIZE: 12px; PADDING-BOTTOM: 3px; CURSOR: hand; BORDER-TOP-STYLE: none; PADDING-TOP: 3px; FONT-FAMILY: Tahoma; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none"></NormalStyle>
<ItemTemplates>
<eo:ToolBarItem Type="Custom">
<HoverStyle CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;"></HoverStyle>
<DownStyle CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;"></DownStyle>
<NormalStyle CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;"></NormalStyle>
</eo:ToolBarItem>
<eo:ToolBarItem Type="DropDownMenu">
<HoverStyle CssText="background-color:#ffe1ac;background-image:url('00100206');background-position-x:right;border-bottom-color:#335ea8;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#335ea8;border-left-style:solid;border-left-width:1px;border-right-color:#335ea8;border-right-style:solid;border-right-width:1px;border-top-color:#335ea8;border-top-style:solid;border-top-width:1px;cursor:hand;padding-bottom:2px;padding-left:3px;padding-right:3px;padding-top:2px;"></HoverStyle>
<DownStyle CssText="BORDER-RIGHT: #335ea8 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #335ea8 1px solid; PADDING-LEFT: 4px; BACKGROUND-POSITION-X: right; BACKGROUND-IMAGE: url(00100206); PADDING-BOTTOM: 1px; BORDER-LEFT: #335ea8 1px solid; CURSOR: hand; PADDING-TOP: 3px; BORDER-BOTTOM: #335ea8 1px solid; BACKGROUND-COLOR: #ffe1ac"></DownStyle>
<NormalStyle CssText="background-image:url('00100205');background-position-x:right;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;cursor:hand;padding-bottom:3px;padding-left:4px;padding-right:4px;padding-top:3px;"></NormalStyle>
</eo:ToolBarItem>
</ItemTemplates>
<Items>
<eo:ToolBarItem Type="Custom">
<CustomItem>
<div onclick="eo_CancelBubble(event)">
<asp:DropDownList Runat="server" AutoPostBack="True" ID="DropDownList1">
<asp:ListItem Value="- Select One -"></asp:ListItem>
<asp:ListItem Value="Option 1"></asp:ListItem>
<asp:ListItem Value="Option 2"></asp:ListItem>
<asp:ListItem Value="Option 3"></asp:ListItem>
</asp:DropDownList>
</div>
</CustomItem>
</eo:ToolBarItem>
<eo:ToolBarItem Type="Separator"></eo:ToolBarItem>
<eo:ToolBarItem ToolTip="New" ImageUrl="00101001" CommandName="New"></eo:ToolBarItem>
<eo:ToolBarItem ToolTip="Open" ImageUrl="00101002" CommandName="Open"></eo:ToolBarItem>
<eo:ToolBarItem ToolTip="Save" ImageUrl="00101003" CommandName="Save"></eo:ToolBarItem>
<eo:ToolBarItem ToolTip="Save All" ImageUrl="00101004" CommandName="SaveAll"></eo:ToolBarItem>
</Items>
</eo:ToolBar>
Can you try the same and see if it works? Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 6/6/2007 Posts: 37
|
I did it and it works fine! I typed something wrong thank you very much.
|
|