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

Tags: Oracle Development

Similar Questions

  • 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

  • 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 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
    ------------------------------------------------------------------------------

  • Deactivating a page element based on the value of another element on the page

    Hello
    I have a page element I want to turn off if the value of another article (drop-down list item) is set to a specific value. I followed the example in the book 'Pro Oracle APEX"(p.320) in this regard. He ordered me to do this in the HTML form element attributes for the element section:
    OnChange = "htmldb_item_change (this); html_DisableOnValue (This, 'Closed', 'P3_PRIORITY', 'P3_ASSIGNED_TO'); »

    It works very well. It disables the element I want to disable. HOWEVER, it does not neutralize the article unless the element with the onchange attribute is changed.

    How can I add features to disable the second element, even if the first element does not change, but contains the value 'Closed' when the user of the first load of the page?

    Thanks for your help and your insight!
    -Reid

    Hello Reid,

    The easiest way would be to (also) a Condition only read the item that you want to disable.

    Greetings,
    Roel

    http://roelhartman.blogspot.com/

  • Conditionally display an item based on the page that I've branched

    Hello


    I have a report on page 6 with a link change. By clicking on this link, the user goes to page 7.
    No I don't have an article on page 7 I need to display only if the user has used the link change the page6 report and came to page 7.

    In all other scenarios, when the user arrives on page 7 the element of should not be visible.

    This is achieved by using any type of condition for the item in question?

    Thank you
    Dippy

    Fisher,

    Here's the sql code, I came up with that.

    In your page .that we say Page_7, you create a hidden item P7_previous_page to fill the page number where the user landed on the current page.

    You can set the source as a function of pl/sql return value and give the next source.

    declare
       l_url varchar2(300);
       l_pos number;
       l_page_num varchar2(4000);
    begin
    
      --- complete URL of referring page 
    
      select OWA_UTIL.GET_CGI_ENV(
       'HTTP_REFERER')
         into l_url from dual;
       l_pos := instr(l_url,'f?p=');
    
      ---extracting the page number (http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/concept.htm#BEIFCDGF).
    
        l_page_num :=  substr(l_url,
                             instr(l_url,':',l_pos,1)+1,
                             (instr(l_url,':',l_pos,2)-1) - (instr(l_url,':',l_pos,1)+1) +1
                             );
    return l_page_num;
    end;
    

    You could do the same thng in a single sql also, but I used the function for clarity.

    Given that the only necessary information comes from the previous page, I think is the only variable that we have access to the URL of the previous page that the env variable, and we will need to extract the page number.

    Once you get this field filled in, you can create a condition according to the value of this field for help
    "Value of ELEMENT in the Expression 1' and using the appropriate according to your needs page number."

  • Tabular presentation - column to turn it off (with picture) based on another value of the column

    Hi all

    I haven't worked much on tabular forms and JS. I'm looking for help in this regard.

    I'm working on a tabular presentation. with several editable fields... I need to disable a column (just for this single line), which contains an image, based on a field of LOV (static) list) (Y/N). The image column must be disabled if the value is N.

    My SQL for the report is something like this: (will keep things simple)

    Select

    emp_id,

    emp_name,

    static_list,

    (case when STATIC_LIST = "Y" THEN ' < a title = "Edit SAMPLE TBL" href = "f?) p = & APP_ID.:10: & APP_SESSION.:NO:P10_EMP_ID, P10_EMP_NAME :'|| EMP_ID | «, » || EMP_NAME | "" "> < img src =" "#IMAGE_PREFIX #SAMPLE.gif" border = '0' (> < /a > ' other ' ' end) as disable_col, "

    dept_name

    of sample_table

    I scoured the topics in this forum. Most of them were made using the table ID f_001, f_002.

    I tried to follow the same path by inspecting the item but the disable_col does not have any ID.  Let's say, f_003 is for the static list and f_004 is assigned to dept_name.

    I tried dynamic actions, but it did not work. Read in a topic that dynamic action does not work on tables. So I chose this approach. Is there a simpler way to solve this?

    need your help on how to proceed with this scenario. Thank you in advance.

    Versions: Apex: 4.2, DB: 11 g

    Thank you

    Daniel

    Hi Daniel_A,

    Daniel_A wrote:

    I did my job in Page 4.

    If the IS_VALID column is select as 'Yes' then the column hyper must be enabled, allowing the user to click on it. If she chose the 'no', then the column Hyper must be disabled for this line.

    The initial question about toggle the hyperlink is resolved. Check your App-> Page 4 35160.

    This is done with the help of two dynamic actions:

    • DA first loading of the Page / after updating of region "tabular":

    Event: After refresh

    Selection type: region

    Region: The other 'tabular '.

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $( 'select[name="f08"]' ).each(function() {
      if ( $(this).val() === "N" ) {
        $(this).closest("tr").find('td[headers="HYPER"]').find("a").addClass("apex_disabled").unbind("click");
      }
    });
    

    Items concerned: no item affected

    • Second DA on the evolution of the selection list:

    Event: change

    Selection type: jQuery Selector

    jQuery Selector: select [name = "f08"]

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: No.

    Code:

    var el = this.triggeringElement;
    if ( el.value === "N" ) {
        $(el).closest("tr").find('td[headers="HYPER"]').find("a").addClass("apex_disabled").unbind("click");
    } else {
        $(el).closest("tr").find('td[headers="HYPER"]').find("a").removeClass("apex_disabled").bind("click");
    }
    

    Items concerned: no item affected

    NOTE: as the original question/topic related to toggle the image link in the column, for the problem with the Page 5, please create a new thread with the details.

    Kind regards

    Kiran

  • How to display the value of an element based on another element

    Hello
    In a page, I have to display name for the corresponding id displayed in id element. I can write a query based on the id and full name as soon as I enter this item.if, so is there any properties that I need? I'm looking for just post_text_item functionality in forms?

    Thank you
    Manoi

    Hello Eric,

    You must alert gReturn instead of get.
    But it is your call to this public page? And Page 0 requires an authorization?

    Greetings,
    Roel

    http://roelhartman.blogspot.com/

  • Display a column based on another column

    Hello

    I work in the Apex 4.2.

    I have a tabular presentation based on a query.

    In this form, I have a column of link change with an icon. When I click it, I open a new page with the details of my record.

    I want that this column appears only when the user is entitled.

    So, I got in my request a new column based on a Pl/sql function that returns 1 when the logged-on user has the privilege package update the record.

    I call this new column "can_update."

    After that, I changed the "conditional display" property of my edit_link column.

    In type of condition, I put: "value for the element / the expression 1 column = Expression 2.

    I put in the expression 1: can_update

    I put in the expression 2: 1

    But it does not work as I want. colonm "edit_link" never appears.

    and the can_update column return the good value 1 or 0 on depend on the recording.

    Anyone has an idea on what I didi wrong?

    Thank you.

    Laurent.

    I found a solution to my problem.

    I have a column in my query that return 'none' or 'inline' when I have the privilege to update my file and thus, the column "edit_link."

    Thos query column name is link_disp

    And in the "link attribute" property, the "link in the column" Section of my edit_link, I add: "style =" display: #LINK_DISP #»»

    and it works well

    Laurent.

  • Make a mandatory item based on another article

    Hi all

    I'm having a problem while doing a required field in a table. I use following code when validating trigger:

    If: XXONT_ABC.ORG IS NOT NULL THEN
    set_item_property('XXONT_ABC.) WASHING "(, EXIGE, PROPERTY_TRUE);"
    end if;

    This code makes the other XXONT_ABC field. WASH required but when I move down to 2nd row, yet it is mandatory for 2nd place while I'm not entered any value in XXONT_ABC.ORG.

    Please suggest.

    Thank you.

    Published by: Amit1cs on May 16, 2013 15:22

    Hello

    did you try with set_item_instance_property. Try this.

    Concerning
    Sri

  • How to view the title of region of APEX 4.2 dynamic chart based on an element of the APEX?

    Hello

    I use APEX4.2 and created

    (1) a list drop-down menu item called P38_DESK that contains a list of offices, such as A, B, C

    (2) a region of the graph with the region title: graphic Mvt by & P38_DESK.

    (3) a dynamic action "Refresh" the area of table if the value of P38_DESK is changed.

    I can see that whenever the office is changed from the dropdown list, the chart section/region becomes therefore refreshed but NOT the title of the chart area. He showed only the first value I chose. for example graph by A Mvt

    So in APEX4.2, how the title of the editable region dynamically (without submitting the entire page) to account for the value in the drop-down list P38_DESK?

    Thank you.

    Dynamic Refresh action updates only the area of the region which changes, rather than the HTML block for the region as a whole. The title bar is outside the area of update.

    This must be done dynamically, by a slight change to the region and adding another real action for the da r.

    1. Change the title of the region toChart Mvt by &P38_DESK.
    2. Add another real action to DA update:
      1. Action: Set value
      2. Fire on Page load: NO.
      3. Type of value: Expression of JavaScript

        $v('P38_DESK')

      4. Selection type: DOM object

        p38-title-desk

    This simply copies the value of the selection of P38_DESK as the content list of the p38-title-desk HTML element. A more complex expression of the JS is necessary if the selection list option text is different from underlying values.

  • AF:Switcher, handfuls of line column values based on another column in the table

    Hello

    I have a question if you can help me on this. It's on af:switcher.

    What I'm trying to do this - is in a table of the adf, based on the value of a column, I want another column to display as a link or not.
    For example, if the status column is 1, then the id column display as a link (I just put a h:outputLink around outputText to do), if it is then show him without bond.

    For this I put two different facets and opportunities switcher to decide what facet of show which line.

    BUT what is happening is that only on opportunities is made. Either / or scenario. It is not made each line according to the value of the status column.

    What is planned.

    I just tried with the dept table.

                    
                    
                    
                      
                    
                    
                    
                        
    
                      
                    
    

    The lines for which the deptno > 20, I wanted to display the pass as link and for the deptno<=20, log="" will="" be="" an="" input="" text.="" it="" works="" fine="" for="" me.="" probably,="" you="" may="" need="" to="" get="" rid="" of="" h:outputlink="" and="" use="" commandlink="" golink="">

    Arun-

  • AutoFill year + 4 based on another field of the year

    Hello

    I tried to change another script I found, but I really don't understand it well enough to make it work.  I use Adobe Acrobat Pro XI.

    I calculate the expiry of an extended warranty.  All dates are entered with the MM-DD and YYYY in separate fields, because of the shape of the manufacturer.

    First Date is manually entered, date of initial purchase.

    2nd date is already set up to automatically fill in the current date.

    date of 3rd is where I need help.  I have the MM and SD as a field duplicate of the first date, it works very well.  I need the "Year_3" field to automatically add the 4 years to the AAAA of the field 'Year' from the first date.

    Any help is appreciated.

    If the first field is called year1, use this code to custom for the second field calculation:

    var year1 = this.getField("Year1").valueAsString;

    If (year1 == "'") event.value = "";

    else event.value = number (year1) + 4;

  • Display variable binding like a LOV element in the user interface.

    Hello

    I had a thought, if we can create a variable of a viewObject as LOV element binding. This I would like to have this because, according to the value that I choose to the LOV to the variable binding, I'll be able to rerun the query of the viewObject that belongs to the variable binding.

    Is that can be done in jdeveloper 11.1.1.4?

    This video can help you
    https://blogs.Oracle.com/Shay/entry/adding_an_lov_to_a_query_param

  • Make a column based on another value of the column in the same table

    JDev 11.1.1.6.0

    It may be a silly question but I'm stuck

    I need to conditionally return a column that said Condition is as if the value in the other column of the same table B is equal to F. I should make A column only when this condition is met. I tried the following code:

    < af:column sortProperty = "PhoneNumber1."
    sortable = "false".
    headerText = "#{bindings." A.hints.PhoneNumber1.label}.
    ID = "c146.
    rendering = "#{rank." PhoneNumber1ResponseFlag eq 'F'} ">"
    < af:outputText value = "#{rank." PhoneNumber1}.
    ID = "ot130" / >
    < / af:column >
    < af:column sortProperty = "PhoneNumber1ResponseFlag."
    sortable = "false".
    headerText = "#{bindings." B.hints.PhoneNumber1ResponseFlag.label}.
    ID = "c80" rendered = "true" >
    < af:outputText value = "#{rank." PhoneNumber1ResponseFlag}.
    ID = "ot129" / >
    < / af:column >

    The data presented in the table for the PhoneNumber1ResponseFlag column are F. Still my condition does not work.

    Well, I've finally sorted it myself by managed bean.

    Here are the steps I followed:

    1. Wrote a new bean managed.
    2. Added a Boolean variable called flag and made to true when the "'PhoneNumber1ResponseFlag ' current line attribute is equal to F."
    3. Changing the property made column on this indicator.

Maybe you are looking for