Hide/show items based on another point when the page is rendered.

Hello

I am trying to hide or display the elements on the page when the page is rendered according to the value of a checkbox control.

That's what I use.

Body HTML attribute:

OnLoad = "initialCheck (); »


Header HTML:
function initialCheck () {
   if (html_GetElement('P21_BEN_SAVINGS').value != 'YES') {
      html_HideItemRow('P21_COST_SAVING');
      html_HideItemRow('P21_LOCATION_CODE');
      html_HideItemRow('P21_ACCOUNT_NO');
      html_HideItemRow('P21_SVG_DEPT');
      html_HideItemRow('P21_RATIONALE');
   } else {
      html_ShowItemRow('P21_COST_SAVING'); 
      html_ShowItemRow('P21_LOCATION_CODE');
      html_ShowItemRow('P21_ACCOUNT_NO');
      html_ShowItemRow('P21_SVG_DEPT');
      html_ShowItemRow('P21_RATIONALE');
   }
}
I want the items listed to show when the page is loaded when the P21_BEN_SAVINGS is checked (equal to 'YES'), but they are hidden in this situation.

I see not the onload call in Firebug, and I don't know if it is the configuration of firebug or that JavaScript is not fair.

Thanks for any help!

Matt

Hi Matt

Try this

function initialCheck () {
   if ($v('P21_BEN_SAVINGS') != 'YES') {
      $x_HideItemRow('P21_COST_SAVING');
      $x_HideItemRow('P21_LOCATION_CODE');
      $x_HideItemRow('P21_ACCOUNT_NO');
      $x_HideItemRow('P21_SVG_DEPT');
      $x_HideItemRow('P21_RATIONALE');
   } else {
      $x_ShowItemRow('P21_COST_SAVING');
      $x_ShowItemRow('P21_LOCATION_CODE');
      $x_ShowItemRow('P21_ACCOUNT_NO');
      $x_ShowItemRow('P21_SVG_DEPT');
      $x_ShowItemRow('P21_RATIONALE');
   }
}

Max

Published by: - Max - April 28, 2010 10:42

Published by: - Max - April 28, 2010 10:43

Tags: Database

