<%--ValidationSummary--%> <asp:ValidationSummary runat="server" DisplayMode="BulletList" ID="ValidationSummaryDetails" CssClass="error validationSummaryTop" HeaderText="<h3>The data has not been saved because there are some errors you need to fix first:</h3>"></asp:ValidationSummary>
<%--ValidationSummary--%> <asp:ValidationSummary runat="server" DisplayMode="BulletList" ID="ValidationSummaryNL" CssClass="error validationSummaryTop" HeaderText="<h3>The data has not been saved because there are some errors you need to fix first:</h3>"></asp:ValidationSummary>
//Create a save button for the details tab. SetSaveButtonProperties("ImgBtnSaveNL");
#endregion }
/// <summary> /// Set the properites of the savebutton for a tab. /// </summary> /// <param name="saveButton"></param> /// <param name="id"></param> private void SetSaveButtonProperties(string id) { //Create a save button from the current datatab. saveButtonData = dataTab.Menu.NewImageButton(); saveButtonData.ID = id; saveButtonData.Click += new ImageClickEventHandler(SaveButton_Click); saveButtonData.AlternateText = "Save"; saveButtonData.ImageUrl = GlobalSettings.Path + "/images/editor/save.gif"; } }
I allready did that and then tried to loop it. Only problem is that I get a nasty error when I try to do it. Umbraco moves the panels I'm adding as Tabs. It cannot do that because they all have the same ID's in the ListView, where they where created.
I have then tried to rename the panels - and all of their controls - BEFORE adding them to umbracos tabs with the AddTab() method. That works some of the way BUT when I click save, no Controls are there. The viewstate remembers nothing and I cannot access my data.
Hmm not sure what might cause this problem. I guess the best thing you can do is look into the Umbraco source code. All tabs you create on a documenttype are added dynamically if you open a node and the same goes for tabs on a mediatype. You should probably have a look at the editContent.aspx and editMedia.aspx pages in the source code.
Dynamic number of Tabs
Hi,
How do I create a dynamic number of Tabs and still get access to the controls in the tabs?
I need to loop through the Umbraco languages and create a tab for each language with some settings in each tab.
Any ideas will be appreciated.
/Rune
Do you want to create dynamic tabs on documenttype or a custom page for a custom section?
Jeroen
The latter, a custom page for a custom section!
Here is a sample of how I add multiple tabs to a page for a custom section:
Frontend:
Codebehind:
In this sample I add a details and NL tab. It's not in a loop, but you should be able get started with this :). For another example have a look at this wiki page: http://our.umbraco.org/wiki/reference/umbraco-best-practices/standard-ui-umbracouicontrols/umbracouicontrols-page-samples
Jeroen
Thanks Jeroen,
I allready did that and then tried to loop it. Only problem is that I get a nasty error when I try to do it. Umbraco moves the panels I'm adding as Tabs. It cannot do that because they all have the same ID's in the ListView, where they where created.
I have then tried to rename the panels - and all of their controls - BEFORE adding them to umbracos tabs with the AddTab() method. That works some of the way BUT when I click save, no Controls are there. The viewstate remembers nothing and I cannot access my data.
/Rune
Hmm not sure what might cause this problem. I guess the best thing you can do is look into the Umbraco source code. All tabs you create on a documenttype are added dynamically if you open a node and the same goes for tabs on a mediatype. You should probably have a look at the editContent.aspx and editMedia.aspx pages in the source code.
Jeroen
really hoped I did'nt have to do that :)
But I'm looking into it now. Will post back if I find a solution. Not before easter tough.
Just so you know, I have submitted an Umbraco support ticket on this. Have been unable to figure it out from the Umbraco source.
/Rune
is working on a reply...