Plugin Developer DiscussionDiscussion for FogBugz Plugin developers |
||
Hi there.
could you provide a sample showing use of buttons for simple postback? the current samples use dialog and editabletable as far as I could see....
I figured it out - as allways, it was quite simple:
Step1: Surround everything with a "<form> block: Step2: Remember to AddPluginPrefix to the submit button: Sample code: StringBuilder reportSelector = new StringBuilder(); reportSelector.AppendFormat(@" <form action=""{0}"" method=""POST""> <input type=""hidden"" name=""{1}actionToken"" value=""{2}"" />", api.Url.PluginPageUrl(), api.PluginPrefix, api.Security.GetActionToken("createReport")); var inputTable = new CEditableTable(api.AddPluginPrefix("ReportParameters")); // Add the controls (dates, text etc removed for clarity // Add the buttons: inputTable.Footer.AddCell(Forms.SubmitButton(api.AddPluginPrefix("renderByProject"), "By project")); inputTable.Footer.AddCell(Forms.SubmitButton(api.AddPluginPrefix("renderByPerson"), "By person")); reportSelector.AppendLine(inputTable.RenderHtml()); reportSelector.AppendLine("</form>"); |
Powered by FogBugz