Similar Questions

  • Display list items based on another element of the list

    Hi all

    I want to display the list item based on another element of the list, but his does not work.

    This is my code:


    / * WHEN-NEW-FORM-INSTANCE * /-his work.
    DECLARE

    rg_district recordgroup;

    rg_name VARCHAR2 (40): = "district";

    vtemp NUMBER;

    BEGIN

    rg_district: = FIND_GROUP (rg_name);

    IF ID_NULL (rg_district)

    THEN

    rg_district: =.

    CREATE_GROUP_FROM_QUERY (rg_name,

    'select dist, dist district_mas.

    );

    vtemp: = POPULATE_GROUP (rg_district);

    POPULATE_LIST ('BLOCK3.) Of RIDING ", rg_name);

    END IF;

    END;

    * / CHANGED AFTER a - list * /-does not work. Cannot complete the list based on the list

    DECLARE

    rg_branch recordgroup;

    rg_name1 VARCHAR2 (1000): = "branch";

    vtemp NUMBER;

    BEGIN

    rg_branch: = FIND_GROUP (rg_name1);

    IF this is ID_NULL (rg_branch)

    THEN

    DELETE_GROUP (rg_name1);

    rg_branch: =.

    CREATE_GROUP_FROM_QUERY

    ("rg_branch",

    "SELECT FROM dist_branch WHERE district IN branch (DIST DISTRICT_MAS WHERE DISTRICT = SELECT').

    || : BLOCK3. DISTRICT OF

    );

    vtemp: = POPULATE_GROUP (rg_branch);

    POPULATE_LIST ('BLOCK3.) Branch of THE ', rg_branch);

    END IF;

    END;

    Table:

    CREATE TABLE DISTRICT_MAS

    (

    DIST VARCHAR2 (100 CHAR)

    );

    CREATE TABLE DIST_BRANCH

    (

    NEIGHBORHOOD VARCHAR2 (100 CHAR),

    DIRECTORATE GENERAL OF THE VARCHAR2 (100 CHAR)

    );

    Values:

    insert into district_mas values ('chennai');

    insert into district_mas values ('coimbatore');

    insert into dist_branch values ('chennai', 'chennai_north');

    insert into dist_branch values ('coimbatore', 'Podanur');


    Concerning

    Nassik M

    I tested the code below when the list has changed


    DECLARE

    rg_branch recordgroup;

    rg_name1 VARCHAR2 (1000): = "branch";

    vtemp NUMBER;

    QT VARCHAR2 (10): = "';

    BEGIN

    rg_branch: = FIND_GROUP (rg_name1);

    IF this is ID_NULL (rg_branch)

    THEN

    DELETE_GROUP (rg_name1);

    END IF;

    rg_branch: =.

    CREATE_GROUP_FROM_QUERY

    (rg_name1,

    'SELECT branch, branch OF THE DISTRICT WHERE the dist_branch =' | QT | : BLOCK3. DISTRICT OF | QT);

    vtemp: = POPULATE_GROUP (rg_branch);

    POPULATE_LIST ('BLOCK3.) Branch of THE ', rg_branch);

    END;

    Hope it's work...

    Hamid

  • Dynamic action to show skillbuilders popup doesn't work when the page refreshes

    Hello!.
    I have a relationship with a column of link:

    "" < a href = "f?... class = show_popup '...

    I have a dynamic action defined like this:


    Event: click.
    type: jquery selector
    selector: a.show_popup
    no condition.

    Action: skillbuildersmodalpage 2.0.0
    URL: attribute of the triggering element.

    It works fine, but after that the popup is shown and closed, the link does not work until the page is completely refreshed again.

    After the closure of the pop-up window, I only update the report with $a_report (in another dynamic action on the 'auto skillbuolders close' event), I don't want to send the entire page...
    the partial update works fine too, but not the link, it works again by refreshing or submit that all page

    any idea?

    Published by: Andres Vilallave on 28-may-2013 16:22

    you define the scope of the dynamic event?

  • To move a page item value in another element of the page

    I have page 1 and page 2, page 1 to an element name is name: _ and page 2 has an element name is your name _. How to pass the First Name of the element value in your name point.

    Please suggest me

    one way can be branch

    https://Apex.Oracle.com/pls/Apex/f?p=57481:22:8403002623920:no:

    WORKSPACE:-REEMATEST

    username:-test

    password:-test

    Page 22

  • How to set the time to refresh the page items when the Page is loaded

    Hi all

    When my pages load, some hidden page items are displayed, and when the page load they are hidden again. Is it possible to keep hidden without this time to refresh?

    Thank you

    Bsalvador

    bsalvador wrote:

    You know the syntax of css to hide the label too?

    #P1_ITEM_X, label[for="P1_ITEM_X"],
    #P1_ITEM_Y, label[for="P1_ITEM_Y"],
    #P1_ITEM_Z, label[for="P1_ITEM_Z"] {
      display: none;
    } 
    

    However this will not affect the underlying layout grid, which still affects the appearance of the page. If possible you can put the items in question in separate regions [sub] and show/hide those, rather than the individual elements.

    Post edited by: fac586

  • Is it possible a 0 is displayed after the decimal point when the value is rounded? (I get: 20-20, 1;) "I need 20, 0-20, 1).

    Using the effect of text "cursor", I am able to view replace "30 ° C" "35.5 ° C". My question is: is it possible a 0 is displayed after the decimal point when the value is rounded? (I get: 20-20, 1;) "I need 20, 0-20, 1). I use this code:

    Temp = effect ("Slider Control") ("Slider");

    sliderValue = Math.round(temp*10)/10;

    [sliderValue + ' ° C ' "']

    Here is the solution:

    numDecimals = 1;

    Temp = effect ("Slider Control") ("Slider");

    sliderValue = (Math.round(temp*10)/10).toFixed(numDecimals);

    sliderValue + "° C";

  • How to disable a page based on the value of another element on the Page element?

    Hello

    How can I turn a page element using javascript based on the value of another element on the page?

    Eg: P1_TEXT want to be disabled if the value in P1_LCOK = "LOCK".

    How can I do this using javascript. I want this implemt on loading the page.

    Kind regards
    Benz

    Put this function in the page header:

    
    

    and call it in the footer:

    f_disable_item;
    

    Denes Kubicek
    ------------------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    ------------------------------------------------------------------------------

  • Need to call the javascript function when the page is loaded

    Hello - I have a javascript function defined on Page 0 of my application. It is in the source of an unconditional
    region whose view point is after the header.

    I call successfully the function of event onchange on individual page elements. (The function
    sets the value of an element based on the value of another).

    But I also need to call the function when the page is loaded. The page is a form of data modification,
    so many values is filled when it is loaded, and I need the dependent values populated
    also.

    I tried to add the call to function in the following way. It is not at all get called (alerts are not forthcoming)
    and there is no error in the Firefox error console...
    - as an event onload in individual items
    -call directly to the edit HTML page header
    -call directly from the HTML body of the edit page (which, from what I've read, sounds
    as to execute onload and my page template doesn't have a defined substitution onload string).

    In these 2 cases, I simply call it like: jsLookupValue ($v ("P8_OBJECTTYPE_ID"), "objecttype_id", "P8_OBJECTTYPE_NAME", "objecttype_name", "hdb_objecttype");

    How can I do this?

    Thank you
    Carol

    If you define the function on the zero page and any page you should be able to call using something like:

    
    

    Have you tried to put just a statement alert() on the page in order to check that it runs just about anything?

  • Strange bug hidden when the page is refreshed

    I have a really strange bug in an application.

    I have a report on the table which displays some O/N flags. The columns that display the flags are implemented as hyperlinks, so the user can reset the flags to "n" by clicking on the links.

    It is based on the following post:

    Processes necessary to remove line

    I did this by pointing the hyperlink to the same page and by assigning an item hidden on the page with an id of line, as shown in the above post.

    When the page loads, it has PL/SQL in front header area running SQL to define the indicators of "n" in the database. Right after that I use a process to clear the cache to reset the hidden element.

    It all works very well... when the user clicks on the hyperlink, the hidden element is filled and PL/SQL is running, then the hidden item is reset. If the user goes to another page and back, PL/SQL does not yet (because the hidden element is now empty).

    However, if the user clicks on the hyperlink, and they then refresh the page (F5), the PL/SQL is running again. Whenever they refresh the PL/SQL runs despite the cache for this element during the erasing. It seems as if the page refreshes is somehow the hidden item, remembered when the user has clicked on the hyperlink.

    I guess that by pressing F5 is to return all of the data, it sends the last time... How can I stop this from happening?

    Hello

    You can also use an approach using Ajax as described here: [http://apex.oracle.com/pls/otn/f?p=41715:17].

    Greetings,
    Roel

    http://roelhartman.blogspot.com/

  • Get the values of default table row when the page loads

    Hello

    I am running JDev 11.1.1.7. We have a page that contains two tables in a relationship of the master / detail of nickname. We can do a real master ADF / detail with view items related because the query for the 2nd table is complex and works best when queries with binding settings. The View object for the 2nd table has a request with 2 link params as it can get in the first table. Thus, when a line is selected in the first table we want to execute ExecuteWithParams on the object from view of the table 2. We do it in the Bean managed for the page in a method that is the selection to the first table listener. It works fine except when the page initially loads, the first line is selected by default. When the default value is selected the selection listener is not triggered.

    I've seen the suggestion of not having a line selected by default when the page loads by removing the value selectedRowKeys on the table. However, we do not want that the 1st row of the table secondary master to be selected by default and we as the table of detail to show the correct corresponding lines.

    Steve

    Steve,

    Not really sure when you say that the 2nd table is complex and may not use the master detail. If the settings link in the parent table, you can set the ViewLink accordingly and it should work, right?

    In any case, if you're after the execution of methods on the loading of the page, you will find the links below.

    If it's a working group, you can add a methodCall as activity by default and UTF, you can use phase listener (if listener server does not).

    https://blogs.Oracle.com/aramamoo/entry/an_epic_question_how_to

    Advice from the Oracle Johny: ADF: how to run the ViewObject with a ViewCriteria on the PageLoad in Application Web ADF

    It will be useful.

    See you soon

    AJ

  • Validation of required field only when the page loads (HR test case!) included

    Hi experts,


    Here you have a simple test for Jdev 12.1.3 HR case: https://dl.dropboxusercontent.com/u/18609389/TestHR.zip

    The main.jspx is just a button which CreateInsert a record dept displayed in another page:

    Screen Shot 10-16-14 at 07.04 PM.PNG

    My problem is the following page (test.jspx) has this code to run when the page loads:

    <af:serverListener type="onloadEvent" method="#{backingBeanScope.backinBean.onPageLoad}"/>
                <af:clientListener method="onLoadClient" type="load"/>
                <af:resource type="javascript">
                  function onLoadClient(event) {
                      AdfCustomEvent.queue(event.getSource(), "onloadEvent", 
                      {
                      },
    false);
                      return true;
                  }
                </af:resource>
    

    The code is simply this (now):

        public void onPageLoad(ClientEvent clientEvent) {
            logger.severe("HR TEST.....");
        }
    

    And that's the problem, required validation is performed.

    Screen Shot 10-16-14 at 07.06 PM.PNG

    Can you tell me why?

    Thank you

    Jose.

    Don't know what is my mistake, but the code is of the actionListener button is not called. :-(

    Well, you combined two different ways to do this (from my first answer).

    If you are still reading this, you will notice "or" before the second suggestion

    Thus,.

    1. keep your clientListener under af:document tag

    2. based on javascript, you find key (use: alert ("button");)  to see if you have referenced correctly your button in findComponentById())

    And then:

    approach 1:

    Use AdfActionEvent.queue (button, true);  queue event on your action button and implement your logic in function attached to the properties of your 'actionListener' or 'action' button (if you don't need listener server in this case)

    approach 2:

    Use AdfCustomEvent.queue (button, "onloadEvent", {}, false);  the queue onloadEvent on your button (in this case you need listener server attached to your button)

    Dario

  • Sorting of images based on their position on the page

    How would I go about sorting the images based on their position on the page? I've read a few articles which mention the use of table method fate and checking their x and y values to sort the table. While that works on the page elements that are perfectly aligned with their x and is the axis, it fails on a layout like this. Does anyone have any ideas on how I could create an individual table for line1, line2, Row3 etc based on his position there and then sort them based on their position X and then create the master table combining them in order?

    I'm new to javascript, so it's a bit out of my League. Any help will be much appreciated.

    rows.jpg

    Hi again,

    I found an idea that seems promising to deal with the issues mentioned above. The main problem, as you have no doubt noticed, is that we cannot simply count about to coordinates (x, y) 'as they are', even after having rounded values, to extract implied rows and columns.

    When we look at the layout below:

    our eyes instantly detect what he expected to be 3 columns and 5 rows, but this underlying order is not immediately accessible from all sort all of the coordinates. We need to improve the algorithm.

    What I propose is to speculate about the gaps that occur on the ordered sequence of coordinates x and y, respectively. To reveal these gaps, we will first sort the data along the x-axis:

    The figure above shows that the width of the rectangles. Each arrow represents a rectangle, and I ordered the elements by increasing x-centers. We can estimate that the element identified #1 belongs to a new group of this simple fact: its left coordinate (red mark) is higher than the coordinated right (blue guide) of the #0element. This observation will give us a strategy to identify gaps in the column.

    Then, the same method is applied to detect the lines. (Sort by values y, identify gaps, based on the progress of the min - max).

    At the end of this process, each object has a (column, row) coordinate pair instead of fragmented values (x, y) . So, we can calculate the final order, i.e. the weight of the comparison function.

    Here is my implementation of this algorithm:

    // ========================================================
    // Up2Bottom and Left2Right Sorting Algorithm
    //   addressing (weakly) sparse rectangles
    // ---
    // Usage:  Select the objects, then run the script
    // Target: InDesign CS4/CS5/CS6/CC
    // ========================================================
    
    const CS = +CoordinateSpaces.SPREAD_COORDINATES,
          AP_MIN = +AnchorPoint.TOP_LEFT_ANCHOR,
          AP_CENTER = +AnchorPoint.CENTER_ANCHOR,
          AP_MAX = +AnchorPoint.BOTTOM_RIGHT_ANCHOR;
    
    var sel = app.properties.selection || null,
        data = [],
        r, i, j, k, t, n, w, vMax;
    
    if( sel && 1 < (n=sel.length) )
        {
        // Collect coordinates and IDs
        // --> {min:[xLeft, yTop], weight:[x,y], max:[xRight,yBottom], id}[]
        for(i=0 ; i < n && (t=sel[i]) ; ++i )
            {
            data[i] = {
                min:    t.resolve(AP_MIN,CS)[0],
                weight: t.resolve(AP_CENTER,CS)[0],
                max:    t.resolve(AP_MAX,CS)[0],
                id:      t.id
                };
            }
    
        // Find rows and columns [i.e. y-weights and x-weights]
        // ---
        for( j=0 ; j < 2 ; ++j )
            {
            // Sort by center coordinate
            // ---
            data.sort(function(a,b){return a.weight[j] - b.weight[j]});
    
            // min > max ==> w++
            // ---
            for(vMax=(t=data[0]).max[j], t.weight[j]=(w=0), i=1 ; (i < n)&&(t=data[i]) ; ++i )
                {
                if( t.min[j] > vMax ){ ++w; vMax=t.max[j]; }
                t.weight[j] = w;
                }
            }
    
        // Compute final weights, clean up data, create ID-to-weight access
        // ---
        for( i=0 ; (i < n)&&(t=data[i]) ; ++i )
            {
            w = n*t.weight[1] + t.weight[0];  // final weight (y first)
            k = '_'+t.id;                     // ID key
    
            (t.min.length=0)||(t.weight.length=0)||(t.max.length=0);
            delete t.min; delete t.weight; delete t.max; delete t.id;
            delete data[i];
    
            data[k] = w;                      // ID-to-weight
            }
    
        // Apply sort --> r
        // ---
        r = sel.sort(function(a,b){return data['_'+a.id]-data['_'+b.id];});
    
        // Show the resulting order
        // ---
        for( i=0 ; i < n ; ++i )
            {
            app.select(r[i]);
            $.sleep(1000);
            }
        }
    

    @+

    Marc

  • the page is rendered and loaded questions of list item change

    Hi all

    I have 2 questions, I'll try to put it as clear as possible. The link and log in info on the bottom.

    1. in what order is the rendered page fire? In other words, I have a report to Page 2 (Payroll Summary) and in this report, I select and where clause. The where the info from the article comes from a list item. When you view the report it shows nothing, so I guess that because the element is not filled in and yet, this is why the report does not. Not sure... so if someone can clarify that for me, it would be great.

    2. when I change a list item (eg. Payroll between 2010 and 2009 year), how can I refresh the payoll report that uses the year of payroll as a parameter? is it possible to launch the summary report on the Payroll when the year changes? If so, how?

    My apex page is

    http://Apex.Oracle.com/pls/Apex/f?p=31754:2:678019909905630:no:

    It is application of dashboard.

    Workspace Laba
    Username [email protected]
    Password edumet

    Once the connection to the application info is

    E-mail [email protected]
    password Laba

    Thank you
    Laba

    Emeric,

    When the page is sent after the selection value is changed, the prior to execution of the header calculations. I added a condition on the calculation, so that it only works when the value of the element is set to zero.

    Thank you
    Machaan

  • LOV cascading works not when the page is public

    Hello

    I have a LOV cascading in a tabular form that I built example Denes Kubicek
    http://Apex.Oracle.com/pls/OTN/f?p=31517:176:2702932664861989:

    Thanks to this wonderful examle, I could make my lov cascading.

    However when I do the public page, the second lov (which is based on the first) does not work.

    Inorder to debug I changed to get.get () get.get ('XML') and put an alert on it; to check if the string of the selection list is correctly returned by the application process - it returns null. The alert even returns the string from the selection list when I set the authentication on the page.

    Also I noticed that when the page is public the application (TAB_CASCADING_ITEM) item is not be filled with the value of the first selection list.
    No matter who has encountered the same problem?
    Appreciate any suggestions?

    Thank you
    Dippy

    One of the parameters in the htmldb_get is the page on which the process is running. You should change this to the current page or make public page 0 as well.

  • Why my cursor jump to another area of the page if I stop while typing?

    Using windows xp pro, IE 8, while typing, if I pause or stop thinking, sometimes my cursor will move to another area on the page.  If I go back to typing, letters will start to appear when the cursor is, it is very random and only moves to the area on the page where I already typed, sometimes in the middle of a Word.

    Thank you annie...

    Hi AnnieSaub,

    1. did you of recent changes on the computer?

    2. the problem only happens when you use internet explorer 8?

    3. you use USB keyboard or computer laptop touchpad?

    4 when was the last time it was working fine?

    If the problem only occurs when you use Internet explorer 8 then try the steps below.

    Method 1

    Check if Add-ons installed on the Internet explore is the origin of the problem. I suggest that you try to open Internet explorer without modules and check if the problem persists.

    (a) click the Start button, click all programs, and click Accessories

    (b) click System Tools, click Internet Explorer (No Add-ons).

    How the modules of the browser affect my computer?

    http://Windows.Microsoft.com/en-us/Windows-Vista/how-do-browser-add-ons-affect-my-computer

    Note: Above article is also applicable to the Windows XP operating systems.

    Method 2

    If the previous step fails then try to reset the internet settings explore by default and check.

    For more information please visit the link below.

    How to reset Internet Explorer settings

    http://support.Microsoft.com/kb/923737

    Important: Reset Internet explore its default configuration. This step will disable also any add-ons, plug-ins or toolbars that are installed. Although this solution is fast, it also means that, if you want to use one of these modules in the future, they must be reinstalled.

Maybe you are looking for

  • transferring files to the slow nas Server

    I just bought a new PC (HP Compaq) with Windows 8 and you have a NAS from Synology DS209 server. I joined this as a networkdrive, but it's extremely slow to copy files from the PC to the network (24 Kbps) drive. The two units are wired (no WIFI) dire

  • U530 Touch does not start

    Hello world I was very happy with my Lenovo Ultrabook, at least until today. Because this isn't the first post on this topic, I want to assure you that I googled for it at least for a while, but have not found solutions / exactly the same problem. Wh

  • Backpack for T540p

    Hello I recently bought Thinkpad T540p with battery 9 cells (abount so 2 cm of the battery out in the back). I am now looking to buy a bag for my laptop but I don't know if the laptop can fit in because of the battery. I've been watching: ThinkPad ba

  • Why the cd dvd burner motor does not start but will start to manual

    I have a E-Machines, does not start Windows Vista Home Premium 32-Bit, Windows media player or no matter what dvd burner

  • Why are the skins on WMP so small?

    I am running Win 7 Pro x 64 Sp1 & the latest version of WMP, my problem is the relatively small size skins, they display OK and zll functionality is there but they are sitting on my monitor dead center and they are not more than 3 "x 3". Is there a w