Plugin - Admin Popup, Return to Widget/widgetId

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I'm designing a new plugin using the Widget interface but am having difficulty with one particular part.  It's probably a newbie problem to have but for some reason I just can't get it fixed.  So far everything else is working great on the plugin except this.  Once it's finished I will likely be contributing it to the community.

In the widget config view, I have a popup screen which allows users to select topics from a list model.

On form submit, topics are saved and linked to the proper widget entity but I can't figure out what return value to use in the controller.  Since 'Configure' in my plugin controller is a Child Action, I can't return directly to that (or at least I don't know how to).  I think I need to return to the Widget controller, Edit Action for the proper widgetId, I just can't seem to figure out the syntax.  

Below is the code for TopicAddPopup in my plugin controller.  I've also got a btnId and formId which I believe is being passed from the button which brings up the popup.  At some point I added these thinking it would help in my solution.  I guess I'm just a bit lost on this one.


        [HttpPost]
        [FormValueRequired("save")]
        public ActionResult TopicAddPopup(string btnId, string formId, TopicBannerModel.AddBannerTopicsModel model)
        {
            if (model.SelectedTopicIds != null)
            {
                foreach (int id in model.SelectedTopicIds)
                {
                    var topic = _topicService.GetTopicById(id);
                    if (topic != null)
                    {
                        _tbService.InsertBannerTopic(
                            new BannerTopicsRecord()
                            {
                                WidgetId = model.WidgetId,
                                TopicId = id,
                                DisplayOrder = 1
                            });
                    }
                }
            }
            ViewBag.RefreshPage = true;
            ViewBag.btnId = btnId;
            ViewBag.formId = formId;
            model.BannerTopics = new GridModel<TopicModel>();
            return null;
            //return View("~/Administration/Views/Widget/Edit.cshtml", model.WidgetId);
        }


Thanks in advance for any help.
11 years ago
Actually, nevermind.  I was able to bug check and complete the project.  Found a decent solution for the return on the popup.  Basically just needed to use the same return on the HTTP Post as the original popup action.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.