Showing posts with label Open UI. Show all posts
Showing posts with label Open UI. Show all posts

July 07, 2016

How to customize siebel error messages?


With IP14 Oracle has provided ErrorObjectRenderer.js to replace browser based dialogs with jQuery based dialogs. Problem with browser based dialogs is that users can accidently disable them. Thus it is not a good place to show error messages or important instructions to the user. 
Standard alert()
However jQuery based dialogs always shows up on the screen and user have to click ok always to get past them.
jQuery Dialog

Lets see how we can achieve the same functionality in IP13.  

Open UI framework uses browser alert() function to popup error messages. In Javascript it is possible to override any function including browser native functions like alert and change it according to the business needs.

Simplest way to override alert is to define a function alert() in your code, this will force your browser to call your custom function all the time whenever Siebel calls alert() instead of browser's native function. .

function alert(str){
 $("<div id='my_error'>" + str + "</div>").dialog({
               modal: true,
                buttons: [{ id: "btn-accept",
                    text: "Ok",
                    click: function () { $(this).dialog("close"); }               
                }]
            });
}

Just add the above code in post load file and job done, after executing this code all the error messages will shown in jQuery dialog which will always pop-up. See it in action on codepen

Happy alerting ! 
This is trick is shared by avid reader TJ, please share your tips and tricks in comments below.

June 23, 2016

Just one Elastic applet?

Oracle introduced wonderful elastic list applets with IP16,  this feature shrinks list applet size if there are no or less records needs to be displayed. However this doesn't always looks nice, specially in MVG applets and pick applets.
Default Elastic Applets in IP16
 
This feature can be turned off by setting "Enable Elastic Grid" system preference, but it is turned off for entire application. That makes me think is there any way we can make only one applet as elastic applet?  Answer is yes :)

Neel on Siebel Unleashed published beautiful trick to back port elastic applets into IP15. Absolutely splendid! This trick can be extended to make only few applets Elastic. 

To make all list applets Elastic add following in custom CSS file:
.ui-jqgrid-bdiv{max-height:340px !important; height:auto !important;}
To make only one applet Elastic (After turning of the system preference) add following CSS :
div[title="Line Items List Applet"] div.ui-jqgrid-bdiv { height: auto !important}

By preceding another div selector to the CSS rule we can instruct browser to apply CSS style only if applet name is : "Line Items List Applet". One can use this trick to change other UI attributes for specific applets and apply different styling.


Happy Styling :)

June 16, 2016

How to hide disabled buttons in Siebel Open UI?

With IP 15 and 16 Open UI themes have inclined towards bigger controls and more blank space on page, which is not bad thing but too much of it is making UI cluttered specially on small screens.

To fix this issue one can hide all disabled controls and all the white space around it. this can be done by simply adding following CSS and Open UI framework takes care of the rest.

button.appletButtonDis {
    display: none;
}

Further on to hide disabled menu items add :

li[aria-disabled=true]{
    display: none;
}

Siebel adds these classes and attributes to all the buttons on all applets and menus including new/query/delete icons to show them as disabled. Thus this change effects the entire application.

This post is contributed by esteem reader from down under via siebel-developers slack community. Register today to read more discussion like this.

August 27, 2015

HTML Attributes doesnt work in Siebel Open UI

HTML Attribute Property of applet controls is a standard interactivity application's property which allows to set HTML attributes so that javascript can directly refer that element using document.GetElementById() or GetElementByName()

From Tools help:
"
HTML Attributes (O) -  Specifies to add HTML tag attributes to the HTML tags that the Standard Interactivity client creates when it displays the control. For example, If you set the HTML Attributes property to size=30 for a text box, then the client creates the following tag: <input type = text size=30 . . .>
"

However this trick is not available in Open UI as Open UI is considered to be HI application. Enhancement request has been created by oracle to consider this in future releases.


Solution:

In absense of this attribute property, developers have to scan through the elements using syntax like :

To access control of applet use following in PR layer:

this.GetPM().GetControl ("First Name");

or following to access the applet's wrapper.

var appplet_wrapper = "#s_" + tihs.GetPM().Get("GetFullId") + "_div";

 After getting access to the applet wrapper one can use jquery find method to extract controls of the applet.

 Hope it helps.

August 25, 2015

Open UI just doesn't work!

I recently met a group of people who basically vented out their first reactions on Siebel Open UI. Group consisted of both technical staff and non technical end users, thus I was able to validate and confirm issues.

At the end of discussion I was left with long list of things that doesn't work in Open UI. On researching support web, picture became more appalling.

Following is the list of very basic things that just don't work in Open UI, and sad part is that Oracle is not acting on them at all.

