How to overlay a jQuery UI Dialog over a Skillbuilders modal page? - jquery-ui

I am using the SkillBuilders Modal Page within my Oracle APEX application, i.e.
SkillBuilders Modal Page
to present the user with a tabular form, where they can enter specific values via select lists.
What I also have is validation based on another thread that I raised in Stackoverflow:
How to perform row by row validation on an Oracle APEX Tabular form using Ajax?
The problem that I am having is within my SkillBuilders Modal Page, I have some validation by where I want to make a call to jQueryUI dialog, in order to present the user a message. I do this by calling:
$('#dialogbox').dialog('open');
Unfortunately it doesn't actually seem to appear on screen and I believe it's something to do with the fact that I am trying to overlay a modal dialog over a modal page (skillbuilders modal plugin).
How can I solve this problem?

Related

Jqgrid breaks properties of other jqgrid

As titled,
In my webpage, i have a jqgrid, and a button that will pop up a modal dialog that contains another jqgrid (displaying different data) on it. The problem is, the jqgrid on the modal dialog breaks the jqgrid on the page, like for example, if i set my jqgrid on the dialog to have no filter function, then it will cause the jqgrid's filter on the webpage to suddenly disappear.
Just want to know if anyone encounter such issues before?
By the way the webpage was created using Grails, so i'm not sure if this is related to Grails's resource issue or not.
It's difficult to help you because you don't posted your code. I can only to suppose that you could have id conflicts between the grid in modal dialog and the grids on the main page. I would suggest you to add idPrefix option with some non-empty unique value in the modal dialog. For example you can add idPrefix: "g1_" in the first grid and idPrefix: "g2_" in the second grid. Then the rows with ids "1", "2", "3" will be "g1_1", "g1_2", "g1_3" in the first grid and there will be "g2_1", "g2_2", "g2_3" in the second grid.

ASP.NET MVC Show a MessageBox

I have a ASP.net MVC application. On one page I have a button and when user clicks on it I need to display some information on a pop up window. How can I do that in ASP.NET MVC? What do I use and where do I write the code for pop window? In the controller? Some java script?
Thank you!!
You can display messages with javascript. The content of the message can be set in the markup or by your Controller as a Model property. You have a few display options:
Use the alert() function, which will display a native browser dialog
Display a styled modal dialog (E.g. jQuery UI dialog)
Display a styled div (E.g. jQuery UI Message - shameless plug, this one of my open source projects)
The alert function isn't very pretty, but it's the simplest. I typically go with a modal dialog or a styled div, depending on the UI requirements.
If the information you want to display in a pop up is dynamic (i.e you need some c# logic to run) then I'd suggest putting that logic in a controller and have the corresponding view be the pop up itself. You can stick some JavaScript at the top of the view to launch the popup on load.
The page with the button trigger can call that controller and pass any data needed. To make it smooth maybe make the trigger use Ajax.

ASP.NET MVC search box: use modal popup or inline div or redirect to another page?

I have a view with a textbox and a search button, eg CustomerTextBox and CustomerSearchButton.
The list of customers is too long to display in a dropdown, and there has to be advanced search functions anyway.
What is the best practice in MVC to handle this case? When the user clicks on the search button, should it:
A. Load another view into a modal popup (eg /customers/search)?
B. Have the search form in a hidden div that expands when the search button is clicked?
C. Redirect the user to a search page by means of RedirectTo("/customers/search")?
I've only been doing MVC for 3 days so thanks to those who answer my questions that might have quite obvious answers that I cant see yet. :)
I think it's really up to you, what would fit your site better? If you need some advanced searching capabilities, create a /customers/search and redirect to it. If its somewhat simple and quick, use a modal popup, or expand a hidden div with a search field or two when clicking the button.
Check this out:
How to implement search features in ASP.NET MVC applications

binding fields in a dialog popup in my view

i have an html table in my asp.net mvc view an i am running into some real estate issues with screen space.
I think in one area of my view i am going to have a button in a column of an html table that says "Details" which, when clicked, loads up some dialog ui. what i am trying to get my head around is that i want the fields in the dialog to also be part of data binding object in the overall form which i am passing to the controller when i submit the form.
is there anything that i should be worried about or anything that you need to do special if you have a form where inside your form you have a button that create a popup with some more details elements. I am just trying to see from a data binding view if there are any issues.
also any examples of doing anything similar would be great.
EDIT
So i tried doing this an ran into a binding issue. i have a follow up question with the specifics about this binding issue with jquery ui dialog here:
why does jquery ui dialog break asp.net mvc's default model binding .
There shouldn't be any issues if you are binding elements from your popup dialog to corresponding hidden elements in your main view. These hidden elements will bind correctly like any other control in your main form.
Of course, you might be POSTing the form elements from your popup form to its own controller method directly, and that is also a perfectly good approach.

MVC question - hide /show a panel with partial postback from radiobutton submit

I have 2 radio button with values New & Existing. If user chooses New, then I show a textbox on the form and if Existing a dropdown and textbox is hidden. The question is , does the hide/show of the textbox/dropdownlist have to be written in the View or the Controller class? Also when I choose the selection my whole form is posting back and hence all validation error msgs are being shown which should not be shown nless the save button is clicked, how do I a partial postback without full form submission? Any code snippets or urls would be benificial in this respect.
The question is , does the hide/show of the textbox/dropdownlist have to be written in the View or the Controller class?
Just show/hide with jQuery that.
Also when I choose the selection my whole form is posting back and hence all validation error msgs are being shown which should not be shown nless the save button is clicked, how do I a partial postback without full form submission? Any code snippets or urls would be benificial in this respect.
Perform 'partial postbacks' through javascript.
Post form to save action only once when it's ready (when Save button is clicked).
Some resources:
jQuery tutorial
jQuery AJAX
About form AJAX`ifying
If I understand you correctly, the answer is the hiding and showing of controls should be done on the view as it's display specific.
If you use javascript to show and hide the controls then because it's on the client side you would not have to postback the form, and could do server side validation when the save button is clicked.
jQuery is very good: Jquery Website
Hope that helps?

Resources