Sunil S. Ranka's Weblog

Superior Data Analytics is the antidote to Business Failure

How To Replace Multiple Go Button By One Go Button In Prompts

Posted by sranka on November 9, 2008

Hi All,

Waited too long for posting. Been thinking about posting 3-4 blog entries, but release cycle kept me busy. For this blog content, all  excitement began on Friday evening, one of the project manager, from other group called me and asked me if I could help them with one of their business show stopper, may result in delaying Go-Live.  The problem statement was very simple :

Business doesn’t like multiple Go button when they need to use multiple prompts on the same dashboard page.

Following was Oracle’s stance :

Can not be done in Maui (10.3.X), but they will have it in the next release. (Schedule for next summer)

Last week end, worked through Sunday till Tuesday on working this particular problem. We faced the same problem about 1.5 years back, but business was not that tough that time, but this time it was do or die situation. There were many suggestions, one of the suggestion was to integrate Java and OBIEE. Have prompts define in Java and pass on the values to OBIEE, with the mean of SSO, GoNav, GoURL etc… From architectural and presentational point of view, the solution looked great, but implementation sounded really scary. One tiger team was formed to solve the problem. After listening and understanding the problem, I asked for couple of hours to find solution to the problem withing OBIEE.

Following images shows, what OBIEE provides out of box :

Multiple Go Button

Following images shows, what Businees Requirement was :

Single Custom Go Button

Single Custom Go Button

Following are the steps ::

Add following piece of code in C:\OracleBI\oc4j_bi\j2ee\home\applications\analytics\analytics\res\b_mozilla\calendar.js file under — DoLoad() — function

// sranka — following is the customize code writting by sranka for hidding standard Gobutton

var tCustomTagX  = ”;
try{
tCustomTagX = document.getElementById(“customTag”); // Need to create a hidden input as customTag in the report
}catch(e){
tCustomTagX = ”;
}

try{
if(tCustomTagX.value == “customTag”){
custom_hideGoButton();
}
}catch(e){}

// End of customize code by sranka

Add the following function in calendar.js file :

// samvi :: sranka — custom Java Script for Hiding the Go Button

function custom_hideGoButton()
{

try{
var aElm=document.getElementsByTagName(‘span’);
for(var i=0; i<aElm.length; i++) {
if (aElm[i].innerHTML.indexOf(‘GFPDoFilters’) > -1)
{
aElm[i].style.display = “none”;
}//if
}// for
}// try
catch(e)
{alert(‘ Error in calendar.js sranka :: ‘ + e);}

} // end of hideGoButton

Create a dummy HTML tag with following type and value. (This should be the 1st element on the page) ::
<input type=”hidden” id=”customTag” name=”customTag” value=”customTag”/>
Use following JS for hiding the Go Button:
<script>
try{
var aElm=document.getElementsByTagName(‘span’);
for(var i=0; i<aElm.length; i++) {
if (aElm[i].innerHTML.indexOf(‘GFPDoFilters’) > -1)
{
aElm[i].style.display = “none”;
}//if
}// for
}// try
catch(e)
{alert(‘ XXX ‘ + e);}
</script>
Add following piece of code in 

C:\OracleBI\oc4j_bi\j2ee\home\applications\analytics\analytics\res\b_mozilla\prompts\globalfilterprompts.js
//——————-
// Called by form onsubmit to move all filter data into the main view form

// —- start of customization for hidding GoButton — Modified by Sunil S Ranka (sranka)

