Wednesday 15 January 2014

OBIEE 11g - Single Apply Button

Steps to follow :
1.Don't hide "Apply" button from the dashboard.
    If you hide "Apply" button, values pass automatically from prompts to reports.
2.Hide "Reset" button from the dashboard.

Hide & Stop passing the values until click on the "Apply" button. For that follow the code

<style type="text/css">.PromptViewCell .button{display:none}</style>

For Single "Apply" button and the  functionality as follows,

<DIV CLASS = "XUIPromptEntry minibuttonOn">
<input class="button" type = "button" value = "Apply" onclick='javascript:

try


var aElm=PromptManager.getPromptManager().getAllPromptCollectionJSON();

   for(var i = 0; i < aElm.length; i ++ )

  {

   {


     for(var j = 0; j < aElm[i].promptSteps[0].prompts.length;      j ++ )


     {


 var promptid =    aElm[i].promptSteps[0].prompts[j].promptStreamID   ;

      var g = null;
      var h = PromptManager.getPromptManager().getPromptCollectionInfoWithViewID(aElm[i].viewStatePath);

        if(h)

       {
          try
{
 var b = h.getAllPromptExprsArray();
 if( ! h.verifyPromptValuesAndDisplayError(b))
{
  return
    }
          g = PromptManager.buildPromptExprGivenExpr(" ", b)
         }
         catch(f)
         {
           alert(f);
           return
    }
        }

       PromptManager.submitPrompt(aElm[i].viewStatePath, true, "PromptFinish", g)

     }

    }

  }
}

catch(e) {alert("Apply ALL Button Exception " + e.description);}'></input>

<input class="button" type = "button"  value = "Reset" ONCLICK = 'return PersonalizationEditor.removeDefaultSelection(false)' > </input>
</DIV>

"Apply" button settings


"Reset" Button Settings



I am having 2 different set of prompts
1st Prompt  contains period information (Year & Month)

Save as Test1 


2nd Prompt contains Office & Product information

Save as Test2

Report is as follows

Save as Test1

Hide & Stop Apply button functionality
Place the Blue in color code  in the Text box (in this example: Text1)


"Apply" & "Reset" button code and functionality
Place the Red in color code in the another Text box (in this example : Text2)


Dashboard layout 


Dashboard at Finally

Clicks on "Apply" button



Clicks on "Reset" button


Note : While copy & paste the codes beware of double quotes (" ). If double quotes are not proper in copying adjust and then paste.