Can the sql contextual parser / suggestions drop-down list be suppressed in Apache Superset? - apache-superset

In a sqllab window for Apache Superset the editor is quite slow because it is trying to provide suggestions for table names. For example simply typing select takes several seconds for the word to appear as the suggestion provider populates a dropdown list.
Here is the dropdown that took a few seconds to show - and none of the letters I was typing of select show up until the dropdown list is populated and displayed:
I really want to just disable the whole syntax parser and suggestion maker because needing to wait multiple seconds just for my typing to appear more than destroys whatever value it could provide. Is that possible to suppress?

Related

Oracle APEX 21.2.6 Interactive Grid - double-click to edit popup LOV shifts data rows over. How to prevent this?

I have an IG display that looks like this without clicking anything else:
Only Supervisor, and Direct Supervisor are editable, and they are both Popup LOV's.
If I double-click the Supervisor data, and immediately type any letter for the Popup LOV search, the data row(s) display shifts to the left like this:
It doesn't matter how wide the window is when I test this. I've been looking for ways to prevent that shift. Do you have any tips to resolve that?
Thank you
I've since learned that this is a known issue, and a bug report was logged: https://community.oracle.com/tech/developers/discussion/4340268/apex-20-1-popup-lov-in-interactive-grid-causing-issue/p1?new=1
I've also noticed that it seems to happen from a single click plus typing to search - not necessarily from a double-click.
Finally, freezing a column or two in place in the IG display appears to prevent the visual shift of the columns.

Oracle APEX - Reusable Pages?

We have some tables in our database that all have the same attributes but the table is named differently for each. I'm not sure of the Architect's original intent in creating them in this way, but this is what I have to work with.
My question for all the expert Oracle APEX developers: is there away to create a reusable page that I can pass the table name to and that table name would be used in the reporting region and DML processing of that page?
I've read up on templates and plugins and don't see a path forward with those options. Of course, I'm new to webdevelopment, so forgive my ignorance.
We are using version 18.2.
Thanks,
Brian
For reporting purposes, you could use a source which is a function that returns a query (i.e. a SELECT statement). Doing so, you'd dynamically decide which table to select from.
However, DML isn't that simple. Instead of default row processing, you should write your own process(es) so that you'd insert/update/delete rows in the right table. I've never done that, but I'd say that it is possible. Basically, you'd keep all logic in the database (for example, a package) and call those procedures from your Apex application.
You could have multiple regions on one page; one region per table. Then use dynamic actions to show/hide the regions and run the select query based on a table name selected by the user.
Select table name from a dropdown or list
Show the region that matches the table name (dynamic action)
Hide the any other regions that are visible (dynamic action)
Refresh the selected region so the data loads (dynamic action)
If that idea works let me know and I can provide a bit more guidance.
I never tried it with reports, but would it work to put all three reports in a single page, and set them via an Item to have Server-Side Conditions that decide what gets shown in the page? You'd likely need separate items with a determined value for the page to recognize and display.
I know I did that to set buttons such as Delete, Save and Create dynamically, rather than creating two or more separate pages for handling editing of certain information. In this case it regarded which buttons to shown based on a reports' primary key being sent to said "Edit" page. If the value was empty, it meant you wanted to create a new record (also because the create button/link sent no PK). If said PK was sent (via a edit button/link), then you'd have the page recognize it and hide the create button and rather show the edit button.

Copy Records in Oracle Apex