function GFPDoFilters_samvi(sViewID, tTable, bGFPReloadInline)
{
// RIE: calling GFPDoFilters in preview mode
// doesn’t do anything so we are going to just return
if(sViewID == ksGFPStatePath) // ksGFPStatePath = o:preview~g:globalfilter
return;

var tExpr = XUICreateElement(saw.xml.kSawxNamespace, ‘expr’);
tExpr.setAttribute(“xsi:type”, “sawx:logical”);
tExpr.setAttribute(“op”, “and”);

for (var h = 0; h < tTable.length; ++h)
{
var tPromptCells_New = tTable[h].getElementsByTagName(“TD”);

for (var i = 0; i < tPromptCells_New.length; ++i)
{
var tElement = tPromptCells_New[i];
if (tElement.getAttribute(“GFPBuilder”) != null)
{
try
{
var tFilter = eval(tElement.getAttribute(“GFPBuilder”));
if (tFilter)
{
tExpr.appendChild(tFilter);
}
}
catch (e)
{
alert(‘XXXX ‘ + e);
return;
}
}
}

}

/*
var tPromptCells = tTable.getElementsByTagName(“TD”);
for (var i = 0; i < tPromptCells.length; ++i)
{
var tElement = tPromptCells[i];
if (tElement.getAttribute(“GFPBuilder”) != null)
{
try
{
var tFilter = eval(tElement.getAttribute(“GFPBuilder”));
if (tFilter)
{
tExpr.appendChild(tFilter);
}
}
catch (e)
{
alert(e);
return;
}
}
}

*/

var tDelayedDash = document.getElementById(“sawDashboardDelayed”);

if (tExpr.childNodes.length == 0 && !document.getElementById(“sawDashboardDelayed”))
return false;
else if (tExpr.childNodes.length == 0)
tExpr = null;
else if (tExpr.childNodes.length == 1)
tExpr = tExpr.childNodes[0];

if (tExpr)
{
tExpr.setAttribute(“xmlns:xsi”, “http://www.w3.org/2001/XMLSchema-instance&#8221;);
}

// inline report load support on dashboard
// now we have a switch to control whether we do it inline
var tForm = GetViewForm(”, -1, bGFPReloadInline);

if (sViewID == ksGFPStatePath) // the view id (for GFP preview) is recently changed to this
{
//tForm.P1.value = saw.getXmlText(document.getElementById(“idXUIGFPPreview”)); //this doesn’t work
var tRoot = XUIGetRootXML(“idXUIGFPPreview”);
tForm.P1.value = saw.getXmlText(saw.getFirstChildElement(tRoot));
tForm.action = saw.commandToURL(“ViewPreview”);
submitViewForm(tForm,null);
return;
}

GFPApplyFilters(tForm,tExpr, sViewID);
return false;
}


Use Following JS for creating customGo button :
<script>
/* created by sranka
function customCall()
{
try{
var aElm=document.getElementsByTagName(‘table’);
var tTableArray = new Array();
var k = 0;
for(var i=0; i<aElm.length; i++) {
if(aElm[i].className==’GFPBox’) {
tTableArray[k] =  document.getElementById(aElm[i].id);
k++;
}
}
GFPDoFilters_samvi(”,tTableArray,true);
}
catch(e)
{alert(‘ XXX ‘ + e);}
}
</script>

<td class=”GFPSubmit”><table cellspacing=”0″>
<tbody><tr>
<td class=”XUIPromptEntry”><span class=”minibuttonOn”><a onclick=”javascript:customCall();” href=”javascript:void(null)”>Custom Go New</a></span><div value=”dashboard” id=”d:dashboard~p:b10pia6cf02k1ngq~s:j8obsfvm99vnd77s~g:c7te6i611dqgunnkScope”/></td>
</tr>
<tr>
<td/>
</tr>
</tbody></table>
</td>
Hope this helps
Sunil S Ranka

Advertisements

40 Responses to “How To Replace Multiple Go Button By One Go Button In Prompts”

  1. Nice one!

    In which file to you add the last two script parts?

    regards

    John
    http://obiee101.blogspot.com

  2. Kurt Wolff said

    This looks very useful, but instructions could use a little more elaboration. For example, when you say include your code in the DoLoad() function — where should it be inserted, exactly?

  3. sranka said

    Hi John

    Add the last two scripts in the dashboard page. These scripts needs to be added as part of the — Dashboard Object , Text –. Make sure when you add this as part on — Dashboard Object Text — check the — Contains HTML Markup — check box

    Hope this helps

    Sunil S Ranka

  4. sranka said

    Hi Kurt

    Thanks for the comments :

    The code can be added any where in the DoLoad function.

    Add the last two scripts in the dashboard page. These scripts needs to be added as part of the — Dashboard Object , Text –. Make sure when you add this as part on — Dashboard Object Text — check the — Contains HTML Markup — check box

    Hope this helps

    Sunil S Ranka

  5. Venkata said

    This is one of our requirements. I tried implementing it but got struck. I added the code and the function in calender.js. I created the dummy html tag in dashboard page by putting the above code in a text dashboard object and marked it as HTML. I added the last two codes in dashboard page and checked the html check box. restarted the OC4j and the server and presentation services. but could not find what I expected. Is there something else we should follow? Just let me know!! Thanks in Advance..

  6. Jyotshna said

    Hiii,
    Congrats for extraordinary code. I have been trying to implement this. But got struck mid way. I have not been able to remove all the go button . Can u elaborately tell where to insert the code. I will be glad if u reply to my mail. Can u please tell how to implement in the Disconnected Application as we have requirement both in Connected and Disconnected Application.

    Thanks and once again Congrats For such an innovative idea.

    Thanks & Regards
    Jyotshna

  7. Jyotshna said

    Hiiii,
    First of all many thanks for ur code, I have done it in the OBIEE(Connected Mode), but the problem which i am facing is that the Go() button is not getting hide at the initial stage.
    After clicking on the prompt and selecting any of the value then only the Go() button is going and the function is implemented. I want to hide the Go() button when the page is loaded. How to implement it? Can u give me any suggestion how to hide the button when the page comes . I am new in this field.
    How to implement the same in the Disconnected Mode. I will be glad enough if u reply soon.

    Thanks & Regards
    Jyotshna

  8. Jyotshna said

    Hiii,
    First of all congrats for ur great work. We have done the implemetation of multiple go but the “Go” button is getting hide only when we click on any of the prompt.Can u tell how to do that?
    How will I implement in Disconnected mode because there’s no OC4j.Please can u reply soon.

  9. TheUssef said

    Very Useful informations .
    thank you bro 🙂
    keep it up 🙂

  10. Mark said

    Jyotshna,
    To hide the buttons you need to put the hide html call after the prompts. If you put it before the prompts the code runs inline and the buttons will not be hidden on the initial load.

    All,
    I am having a problem having the filters in the prompt remaining set. Any suggestions.

    BTW, great code so far. I’ve had to make some modes, but our business users have wanted this for a while.

  11. Mark said

    Got everything working. THis is much better than sepaarte goes. Especially when you have 5 or more prompts on a dashboard…

  12. Yubai said

    Hi, I’m not sure where to put the code that follow these titles:

    * Create a dummy HTML tag with following type and value.
    * Use following JS for hiding the Go Button:
    * Use Following JS for creating customGo button:

    I dragged a text item into the dashboard page, and paste all three scripts there, but the only thing I see is a text box and a link (instead of a button)with the text ‘Custom Go New’, and the prompt buttons didn’t hide.

    Thanks

  13. karthikeyan said

    Hi,

    1.I have added the piece of code below the Doload function and added the function in the calender.js

    2 . where i have to add the ?

    3. I have added the hiding the Go Button js in dasboard page text object

    4.I have added the piece of code inside globalfilterprompts.js

    5.I have added the customGo button js in dasboard page text object.

    after restart everything it’s not working can you help me where I have to add the codes.

  14. karthikeyan said

    Hi,

    1.I have added the piece of code below the Doload function and added the function in the calender.js

    2 . where i have to add the html input tag ?

    3. I have added the hiding the Go Button js in dasboard page text object

    4.I have added the piece of code inside globalfilterprompts.js

    5.I have added the customGo button js in dasboard page text object.

    after restart everything it’s not working can you help me where I have to add the codes.

  15. Newbie said

    Does anyone know how to solve this problem?

    In Mozilla I am getting this error

    XXX Exception… “String contains an invalid character” code: “5” nsresult: “0x80530005 (NS_ERROR_DOM_INVALID_CHARACTER_ERR)” location: “http://localhost:9704/analytics/res/b_mozilla/prompts/globalfilterprompt.js Line: 736”

    But when I look in globalfilterprompt.js in line I am looking in this code

    if (tExpr.childNodes.length == 0 && !document.getElementById(“sawDashboardDelayed”))

    Please help

  16. Newbie said

    I had error in code. When C/P code from site, line was like this

    tExpr.setAttribute(“xmlns 😡 si”, “http://www.w3.org/2001/XMLSchema-instance”);

    but it should be like this

    tExpr.setAttribute(“xmlns:xsi”, “http://www.w3.org/2001/XMLSchema-instance”);

    🙂

    Thank you for posting this blog it was very helpful for me 🙂

  17. Asif Husain Khan said

    Hi
    pls help me in my query.I wana keep multiple prompts in a single section of a dashboard (obi ee 10.1.3.3.2) which behaves INDIVIDUALLY, so that on giving the values in edit box in each of the prompt would give the result by affecting the compound layout view kept in other section, for each of the item selected in the drop down list of each of a prompt.would be obliged if you could mail me the solution.

    Regards
    Asif Husain Khan

  18. OBIEE said

    In Internet Explorer does not run, but in Mozilla Firefox yes, Do you know why?

    Thanks
    Regards

  19. Remi Morlot said

    Hi,

    Thanks for your posts.

    I have tried to implement this.
    I believe I am almost there but I don’t understand how the following can work :
    GFPDoFilters_samvi(“,tTableArray,true);

    As per your function, it is expecting a sViewId and we are passing ” ??

    The function returns an error in my case…

    Can you please advise ?

    Regards

    Rémi Morlot

  20. Elish said

    Thanks for the idea. I am testing this solution and found a weird behavior with presentation variables.

    I have several prompts; some of them populate presentation variables.

    I have an answer that displays some data and one of the columns in it is the presentation variable from the prompt.

    When I change the value of the presentation variable (by making a selection in the prompt) it does not get populated the first time I hit GO. It will get populated the second time I hit GO.

    Any Ideas?

  21. Remi Morlot said

    Hi,

    I have successfully implemented your code. Thanks.
    My former error was to update JS files on the wrong server 😦 duh

    Otherwise I had to change “/* created by sranka” in the CustomGo button script as your comment is never closed like that : “*/”

    Also, copy-pasting your code was tricky as ‘” characters are converted in ‘ and ”

    But it’s done now and I appreciate your work. We need more solutions like this one !

    Keep the good work

    Rémi

  22. Ram said

    Hi,

    Great Code.

    I need help as i struck in the middle. The followed all the steps and the SQL is been generated but after the query finished results also my eye glow is running and not giving results in UI.

    Please help me.

    Thanks
    Ram

    • Rajesh N said

      Ram,

      Did u get to fix this issue?

      I am stuck up in this same position.

      any ideas here. At the moment I am clicking on the custom go but only the hour glass appears in it.

      Regards
      Rajesh

  23. Nisha said

    Hey i used the java script given here to hide multi-go-button in prompts and it works for IE 7 and firefox 2.0* with 10.3.4.1.

    Now when i use this same script in firefox 3.0* for BI version 10.3.4.1 it doesn’t work .Any idea why ? Please help me with this,as i want to use this feature in firefox3.0* to.

    Nisha

  24. Nisha said

    Hey i used the java script given in link :- https://sranka.wordpress.com/2008/11/09/how-to-replace-multi-go-button-prompt-by-one/#comment-96

    to hide multi-go-button in prompts and it works for IE 7 and firefox 2.0* with 10.3.4.1.

    Now since 10.1.3.4.1 is certified with firefox 3.0* ,when i use this same script in firefox 3.0* for my prompts it doesn’t work .
    Any idea why ? Please help me with this,as i want to use this hide go button feature in firefox 3.0* too.

    Are these scripts browser to browser incompatible ? If yes from where can i get the script for firefox 3.0* ?

    Awaiting for the inputs.

    Or can you give me your email id to post my query?

    Thanks,
    Nisha

  25. Crobicom said

    Simplified solution is a dummy request -> Narative text view with below code

  26. Crobicom said

  27. Crobicom said

    Changed Source

  28. Ram Joshi said

    I used a a simple CSS fix to hide the Go buttons in the prompts. No need to modify any files and this can be done on a per-report basis.

    1. Add a Text block to any section on your current Dashboard.

    2. Add this to the Text block:
    .GFPSubmit {display: none;}

    3. Check “Contains HTML Markup”.

    Your Go buttons are now hidden.

  29. Kurt Wolff said

    This is potentially really useful,but it seems, reading the comments, as though almost no one can get it to work. I’m in that camp, too, by the way. Can anyone who did get it to work post what they actually did — and do it so that you don’t have a mess of character conversions to do. Maybe just put out a link to complete versions of the modified js files.

  30. AHARRAB said

    Thanks for the Article.
    Can you specify please what this value means p:b10pia6cf02k1ngq~s:j8obsfvm99vnd77s~g:c7te6i611dqgunnkScope in the code
    Custom Go New

    Regards

  31. I experienced the same problem with hiding the Go buttons.
    I found a solution for this problem.

    // sranka — following is the customize code writting by sranka for hidding
    var tCustomTagX = ”;
    try{
    tCustomTagX = document.getElementById(“customTag”); // Need to create a hidden input as customTag in the report
    }catch(e){
    tCustomTagX = ”;
    }
    try{
    if(tCustomTagX.value == “customTag”){
    custom_hideGoButton();
    }
    }catch(e){}

    // End of customize code by sranka

    Instead of placing the above code in the DoLoad function, place the code in the dashboard (object Text) page.
    Be aware to place the Dashboard Text Object after the prompts!!! (f.i. at the end of the page).

    The call to “custom_hideGoButton()” function (see below) has a different behaviour (at least in my situation: IE 8) when placed on the dashboard.
    This function searches for all “span” elements.
    Next a check is done if the string “GFPDoFilters” is in the content of the span element.
    In case of placing the code in the OnLoad function, no elements are found (so none are hidden). In case of placing the code on the dashboard (at the end!), the span elements containing “GFPDoFilters” are found and therefore made hidden.

    // Sniplet from the custom_hideGoButton code

    var aElm=document.getElementsByTagName(‘span’);
    for(var i=0; i -1)
    etc…

  32. vishal said

    I have one Dashboard and i created one prompt filtering two fields i.e. region and Year……..I want separate go button for each prompt….How could it be done

  33. sanjay said

    Nisha the code to hide Go button working fine here

  34. sanjay said

    Hi Sranka, U have done good one..

    I done all the things as you mentioned here. But I did not get succeeded.
    I am using Obiee 10.3.4.1 and IE 8 It is not working to me

    Can you please give me the solution

    Thanks

    • sandeep said

      Hi sanjay even I am trying to implement the same with 10.1.3.4.1 with ie8. Were you succesful in implementing this, if yes could you please explain this to me. thanks in advance.

  35. Hello, this is an awesome site. It has been really informative and it has helped me a lot. Good work. I will definitely be returning for more of your awesome info. I also like to blog myself about jailbreak iPhone. I would love for you to give me your thoughts.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: