Thursday 21 August 2014

OBIEE 11g: Multiple dashboard prompts with single Apply and Reset Button


Single apply and reset button for multiple dashboard prompts:

Generally each single dashboard prompt has Apply and Reset button.
Refer the screenshot:


We need to hide those apply and reset 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.
Java script code for creating APPLY and RESET button:

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>



Settings with Apply And Reset Button:
                         
 1.Apply Button:




2.Reset Button:



3.Criteria and Filters:




4.Text box:1 for hiding apply button script:




5.Text box:2 for Creating Apply And Reset  button script:




6. Dashboard page creation :




7. Final result on dashboard: 





Kindly share your feedback if it helps..
Enjoy coding..!!