I need to copy selected row values and store as a new record.
I am using Oracle Apex 4.2 and Tabular Form.
I need to use checkbox to select the rows and button copy. When i select multiple rows followed by click copy button to copy all the selected row values as new rows and save.
Can anyone Help
Copying Records Through an APEX Tabular Form Input
The idea of cloning existing records from a single table through an Oracle APEX Tabular Form works without much interference with the default design that you can set up through the APEX wizard for page region content.
Build a table with an independent primary key.
Suggested to include two auxiliary columns: COPY_REQUEST and COPIED_FROM for running copy operations. Specific form elements will map to these columns on the tabular form that will be set up.
Build an Oracle stored procedure that can read which records need to be copied. This procedure will be invoked each time the SUBMIT button is pressed.
(optional) Consider including a suppression of step (3) in the event that there is nothing to process (i.e., no records marked for copying).
The Working Table for Receiving Input: COPY_ME
TIP: You will have an easier time if you use the standard TABLE creation wizard. Designate CUSTOMER_ID as the PRIMARY_KEY and have APEX create its standard auto-incrementing functionality on top. (sequence plus trigger set up.)
Here's the sample data I used... though it doesn't matter. You can put in your own values and be able to verify what happened easily.
The Heavy Lifting: The Stored Procedure for Cloning Records in COPY_ME
This procedure works with 1 or more records at a time with a special identifier in the COPY_REQUEST table. After the task is done, the procedure cleans up and resets the request value again.
create or replace procedure proc_copy_me_request is
c_request_code CONSTANT char(1):= 'Y';
cursor copy_cursor is
SELECT cme.CUSTOMER_ID, cme.CUSTOMER_NAME, cme.CITY, cme.COUNTRY,
cme.COPY_REQUEST
FROM copy_me cme
WHERE cme.COPY_REQUEST = c_request_code
FOR UPDATE OF cme.COPY_REQUEST;
BEGIN
FOR i in copy_cursor LOOP
INSERT INTO copy_me (customer_name, city, country, copied_from)
VALUES (i.customer_name, i.city, i.country, i.customer_id);
UPDATE copy_me
SET copy_request = null
WHERE CURRENT OF copy_cursor;
END LOOP;
COMMIT;
END proc_copy_me_request;
There is also a column that can be hidden. It tracks where the record was originally copied from.
Note that the cursor is using the FOR UPDATE OF and WHERE CURRENT OF notation. This is important because the procedure is changing the records that are referenced by it.
APEX Page Setup Instructions
Set up a standard FORM type page and choose the TABULAR FORM style. Follow the set up instructions, taking care to map the correct primary key, and also to the PK sequence object created with the table in the previous steps above.
This is what your page set up will look like after these steps are completed:
EDIT The COPY_REQUEST Form Value:
Under the column attributes section, change the Display As option to "simple checkbox"
Under the list of values section, put a single value under the LOV Definition: Y (case sensitive in either way... just be consistent)
EDIT The COPIED_FROM Form Value:
Under the column attributes section, change the Display As option to "Display as Text(Saves State)". This is just to prevent users from stepping on this read-only field. You could also suppress it if it isn't important to know.
CREATE a New Process: Execute Copy Procedure
This is the bottom of the same configuration page, there are very few things to change or add:
Demonstration: Screenshot of COPY_ME Tabular Form Page in Action
The first screenshot below is before the page is tidied up and the checkbox control is put into place.
Plug in some test data and give it at try. The Page Process created in the step above conditionally invokes the stored procedure that processes all copy requests made at the same time when the SUBMIT form button is selected.
COMMENTS: If you spend enough time tinkering around with the built-in wizards in Oracle APEX, there are opportunities to learn new design patterns and process flows compatible within the tool. Adapting your approach can reduce the amount of additional work and frustration.

Oracle ApexCreate Time field HH:MM

