DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Search Form in Oracle Visual Builder Based on ADF BC REST

Search Form in Oracle Visual Builder Based on ADF BC REST

Oracle Visual Builder makes it easy to create microservice applications out of the box. Read on to learn how to make a search function!

Andrejus Baranovskis user avatar by
Andrejus Baranovskis
·
Jan. 29, 19 · Tutorial
Like (1)
Save
Tweet
Share
7.77K Views

Join the DZone community and get the full member experience.

Join For Free

Oracle Visual Builder supports ADF BC REST out of the box. We'll build the service connection using the "Define by Specification" wizard:

Wizards support ADF as API types. Add describe at the end of the REST URL, this will bring in metadata for the exposed ADF BC REST service (information about attribute types, etc.):

A list of endpoints will be populated automatically. You could select all endpoints to be supported for your connection or select only a few:

The most typical thing you would do with endpoints is to map it with the table to display collection data. You would drag and drop Oracle JET table into VBCS page and choose the 'Add Data' option to map it with the service connection:

In the wizard you would select the previously defined service connection:

There is a way to switch wizard to detailed view and choose from multiple endpoints available for the connection:

In the next step, you would select service attributes to be displayed in table columns. All declarative, sweet:

In Visual Builder, at any point, you can quickly test the application. It will load in a separate browser tab (or you could switch the ap to Live mode and test the page functionality directly in the VBCS window):

Every action in Visual Builder is handled through events. For example, this event is mapped with the Reset button (you can see it in the structure tab on the left):

At any point, you can switch to source view and check (or edit) the HTML/JET code which is generated for you by Visual Builder. So cool, imagine typing and copy-pasting all this text by hand — tough and time-consuming (you could do better things in your life than copy-pasting HTML code):

Let's explain how search form logic is done in this sample. I have defined the page scope variable type; this type would hold the search attribute name, type, and operation:

Create as many variables based on this type and as many search criteria items as you will expect to have. Make sure to provide attribute and operation names (leave the value property empty, this will be assigned by the user):

Map search form fields with variables:

Create an event for the Search button, which calls a search action chain:

In an action chain, we can define search logic. Before executing search criteria, we need to prepare a search criteria array (normally this step could be skipped, but there is an issue in the current Visual Builder — it fails to execute criteria search when at least one of the criteria items is empty). Calling a custom JavaScript function where search criteria array will be prepared:

Here's the custom JavaScript function. It helps to prepare the array to be based to criteria (if the search item is not set, we are assigning an empty value):

The result of the function is mapped with the service connection criteria. The search will be executed automatically:

Table pagination is handled automatically too. Make sure to specify scroll policy = loadMoreOnScroll and define the fetch size:

Resources:

1. Sample source code on my GitHub

2. Blog from Shay - Filtering Data Providers with Compound Conditions in Visual Builder

3. Blog from Shay - Oracle JET UI on Top of Oracle ADF With Visual Builder

4. My previous post about query logic in Visual Builder - Query Logic Implementation in VBCS for ADF BC REST

REST Web Protocols Form (document)

Published at DZone with permission of Andrejus Baranovskis, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What Is Testing as a Service?
  • How To Avoid “Schema Drift”
  • Implementing Adaptive Concurrency Limits
  • How to Deploy Machine Learning Models on AWS Lambda Using Docker

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: