I am trying to develop the screen with nested popup (Popup inside another popup), Now am facing issues to close the inner popup and make visible the outer popup without redirecting to any page. how to achieve this ?
First popup has one grid and one new button, clicking on new button opens one more popup , here am uploading files and storing the details in DB while submitting the upload button, it should close the inner popup and focus should be in outer popup with updated grid details.
Please give any idea to achieve this ?
My 2nd Popup View Code,
<?php
echo CHtml::form('','post',array('enctype'=>'multipart/form-data'));
echo CHtml::activeFileField($model, 'name');
echo CHtml::button( 'Submit',array('submit' => array('baseContact/SaveAttachDocuments')));
echo CHtml::endForm();?>
Controller Action for 2nd Popup,
public function actionSaveAttachDocuments()
{
$model=new DocumentAttachmentModel();
$filename =CUploadedFile::getInstance($model,'name');
$model->type =pathinfo($filename, PATHINFO_EXTENSION);
$model->name =pathinfo($filename,PATHINFO_FILENAME);
$model->save();
/** Here i have to close the 2nd popup and update the grid in 1st popup **/
}
I guess you should close the inner popup by javascript (after client side validation), and then call the controller action for the outer popup again from the actionSaveAttachDocuments() method.
Related
I have a popup without title and I want to detect the window using any other criteria (for example a div that wraps the whole popup) and click a button inside it.
I've tried the following:
when:
withWindow({ $("div", class:"main.msgAlert" )}) {
$('#close').click()
}
then: true
But I always get a org.openqa.selenium.ElementNotVisibleException at te #close action.
Am I failing at detecting the window or is the error related to the button?
I have an injected stylesheet that calls a popup with window...open() on two occasions. One when the user clicks an HTML button, and two, when a user clicks on a context menu item. To listen for the context menu item, I need to add a listener on the injected script like so
safari.self.addEventListener("message", messageCallBack, false); // Message comes from global.html when context menu item is clicked
And the following callback
function messageCallBack(msgEvent) {
...
window.open(...)
...
}
For some reason, the popup works when the button calls window.open, but NOT when the message callback calls window.open. I'm assuming it maybe have something to do with the window object.
I suspect this is due to restrictions on window.open designed to combat pop-up ads. This means it will only work in response to a click event.
To get around this, I would recommend you open the new window from your global page using the safari.application API:
safari.application.openBrowserWindow();
safari.application.activeBrowserWindow.activeTab.url = '...';
You can also open new tabs with:
safari.application.activeBrowserWindow.openTab('foreground').url = '...';
To achieve this, you may need to send a message from your injected script to the global page.
i am having a page with grid view and some checkbox fields init.
i added a submit button to it by adding echo CHtml::submitButton('Submit-form');
But, that button is not responding.
why so?
how i should submit this form?
my view page
my controller page
In your controller you have:
public function actionmyaction()
{
echo \'myaction reaced\';
var_dump($_POST);
}
You have to use camelcase with that, so actionMyaction() would probably do the trick.
Sorry for my very simple question, I'am new to HTML5 Builder.
I'm developing a simple database editing application (to add or remove some advertisments on site, only for system administrator), and I want to make it using HTML5 builder (I hope, it will be fast and simple).
On button click on main page ("Add record" button), I need to open another page with data fields (advinfo.php).
How can I do it?
Thanks.
You just need to redirect to the target page. How to do so will depend on the language you want to use.
If you want to use the JavaScript OnClick event of the button:
function Button1JSClick($sender, $params)
{
?>
//begin js
window.location = "advinfo.php";
//end
<?php
}
If you want to use the PHP OnClick event (the standard event):
function Button2Click($sender, $params)
{
header("Location: advinfo.php");
}
The idea is simple: create a web part page in SP Designer 2010 that allows a new list item to be created, and then use some javascript from the CSOM to pop the page in a modal dialog from another page. The problem is that a dialog box comes up and briefly flashes that it is loading content, but then it disappears and I'm left with a refreshed version of the page I just clicked from. Here's my code . . .
//attach a click delegate to the table containing the following button(s)
<button type='button' class='ms-listheaderlabel'>Close</button>
//on button clicked event, call the following function
function openModalDialog(dialogPage, closeCallback) {
var options = [];
options.title = unescape("Close Ticket");
options.allowMaximize = true;
options.showClose = true;
options.autoSize = true;
options.url = dialogPage;
options.dialogReturnValueCallback = Function.createDelegate(null, closeCallback);
SP.UI.ModalDialog.showModalDialog(options);
};
. . . where dialogPage is the url for the form I created (same site, SitePages library) and closeCallback is an anonymous function passed in to handle the return value from the dialog. I've tried calling the page directly and it loads just fine. Pop up blocker is completely off. Using IE9 and tried 8 compatability mode as well as another machine with straight IE8. System modals work just fine. Any ideas out there?
I am going through the exact same issue right now. What I have discovered so far is if I use
<input type="button" value="Try Me" onclick="openModalDialogBox()" />
it works as expected. But if I use an asp:button to do the same thing it fails. I think it may have to do with the postback to the server, but I could be wrong about that.
I am just switching my buttons to inputs.
Tim