Hello All,
In this post i will share one of the enhancement or probably i should call it fix for enabling scrolling which was a very useful feature in Siebel HI.
In Open UI we have now navigation controls in bottom of applet In IP 13 to IP 16, we have below controls
Lets try to understand the things we need to get the things Working
In this post i will share one of the enhancement or probably i should call it fix for enabling scrolling which was a very useful feature in Siebel HI.
In Open UI we have now navigation controls in bottom of applet In IP 13 to IP 16, we have below controls
- Next Record
- Previous Record
- Next Record Set
- Previous Record Set
- Next Record Set
- Previous Record Set
- Last Record Set
- First Record Set
Now with the below code we can use the record navigation from Mouse scrolling ,
- Scroll down to go to Next record Set
- Scroll up to go to Previous Record Set.
Lets try to understand the things we need to get the things Working
- Bind Mouse Scroll event , to let Siebel know that it has to do something on mouse scrolling
- Check for Up/Down Scrolling, to perform forward or backward navigation (this code is standard HTML 5 code )
if(e.originalEvent.wheelDelta /120 > 0) {
console.log('scrolling up !');
else
console.log('scrolling Down!');}
- Call method for Navigation , method called for fetching next records is GotoNextSet and for moving to previous record is GotoPreviousSet. We need to call this method based on Scrolling directions
if(pm.ExecuteMethod("CanInvokeMethod", "GotoNextSet"))
{
pm.ExecuteMethod("InvokeMethod","GotoNextSet",null,false);
}
Note : We could have directly written pm.ExecuteMethod("InvokeMethod","GotoNextSet",null,false) , but i have used if statement and check for CanInvokeMethod to prevent error which will appear in case of scrolling even if we have reached last record set or First record set
Note : We could have directly written pm.ExecuteMethod("InvokeMethod","GotoNextSet",null,false) , but i have used if statement and check for CanInvokeMethod to prevent error which will appear in case of scrolling even if we have reached last record set or First record set
$(appletPlaceHolder).bind('mousewheel', function(e){
if(e.originalEvent.wheelDelta /120 > 0) {
console.log('scrolling up !');
e.preventDefault(); // to prevent default browser scrolling
//to prevent unnecessary pop ups using canInvoke first
if(pm.ExecuteMethod("CanInvokeMethod", "GotoNextSet")){
pm.ExecuteMethod("InvokeMethod","GotoNextSet",null,false); }
}
else
{
console.log('scrolling down !');
e.preventDefault(); // to prevent default browser scrolling
//to prevent unnecessary pop ups using canInvoke first
if(pm.ExecuteMethod("CanInvokeMethod", "GotoPreviousSet")){
pm.ExecuteMethod("InvokeMethod","GotoPreviousSet",null,false);}
}
});
|
try it, your comment and suggestions are always welcome
Hi. Just a note. Scrolling the mouse wheel repeatedly could cause more pain than simply holding the mouse button down on the next set or previous set buttons.
ReplyDelete