[ADF BC] Showing a list of values based on the contents of another list

I have tried to make a simplified example to illustrate what I want to do. Here is a picture of my example schema:
Example Schema Image
There are three entity tables: Employee, Department and Location.
There are also two intersection tabels: Employee_Location and Department_Location.
My ADF BC model layer is based on this schema.
What I am trying to do is have a creation process for an employee where you first fill in the employee details (forname and surname), then you assign the employee to a department, then - based on the locations assigned to the department - assign one or more locations to the employee.
Imagine that the employee is a door-to-door salesman and that each department in is company has several areas of a town that they cover (locations). Each employee will cover a subset of the locations that the department covers.
The first two steps are easy - the details page can be created using a form on the employee view and the department assignment can be done with a list of values drop down on the departments view.
The third step is a little more complex. You can use a shuttle to assign one or more locations to the employee, but you shouldn't just show a list of all locations, since some of these will not be covered by the department and therefore not be available to the employee. What I want is only the locations associated with the employee's department to appear in the list.
So my question is how do I model this using ADF Business Components?
Also, if an employee is allowed to be assigned to more than one department (adding another intersection table between the employee and department tables), how would I model that?

Hi,
For your reference variable name should be simply any name i.e resorts_resort.No need to put @ in front when declaring variable and to refer presentation variable you should use the below syntax
@{Variable_name}{Default_value} where default_value is some default value you want to give.
Now coming to your problem you can fulfill your requirement by simply checking constrain checkbox.If you choose all values instaed of SQL results constrain checkbox will appear.Approach followed by you should also work but constrain is an easy option.
Thanks
Sandeep
Edited by: Sandeep Saini on 10-Sep-2010 00:59
Edited by: Sandeep Saini on 10-Sep-2010 00:59

