简体   繁体   中英

How can I build a 5-star rating system in Oracle Apex?

I need to build a 5-star rating system in Oracle Apex.

For reference, here is a basic modal dialog for one of my database tables.

在此处输入图像描述

It shows the rating for this item as 3.5
The value comes directly from a column in my table.

Instead of displaying the numeric value, I'd like to display something like this:

在此处输入图像描述

I'm new to Apex, so I don't know where to begin.
My first instinct is to (somehow) create a dynamically sized gold rectangle, which changes size based on the numeric value, and then put some type of "mask" in front of it to cover everything except the star shapes.

Creating a "mask" image with transparent star cutouts is easy, but implementing this display seems like it might require some more advanced Apex skills. (custom JavaScript?)

Or maybe there's a better method, I have no idea.

In addition to being able to display the number of stars, I also need users to be able to click on the stars to set the rating.
They should be able to select any rating from 0-5 in increments of 1/2 star.

Where should I begin with a problem like this?
Does Apex have built-in support for custom controls?
Are they relatively simple to implement?

APEX has a plug-in framework that allows third parties to build a variety of items, processes, etc. that you can drop in to your application. There are a couple of different repositories but the APEX.world repository is the most common. There are a couple of pre-built star controls there that I would expect you could just use.

Oracle also has a tutorial that walks you through importing and using a star control plug-in . I haven't looked to see whether they are using the same plug-in (or the same version of the plug-in) that is out in the APEX.world repository but the process is going to be basically identical regardless of the plugin.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM