cancel
Showing results for 
Search instead for 
Did you mean: 

Portal & Bsp inputfield Problem - Access Denied in javascript

darren_bambrick2
Active Participant
0 Kudos

Hi All

I have a bsp in a portal bsp IView.

I have a date inputfield that throws a javascript error (Access Denied) when I try and select a date from the showhelp button.

I think it may have something to do with the domain relaxing script.

Here is my code

JScript for domain relaxing

if ( document.domain.indexOf(".") > 0 ) document.domain = document.domain.substr(document.domain.indexOf(".")+1);

in my form section.

<htmlb:inputField id="d_date" type="DATE" value="<%=sy-datum%>" showHelp="TRUE"/>

Has anyone any idea of how to solve this ?

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello,

I have the same issue.

I have relaxed the domain from my iframe so as I could launch some functions but when I try to click on an input field type Date, the popup cannot be displayed.

From my parent :

<script>

  function resizeIframe(width,height)

  {

    document.getElementById('id_mon_iframe').width = width;

    document.getElementById('id_mon_iframe').height = height;

  }

</script>

<iframe

width="100%"

name="frame_object"

src="/sap/bc/bsp/sap/my_test/index.do"

frameborder="0"

id='id_mon_iframe'>

</iframe>

From my iframe :

      <script type="text/javascript" language="JavaScript">

       function relaxDomain(input)

       {

         if (input.search(/^\\d+\\.\\d+\\.\\d+\\.\\d+$/) >=0 )

         {

           return input;

         }

         var lnDotPos = input.indexOf(".");

         return (lnDotPos >= 0) ? input.substr( lnDotPos + 1 ) : input;

       }

       function oniframeload()

       {

         var result = relaxDomain(document.domain);

         var width = 2100;

         var height = document.body.scrollHeight + 50;

         if(result != document.domain)

         {

           document.domain = result;

         }

         parent.resizeIframe(width,height);

       }

       </script>

     </htmlb:form>

   </htmlb:page>

</htmlb:content>

JS Error message :

Détails de l’erreur de la page Web

Agent utilisateur : Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)

Horodateur : Sun, 21 Dec 2014 15:10:28 UTC

Message : Accès refusé (Access Denied).

Ligne : 125

Caractère : 3

Code : 0

URI : http://xxxxx.xxxxx.xxx:xxxx/sap/public/bc/ur/Design2002/js/popup_ie6.js?6.0.17.0.0

Anyone with an idea?

Thx.

darren_bambrick2
Active Participant
0 Kudos

Hi Dorian

If I can remember correctly it had something to do with using the  <htmlb:page> tag.

can you try the following page structure and test the date

<%@ page contentType="text/html;charset=windows-1252"%>
<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>
<%@ extension name="bsp" prefix="bsp" %>
<%@ extension name="phtmlb" prefix="phtmlb" %>
<%@ extension name="xhtmlb" prefix="xhtmlb" %>
<htmlb:content design="design2003" level2Check="X" controlRendering="BROWSER" >
<htmlb:document>
<htmlb:documentHead title="Test"></htmlb:documentHead>

<htmlb:documentBody>
<htmlb:inputField  id="d_date" type="DATE" value="<%=sy-datum%>" showHelp="TRUE"/>
</htmlb:documentBody>

</htmlb:document>

</htmlb:content>


Former Member
0 Kudos

Hi,

I've tried this one and didn't get anymore :

<%@page language="abap" %>

<%@extension name="htmlb" prefix="htmlb" %>

<htmlb:content design      = "Design2003"

                themeRoot   = "sap_standard"

                level2Check = "X" >

   <htmlb:page onLoad="oniframeload()" >

     <htmlb:form>

darren_bambrick2
Active Participant
0 Kudos

Closing thread, no resolution

Former Member
0 Kudos

Hi darren.

<htmlb:inputField id="d_date" type="DATE" value="<%=sy-datum%>" showHelp="TRUE"/>

if value is of system date, dont use this.

Use different parameter.

Set that sy-datum to that parameter and use it.

This might help You.

darren_bambrick2
Active Participant
0 Kudos

Hi

Thats not the issue, I have tried several date fields for the value attribute.

Thanks for the quick response.

Darren