Javascript/ Page Attributes

Hi Guys
Firstly sorry my name hasnt appeared i have tryed several times to change my handle and it says update in a hour!
Anyway
My Issue is as follows
I have 5 reports in page regions on a page1
I have added Javascript in page 1 attributes and modifyed the template slightly so that i can get Fixed columns on my reports scrollbar
This is working perfectly for the first report/region but not for the other 4 reports
Has anyone got an idea on this ?
I can supply the javascript code
Thanks in advance

Dan
The Javascript is as follows.
<!--
<script language="JavaScript" type="text/javascript">
<!-- Hide
//Function Builds Static Header and Scrollable Div called with document onload
function MakeStaticHeader(xDataGridName,xScrollHeight){
//Grab the Table object
var theTable = document.getElementById(xDataGridName);
//Create a holder div so div header can be added correctly before table
var myHolderDiv = document.createElement("div");
myHolderDiv.setAttribute('id','tableHolder_'+ xDataGridName)
//Create the Header Div, setting id and adding to Holder
var myHeaderDiv = document.createElement("div");
myHeaderDiv.setAttribute('id','divHeader_' + xDataGridName)
myHolderDiv.appendChild(myHeaderDiv);
//Insert the Holder and Header divs
theTable.parentNode.insertBefore(myHolderDiv,theTable);
//Append the Child
myHolderDiv.appendChild(theTable)
//More messy code with IE
if(document.all){
theName = "hold2_" + xDataGridName;
else{
theName = xDataGridName;
//Create Body Div for scrollable body (IE creates a holder, mozilla creates the scroller)
var theBodyDiv = document.createElement("div");
theBodyDiv.setAttribute('id','divBody_' + theName);
theBodyDiv.setAttribute('style','OVERFLOW-Y: scroll; OVERFLOW-X: auto; OVERFLOW: auto; HEIGHT: ' + xScrollHeight + ';')
theTable.parentNode.insertBefore(theBodyDiv,theTable);
theBodyDiv.appendChild(theTable);
//Since IE can not apply the style to the new Child above, we need to make it messy! (IE is making this hard!)
//Converts the holder to a scroller
if(document.all){
var theMessDiv = document.getElementById('divBody_' + theName);
startDiv1 = '<div id="divBody_'+ xDataGridName +'" style="OVERFLOW-Y: scroll; OVERFLOW-X: auto; OVERFLOW: auto; HEIGHT: '+ xScrollHeight +';">';
endDiv1 = '</div>';
theMessDiv.innerHTML = startDiv1 + theMessDiv.innerHTML + endDiv1;
//The following Code Builds the header
theTable = document.getElementById(xDataGridName); // Arie
//Grab border widths (have to check for different ways to define it!)
var borderWidth = parseInt(theTable.style.borderwidth);
if(!borderWidth){
borderWidth = parseInt(theTable.border); }
if(!borderWidth){
borderWidth = parseInt(0); }
//Grab the table Headers (if exsists)
     var theThs = theTable.getElementsByTagName("th");
     var hasThs = parseInt(theThs.length);
     var hasHeadCells = false;
     //See if the Table Headers exist
     if(hasThs>0){
     hasHeadCells = true;
//Grab the table rows
     var theTrs = theTable.getElementsByTagName("tr");
//Find the number of columns
var theTrsTds = theTrs[1].getElementsByTagName("td");
     var numberOfColumns = parseInt(theTrsTds.length);
//Grab all of the table cells
var theTds = theTable.getElementsByTagName("td");
//Determine the widths of the columns of the table
var totalWidth = 0;
var theWidths = new Array();
for(i=0;i<numberOfColumns;i++){
          if(hasHeadCells){
          theWidths[i] = theThs.offsetWidth;
          else{
theWidths[i] = theTds[i].offsetWidth;
          theTds[i+numberOfColumns].style.width = theWidths[i];
totalWidth += parseInt(theWidths[i]);
//Set the width of the div so the scroll bar is on the edge of the table
document.getElementById("divBody_" + xDataGridName).style.width = document.getElementById("divBody_" + theName).offsetWidth;
//Grab the content for the headers
theHeaderCode = theTrs[0].innerHTML;
//This is for IE only since it does not support getComputedStyle which is alot easier!
var theStyle = "";
if(document.getElementById("divBody_" + xDataGridName).currentStyle){
//Grab the innerHTML and locate the style
theX = document.getElementById("divBody_" + xDataGridName).innerHTML;
theX = theX.split("style");
//Verify that there is a style tag in the table tag
if(theX[0].indexOf(xDataGridName) >= 0 && theX[1].indexOf("<TBODY>") >=0){
//split aprt to get the style
theQ = theX[1].split('"');
//set the style string
theStyle= "style='" + theQ[1] + "'";
//Create the table code and set it on the document
tbCode = "<table id='theAddon_"+ xDataGridName +"' "+ theStyle +">" + theHeaderCode + "</table>";
document.getElementById("divHeader_" + xDataGridName).innerHTML = tbCode;
//Apply the CSS Class and the Widths to the header Elements
     if(hasThs > 0){lookFor = "th";}
     else{lookFor = "td";}
theNewTD = document.getElementById("divHeader_" + xDataGridName).getElementsByTagName(lookFor);
for(i=0;i<theNewTD.length;i++){
theNewTD[i].style.width = theWidths[i];
/* Arie Workaround - English version*/
//theNewTD[i].style.borderStyle = "solid none solid solid";
//theNewTD[i].style.borderWidth = "1px";
//Apply CSS to the static table
theOrgTable = document.getElementById(xDataGridName);
theNewTable = document.getElementById("theAddon_" + xDataGridName);
     for(x=0;x<theOrgTable.attributes.length;x++){
     if(theOrgTable.attributes[x].nodeValue && theOrgTable.attributes[x].nodeName.toLowerCase() != "id"){
     theNewTable.setAttribute(theOrgTable.attributes[x].nodeName,theOrgTable.attributes[x].nodeValue);
// Calculate the scrollbar width and streach the last header cell
var scrollbarWidth = document.getElementById("divHeader_" + xDataGridName).offsetWidth - document.getElementById("theAddon_" + xDataGridName).offsetWidth
var lastHeaderCell = theNewTD.length - 1;
theNewTD[lastHeaderCell].style.width = theWidths[lastHeaderCell] + scrollbarWidth;
theNewTD[lastHeaderCell].style.borderStyleLeft = "solid";
theNewTD[lastHeaderCell].style.borderWidthLeft = "1px";
//Hide the orginal header row
     theTrs[0].style.display = "none";
//Make mozilla browsers see the applied styles
makeSame(theOrgTable,theNewTable)
//Function to make Mozilla have the same inline styles
function makeSame(elem_1, elem_2){
if (window.getComputedStyle){
elem_1x=window.getComputedStyle(elem_1, "");
elem_2x=window.getComputedStyle(elem_2, "");
elem_2x = elem_1x;
// End Hide -->
</script>

Similar Messages

  • Problem with JavaScript code in Page Attributes, modal popup...

    Hello all!
    I'm encountering a problem with a modal popup I wrote in JavaScript.
    h3.
    The situation*
    A user sees an interactive report with rows that are clickable, so these rows are links. Upon clicking the name of something in a row, some items get a certain value and a modal popup shows on the screen. In this modal popup, there are details regarding that particular row the user has clicked, but the problem_ here is...
    The modal popup closes itself only seconds after it has been opened.
    This must be because I've probably made a mistake somewhere in my code, but I just can't figure out where... It also appears that when I click on a row link, the popup shows, but the progress bar of my toolbar seems to show a loading bar (as if I refreshed the page).
    h3.
    My code*
    This code is located in the _"Function and Global Variable Declaration"_ part, under the _"JavaScript"_ tab. Code is in the _"Page Attributes"_ of my page 24.
    function showhide(x){
    $x('REGION1').style.display = ( x == 'REGION1') ? 'block' : 'none';
    $x('REGION2').style.display = ( x == 'REGION2') ? 'block' : 'none';
    $x('REGION3').style.display = ( x == 'REGION3') ? 'block' : 'none';
    $( function(){
      $('#ModalForm').dialog(
         modal: true,
         autoOpen: false,
         width: 500,
         height: 350,
         buttons:{ Close: function(){closeForm();}        
    function openForm()
        $('#ModalForm').dialog('open');
    function closeForm()
        $('#ModalForm').dialog('close');
        $(document).ready(function() {
            $('a.temppop').click(function() {
                openForm();
        });This code is located in the _"Header Text"_ part, under the _"Header"_ tab. Code is in the _"Page Attributes"_ of my page 24.
    <link rel="stylesheet" href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css" type="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"> </script>This code is located in the _"Column Link"_ part, you get there by going to the _"Report Attributes"_ of the region called _"Template overview"_ on page 24. This region is an interactive report.
    Link Text: #FOODTEMPLATENAME#
    Link Attributes: class="temppop"
    Target: Page in this Application
    Page: 24
    Item 1, name: P24_MEALID; item 1, value: #MEALTYPEID#
    Item 2, name: P24_TEMPLATEID; item 2, value: #FOODTEMPLATEID#So basically I call the function to open the modal popup by the class name. When a link with that class name in it is clicked, it opens the popup.
    To remind you of the problem, the modal popup closes seconds after it has been opened. How do I fix this?
    Thanks in advance.
    (APEX version 4.1.1.00.23)

    Come on guys... I really need to know this. :(

  • Change page attribute with JavaScript

    Hi,
    hope someone can help.
    Is it possible to change a BSP page attribute with JavaScript??
    I have a JavaScript array with some serialnumbers. After push a save button, i want to save the array data into a page attribute.
    Some ideas?
    Regards Anton

    Hi,
    The only way of passing vars from JS to page attributes is submitting them via (hidden) values in a form or via params in an URL.
    Alternatively, you can try to let JS store things in a client cookie and let the BSP read that cookie.
    I didn't try that out yet though.
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • BSP: How copy received portal event string to ABAP-Page-Attribute variable?

    Hi,
    I am able to receive and display portal events (EPCF API) with the following code:
    <SCRIPT src="epcfproxy.js"></SCRIPT>
    <script language="javascript">
    if(window.document.domain == window.location.hostname){
    document.domain = document.domain.substring(document.domain.indexOf('.')+1);
        EPCMPROXY.subscribeEvent("urn:com.sap:BWEvents","BWiViewevent", window, "myreceiveEvent");
    function myreceiveEvent( eventObj ) {
       alert("event received:" + eventObj.dataObject );
    But now the received data is only stored in Javascript-"variables".
    How can I copy the received string to ABAP variables? These variables will be declared as Page Attribute (e.g. rec_event_data  TYPE STRING)
    Is my Javascript-solution a good way to handle portal events or are there better solutions?
    Thanks a lot.
    Regards,
    Henning

    Hi,
    yes I was able to do it.
    The code should be something like this. I can not test it at the moment.
    function myreceiveEvent( eventObj )
            document.form1.rec_event.value = eventObj.dataObject;
            document.form1.submit();
    <htmlb:form id="form1">
          <input type="hidden" name="rec_event" value="">
    </htmlb:form>
    Event Handler: OnInputProcessing
    rec_event_data = request->get_form_field('rec_event').
    Regrads,
    Henning

  • Page Attributes and Application Class Attributes

    Hi, everyone,
    I am quite new to BSP.
    I have a question here:
    what is the difference between page attributes and application class attributes of a bsp application? As they are both global attributes, there seems to be no big difference when we use them.
    thanks a lot.
    Fan

    Hi Fan,
    a BSP application can be made up of many pages.
    A page attribute is visible only in the page it is associated with.
    Attributes of the application class are visible from every page in that application.
    Cheers
    Graham Robbo

  • Change default page attributes

    I am trying to design a standard framework for our developers using the portal
    (e.g., standard header, footer, etc). In particular, I would like to change a
    couple of default page attributes such as "hidden" and "layout type". Any ideas
    where this could be done? Thanks.

    I never even thought of that - Word woman that I was!  Thanks so much - I shall give it a go!!

  • Database options grayed when creating ASP (Javascript) page

    I recently installed CS5 Master Suite on a WinXP-32 machine and was able to create ASP pages in Javascript that could connect to and update a Microsoft Access 2003 database.  But since certain apps in the suite required 64-bit OS, I wiped the machine and installed Windows 7 64-bit.
    I've managed to get it set up so that I can connect to the database if I create a new ASP page with VBScript, but if I create a new page with Javascript, the ability to add a new connection in the database pane is grayed out, despite all the items listed underneath being checked off.
    I assume the DSN is setup correctly since the VBScript pages work.  I've installed IIS7 on the machine with 32-bit application pool enabled so that the server can connect with the 32-bit ODBC driver.
    Any hints on how to get database connection working in Javascript pages would be greatly appreciated!

    Actually, it appears you were right. . .  according to:
    http://help.adobe.com/en_US/dreamweaver/cs/using/WSc78c5058ca073340dcda9110b1f693f21-79e0a .html
    Note: As of Dreamweaver CS5, Dreamweaver no longer installs ASP.NET, ASP JavaScript, or JSP server behaviors. If you’re working on ASP.NET, ASP JavaScript, or JSP pages, however, Dreamweaver will still support Live view, code coloring, and code hinting for those pages. You do not need to select ASP.NET, ASP JavaScript or JSP in the Site Definition dialog box for any of these features to work.
    The only reason I can think that it worked prior to the OS change was that we did have CS4 installed which was later upgraded to CS5.  The pages may have either been created prior to the upgrade or it retained support for ASP Javascript through the upgrade, but no longer had it with the fresh install after the OS change,
    Thanks for the info.  Knowing it was a design decision on Adobe's part made it a bit easier to generate a search to locate the info I was looking for.

  • Validate Date and block JavaScript page change

    how I can validate date acrobat, can block JavaScript page change, only change with a button? 

    If you use the "util.scand" method date validation is part of the process. It either returns the number of milliseconds from the Epoch date used by JavaScript for the date time object the null value.
    Date Arithmetic has some sample scripts, but you need to keep in mind that Date and Time are not independent and using "new Date()" returns the date and time at the time that line of code is executed and that can cause issues for the computing of dates only.
    Are you sure of day count, most differences include the start and end dates in the number of days for the calculation.
    Custom calculation for today's date field (format is None):
    // get today's date an time
    var oToday = new Date();
    // set to start of day
    oToday.setFullYear(oToday.getFullYear(), oToday.getMonth(), oToday.getDate(), 0, 0, 0, 0)
    // set field value
    event.value = util.printd("d/mm/yyyy", oToday);
    Custom calculation for the difference in days field (format None):
    var cEnteredDate = this.getField("EnteredDate").value;
    var cToday = this.getField("Today").value;
    event.value = "";
    if(cEnteredDate != "" && cToday != "") {
    // process only if date values not empty
    // convert date strings to date time objectat midnight
    var oEnteredDate = util.scand("d/mm/yyyy", cEnteredDate );
    if (oEnteredDate == null) {
    app.alert("Error in processing entered date", 2, 0);
    oEnteredDate.setFullYear(oEnteredDate.getFullYear(), oEnteredDate.getMonth(),oEnteredDate.getDate(), 0, 0, 0, 0) 
    var oToday = util.scand("d/mm/yyyy", cToday);
    if(oToday ==  null) {
    app.alert("Error converting today", 2,0);
    oToday.setFullYear(oToday.getFullYear(), oToday.getMonth(),oToday.getDate(), 0, 0, 0, 0) 
    // convert date objects to days
    var nEnteredDate = Math.floor(oEnteredDate.getTime() / (1000 * 60 * 60 * 24));
    var nToday = Math.floor(oToday.getTime() / (1000 * 60 * 60 * 24));
    // compute & format the difference
    event.value = util.printf("%,0 1.0f", (nToday - nEnteredDate));

  • Using page attribute in event handler method of controller

    Hi all,
      I have created a page attribute GT_TABLE. I need to use this table in one of the event handler methods of the controller of the same page. I tried to use the GET_ATTRIBUTE method but it always returns an empty table.
      Can someone please guide me in this respect.
      Thanking you in advance,
    Regards,
    Sumit.

    Hi Sumit,
    The page attribute you mention (GT_TABLE) it's an internal table, isn't it? So far I know, the value of internal table will gone when BSP finish to load in server. If you want to keep the data in internal table, you need to load the internal table into Session (in one of page event in BSP).
    Regards
    David

  • Page Attribute

    Hi All,
    I have a page with FLOW LOGIC and I have declared a page attribute here. What is the best approach to pass on this page attribute to a View?
    My application is a combination of pages with flow logic and MVC.
    Thanks,
    ~Mark

    Hi,
      Go through the below link,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/e2/a1793a0190cf32e10000000a11402f/frameset.htm
    Regards,
    Azaz Ali.

  • How to fill a field in a page attribute structure

    Hi
    We're trying to build a BSP Application (Pages with flow logic). One of the BSP Pages is a search for customer data, with search fields displayed dynamically.
    Now Im trying to fill the fields of structure "ls_partner", which is defined as a page attribute. However, it always is initial at onInputProcessing. It works well for normal page attributes (like strings etc.), but not with fields of a structure.
    I found the following on sdn:
    If firstname is a field in a structure called myaddress of the type address, you can access firstname in the layout as follows:
    <input type=text name="myaddress.firstname">
    This doesn't seem to work though. Any suggestions?
    Thanks a lot!
    Philipp

    Hi Phil,
    I assume by "fill the fields of a structure" you mean by passing the parameters as form field or HTTP header parameters.
    I don't believe you can do this. You can only pass parameters that map to a page attribute that is a data element like STRING, INT4, MATNR, etc.
    If you need to pass an entire structure you probabaly need to pass each individual element as a separate paramater, or else pack the structure into a string field and then parse it to extract the individual elements at runtime.
    Cheers
    Graham Robbo

  • Struts - HTML:link tag with dynamic page attribute?

    I am trying to use the html:link but the page value is dynamic (resulting from the bean within the iterate tag). The code below doesn't work - error. Is there a way to use all Struts tags and make this happen. Any ideas?
            <logic:iterate id="myMenuForm" property="menuItem" scope="session" name="menuForm" >          <html:link page="<bean:write name="myMenuForm" property="menuDisplayName"/>">                  <bean:write name="myMenuForm" property="menuDisplayName"/>          </html:link>        </logic:iterate> Thanks,
    mlv

    Thanks for all your help. Based on all you your comments, it is now working
    and I thought I would provide some details about how I got it working.
    There are not that many examples within the Struts documentation.
    id = unique name for the object that can be referenced within the iterate
    tag.
    name = is the Bean, in this case it's the ActionForm, that contains the List
    object that will be iterated. In my case, I have a ActionForm that contains
    a List property that contains all the menu item rows from the databse.
    property = is the property name within the ActionForm that is the List
    object. Links to the getter method
    Within the <bean:write> tag you use the id name to get a handle on the final
    object from the iterate tag and the property is one of the property values
    within the bean that is contained within the List.
    So in this case I have a ActionForm bean that contains a List property that
    contains a collection of beans.
    FormAction - bean
    property menuItems of type List contains:
    - row 1 = bean (with a property of menuDisplayName)
    - row 2 = bean (with a property of menuDisplayName)
    - row 3 = bean (with a property of menuDisplayName)
    Here's the JSP code for the tag.
            <logic:iterate id="myMenuForm" name="menuForm" property="menuItem" >
              <html:link page="www.yahoo.com"/>
                      <bean:write name="myMenuForm" property="menuDisplayName"/>
              </html:link>
            </logic:iterate>Now I would like to make the <html:link> page attribute value dynamic from
    the iterate bean. Therefore, you can make the url for the link dynamic If
    you know how to do that, please feel free to provide some help.

  • How to add a field that is not part of existing page attributes

    Hi Experts,
    Can someone give step by step procedure for adding a field that is not part of IC web view page attributes. I mean the field that I want to add is in BOL entity BTSaleset which is linked to BTAdminH through BTHeadersaleset relation. I have BTadminH in the page attributes but not BTsaleset.
    Thanks in Advance

    Experts.. any inputs ?

  • Is page attribute 'table' limited to 12 fields?

    hi,
    i am on WAS 6.20.
    in an bsp under rider type-definitions i need to create a type, which consists of more than 12 fields. i found out, that
    a) only string types are possible and
    b) apparently max. 12 fields are possible
    i create an internal table page attribute from that type, which gets filled during runtime and transferred to another page (there it is an auto-attribute). when setting up more than 12 fields, the receiving page won't display - (server not found).
    i don't get syntax errors, neither ST22.
    is there a way to enhance types here?
    or must i perform everything in the one and only starting page? which is a bit unhandy...
    i just read another thread, where somebody has a problem with table types - can i create a table type in the dictionary, which contains only char fields, but more than 12...?
    thanx, matthias

    Hi Christian and Raja,
    as for Christians hint: I tried an ordinary report like this:
    DATA: ig_all TYPE zmed_a_tab,
          wg_all TYPE zmed_a_struc.
    wg_all-freitxt = 'hallo freitext'.
    wg_all-menge = '12'.
    wg_all-preis = '12'.
    wg_all-waehrung = 'EUR'.
    wg_all-bestell_iso = 'STK'.
    wg_all-kstl = '9842000'.
    APPEND wg_all TO ig_all.
    CLEAR wg_all.
    wg_all-freitxt = 'hallo freitext'.
    wg_all-menge = '12'.
    wg_all-preis = '12'.
    wg_all-waehrung = 'EUR'.
    wg_all-bestell_iso = 'STK'.
    wg_all-kstl = '9842000'.
    APPEND wg_all TO ig_all.
    CLEAR wg_all.
    LOOP AT ig_all INTO wg_all.
      WRITE: / wg_all-freitxt, wg_all-menge, wg_all-preis, wg_all-waehrung,
              wg_all-bestell_iso, wg_all-kstl.
    ENDLOOP.
    So in an ordinary ABAP my dd.tab works fine!
    But I shall also check Rajas server side cookie.
    Still Rajas statement:
    "navigation->set_parameter( name = 'ig_all' value = ig_all ).
    can only accept flat strictures."
    can not be true, as I managed to shift more than one table row from page A to B (but with another dd.structure).
    btw, the dd.structure I use and which is being used in my dd.tabletype looks like the following (and mybe BSP can't handle this???):
    FREITXT          CHAR200     CHAR     200     0
    MENGE          CHAR3     CHAR     3     0
    SACHKONTO     CHAR7     CHAR     7     0
    KSTL          CHAR7     CHAR     7     0
    .INCLUDE     ZKATALOG               
    KATEGORIE          CHAR     60     0
    ACTION               CHAR     20     0
    MATKL               CHAR     9     0
    PREIS               CURR     11     2
    WAEHRUNG          CUKY     5     0
    PREIS_MENGE          DEC     5     0
    regards, matthias

  • Is there a way to change the default page attributes (font, margins, etc) in Pages or do I have to change them every time I open a new document?

    Is there a way to change the default page attributes (font, margins, etc) in Pages or do I have to change them every time I open a new document?

    I never even thought of that - Word woman that I was!  Thanks so much - I shall give it a go!!

Maybe you are looking for

  • Images in a StyledDocument - .rtf / .html -file

    Is there a limitation in streaming Documents to .rtf / .html-files? I have a code like this: DefaultStyledDocument doc = new DefaultStyledDocument(); attr = new SimpleAttributeSet(); StyleConstants.setIcon(attr, new ImageIcon("picture.jpg")); doc.ins

  • How do I uninstall an extention that won't load.

    When I start Safari it complains about an old extension and says it won't load it. I already have a newer version installed. I can see the new version of the extension under preferences, but not the old version. How do I get rid of the old version, s

  • How to add new item in XFCE menu?

    I just build the Lazarus IDE (not using the one from repo), and would like it to be available under Development menu. I made this lazarus.desktop: [Desktop Entry] Version=1.0 Type=Application Name=Lazarus Comment=Delphi-like IDE for FreePascal Icon=

  • How do I type in a website?

    You cannot type new sites into tabs that are showing. How do I get to a site that I do not have a link to or is bookmarked?

  • How Do I Paste Metadata in Bridge?

    In CS5 you can paste metadata in the Bridge>Get Info panel. I can't do it in CS6. How do I copy all my keywords and descriptions? Mac 10.6.8