I am having difficulty with a duration field on my form/table.
The users need to indicate in HH:MM how long a meeting took.
What datatype should the column have in the Table. Currently it is TIMESTAMP
How can I make the field have an input mask of 'HH:MM'. What I would like is for the user to be able to type '0130' and the field format it to '01:30' immediately.
Reporting on these times is required so I assume that entering the data as VARCHAR will not help.
Honestly, this is not such an easy subject as people might think it is, and probably more from a user interface point of view than technically.
The easiest way out? The apex datetimepicker. And honestly, if you're new to the technology I'd advise you to use this, especially if you want to steer clear from javascript/jquery initially.
Let's put it this way: the datepicker is fine and works good, but time is really not that fantastic.
Not all that hot right. The value in the input item does not change until you hit 'Close'. The time component seems like a last second sloppy addition honestly. It works, however. (But I'd still set the field to readonly so that a user can not enter text directly.)
Allowing text to be entered means it needs to be validated according to the correct format mask. And format masks differ between those in jQuery (the datepicker) and those in Oracle, and it might be possible that your oracle format mask is not possible in the datepicker, adding even more complexity. There is also no 'live' date validation (nor datetime), there is only the builtin item validation which will check the format mask and which fires on submit.
Anyway, I'd say take a look at it. Set your item to be displayed as a Date Picker, and use the format mask under settings to get the datetime picker:
Now you can push it further of course, though it'll cost some effort. There are several options though.
Personally, when I've implemented date+time I've always split the date from the time in 2 fields. 1 with the date component, and one with the time component, while keeping the item with the original value hidden (so 3 items total). I then use the datepicker on the date item, and use jquery timepicker plugins on the time item. On submit I then add the 2 values together and parse them in a date, and put this value in the original item again (to allow the standard processing to work on items with source set to database column).
One example of a timepicker is here, another one here. They're both not that hard to implement. They have good documentation too. I don't want to dive in the implementation of it here though, I advise you take a look at it first and see how much it scares you. (I'd set up an apex demo but am a bit pressed for time at the moment).
For example, using Trent's (second link) plugin:
put the js file in the apex images directory. I made a folder "/custom" in my case
add the required js files to the page (assuming apex 4.2, put this in javascript file urls)
#IMAGE_PREFIX#libraries/jquery-ui/1.8.22/ui/jquery.ui.slider.js
#IMAGE_PREFIX#custom/jquery-ui-timepicker-addon.js
use onload code such as this to initialize a field
$("#P95_DEPARTURE_TIME").timepicker({hourGrid: 4,minuteGrid: 10});
It'll end up looking as this:
Any further interaction between pickers will need to be handled in javascript code if you want it live. Don't forget server validations.
As for items, my hidden date item has format mask DD-MON-YYYY HH24:MI. Format masks are important, because items are bind variables, and bind variables are varchar2. The value in the html form is also just that, text.
For example, this is on my displayed date item, with a similar setup for the time item:
Then in an after-submit computation I glue the values together again and put them in the m that'll save the value to the database:
:P95_DEPARTURE_DATE_DISP||' '||:P95_DEPARTURE_TIME
This is just a short guide on the setup though, but might be interesting once you're a bit more familiar with the product.
There are also 2 timepicker plugins on apex-plugin, but honestly I don't find them interesting at all when compared to these already existing fine jquery plugins.
Give it some thought and look at it.
If quarters are enough..
item: text field with autocomplete
SELECT ss|| ':' || dd ss_dd
FROM
(SELECT to_char(trunc(sysdate)+(level - 1)/ 24,'HH24')ss
FROM dual CONNECT BY level <= 24),
(SELECT lpad(mod(15 * level, 60), 2, '0') dd
FROM dual CONNECT BY level <= 4)
APEX 4.2: Just to shed some light for any future viewings; now there are loads of Apex plugins for the purpose of picking Date/Time or both returning variations of date time formats as you would required. For e.g. as in your case HH:MM or HH24:MI.
I have personally used TimePicker plugin from http://www.apex-plugin.com which I have no problem in recommending.

Making a Row Read Only in a tabular form based on table value

I have a tabular form which is updated throughout the year and i wanted to prevent users from editing certain rows. Currently the 'row type' is hard coded however I want the application admin to control which 'row types' are readable / write at certain times. My answered question, click here.
Currently a dynamic action is fired which prevents the rows that contain the type 'manager figure' and 'sales_target' being edited.
I have created a table with the three row types against each customer. Each status is set by a number: 0 to 3 (These i will decode into something meaningful for users).
0 - Row with that row type is read only.
1 - Users can enter into the row with that row type.
2 - row is read only with that row type.
3 - row is complete and set to read only.
I have created a new form (new tab) for the admin user to maintain each status.
Currently for Customer 'Big Toy Store' rows should be set as follows:
Manager Figure row should be read only (since set to 2)
Sales should be readable (since set to 0)
Sales target should be writable (since set to 1)
Please can i be pointed in the right direction, ive looked into jquery but struggling to work out how to pass the output of an sql query to it, so it can be used to determine which rows should be read only.
Link:apex.oracle.com
workspace: apps2
user: developer.user
password: DynamicAction
application name: Application 71656 Read only Rows for Tabular Form
I'm not sure that a tabular form is a good format to work out this idea. As you can see, you require quite a bit of javascript to produce the results you want. Not only that, but this is all client side too, and thus there are some security risks to take into account. After all, I could just run some Firebug and disable or revert all things you did, and even change the numbers. Especially with sales figures, which is something you most definitely do want altered by everybody and is also the nature of your question, security is important.
There are more elegant ways here for you to control this, and not in the least to reduce the amount of highly customized javascript code. For example, you could do away with the tabular form, and instead implement a modal popup from an interactive report. Since the modal popup would be an iframe and thus a different page, you can create a form page. On a form page you have a lot more control over what happens to certain elements. You can specify conditions, read-only conditions, or use authorization schemes. All things you can not evidently use in a tabular form.
I'd think you'd do yourself a service by thinking this over again, and explore a different option. How much of a dealbreaker is using a tabular form actually?
You need the user. You need to know what group he belongs to, and then this has to be checked against the different statusses and rows have to be en/disabled. Do you really want this to happen on the client side?
I'm not saying it can't be done in a tabular form and javascript. It can, I'm just really doubting this is the correct approach!