Having a popup window able to update the main window - asp.net-mvc

I have a list of items showed on a page. Each item can be clicked and opened in a popup window to be edited. On this popup window, I have a save button.
When this 'save' button is clicked, I would like:
call an action controller to update the database
close the popup window
refresh the main list item (still opened in the background)
Can anyone help me to achieve this? I really don't know how to update the main window (list of items).
Thanks.

Related

Can I programmatically open a turbo_frame?

I have a list of documents(index.html.erb) where I can click a document to load details (show.html.erb) in a turbo_frame modal. This works well. There is a preview button that goes to a non turbo view for previewing an attachment. From here I want to click a back button to go back to the index.html.erb page but I'd also like to trigger the show.html.erb modal so they are technically back where they started. I was attempting to just force a redirect in the controller to the documents#show but this changes the route to /show and closing the modal gives you a blank page. Is it possible to open a turbo_frame without a click?

VoiceOVer and Bootstrap menu modal

I have a menu button that opens a drop down menu modal. One is how I prevent VoiceOver from reading right off the menu and second when I double tap outside the menu to close focus goes to the parent page and not back to the menu button.
I await clarification on the first part. As for the second, you want to post a notification, with the element to be focused.
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, viewToBeFocused);

Data is unloaded from View Controller when segue happens

I have two screens that I am performing a push segue between. In the first screen, there are 5 buttons that you click on to send you to the next page. On the next page, you edit some information that is specific to each button, then you click a button and get sent back to the first screen. (Kind of like editing contacts) When I edit one button it works perfectly. However, when I click on the next button and edit its information, when I come back the original screen has lost the information about the first button. Just to be clear, I am not actually editing the button. There is information that is being displayed on the button, but I am storing data in some properties on the view controller.
I think the problem is that the data stored in the properties is being cleared when I perform the segue. How can I make it so that the data persists?
Thanks to #rdelmar, I am now using a modal segue from the first view. I then use dismissViewControllerAnimated to go back. (Found in this question.)

check in viewWillAppear for tab clicks before refreshing

I have 4 tabs in my application, one of my Tab loads a UIWebview which loads remote html contents. I have code to refresh content in "viewWillAppear" which will refresh the content when you navigate between tabs so far so good.
Here is my problem:
When I click on Tab 1 ( UIWebView) and load an html form which has file upload input field as shown in the screen cap, upon clicking "Choose file" from html form will trigger actionsheet ( shown below) "Take Photo/Video" , this will launch the camera after taking the picture and selecting it will force the UIWebview to refresh ( as the code to refresh is in viewWillApper which will trigger the refresh when coming from camera) which is not right as I don't want my view to refresh when coming from Camera, can someone suggest if there is a way to check in viewWillApper if you are coming from Camera/Gallery or by clicking on tab. Thnx.

How to send open uikeyboard back while opening other subview?

In my application I have one uiview.
I am adding another subview to this view which contains one textfield.
when user clicks that field then it display the keypad.
This subview also contains one add and delete button.
when user clicks on that button another view is opened which is also the subview of main view and that view contains selection list in the table.
The problem here is when user types something in textfield so keyboard is open.
if user does not dismiss that keyboard and clicks on add button to select from selection list then only half of the selection list is visible because keyboard is still open.
I want to send the keyboard back.
Here i do not want to dismiss the keyborad.while user clicks the add button.i only want to send it back to the selection view.when user is done with selection view keyboard should be open as it is.How can i solve this issue?
If you want the keyboard to go away, you need to dismiss it when they click on the button by using [yourTextField resignFirstResponder];.
If you want it to come back when they select an item, you will need to call [yourTextField becomeFirstResponder];.

Resources