Similar Messages

  • Is there a way to fill a cell with a value based on the selection from another cell?

    For example: If have a drop down menu created for Cell A1 with options (Dog 1, Cat 2, Bird 3). Is there a way to fill cell A2 automatically when I select from the drop down menu.
    So if I selected 'Cat' in A1, cell A2 would automatically input the 2.

    I suggest an extensible method that allows you to add other animals:
    This method adds a small table called "Animal Lookup" that matches names (same as in the pop-up menu) with a value.
    The table on the left uses this table to retrieve the value based on the animal:
    B2=VLOOKUP(A2, Animal Lookup :: A:B, 2, 0)
    select B2 and fill down

  • The drop down list values want to vary based on the contents of another drop down field

    hi,
    hi in search page i have two drop down list. i have two tables and one mapping tables. service line and subservice line are tables and i have one mapping table. using rapid application i create one component using mapping table. now in search page i have two drop list. one is servline and another is sub serviceline. in service line i have values like 1,2 k  for subservice 3,4.5,6 for one service line ex. for 1 i have two subservice 3,4 and for 2 i have 5,6. now my requirment in if i choose service line 1 in first drop down list, automatically in second drop down list want to contain values 3, 4. before both the drop down list have values.if i chose one value the correponding mapping value want to come in drop down list in same context node.

    Hi,
    This requirement involves defining p-getter for the service type, and the v-getter of you sub type.
    Since this involves to populate the values of subtype attribute depending on value of service type, u need a round trip.
    This is done in the p-getter of the 1st attribute(service type in your case).
    In the v-getter of the 2nd attribute, 1st fetch the current value of attribute 1, then filter the value in the dropdown table according to ur logic.
    Ref :Drop down values in table view
    Regrads
    Anish

  • Create a drop down list that populates based on the selection form another drop down list.

    I need to set up a drop down list that is popualated (i.e. displays a certain list of selctions in the drop down list) based on the choise the form user selects in an adjacent List
    For example
    There are two drop down list field sitting side by side in the form
    1. Select State          2. Select Course
    What I want to do is have a list of states in the first drop down list (1.Select State) and depending on which state the form user selects , the second drop down list (2.Select Course) will populate with a selction of courses available in that selected state only (i.e. it will on;y show course available in QLD if QLD is selcted).
    Is this hard to do?

    Hi,
    I would recommend some posts from Stefan Cameron's blog:
    http://forms.stefcameron.com/2006/09/18/connecting-a-form-to-a-database/
    http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/
    http://forms.stefcameron.com/2006/12/18/databases-inserting-updating-and-deleting-records/
    http://forms.stefcameron.com/2006/12/07/better-form-design-with-xfa-25/
    Hope that helps,
    Niall

  • Assign to item a list of value according to the contents of other fields...

    Let me explain, I have two items in my page, the first is not required, if it is null the second field is a value list based on selection A (select from A. .. A. .. where . A..) but if the field is not null then the list of values of the second field is based on the selection B (Select B from B where B. ..).
    I create a dynamic action on the event "change" of my first field,  on the "true action" I tried this:
    declare
      vva_ternum Varchar2 (3): = null;
    Begin
      APEX_ITEM.SELECT_LIST_FROM_LOV (2, : P26_TERNUM, 'LOV_RSPRODUIT_TERRITOIRE');
    End;
    But it does not work!!
    do you have a suggestion?

    Him this is my LOV :
    IF Trim(:P26_TERNUM) IS NOT NULL THEN
    RETURN
       'SELECT Initcap(Trim(P.PRODSC)) || '' -  ''|| Trim(P.PRONUM) AS dv , ' ||
       'T.PRONUM '  ||
       'FROM RSETABL_PRODUIT T ' ||
       'INNER JOIN RSPRODUIT P ON T.PRONUM = P.PRONUM ' ||
       'WHERE T.TERNUM = :P26_TERNUM ' ||
       'ORDER BY 1'; 
    ELSE
      RETURN
       'SELECT Initcap(Trim(PRODSC)) || '' - '' || Trim(PRONUM) AS dv , ' ||
       'PRONUM '  ||
       'FROM RSPRODUIT' ;
    END IF;
    This is my properties of my second field
    List of Values
    Named LOV
       TEST_PRODUIT
    Display Extra Values
      No
    Display Null Value
      No
    Cascading LOV Parent Item(s)
    P26_TERNUM
    Page Items to Submit
    Optimize Refresh
      Yes
    Editor Setting: Textarea - HTML/XML - Javascript - PL/SQL 
    List of values definition
    IF Trim(:P26_TERNUM) IS NOT NULL THEN
    RETURN
       'SELECT Initcap(Trim(P.PRODSC)) || '' - ''|| Trim(P.PRONUM) AS dv , ' ||
       'T.PRONUM '  ||
       'FROM RSETABL_PRODUIT T ' ||
       'INNER JOIN RSPRODUIT P ON T.PRONUM = P.PRONUM ' ||
       'WHERE T.TERNUM = :P26_TERNUM ' ||
       'ORDER BY 1';
    ELSE
      RETURN
       'SELECT Initcap(Trim(PRODSC)) || '' - '' || Trim(PRONUM) AS dv , ' ||
       'PRONUM '  ||
       'FROM RSPRODUIT' ;
    END IF;
    Create or edit static List of ValuesCreate Dynamic List of Values

  • DYNAMIC INTERNAL TABLE CREATION BASED ON THE CONTENT OF ANOTHER INTERNAL TA

    Hi All
    I need to create an internal table at runtime.
    I have a selection screen parameter which is specific to country, Which can take values below
    eg:- IT_AREA for Italy(IT)
    FR_AREA for France(FR)
    IE_AREA for Ireland(IE).....And similary for other countries
    Based on the Above parameter, I need to create Internal Table as below
    DATA: itab TYPE italy_data Occurs 0.
    If I declare as above, Then itab has fields from italy_data. And this internal table i will be sending it to Function Module to get data into it.
    My Requirement is to Create the Internal table itab during runtime for tables italy_data OR france_data OR ireland_data based on selection screen parameter. Tables on Country may have different number of fields in it.
    Can anyone help me on this??

    Hi,
    Here is a sample code to create a dynamic internal table.
    REPORT ytrab03.
    TABLES: mara, makt.
    TYPE-POOLS: slis.
    DATA: it_fcat TYPE slis_t_fieldcat_alv,
    is_fcat LIKE LINE OF it_fcat,
    ls_layout TYPE slis_layout_alv.
    DATA: it_fieldcat TYPE lvc_t_fcat,
    is_fieldcat LIKE LINE OF it_fieldcat.
    DATA: new_table TYPE REF TO data,
    new_line TYPE REF TO data,
    ob_cont_alv TYPE REF TO cl_gui_custom_container,
    ob_alv TYPE REF TO cl_gui_alv_grid,
    vg_campos(255) TYPE c,
    i_campos LIKE TABLE OF vg_campos,
    vg_campo(30) TYPE c,
    vg_tables(60) TYPE c.
    DATA: e_params LIKE zutsvga_alv_01.
    FIELD-SYMBOLS: <l_table> TYPE table,
    <l_line> TYPE ANY,
    <l_field> TYPE ANY.
    PARAMETERS: p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
    is_fcat-fieldname = 'COL01'.
    is_fcat-ref_fieldname = 'MATNR'.
    is_fcat-ref_tabname = 'MARA'.
    APPEND is_fcat TO it_fcat.
    is_fcat-fieldname = 'COL02'.
    is_fcat-ref_fieldname = 'MAKTX'.
    is_fcat-ref_tabname = 'MAKT'.
    APPEND is_fcat TO it_fcat.
    LOOP AT it_fcat INTO is_fcat.
    is_fieldcat-fieldname = is_fcat-fieldname.
    is_fieldcat-ref_field = is_fcat-ref_fieldname.
    is_fieldcat-ref_table = is_fcat-ref_tabname.
    APPEND is_fieldcat TO it_fieldcat.
    CONCATENATE is_fieldcat-ref_table is_fieldcat-ref_field
    INTO vg_campos SEPARATED BY '~'.
    APPEND vg_campos TO i_campos.
    ENDLOOP.
    *... Create the dynamic internal table
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = it_fieldcat
    IMPORTING
    ep_table = new_table.
    *... Create a new line
    ASSIGN new_table->* TO <l_table>.
    CREATE DATA new_line LIKE LINE OF <l_table>.
    ASSIGN new_line->* TO <l_line>.
    SELECT (i_campos) FROM mara INNER JOIN makt
    ON mara~matnr = makt~matnr
    UP TO p_max ROWS
    INTO TABLE <l_table>.
    LOOP AT <l_table> INTO <l_line>.
    LOOP AT it_fcat INTO is_fcat.
    ASSIGN COMPONENT is_fcat-fieldname
    OF STRUCTURE <l_line> TO <l_field>.
    IF sy-tabix = 1.
    WRITE: /2 <l_field>.
    ELSE.
    WRITE: <l_field>.
    ENDIF.
    ENDLOOP.
    ENDLOOP.
    Regards,
    Karuna.

  • Looking to set the result of a variable based on the content of another (new to scripts)

    Hi,
    I'm new to scripts, new to acrobat forms to be honest, so be gentle with me
    I have a text field Acc1pnt which can accept either Y or N as an entry. Based on the answer, text field Acc1snd would always be N/A if the result of Acc1pnt is N. I'm looking for a script that will add N/A to the second text field and skip over it (make read only?) if the answer to the first field is N.
    Sorry if I'm making this look like hard work. Basically a check is made as to whether an accessory is received and, if it is, whether it is 'sound' or 'damaged'. Obviously if it isn't received then it's condition is irrelevant hence N/A in the senond text field.
    Also, is there something simple I can add to convert an entry to a capital letter?
    Thanks in advance
    Cliff

    Hi Gilad
    I've shied away from radio buttons as the users are used to tabbing through the fields and 'clicking' a radio button would mean taking their hands from the keyboard, I will certainly consider it though.
    Acc1snd (the 2nd variable) should be editable ONLY if the answer to Acc1pnt (the 1st variable) is Y. If the value of the 1st variable is N then Acc1snd can only be N/A (not applicable) and should not be editable.
    Obviously if the user makes an initial mistake and needs to change the value of the 1st variable to Y then the 2nd variable would then need to be editable.
    I will run through the tutorials this evening

  • Populate one cell based on the contents of another

    Greetings to all
    I am entering street addresses into numbers. In an effort to save time I would like the entry into column B to determine what is automatically entered into column C
    Example:
    If I enter Jones in column B, I want Street to automatically populate column C in the same row
    If I enter Smith in column B, I want Avenue to automatically populate column C in the same row.
    Thanks in advance for any help.
    AJ

    I assume that "Jones" is "Jones Street" and "Smith" is "Smith Avenue".
    You will need a lookup table with a column containing all of the road names you will be entering, and a second column listing the the matching road type (Street, Avenue, Boulevard, Place, etc.) for each name. Fill the formula shown in the illustration down to all the cells in column C of the Main table.
    I've used IFERROR to flag street names that are not found in the table. To omit the "no match" message and instead show an empty cell, change "no match" to "" in the formula.
    Regards,
    Barry

  • Changing content of one label, based on the content of another

    Hello all,
    I need some advice on how to go about doing something that should be simple.
    Basically, I have two labels, that will be used in a marquee animation. When label one gets changed, I want label two to mimic label one's content. Since there is no ContentChanged Event for labels, I have been relying on the SizeChanged event of label one
    to do the job.
    However, the issue arises when label one's content extends past that of its parent container, thus no longer firing SizeChanged.
    When label one's supposed length is equal to or greater than that of its container, is when I would start the marquee animation.
    Basically, I need a sure fire, reliable, 100% accurate way to update label two's content to match that of label one's despite its length.
    I have read the following: Label.Content Changed Event
    However this does not solve the issue, as the event fires for "all" custom label classes, due to the ContentProperty being declared Static/Shared.
    Thanks in advance!

    <UserControl x:Class="CustomControls.UserControls.ValidationUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    mc:Ignorable="d" Height="36" Width="120">
    <Grid x:Name="z">
    <TextBox x:Name="txtBase" Text="TextBox" Margin="0,0,0,13"/>
    <Label x:Name="lblStatus" Content="Status" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Bottom" FontSize="10" Foreground="#FFE12828" FontWeight="Bold">
    <Label.Effect>
    <DropShadowEffect BlurRadius="5" ShadowDepth="1"/>
    </Label.Effect>
    </Label>
    <Label x:FieldModifier="Friend" x:Name="lblMarquee" Content="{Binding ElementName=lblStatus, Path=Content}" HorizontalAlignment="Right" Margin="0,23,-29,0" FontSize="10" Foreground="#FFE12828" FontWeight="Bold" Background="Transparent" Height="13" VerticalAlignment="Top">
    <Label.Effect>
    <DropShadowEffect BlurRadius="5" ShadowDepth="1"/>
    </Label.Effect>
    </Label>
    </Grid>
    </UserControl>

  • After I've heard an audiobook downloaded from the public library, how do I delete it from the Shuffle?  When I plug it into my computer, I get a screen showing how much space is left on the Shuffle but no list of files that I can delete.  WRA

    After I've heard an audiobook downloaded from the public library, how do I delete it from the Shuffle to make room for other audiobooks?  When I plug it into my computer, I get a screen showing how much space is left on the Shuffle but no list of files that I can delete.  These books, incidentally do not appear in the ITunes screen.  WRA

    Select the iPod shuffle in the iTunes sidebar (under DEVICES).  If this is a current 4th (or 3rd) gen iPod shuffle, you should be able to see the contents of the shuffle by type, intented under the shuffle's name (still in the sidebar).  Select Music or Audiobooks (not sure where those items from the library will be listed).  The items will be listed to the right, for each category.  Find the items, select, and delete.
    It's on page 20 of the manual
    http://manuals.info.apple.com/en_US/iPod_shuffle_4thgen_User_Guide.pdf
    NOTE:  If this is an 1st or 2nd gen iPod shuffle, select the iPod shuffle in the iTunes sidebar (under DEVICES).  Over to the right, go to the Contents tab, where the items are listed.  Select and delete them from this list.
    I find it more convenient to make a playlist in iTunes with things I want to put on the shuffle.  I then set up automatic syncing (or use autofill) to have iTunes load the shuffle from that playlist, automatically.

  • Value based on the periodic unit price (only with pr.ctrl S)

    Dear all,
    There is this field in mateial master called "Value based on the periodic unit price (only with pr.ctrl S)" in accounting view 1,
    1 - May I know what is this field about (in between our company using material ledger).
    2 - May I know why the value of this field are different between our company period 6 and period 7 for this year? what contribute to it? and is it something wrong with different value between two different period or absolutely normal?
    Thanks.
    Tuff

    Dear all,
    Does anyone know my question?
    Thanks,
    tuff

  • Value based on the periodic unit price(only with pr.ctrl S) field in MatMas

    Dear all,
    There is this field in mateial master called "Value based on the periodic unit price (only with pr.ctrl S)" in accounting view 1,
    1 - May I know what is this field about (in between our company using material ledger).
    2 - May I know why the value of this field are different between our company period 6 and period 7 for this year? what contribute to it? and is it something wrong with different value between two different period or absolutely normal?
    Thanks.
    Tuff

    Hi Tuffy,
    For your 1st query:
    PUP field in Accounting 1 (if ML is active, Price Determination indicator=3) is the result of Actual Costing Run (CKMLCP) closing entry.
    For your 2nd query:
    In most of the cases the values will be different in Previous Period and Current Period. e.g.Period 6 values are the results of Actual Costing Run (CKMLCP) in 1st week of Period 6 for Previous Period (i.e. Period 5). Period 7 values are the results of Actual Costing Run (CKMLCP) in 1st week of Period 7 for Previous Period (i.e. Period 6).
    The reason for the different values: Price differences, Exchange rate differences, Price/Exchange rate differences from Low lower materials, etc.
    Thanks & Regards,
    ADI

  • Value based on the periodic unit price (only with pr.ctrl S) field in mat.

    Dear all,
    There is this field in mateial master called "Value based on the periodic unit price (only with pr.ctrl S)" in accounting view 1,
    1 - May I know what is this field about (in between our company using material ledger).
    2 - May I know why the value of this field are different between our company period 6 and period 7 for this year? what contribute to it? and is it something wrong with different value between two different period or absolutely normal?
    Thanks.
    Tuff

    Hi Tuffy,
    For your 1st query:
    PUP field in Accounting 1 (if ML is active, Price Determination indicator=3) is the result of Actual Costing Run (CKMLCP) closing entry.
    For your 2nd query:
    In most of the cases the values will be different in Previous Period and Current Period. e.g.Period 6 values are the results of Actual Costing Run (CKMLCP) in 1st week of Period 6 for Previous Period (i.e. Period 5). Period 7 values are the results of Actual Costing Run (CKMLCP) in 1st week of Period 7 for Previous Period (i.e. Period 6).
    The reason for the different values: Price differences, Exchange rate differences, Price/Exchange rate differences from Low lower materials, etc.
    Thanks & Regards,
    ADI

  • Trying to set attribute value based on user selection of another attribute

    I am trying to set an attribute value based on the user's selection of another attribute using JSP EditCurrentRecord. When the user chooses the AreaId from the combo box I want to look up the value of the RgnID, preferrably without the user seeing this field at all. Below is my code which does not work. When I run it I get Error Message: null. Any suggestions are appreciated!!
    <jsp:useBean id="RowEditor" class="oracle.jbo.html.databeans.EditCurrentRecord" scope="request">
    <%
    RowEditor.initialize(pageContext, "MyProject2_package1_SRSecurityModule.UsrAreaWhView");
    RowEditor.setTargetUrl("UsrAreaWhView_SubmitInsertForm.jsp");
    RowEditor.createNewRow();
    RowEditor.setDisplayAttributes("OracleId, RgnId, RegionKey, AreaId");
    RowEditor.useEditField("OracleId");
    RowEditor.getFieldRenderer("OracleId").setPromptText("Oracle ID");
    RowEditor.useEditField("AreaId");
    RowEditor.useComboBox("AreaId","AreaWhView","Area","AreaKey");
    RowEditor.getFieldRenderer("AreaId").setPromptText("Area");
    RowEditor.useEditField("RgnId");
    RowEditor.getFieldRenderer("RgnId").setPromptText("Region");
    RowEditor.getRowSet().getViewObject().getCurrentRow().setAttribute("RgnId",RowEditor.getRowSet().getViewObject().getCurrentRow().getAttribute("RegionKey"));
    RowEditor.setReleaseApplicationResources(true);
    RowEditor.render();
    %>
    </jsp:useBean>

    ok, sorry everyone for making it confusing; this is what I am
    trying to acheieve;
    I would like the user to populate my database with thier
    username AND userID. I have a dropdown box with thier username
    dynamicly populated already, what I am trying to achieve, is a way
    of when the user selects thier username either another dropdown or
    a hidden field is automatically populated with the appropiate
    userID (to match thier username). Now I could just have two
    dropdowns and they select both, but i'd rather avoid the
    possibility of mismatches, and that is why I would like it to be
    automatic and based on thier username selection...
    Does that make sense....?

  • Is it possible to view the content of multiple lists(located in multiple webs) in one ListViewWebpart? And how can I filter a multivalue column?

    Is it possible to view the content of multiple lists, that are located in different webs as well, in just one ListViewWebpart? Could I maybe change the query programmatically so that it get's the content this way?
    I know that I could use the Content Query Webpart instead - actually I have been using that so far, but the problem is, that it brings no standard Sharepoint functionality for lists with it... I had to write the xsl style sheet, there are no dynamic filters
    that the user could set, there are no default list operations the user could use.
    The ListViewWepart has all of these, but it only shows the content of one list...
    And my second problem:
    One column can contain multiple values (like a column that contains multiple users or user groups that are related to one entry). I can filter every other column with the standard filters, but not the column with multiple values in it. Is it possible to
    activate that or maybe add this feature programmatically?

    You can fetch data from multiple lists in ListViewWebpart, this can be possible through Content Query web part or Custom Web Part using visual studio but in that case you can not get the standard SharePoint funcationality for list (which is available in
    ListViewWebparts).
    No OOB filter available for multi-choice column, you also have to go with custom solution to achieve this.
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

Maybe you are looking for

  • Get kernel panic when I burn DVDs

    when I burn several DVDs using the internal DVD burner on my 1.25 Ghz G4 running OS X 10.4.11, I am getting a kernel panic that tells me to reboot my computer. I'm using Toast Titanium 8 to burn with. Any ideas how to prevent this? Here's the details

  • Calendar in Notification Center

    I want to be able to have a look at all my daily calendar's appointments in Notification Center. Even the ones that may have expired several hours ago (but always within the same day of course). Instead, what I get is a limited time frame from now on

  • I am using GUI_DOWNLOAD FM to download my internal table entries into .xls

    Hi I am using GUI_DOWNLOAD FM to download my internal table entries into .xls file. but it's not download total records in final table. in debugging it showing total records. exporting: filename filetype field-suprater header tables data_tab fieldnam

  • How to change HOST Name without a reinstall in XI 3.1 ?

    Is it possible to change the host name in XI 3.1 without reinstall ?

  • Language DA ENG (int)

    I was earlier told that I only had to chose language in preferences for apps in my CC to chance. That didn't do it. What can I do? I don't want the apps in Danish, I'm used to work in International ENG. Please help!