Hi,
I am converting my Ultrawebtab to Webtab (2011 Vol1). I have a menu and a tab in a page. When i click on a menu i will open a new tab. I have created 5 dummy tabs for which the ContentURL is empty and it will be hidden when the page is loaded first. Depending on the menu item i click i will set the text, image and ContentURL for it in client-side. I have the following questions
1) I am able to set the values for the Text and ContentURL but i am not able to set imageurl in client-side. How to do it?
2) If i click on a menu item, i am first checking whether a tab for that Menu is already opened (or) not. If it is opened, then i will give focus to that tab by setting the value of selected index for that tab. When the focus is set to that tab, the content in that tab gets refreshed. This should not happen. How to avoid postback?.
3) How do i access the a text box value present within the tab control from the parent page where the tab is hosted?
Code:
<ig:WebTab ID="tabWO" runat="server" Height="100%" Width="100%" EnableAjaxViewState="False" DisplayMode="Scrollable">
<tabs>
<ig:ContentTabItem runat="server" Text="Sample" BorderStyle="None" ScrollBars="Hidden" ContentUrl="Sample.aspx" Font-Names="Verdana" Font-Size="8pt">
</ig:ContentTabItem>
<ig:ContentTabItem runat="server" Text="Sample1" BorderStyle="None" ContentUrl="Sample1.aspx" Font-Names="Verdana" Font-Size="8pt">
<ig:ContentTabItem runat="server" Text="" Hidden="true" BorderStyle="None" ScrollBars="Scroll" ContentUrl="" Font-Names="Verdana" Font-Size="8pt" >
<ig:ContentTabItem runat="server" Text="Dummy" Hidden="true" BorderStyle="None" ScrollBars="Scroll" ContentUrl="" Font-Names="Verdana" Font-Size="8pt" >
</tabs>
<PostBackOptions EnableLoadOnDemand="false" EnableReloadingOnTabClick="false" />
</ig:WebTab>
Thanks,
Raja.
Hello Raja,
I assume you are talking about the close buttons of the tabs. If so, you could use the TabClosed client-side event and set the SelectedIndex to be the index of the desired tab:
function WebTab1_TabClosed(sender, eventArgs)
{
sender.set_selectedIndex(3);
}
Feel free to contact me if you have any questions.
Sorry for the late reply as i was working in another project. First i would like to reply to my previous questions. I was able to change the imageurl property in client side by using the following code
var webTab = $find("<%=WebTab1.ClientID%>");var imageElement = webTab.getTabAt(i).getImageElem();imageElement.src = tabDefaultImage;
The above code will work in Client-side provided the "ImageUrl" tag is set in "ig:ContentTabItem" for that tab during design time.
Now i have a new question. As you can see in my previous code that by default i will load first 2 tabs and the rest will be hidden. I have a menu and depending upon that menu option, i select which hidden tab is to be visible. Suppose let say that i have made tab4,tab5 and tab7 as visible. I select tab5 and then tab4 and then tab7, when i click on close button i want tab4 to be selected automatically. Is there some way of doing that?
Thanks,Raja
Hi Raja,
We are still following this forum thread.Have you been able to take a look at the provided code snipped ?
If you have any other questions please do not hesitate to contact us.
Sincerely,
Dimi
Developer Support Engineer
Infragistics
www.infragistics.com/support
You can use something like this:
var textbox = document.getElementById("<%= TextBox1.ClientID %>");
Let me know if this helps.
Thanks for the reply. By setting the AutoPostBackFlags-SelectedIndexChanged="Off" it's working. Is there a way to access the textbox inside a ContentTabItem in client side?
Raja