I love JavaScript as it is FAST and reduces load from the server.
lots of stuff that javascript does can be done very easily by peoplecode.
Like if one wants to show an alert message using javascript.
For that One can simply use the messagebox function in peoplecode.
For checking the length of the field, one can write an logic on the field change and check the length using the field class.
But for that you may need to make the page or field interactive, that means the page will go to server after each interaction and thus again increasing the load on the server.
Therefore I prefer Javascript.
Now coming to the Auto refresh of peoplesoft page.
There is a delivered button that one can use (Refresh )
For auto reload a page:
Place a HTML tag in the page:
lots of stuff that javascript does can be done very easily by peoplecode.
Like if one wants to show an alert message using javascript.
For that One can simply use the messagebox function in peoplecode.
For checking the length of the field, one can write an logic on the field change and check the length using the field class.
But for that you may need to make the page or field interactive, that means the page will go to server after each interaction and thus again increasing the load on the server.
Therefore I prefer Javascript.
Now coming to the Auto refresh of peoplesoft page.
There is a delivered button that one can use (Refresh )
Or second method will be:
getlevel0().refresh(); this will refresh the page and bring new data in the component buffer.
But our requirement is that the page should refresh itself without user intervention.
For that I used a simple combination of 2 functions in javascript.
One need to place a HTML on peoplesoft page, now you can have it as constant or as the field in derived work record.
For field in derived work record you will have to create an HTML definition, Place the script in the definition and provide the value with getHTMLtext function.You can choose the event on which you
want to fire the code/script.For auto reload a page:
Place a HTML tag in the page:
Here I have created no function as i want to fire the script as soon as it loads.
Using the function:setintervel we tell the code the time diff to fire the reload process.
With this code in place the page will refresh itself after the time interval defined.
This can useful if somebody wants to monitor real time numbers coming on real time basis.
I have used this in my PeopleSoft page and it nothing but cool!
ReplyDeleteGood job, Rohil.