referencing a button on a parent form - getelementbyid

On my website...form1 is the parent web page and has a disabled button (button1), a login button and an iframe. The login button sets the source of the iframe to a login form (form2) with a user id and password text boxes and an ok button. Form2's ok button click sets the same iframe source to form3 which evaluates the login and on success, enables the disabled button on form1.
Question: what is the javascript command in form3 to enable the disabled button in form1?
neither
window.parent.getElementById("button1").disabled = false
or
window.document.form1.getElementById("button1").disabled = false
seem to enable the button.

Problem solved. The answer is:
window.top.document.getElementById('button1') or window.parent.document.getElementById('button1') if the parent document isn't the top document.

Related

How to redirect to previous page after clicking "ok" on the apex.confirm message box in oracle apex dynamic action

How to navigate back to the previous page after I hit ok on the confirm message box on apex. I used a dynamic action on the delete button but it only deletes the record not navigate back to the previous page. Is my code below correct?
if(apex.confirm(htmldb_delete_message,'DELETE') == true)
{
apex.navigation.redirect(window.history.back());
}
If you are using the default delete button that is created by the form creation wizard, then on the button properties you'll see that the button's behavior target is defined by a javascript which prompts a confirmation window. After the user hits "OK" on that window, the page is submitted so your delete process can execute.
Trying to execute a javascript code before that to force the navigation may be a bad idea and you would have to restructure your delete process to be processed at the right point
Try to create a branch (https://docs.oracle.com/cd/E59726_01/doc.50/e39147/nav_branch_using.htm#HTMDB25149) instead of using a dynamic action to navigate back to previous page. You can configure it to occur "after processing" and either manually set the page that you to go back to or use a hidden item to always go back to the page which the user came from as described in here: How do add a button to go back to another page in oracle apex interactive grid

Modal dialog - refresh the parent page on close modal dialog or submit button

Using Apex 5.1.3
I have everyting working, but I have a requreimet to refresh the entire page (parent page) on the close of the modal page or press submit button.
I have tried quite a few things in dynamic actions on the parent page etc, but nothing is working.
How can I get the parent page to fully refresh when the modal dialog is submitted and closed.
Your help would be most appreciated.
Regards,
Morshed
You could either place a branch after processing on your modal that redirects to the parent page, or create a dynamic action 'on dialog close' on the button/region that invokes the dialog page, which then submits/refreshes the page.
If you think 'nothing is working', put APEX in debug mode, open your browser console, and check if the dynamic actions are actually firing.

How do I switch to a Modal Popup and identify elements in it using coded steps in Telerik

Scenario:
Launch a web page
Click on the Login button
A Modal Popup appears with username, password fields and a Sign In button
Expected:
a. I would like to identify username, password and Sign In elements in the Modal Popup,
b. I would like to pass values to the username and password fields in the Modal Popup,
c. I would like to click on the Sign In button in the Modal Popup.
I wish to achieve a, b and c using coded steps. Is that possible?
You can check this code library on the matter: Using r.a.d.window for a login form.

Wicket: Modal Windows and callback functionality

I have a modal window that shows a panel which contains a form that has some textfields and a submit button
on submit an insert into the database occurs and then I have some ajax behaviour that i want to activate on the modal windows containing page on click of the button.
So flow is at present:
click link
modal window appears
user fills out form
user submits form
form data persisted to db
modal window closes
I need it to do this in addition:
activate some ajax behaviour on the page that contains the panel
any help on how best to do this in the wicket way is appreciated.
I resolved this by passing an instance of the page containing the panel to the panel (i.e. - in the constructor), then calling a method on the page from the panel to perform the Ajax update.
I would be interested to see what others have done or to hear if there are issues with the approach I have taken.
Set up a WindowClose callback.
In the WicketStuff project called ModelX (Disclaimer: I'm the developer of that) I have created an IWindowClosedListener interface which has a method:
void windowClosed(Panel panel, AjaxRequestTarget target)
So then any Page or Panel that can open a modal that needs to do something when that modal is closed simply implements that interface and its windowClosed method gets called at the right time.

AJAX webpage to navigate on previous page

The data is displayed in gridview with paging on an AJAX enabled webpage. The gridView contains Item templates containing a link button. On itemCommand event, page redirects to display data in new page. When the Back button on browser is pressed, the previous state of the page doesn't load.
Perhaps set a cookie and use it to get the right page when initializing the gridview. Or modify the hash at the end of the URL (eg, add "#page2" to the location bar and read it back on init).
Look at this js stuff from google
Use Google Web Toolkit, it allows the state to be bookmarked and isn't affected by back/forward button.
Otherwise your options are:
Telling the user to not press the back button.
Putting the state in the url, e.g mypage.asp#page_123 and using that to determine the state in your javascript at page load.

Resources