Please share your views in the comments below.

  1. Scrolling through list applet does not work with keyboard shortcut.

    When you get a list applet displayed in Open UI and before you click on any data row you navigate with the keys <CTRL>+<ARROW-DOWN> the focus will jump to the next record.But the previous record is still highlighted.
    Oracle raised couple of bugs for it, but didn't provided any fix for IP2013

  2. Drag and Drop of attachment does not work in IE9 and IE11 in IP2013 however it works in other browsers.


    Open UI Product Management recommends :
    ..."Drag and drop will not work in any IE version in Siebel 8.1.1.10 release and below. The biggest issue here is that IE8 and IE9 simply don’t support standards based drag and drop in HTML5. For IE10 there is a defect in a third party being used to provide this functionality. The third party has resolved the issue and it will be included in a future Siebel release. We would not encourage customers to upgrade the third party themselves, but rather they should wait for the next Siebel release when a fix will be made available"....
    In one of the SR oracle has gone one step further and recommended to change the browser.

  3. Open UI doesn't show hour glass while running query.

    This has been reported to oracle by many customers and since earliest open UI release, still oracle hasn't provided any fix yet.
    Steps to replicate:
    1) Log Into Open UI enabled siebel application
    2) Navigate to Accounts > All Accounts View
    3) Select the field to be searched using In Line Search(dropdown on top of list applet)
    4) Query for a field which can take some time to return records
    5) hourglass not shown and user doesn't know whether the system is querying or not!

  4. Vertical scroll is not present in open ui list applets.


    Siebel HI List Applet
    This one is the annoying thing of open UI. I don't understand why oracle has gone ahead picked up jqgrid for designing list applets. Grid is not capable enough to handle the large amount of data thus vertical scrolling is difficult to implement. This is also the reason of bad performance of Open UI client.

  5. Text area fields in open UI does not pops up.

    This is the second most annoying thing for an experienced HI user. Suddenly after upgrade Siebel losses it's popout text areas and no solution was provided till date. I have seen long time wasted to resolve this thing by many developers.
We all know list of issues with Open UI doesn't end here. I will create another list of Top 10 annoying things of Open UI to share it with you.

Till the time if you any problem that was just rejected by oracle to fix and think that should get slot in top 10 the please share it in comments below.

#ShameOnOracle

June 30, 2015

How to change color of screen tab in Open UI?

I think this configuration should available out of the box in Siebel. Never the less I am happy that it is possible to customize the View PR layer in Open UI to change the colors of view bar of specific views.

In this example we will see how can we change the view bar background conditionally using Open UI View level PR customization.

This is how grey tab theme looks out of the box for Manifest File view :
 
Open UI Manifest File View

And this is how Manifest Administration view looks with Open UI PR Customization:

Open UI Manifest Administration View

May be savvy developers would like to have pale yellow for read only views or red for administration screens???


Part 1 : Create CSS class
This customization requires extending the theme in theme.js and creating new class to add different color. New Class should look something like :
custom-theme.css
When this class is associated with any control, it will change the background of the element to transparent and change the background color to blue.

Part 2: Create View PR Customization 
Now the task left is to find the view bar element in the DOM and assigning the class, this can be done with these two commands:

            $("#s_sctrl_tabView").addClass("custom_viewbar");
            $("#s_sctrl_tabScreen").find("li.ui-tabs-active[role='tab']").find("a").addClass("custom_viewbar");

Additionally we need to handle the browser resize event and reassign the class on change of size of browser. Sadly resize event is not passed on the View level PR as described in bookshelf and it has to be done with help of jQuery bind function. Code handling resize event looks like :

        $(window).bind("resize", OnPRResize);

At last we need to handle the cleaanup in the EndLife event of jQuery bind and the class allocation.

$(".custom_viewbar").removeClass("custom_viewbar");
$(window).unbind("resize", OnPRResize);

The final code of PR looks like:


if (typeof(SiebelAppFacade.testPR) === "undefined") {
    SiebelJS.Namespace("SiebelAppFacade.testPR");
    define("siebel/custom/testPR", ["siebel/viewpr"],function () {
    SiebelAppFacade.testPR = (function () {

    function testPR(pm) {
                SiebelAppFacade.testPR.superclass.constructor.apply(this, arguments);
    }
    SiebelJS.Extend(testPR, SiebelAppFacade.ViewPR);

    testPR.prototype.Init = function () {
        $(window).bind("resize", OnPRResize);
        SiebelAppFacade.testPR.superclass.Init.apply(this, arguments);
    }

    testPR.prototype.ShowUI = function () {
        SiebelAppFacade.testPR.superclass.ShowUI.apply(this, arguments);
    }

    testPR.prototype.BindData = function (bRefresh) {
            SiebelAppFacade.testPR.superclass.BindData.apply(this, arguments);
    }
    var OnPRResize = function OnResize(){
            $("#s_sctrl_tabView").addClass("custom_viewbar");
            $("#s_sctrl_tabScreen").find("li.ui-tabs-active[role='tab']").find("a").addClass("custom_viewbar");
    };
    testPR.prototype.BindEvents = function () {
            SiebelAppFacade.testPR.superclass.BindEvents.apply(this, arguments);
    }
    testPR.prototype.EndLife = function () {
        $(".custom_viewbar").removeClass("custom_viewbar");
        $(window).unbind("resize", OnPRResize);
        SiebelAppFacade.testPR.superclass.EndLife.apply(this, arguments);
    }

    testPR.prototype.Setup = function () {};

    testPR.prototype.SetRenderer = function () {
                $("#s_sctrl_tabView").addClass("custom_viewbar");
                $("#s_sctrl_tabScreen").find("li.ui-tabs-active[role='tab']").find("a").addClass("custom_viewbar");
    };

    return testPR;
    }()
    );
    return "SiebelAppFacade.testPR";
    })
}

