I have a Home Page, it shows the status of the information of the company. But some days, there is some delay of information, due to errors in the PL's or in the server. Today I created a new region in the Home Page that shows a disclaimer/text/warning that there is a delay of 5 hours(I will delete this item at the end of the day or the 5 hours of delay). But I want to know if it's possible, that this message (I created another page with a text area item) written by my coworkers, can appear with a button from the other page and then hide the original region in the Home Page.
I'm using Oracle APEX 5.1
Thanks in advance.
So your ask is: Can I control what is shown/hidden in my Home Page from another page? Sure you can! You can try using APEX's Application Settings.
Then just:
Create an application setting (e.g. SHOW_MESSAGE)
Create buttons and a process attached to it calling the SET_VALUE procedure setting SHOW_MESSAGE to Y or N
-- from the Documentation example
begin
APEX_APP_SETTING.SET_VALUE(
p_name => 'SHOW_MESSAGE',
p_value => 'Y' );
end;
On your home page, just add a Server-Side Condition to the region checking if the GET_VALUE equals to Y
Apex does not support push notifications to push messages from the server, but you can use a workaround.
Create a region on the home page that displays the message
Create a dynamic action on page load to hide the message region if the message text is null
Create an an application process return 'Y' if there is a text message to show and 'N' when there is no message. The processing point of this process should be "Ajax Callback...". There are quite a bit of examples on the web on how to use application processes in ajax callback.
On your home page, create a javascript function (in section "Function and Global Variable Declaration") that invokes the application process and shows/hides the message regions based on the result.
On your home page, execute a javascript timer function (in section "Execute when Page Loads") to check every xx milliseconds for updates.
Notes:
As you can see this is quite a bit of relatively advanced work. You might consider showing the message at page rendering time instead.
Don't set the number of milliseconds too low. For every user on this page, a request to the database will be fired every xx milliseconds which can lead to a lot of traffic. For a case like yours, I'd set that to every 2 or even 5 minutes.
This is just one implementation, there are other options (using events, dynamic actions, etc) but it all boils down to the same technique: process on client running at interval.
Related
I am automating a portion of a website that kicks off a job when you click a button. The status of the job is reported on the page in another field, but it isn't automatically pushed. The end user needs to click a Refresh button inside the page to see the latest status.
Something like this
browser.expect.element('#status').text.to.equal('Done').before(10000);
would work if the data was pushed without using interaction, but since I have to manually click another button to get the latest status that wouldn't work.
Is there a built in method to do something every [interval here] until [condition true] or [timeout reached] in Nightwatch? I don't want to use a hard pause since the job could take more or less time depending how the server is feeling.
By another field do you mean an iFrame, svg or perhaps another tab/window?
You don't need manually, there is an option to switch to a different window with the following:
Window Handles + SwitchTo:
command(windowNum){
const result = browser.windowHandles();
let handle = result.value[windowNum];
browser.switchWindow(handle);
}
Refresh a page
browser.refresh();
I don't believe there is a built in method in Nightwatch but I'm sure you can use a for loop and an if statement
So I have a button in a page wherein when it is pressed, it kicks off a process, specifically an application engine. As we all know, when an app engine runs, it is being shown in the process monitor page.
What I want to do is on that same page that I have, the status of the application can be displayed or seen. That part of the page should look like this (see photo 1).
fetch the runstatus of your process from the table PSPRCSRQST.
The runstatus is an XLAT value. See the table PSXLATITEM where fieldname='RUNSTATUS' for the description of the runstatus
I have a form submission using HTML helpers and a p tag that displays a simple count.
On page load, the count in the p tag is obviously 0, which is derived from a list in the model by calling #Model.Individual.Count. After the form is submitted, I'm expecting the Individual list should have a Count of 1. This is indeed the case when I'm debugging it through Visual Studio. I can see it being updated in the model and hitting the breakpoints in the View and #Model.Individual.Count has a value of 1. But then when the page loads in the browser, the value in the p tag still says 0.
I have no idea what is going on since the debug value says 1 but it displays 0 in the browser...
It appears this was due to page life-cycle events and at which times certain scripts were being loaded during the page events. Additionally, since I have desktop and mobile scripts running on the same .cshtml file (loading them or not loading them depending on the screen size), conflicts were occurring.
Overall, the problem was with scripts being fired at the correct times during the page life-cycle.
We have developed an MVC4 Web Application. Due to the flow of pages (it is a reservation system) we need when the user pressed back button the page to be executed again ie reload data from database as it was called from first time.
May be a solution is to suggest how to Capture the browser's back button in an MVC4 web application and execute a Controller's Action
Kindly consider.
Any assistance is kindly appreciated.
Based on your comments it seems you are building up state over several pages (in a wizard style) and it is when navigating back to an earlier page that you would like the state to be cleared.
You would need to capture the page navigation logic on the server side and not rely on capturing back button events on the client side.
You should use the state you've captured to determine what should be displayed to the user and what should happen to the current state you have.
For example, imagine you have pages A, B, C, D which collect user information. The user has entered information on pages A and B (which has been gathered in the session or the database perhaps) and is now on page C. They then navigate back to page A (via the back button or by modifying the url directly). At this point (in the controller for page A) you can determine from the current state that they have been to page B and therefore deduce that they must have navigated back. You can therefore clear the state at this point or perform whatever logic is required.
A user logs into my application in a tab in a browser
They get an email and click a link which opens a new tab in the same browser and logs them in under a different email say.
If they go back to the first tab they are no longer the same user and I want the page to automatically detect this and then reload or redirect them if they are unauthorized to view the page.
Anyway to do this?
Or, if you really want to know when user is switched the tab, try this library:
visibility.js
As stated by #Hck:
add javascript code to reload page periodically (for example once per 30 seconds) – Hck
JavaScript is pretty much the only way to make pages do stuff after they're loaded. Note that in pretty much any user authentication system, a given browser will only be logged in as one user at a time, so as soon as the second tab opens, that browser will be acting as the second user - they can still see the current content of the first tab, but links (for instance) will no longer work unless the second user was also authorized to use them.
There are some JQuery plugins that do this sort of thing, like PeriodicalUpdater, or you can write your own (an example).