[Background]
On the Application Home page screen, Siebel provides us with the ability to close individual Applets, and hide them from the home page. Applets can also be hidden by default in the View definition, and users can display the applets again through the Edit Layout view.
This is actually what a home page actually looks like when you hide all the applets.
To the uninitiated, it looks like the data has disappeared or deleted! Surely this cant pass UAT, yes laugh it off, give your users some training and tell them not to party on the weekends and come to work switched off. However you may take an important design principle to heart - Design for the lowest denominator.
How about we give our users a friendly message that reminds them their data is not goneski, its just not visible.
This message will dynamically appear when there are no applets displayed, and slide down smoothly like an accordian, just to give your users that feelgood feeling, and make them wonder why other parts of Siebel is not sexy like this view.
This solutions relies on a Javascript library called jQuery, which allows the developer to easily select and manipulate DOM elements. Never heard of jQuery? You are probably one of those people who are stuck in a web time warp from early 2000s. Circa 2003, there was an explosion of JS frameworks, that provided web developers a new level of abstraction on JS which provided developers with the tools to achieve easy cross browser compatability, stream line their code, and focus on functionality.
Is it production ready? Dont worry, you'll be in good company. Dont hesitate, get it now, and learn it.
Implementation
1. Download jQuery, and include it into your top object
This can be done in application start or a common Page container web template. If you are taking the latter approach back this file up.
2. Identify the web template that your Home Page View is based on
I should now stress that you should not put any javascript logic in your web templates. Any javascript logic should be offloaded into an external file for performance, maintainability and upgrade reasons (In this case the latter is more important than the rest). Plan this out carefully before you attempt to implement this solution.
3. Put the following code in the external file that handles all your home page behaviour
function j(expr){
return top.$(expr,document);//references the top.$ that was loaded in step 1.
}
j(document).ready(function(){//waits for the home page document to finish loading
try{
if(j("[class*='AppletStyle']").length===1){//if the number of applets rendered is 1 (ie Only the Edit Layout Applet is shown), display our fancy message.
var sText = "Your Home Page data is currently on holidays.
"+
"If you would like to see your data, click on the 'Edit Layout' button, then click ";
var sDiv="
";
j("div.Welcome").append(sDiv);//attach a fancy message
j("div#Msg").slideToggle();//use some jQuery magic to make the message animate by sliding down.
}
}catch(e){
}
});
If you loaded jQuery from your Application, you'll have to re-compile, otherwise, if the library is loaded from your web template, you'll just need to re-start your dedicated client, or restart the server, if you are implementing this on the server.
The "beauty" of this solution is that there is no clunky server side co-ordination, and all the logic is performed client side, so it performance translates to a silky smooth experience.
Conclusion
1. Will it perform well?
Yes, no server side components were abused to deliver this functionality
2. Is it maintainable?
Yes, just like web templates, images and other external configuration
3. Can it be upgraded?
Yes. Dont put your code in your templates. Make the effort to offload this to an external file, otherwise dont do it at all.
and
4. Is it sexy?
It is fun and sexy.
This is really great... it is opening new avenues for us to explore. Please keep up this great work.
ReplyDeleteIt would be really great if you could actually show what you mean by
"Download jQuery, and include it into your top object"
and example of both ways of including jquery and external js files...
Hi Sandeep,
ReplyDeleteYou have to use a script include function to point to your jquery file, and then assign the jquery object to your top object eg. top.$=$;