Part3: Configure Manifest
Now when this PR script is associated to any view in Open UI Manifest, view bar color and screen tab color of that view will change to blue.


Hope it helps, if you like this article and would like to see more articles like this please leave a comment or +1

February 15, 2015

Responsive UI Demo of Siebel Open UI IP2014

With IP2014 Siebel has adopted responsive UI design which adapts the UI in real time to the screen size and HTML5 capabilities available on the device. Following video is the best Siebel demo we have ever seen so far.

Please watch and Share!!  

Demo showcases :
- Differences between desktop and tablet devices(ipad)
- HTML 5 Compatibility test
- Application menu adapts to screen size (hides context menu on iPad)
- Icons are larger on tablet device for easy navigation.
- Calendar changes the layout for easier navigation in iPad
- Fluid Grid adapts to the resolution of desktop application into a tablet mode and further to mobile resolutions 
- Checkbox adapts to slider using plugin wrapper on iPAD
- MVG shows both shuttle applet and list applet.
- MVG on iPAD shows as pre IP2014 application.
- iPAD enables multi-select checkboxes.
- Scrolling in remains the same in desktop as in IP2013
- Infinite Scrolling is available in iPAD with progress bar!!! No need of IP2013 Solution  







February 13, 2015

How to get current timestamp in JavaScript?

Following Javascript code returns current date and timestamp of client. This is quite handy for Open UI development, one can call following code from console.log() method to record the invocation sequence which is otherwise very difficult.

function displayTime(str2) {  
    var str = "";
    var currentTime = new Date()
    var hours = currentTime.getHours()
    var minutes = currentTime.getMinutes()
    var seconds = currentTime.getSeconds()
    var milliseconds = currentTime.getMilliseconds()
    if (minutes < 10) {
        minutes = "0" + minutes
    }
    if (seconds < 10) {
        seconds = "0" + seconds
    }
    str += hours + ":" + minutes + ":" + seconds + ":" + milliseconds;
    return str2 + ": " + str;
    }

Siebel Open UI Example:

 console.log("PR Invoked" + displayTime("@"));

Hope it helps. 

February 10, 2015

How to traverse javascript object?

For in loop is one of my favourite commands of JavaScript and it just one step behind the modest alert() ;) 

It is a very powerful command and helps you to loop through any JavaScript object without knowing what object is all about. You don't need to know the types that exists in the object or number of child objects that object has. You just need have the handle of the object and you can loop through all its properties.

It is quite handy if you cant get your head around Siebel Open UI and you want to know what else is available in that object and how the functions are implemented in an object.

Examples:
MyPM.prototype.Setup = function (propSet) {       
    for(var x in propSet){console.log(x + "" + propSet[x]);
    }
        SiebelAppFacade.MyPM.superclass.Setup.call(this, propSet);
}

In this example I am trying to find what else is passed through the property set by Siebel to the Setup function of Presentation Model. and the following I am trying to all the methods that are available by theApplication() object.

for(var x in theApplication()){
console.log(x + " " + theApplication[x]);
}


For those who don't know, For in loop is just plain old JavaScript and is not some thing the jQuery offers.

Happy Hacking :)

January 30, 2015

Mouseless Siebel?

I am fan of keyboard shortcuts and I don't like applications which are dependent on mouse clicks and one of such application is Siebel especially Open UI. Many shortcuts of HI does not work in Open UI as browser overrides like Control +N and Cntrl + Arrow Keys.

This forced me to find this alternative and I found the Mouseless browsing add-in for Firefox.

It is not exactly command line interface but it is the closest you can get in Siebel Open UI, once this plugin in enabled you can browse entire Siebel application with keyboard shortcuts with this plugin.

Install Mouseless Browsing Firefox add-in (by Rudolf Noe) from following URL:
https://addons.mozilla.org/en-us/firefox/addon/mouseless-browsing/

It works with both Siebel dedicated and thin client. Some screenshots:

Siebel Open UI Home Page with Mouseless Plugin

Invoking Navigate Menu

Siebel Open UI Sitemap

Navigating in Siebel Open UI Using keyboard shortcuts.



This plugin indexs all the links on web page and assign a sequence number to it which becomes the keyboard shortcut for it. The shortcut is displayed along with every clickable link. Incase you are in a editable field you can still use the shortcut by pressing Ctrl Key.




I am using it from past week and hasn't faced any issues yet. Give it a try and let me know how you like it.