bhavesh7098
Registered:1454962548 Posts: 56
Posted 1478562882
Reply with quote
#1
Hi I have dropdown filter called ProjectName. In Project name filter there are many project names. There is also value called "create new" . My requirement is if user does not find his project then he will select or click create new and then modal popup screen should appear to create that new project. How to achieve that by in Ironspeed designer?
JimiJ
MVP Developer
Registered:1112254853 Posts: 1,962
Posted 1478581909
Reply with quote
#2
Yes, it's achievable. You just need to override the SelectedIndexChanged and call the generic NewPopUpModalWindow() method below when SelectedItem.Text = "create new": public void NewPopUpModalWindow() { //Note: You must replace TableName with the actual one as well as the DFKA_ColumnName and pK_ColumnName with actual names string url = @"../TableName/Add-TableName.aspx?TabVisible=False&SaveAndNewVisible=False"; bool shouldRedirect = true; string target = null; if (target == null) target = ""; // avoid warning on VS try { // Enclose all database retrieval/update code within a Transaction boundary DbUtils.StartTransaction(); url = this.ModifyRedirectUrl(url, "",true); url = this.Page.ModifyRedirectUrl(url, "",true); } catch (Exception ex) { // Upon error, rollback the transaction this.Page.RollBackTransaction(sender); shouldRedirect = false; this.Page.ErrorOnPage = true; // Report the error message to the end user BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(this, "BUTTON_CLICK_MESSAGE", ex.Message); } finally { DbUtils.EndTransaction(); } if (shouldRedirect) { this.Page.ShouldSaveControlsToSession = true; url = url + "&RedirectStyle=" + (this.Page as BaseApplicationPage).Encrypt("Popup") + "&Target=" + (this.Page as BaseApplicationPage).Encrypt(this.TableName.ClientID) + "&DFKA=" + (this.Page as BaseApplicationPage).Encrypt("DFKA_ColumnName")+ "&IndexField=" + (this.Page as BaseApplicationPage).Encrypt("pK_ColumnName"); string javascriptCall = ""; javascriptCall = "initializePopupPage(this, '" + url + "', false, event);"; AjaxControlToolkit.ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "NewPopUpModalWindow", javascriptCall, true); } }
__________________ Jaime Jegonia
Iron Speed MVP Developer ". . . and whoever sows generously will also reap generously" 2 Cor 9:6