Implementation of drop-down Association for Oracle ADF tables

Source: Internet
Author: User

  1. A business table contains the following fields: province name (Csqmc), Province code (Csqdm), city name (Csxmc), and city code (Csxdm ).
  1. By selecting the province/region name, city/county names are linked.

1. No Csqmc or Csxmc fields exist in the dealer table. Write an SQL statement into the Query to Query the fields in the dealer table.

  1. SelectSsqx. sqmc, ssqx. sxmcWhereDealer table. sqdm = ssqx. sqdm

Ssqx is a provincial/municipal joint view.

  1. Create Or Replace ViewV_sys_sysc07sysc08As
  2. SelectA. csqdm, B. csxdm, a. csqmc, B. csxmc, B. njd, B. nwd
  3. FromSysc07 a, sysc08 B
  4. WhereA. csqdm = B. csqdm
Then, in the dealer VO, get the Csqmc and Csxmc

  

  1. 2. Then, associate the province name with the city name.
  1. Perform LOV configuration in the province name
  1. List data source: Select VO for the province table, and list Attribute select Csqmc for the province table. then, associate the list Attribute with the View Attribute. (because the province name is required to change, the province Code also changes.ReturnIn the value07Table Csqdm is also associated. In UI Hints, select the control type and set the content displayed in the control .)
List data source: Select VO for the province table, and list Attribute select Csqmc for the province table. then, the list Attribute and the View Attribute are associated. (because the province name is required to change, the province Code also changes. Therefore, the Csqdm of table 07 is also associated in List return value, select the control type in UI Hints and set the content displayed in the control .)

.

3. the city and county names are similar to the preceding operations. However, because the province and city names must be linked, the principle is that after the province and city names are selected, the province code should be passed to a parameter, use the where statement to compare the Csqdm and this parameter in the city, county, and county tables (you can create a view ).

View code:

  1. SELECT
  2. SYSC08.CSXDM CSXDM,
  3. SYSC08.CSXMC CSXMC
  4. FROM
  5. SYSC08
  6. WhereSYSC08.CSQDM =: p_csqdm
P_csqdm is the parameter set by the user. If you want to upload the name of the province to which the dealer table is selected-> code, you can configure LOV In the dealer table to implement provincial/municipal linkage.

4. in the coordinated operation on the presentation layer, the province/region name control must be set to autosubmit () to true, and the city name control must be set to partrialtrriger to true, that is, if the province/region name value changes, it is submitted locally, the city name trigger listens to the province/region name controls to achieve linkage.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.