How do I fix this 'funny' JavaScript/Ajax behavior?

Hello all!
I have this kind of funny problem, or, well, a funny result...
The problem is almost solved tho, but it's just this strange behavior that I can't solve.
You can see what I mean here:
http://apex.oracle.com/pls/apex/f?p=9949:101:1370355978553401
Username: visitor
Password: visitor
Login first, then edit the URL to go to page 24 (or just click on "Web Platform", then in the submenu click on "Meals and templates", and then in the custom menu on the left click on "Show templates".
If you have done that, click on any of the two links in the report.
You'll see that suddenly, the whole page seems to be shown inside another region (the region named "Menu2", underneath the normal menu region).
It's like... A page within a page. Pageception (Inception... Pageception... Get it?).
Now, all this happens WITHOUT refreshing. Yes, I want this to be dynamic. My question is:
How do I change my code in such a way, that it does NOT display the whole page 24 inside that menu2 region? Because I want to display a popup, not a page within a page...
My code for doing so is in my Page Attributes. In the JavaScript tab, I have the following code for the popup, and in it you will find the code to get these values in the page items as well:
$( function(){
  $('#ModalForm').dialog(
     modal: true,
     autoOpen: false,
     width: 500,
     height: 350,
     buttons:{ Calculate: function(){calculateTotal();},
               Close: function(){closeForm();}        
function openForm(pFoodTemplateId, pMealTypeId)
var getone = new htmldb_Get('shiny',&APP_ID., null, 24); // initialize get
getone.add('P24_TEMPLATEID', pFoodTemplateId);
getone.add('P24_MEALID', pMealTypeId);
gReturn = getone.get();
getone = null;
$('#ModalForm').dialog('open');
function closeForm()
{ $('#ModalForm').dialog('close');}
$(document).ready(function()
    {$('a.temppop').click(function() {openForm();});
});"Shiny" is the name of the ID of my "menu2" region.
In case I'm not clear (which I probably am, since I'm in a rush):
I have 2 page items that get the value of the selected row's foodtemplateid and mealtypeid. The column link URL from my report is:
javascript: openForm(#FOODTEMPLATEID#, #MEALTYPEID#); So, in a nutshell, item :P24_TEMPLATEID gets the value of the foodtemplateid that corresponds to the row you selected, and item :P24_MEALID gets the value of the mealtypeid that corresponds to the row you selected.
Thank you for your time. I really appreciate it.
Apex version: 4.1.1.00.23

Hi,
Maybe JavaScript should be something like this
function openForm(pFoodTemplateId, pMealTypeId){
$("#P24_TEMPLATEID").text(pFoodTemplateId);
$("#P24_MEALID").text(pMealTypeId);
var getone = new htmldb_Get(null, &APP_ID., "APPLICATION_PROCESS=DUMMY", &APP_PAGE_ID.);
getone.add("P24_TEMPLATEID", pFoodTemplateId);
getone.add("P24_MEALID", pMealTypeId);
gReturn = getone.get();
getone = null;
$("#ModalForm").dialog("open");
}Or
function openForm(pFoodTemplateId, pMealTypeId){
$s("P24_TEMPLATEID", pFoodTemplateId);
$s("P24_MEALID", pMealTypeId);
var getone = new htmldb_Get(null,&APP_ID.,"APPLICATION_PROCESS=DUMMY",&APP_PAGE_ID.);
getone.add("P24_TEMPLATEID", pFoodTemplateId);
getone.add("P24_MEALID", pMealTypeId);
gReturn = getone.get();
getone = null;
$("#ModalForm").dialog("open");
}Regards,
Jari
My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
Twitter: http://www.twitter.com/jariolai
Edited by: jarola on Apr 19, 2012 3:56 PM

Similar Messages

  • On my iPad 2 I can nolonger view maps.  It says there are JavaScript errors.  How can I fix this problem?

    On my iPad 2 I can nolonger view maps.  It says there are JavaScript errors.  How can I fix this problem?

    First, try a system reset.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until the screen blacks out or you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  Connect via cable to the computer that you use for sync.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."

  • HT1657 We just downloaded a movie from Itunes but the picture is completely scrambled. Audio is fine but all you can see are funny color pixels on the screen..how do we fix this?e

    We just downloaded a movie from Itunes but the picture is completely scrambled. Audio is fine but all you can see are funny color pixels on the screen..how do we fix this?

    The movie is from iTunes.   You would think that a download from iTunes to a MacBook could be watched on an HDTV using Apple TV without any headaches bit this does not appear to be the case. 

  • My weather app doesn't show the feels like temp or wind, etc.  How can I fix this?  I am running iOS 8.1.2

    My weather app doesn't show the feels like temp or wind, etc.  How can I fix this?  I am running iOS 8.1.2.

    is that really what it is?  this is the native iphone weather app.  the funny part is that when i use the actual weather channel app, it does provide it.
    is this an api issue with the weather channel and the iphone then?  i guess there's no fix?
    thanks for your help by the way.

  • Firefox will not save my user name and password for one of my sites. How can I fix this problem. It is getting annoying having to reenter every time I check this site. Is there a solution.

    I had my user name and password saved for my library site. My grandson hit something and now the saved user name and password are gone. It asks me every time to enter it and it is getting annoying. How do I fix this. I want Firefox to remember these codes.

    You can create a bookmark with the JavaScript code via a right-click on the "Remember Password" link on the squarefree.com website and choose "Bookmark This Link" and select the "Bookmarks Toolbar" as the destination folder for easy access.
    * https://www.squarefree.com/bookmarklets/forms.html#remember_password
    You need to use the "Remember Password" bookmarklet before or after filling the name and password field on the website with the <u>login form</u>, but before submitting the login form by clicking a button on the web page.
    If the site is using autocomplete="off" then you see a number not equal to 0 (i.e. attributes were removed) in the pop-up alert from the bookmarklet and Firefox should offer to remember the name and password via a drop down dialog of the key icon that will appear on the location bar (Firefox 4+) or via an info bar at the top (Firefox 3).

  • There's a black space at the top of my window, and when I open the browser, my home page comes up but the address line is blank. How do I fix this?

    There's a black space at the top of my window, and when I open the browser, my home page comes up but the address line is blank. How do I fix this?

    -> Tap ALT key or press F10 to show the Menu Bar
    -> go to Help Menu -> select "Restart with Add-ons Disabled"
    Firefox will close then it will open up with just basic Firefox. Now do this:
    -> Update ALL your Firefox Plug-ins https://www.mozilla.com/en-US/plugincheck/
    -> go to View Menu -> Zoom -> click "Reset" -> Page Style -> select "Basic Page Style"
    -> go to View Menu -> Toolbars -> select Menu Bar and Navigation ToolBar -> unselect All Unwanted toolbars
    -> go Tools Menu -> Clear Recent History -> '''Time range to clear: select EVERYTHING''' -> click Details (small arrow) button -> place Checkmarks on '''Cookies, Cache, Site Preferences''' -> click "Clear Now"
    -> go to Tools Menu -> Options -> General -> When Firefox starts : select "Show My Home Page" -> Type the address of the website which you want to be your HomePage e.g. http://www.google.com
    -> go to Tools Menu -> Options -> Content -> place Checkmarks on:
    1) Block Pop-up windows 2) Load images automatically 3) Enable JavaScript
    -> go to Tools Menu -> Options -> Privacy -> History section -> '''Firefox will: select "Use Custom Settings for History"''' -> REMOVE Checkmark from '''"Permanent Private Browsing mode"''' -> place CHECKMARKS on:
    1) Remember my Browsing History 2) Remember Download History 3) Remember Search History 4) Accept Cookies from sites -> select "Exceptions..." button -> Click "Remove All Sites" at the bottom of "Exception - Cookies" window
    4a) Accept Third-party Cookies -> under "Keep Until" select "They Expire"
    -> '''REMOVE CHECKMARK from CLEAR HISTORY WHEN FIREFOX CLOSES'''
    -> '''When using the Location Bar, suggest: select "History and Bookmarks"'''
    -> go to Tools Menu -> Options -> Security -> place Checkmarks on:
    1) Warn me when sites try to install add-ons 2) Block reported attack sites 3) Block reported web forgeries 4) Remember Passwords for sites
    -> Click OK on Options window
    -> click the Favicon (small drop down menu icon) on Firefox SearchBar (its position is on the Right side of the Address Bar) -> click "Manage Search Engines" -> select all Unwanted Search Engines and click Remove -> click OK
    -> go to Tools Menu -> Add-ons -> Extensions section -> REMOVE All Unwanted/Suspicious Extensions (Add-ons) -> Restart Firefox
    You can enable your Known & Trustworthy Add-ons later. Check and tell if its working.

  • Parental Controls are not working correctly.  Websites I've listed under Allow Access are still blocked.  How can I fix this?

    Parental Controls are not working correctly.  There are websites I've listed under Allow Access, however they are still blocked. - such as:  Yahoo mail and USAA banking.  How can I fix this?

    Hendry
    Just thought I'd let you know.  Our suspicions were correct, it was the OS. After I installed Snow Leopard (10.6.8) all the problems were corrected.  I also updated the RAM from 1 gb to 6 gb. The mac is working all around better. Sorry it took so long to get back to everyone. My superdrive had pooped out. Rather than replace it I got an external drive from OWC connected with firewire 800.  So far everything is running very well, as far as I can tell this external drive is better than the original superdrive. My superdrive has always acted funny, infact I returned the first mac I got after a week because its superdrive was also malfunctioning. Anyway, all that to say everything seems to be fully functioning again.
    Roy
    Re: Function keys are not working correctly 

  • Adobe FP 10-A Script in this movie is causing Adobe FP 10 to run slowly. If it continues to run your computer may become unresponsive. Do you want to abort this script? yes or no. How do I fix this crash?

    Adobe FP 10-A Script in this movie is causing Adobe FP 10 to run slowly. If it continues to run your computer may become unresponsive. Do you want to abort this script? yes or no. How do I fix this crash?

    Hi,
    Some "movies' are actually Flash files.
    This means the Flash App will play them (possibly in a browser in some cases).
    Depending where this item is and how it is playing it may be effected by other things
    A web page can include javascript.
    Apple uses javascript here to help with creating the posting box, the Edit options, Adding pics/smilies and the like.
    Sometimes the javascript can be what is called a runaway process and gets sort of stuck in an endless loop.
    If it is a free standing item then it might be triggered by AppleScript on the Mac. (or be modified in some way)
    Again if the Script (normally written with a upper case S) is not perfect it can cause problems.
    9:09 pm      Wednesday; February 26, 2014
      iMac 2.5Ghz 5i 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • TS3297 I purchased an album and some of the songs did not download completely. How can i fix this?

    I purchased an album and some of the songs did not download completely. How can I fix this?

    I have the EXACT issue as Hatchs88 and the response doesn't help. I found a 3 of 4 missing songs as "song".tmp file in the music directory but I can't do anything here... The iTunes store just says purchased and it doesn't the songs show up in the purchased list either. What's funny is that I was able to download on an iPod touch but I cant get it on my PC...

  • I forgot my password on my touchscreen how can i fix this problem?

    my little sisters though it would be funny to set a passcode on my itouch n sadly they forgot it! i need to find out how can i fix this issue without eraseing my music and apps! or if i cant do dat how can i reset the i touch?

    You will have to do as the manual says and restore.

  • My visual voice mail does not work,but I have properly set it up, how do I fix this?

    My visual voice mail does not work,but I have properly set it up, how do I fix this?

    Visual Voicemail is all carrier side, funny enough. Apple can't really do anything to troubleshoot it because it's outside of their realm. Be sure to contact your cellular carrier for further assistance

  • HT1351 Some of the songs I bought from iTunes will not sync to my iPhone.  They show up on my phone, but the letters look faed and I can't play them.  How do I fix this?  I tried restoring my iPhone and it didn't work.

    Some of the songs I bought from iTunes will not sync to my iPhone.  They show up on my phone, but the letters look faed and I can't play them.  How do I fix this?  I tried restoring my iPhone and it didn't work.

    Sorry, I meant the letters look "faded" not faed.

  • CD's not purchased from iTunes but uploaded to iTunes do not show up in the music folder on Apple TV!  How can I fix this?

    CD's purchased from iTunes but uploaded to iTunes do not show up in the music folder on my Apple TV!  How do I fix this?

    You would need to make sure you're accessing the Computers icon. If you are under the Music icon, that will be accessing the cloud and only show iTunes purchases (unless you subscribe to iTunes Match)

  • I've uploaded Acrobat XI Pro and it freezes when I'm using it.  I uninstalled and re-installed.  When I login, it says that it is unable to validate the account and has an option to use the trial.  How do I fix this?

    I've uploaded Acrobat XI Pro and it freezes when I'm using it.  I uninstalled and re-installed.  When I login, it says that it is unable to validate the account and has an option to use the trial.  How do I fix this?

    This is an open forum, not Adobe support... you need Adobe staff support to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • XULRunner keeps saying "error: platform version 1.9.2.9 is not compatible with min version=1.9.2.10 max version=1.9.2.10 how do i fix this?

    Pretty self explanatory. Whenver i open up Firefox this happens. It's happened before, and i had to reinstall firefox. I've been having a lot of problems with firefox lately... how can i fix this?

    go to C:\Program Files\Mozilla Firefox\application.ini
    change to
    MinVersion=1.9.2
    MaxVersion=1.9.2.9

Maybe you are looking for