modal-dialog

Angular modal dialog best practices

佐手、 提交于 2019-12-04 21:11:57
问题 What is the best practice for creating modal dialogs with dynamic content, contrasted with dialogs that don't have dynamic content. Eg.. We have some modal forms that accept a list of form elements, and have submit/cancel. Also, there are modal dialogs that just display a confirm/ok type of operation. I've seen a lot of people saying that dialogs should be services passed into the controller, but it seems to me that services shouldn't be rendering UI components and manipulating the DOM. What

jQuery 'on' not registering in dynamically generated modal popup

不羁岁月 提交于 2019-12-04 21:06:56
问题 I was under the impression that jQuery's on event handler was meant to be able to 'listen' for dynamically created elements AND that it was supposed to replace the behavior of live. However, what I have experienced is that using on is not capturing the click event whereas using live is succeeding! The tricky aspect of my situation is that I am not only dynamically creating content but I'm doing it via an AJAX .get() call, and inserting the resultant HTML into a modal .dialog() jQueryUI popup.

pass multiple variable to bootstrap modal

点点圈 提交于 2019-12-04 21:06:06
can I pass multiple variable to bootstrap modal? here my code : p>Link 1</p> <a data-toggle="modal" id="1" class="push" href="#popresult">test</a> <p> </p> <p>Link 2</p> <a data-toggle="modal" id="2" class="push" href="#popresult">test</a> click the links will pop up a bootstrap modal <div class="modal hide" id="popresult"> <div class="modal-header"> <button class="close" data-dismiss="modal">×</button> <h3>Modal header</h3> </div> <div class="modal-body" style="display:none;"> <p>some content</p> </div> <div class="modal-footer"> <a href="#" class="btn" data-dismiss="modal">Close</a> <a href=

Multiple PrimeFaces dialogs on one page

折月煮酒 提交于 2019-12-04 20:41:56
I am facing problems with dialog windows validation. On home.xhtml I have a tabview with 3 nested dataTables and CRUD buttons (see screenshot). Every button is supposed to call a dialog window with a form to add/edit entity. But whenever I fail to validate some field in any form - all other forms are displayed too: I would like to validate and display only one dialog at a time and keep it displayed untill user presses "Cancel" button or inputs valid values and presses submit button. No other dialogs shold be opened at this time. home.xhtml: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE

Dismiss angular modal on URL change - errors in console

痴心易碎 提交于 2019-12-04 20:08:37
I'm using Angular bootstrap Modal to show a popup window. On clicking backspace outside the textarea / browser back button, i want to cancel the popup and continue with the url change. The default behaviour is that page behind the modal changes, but the modal remains on top. In the controller for the modal instance, I added a $scope.$on('$routeChangeStart', function() {...} ); It works, but I'm seeing errors whenever the controller is invoked again. The $modalInstance.dismiss() is called again, but inside the library, it throws an exception. Here's the plunkr with code and repro steps. Watch

UIModalPresentationFormSheet on iPad in landscape mode

梦想的初衷 提交于 2019-12-04 19:52:09
I created a UIViewController view from XIB with modalPresentationStyle set to UIModalPresentationFormSheet and everything works great in portrait mode. When I switch to landscape the view gets moved upperleft (it's not centered as it should be) and most part of it is clipped. Any ideas why this is happening and how to solve it? Thanks I had this problem as well. Turned out, I had the autorotate function set to Portrait for both the modal controller and the calling controller. In iOS 7, to solve the problem of the modal view controller to appear to the left after apparition of the keyboard

prettyPrint() only has an effect once. (google-prettify)

喜夏-厌秋 提交于 2019-12-04 19:28:07
I have this JavaScript (with jQuery): var g_files_added, socket, cookie, database = null; var file_contents = []; function viewFile(key, filename) { $('#title-filename').text(filename); $('.prettyprint').text(file_contents[key]); $('#viewFileModal').modal('show'); } $(document).ready(function() { $(document).on('shown', '#viewFileModal', function(event) { prettyPrint(); }); }); // Variables have been set in code not shown, irrelevant to problem. // prettyPrint() is called everytime the #viewFileModal is shown, // but its effect is only felt once. So prettyPrint() is invoked every time the

How to open ModalDialog on PageLoad

折月煮酒 提交于 2019-12-04 19:25:41
问题 How can I open a modal dialog on PageLoad() , in the constructor of the WebPage and without the AjaxRequestTarget , with Wicket? 回答1: I couldn't find a way to open it without an Ajax request, but it's perfectly possible to open it when the page is loaded, with a simple behavior: HomePage.java public class HomePage extends WebPage { public HomePage(PageParameters pageParameters) { super(pageParameters); ModalWindow modal = new ModalWindow("modal"); modal.add(new OpenWindowOnLoadBehavior());

How to handle modal-dialog box in Protractor?

不问归期 提交于 2019-12-04 19:16:18
I am trying to use sendKeys() on a modal-dialog box on this website. This dialog box appears after clicking Sign In button. I cannot seem to find any way to switch focus on the box. See the gist I tried using browser.driver.switchTo().activeElement(); in InvalidLogInUnSuccess: { get: function () { this.loginButton.click(); browser.driver.switchTo().activeElement(); this.email.sendKeys("Test"); } } with no luck and throws ElementNotVisibleError Message: ElementNotVisibleError: element not visible (Session info: chrome=41.0.2272.101) (Driver info: chromedriver=2.14.313457

Can you copy an existing div to a modal dialog

拥有回忆 提交于 2019-12-04 18:03:46
I have a dashboard with multiple panels to display different information and I would like to be able to add a button to display the panel in a modal. I am using bootstrap and all I can find is modals already written. I would like to copy the content of a div tag which is a panel and then display that in the model, but I am unsure as how to go about it. The html for the panel can be seen below. The panel does contain a table but I have cut the code down. I have looked around but I can't seem to find a solution for what I need. I understand that I need to use jQuery, copy the panel and add it to