Wednesday, May 30, 2012

Disable The Button To Prevent The Double Click


Scenario:  

We have scenario like where we have payment interface which has been triggered by Payment button on Payment applet. Now customer want to make sure this button would be pressed only once till the request is not get processed successfully.

Solution:  

This can be achieved by two options. First one is browser script and another is very siebel and also applicable for eService as well

·         Go To Applet Control

·         Select Payment Control and Go to HTML attribute of this control.

·         Copy below value in HTML Attribute:

                onclick="function fn1(){disabled=true;}setTimeout(fn1, 100);"

            Note: Here 100 is timeout interval in ms.

Adding asterisk * on a field which is not marked as REQUIRED


Scenario:
We have scenario like where we have to show a * on a field in Siebel which is not marked as REQUIRED in configuration.
Let’s say requirement is to show the red asterisk ( * ) on “Main Phone Number” field on Contact Form Applet.

Solution: 

·         Select the appropriate applet ( In our example “Contact Form Applet” ) and check the edit web layout option.
·         Select the properties of the desired field ( In our example “Main Phone Number” ).
·         Under Caption String-Override add the following HTML code.

     <body><font size=”3″ color=”#FF0000″> *</font> Main Phone Number</body>

Making Buttons/Controls Invisible




Scenario:
 An Applet is being used in many views and the button/control on the applet should be visible in one view only. We need to avoid creation of multiple applets. In simple words in one view user should be allowed to perform some operation on button click while in other views he/she should not see buttons.


Solution:



·         One approach is to have applet Base mode defined in the other view without buttons but it fails when multiple toggles are defined in the applet and applet defined in view is of mode type "Edit".


·         Other option is to make controls invisible. Following Browser Script code could be useful for making buttons hidden in Form Applet dynamically based on the View type.


function Applet_Load()
{
 var sView = theApplication().GetProfileAttr("ActiveViewName");
 switch(sView)
 {
  case "Related Activity View":
     var ctrlSubmit = this.FindActiveXControl("Submit"); // This is the name of control
     ctrlBack.style.visibility = "hidden";//Setting visibility property to hidden
     break;
   
 }
}



 t dynamically based on the View type