How to make a LOV in Oracle ADF that also returns a static value? - oracle

Say I want to have a lov of colors. Red , Blue Green. I want an LOV that retrieves those values from a database but on top of that I want to add one more value "All". So the LOV could be a list of someone's potential favorite color and by default the "All" option is displayed in the LOV. A user can choose any color or maybe decide to revert to the 'ALL" option.
Is it possible to add this static value to an LOV that retrieves values via a db? I know you can just create a static LOV but the point is we need to retrieve the latest colors or whatever value is in the db if it ever grows.
Edit: JDeveloper 12c (12.1.3.0.0)

If the 'all' option is valid, you should add it into the DB, like the other colors. If you don't want to put 'all' into the DB, you can use SQL and create the 'all' option as a static result before the actual query to the table using a union SQL statement.
One other way to archive this is to add the 'all' option to the items list in a bean, like it's shown here https://community.oracle.com/tech/developers/discussion/616712/adf-faces-how-to-add-static-option-to-dynamic-lov
You still have to think about what should happen if the user selects 'all' from the list. How does the UI handle this?

I think you should insert "All" value to table in database. The table should contain "ORDER_COLOR" column. We will prepare data some thing like:
("All", 999999)
("RED",1)
("BLUE, 2)
("GREEN",3)
("NEWEST_COLOR",4)
In ViewObject query. You can order by ORDER_COLUMN desc. The ALL will on the top and next one is NEWEST_COLOR

Related

Populate Text Fields from a selected table Apex

I want to populate text fields from a table selected first from a LOV and user input.
How can I do it in apex? How can I manipulate that with processing ?
For small amount of values, I prefer Select List item as it looks nice; if there are many values, it can't handle it so I use a Popup LOV instead.
In order to populate certain fields with values, you can use a dynamic action whose action is Set value (and there you can choose how to do it; for example, using some PL/SQL code).

show selected columns of table in QlikView

I am creating a Dashboard in QlikView, allowing the user to extract data based on the filters and selected columns. Requirments are below.
“Data Extract” table MUST be empty (even no column names are showed)at first!
Clicking the blue button shows the list of data available.
A table will then show those selected columns.
Does someone know how to do these?
Screenshot:
You need to set a conditional expression on each of your dimension and measures.
A simple example would be to have an ID for each measure, here the measure "NetSales" can be referenced by MeasureID "a".
Measure | MeasureID
NetSales | a
In the conditional expression for NetSales you can have:
=if(IsNull(GetFieldSelections(Measure)),0,SubStringCount(Concat(MeasureID, '|'), 'a'))
This will check the possible MeasureIDs and return 1 if NetSales is selected.
You need to create a "floating" tables with the dimensions & expressions you need to use in the table object:
Here is an example I made : https://ufile.io/j20am (just reload the file If you use personal edition)

OBIEE 12C: dashboard prompt auto fill when selection is sql result

I wanted to created a dashboard prompt which would automatically fill in with the first available value. This is possible when the selection choices are e.g. all column values.
What I need is to select my values via sql result but still want to fill in the first available value, but that option is blanked out when choosing sql results.
Is there a way to achieve this, maybe via adapting the xml?
Thanks!
What you have highlighted is ONLY ever active when you have interdependent prompts with constraints. I.e. "Limit values by" set to TRUE

I need to make the column values of a table case Insensitive while reading them in a Spotfire Prompt from a Oracle View

I am loading data into Spotfire report from Oracle using view. In the Spotfire Prompt when the text value is entered, whether it is Upper,lower or mixure of both the relative column values should be displayed. Since this is done at the data base level i need some way to make the column values case insensitive.
I know that column values can be converted to upper/lower case with upper()/lower() function but i need a way so that even a mixure of upper/lower cases will search the column values.
I found one more solution for session :
alter session set NLS_COMP=ANSI;
alter session set NLS_SORT=BINARY_CI;
After using the above code any SQL search for column will be case insensitive. but i need a solution where i can use it in the view of the column element.
Does the inputted value need to be a prompt? It would be possible to do this using a parameter (which could be set by a document property/ input field/ configuration block).
Within the SQL for your query, you could add a where clause something like
upper(A1."mycolumn")=upper(?myParameter)
After refreshing the parameters section of the information link ‘myParameter’ will appear. The information link can then be added as an on demand table, with myParameter being set via a document property.

Passing more than 3 items in a reports column link

I have a report that is listing students and I want a column to edit a student. I've done so by following this answer:
How do you add an edit button to each row in a report in Oracle APEX?
However, I can only seem to pass 3 items and there's no option to add more. I took a screenshot to explain more:
I need to pass 8 values, how can I do that?
Thanks!
Normally, for this you would only pass the Primary Key columns (here looks like #RECORD_NUMBER# only). The page that you send the person to would then load the form based on the primary key lookup only. If multiple users were using this application, you would want the edit form to always retrieve the current values of the database, not what happened to be on the screen when a particular person ran a certain report.
Change the Target type to URL.
Apex will format what to already have into a URL text field which magically appears between Tem3 and Page Checksum.
All you need to do is to add your new items and values in the appropriate places in the URL.
I found a workaround, at least it was useful to my scenario.
I have an IR page, query returns 4 columns, lets say: ID, DESCRIPTION, SOME_NUMBER,SOME_NUMBER2.
ID NUMBER(9), DESCRIPTION VARCHAR2(30), SOME_NUMBER NUMBER(1), SOME_NUMBER2 NUMBER(3).
What I did was, to setup items this way:
P11_ITEM1-->#ID#
P11_ITEM2-->#DESCRIPTION#
P11_ITEM3-->#SOME_NUMBER##SOME_NUMBER2#
Previous data have been sent to page 11.
In page 11, all items are display only items.
And P11_ITEM3 actually received two concatenated values.
For example, the calling page has columns SOME_NUMER=4 and SOME_NUMBER2=150
so, in pag1 11, P11_ITEM3 shows 4150
In page 11 I created a Before Footer process (pl/sql expression)
to set up new items, for example P11_N1 as source SUBSTR(P11_ITEM3,1,1)
and item P11_N2 as source SUBSTR(P11_ITEM3,2,3)
So, I had those items with corresponding values from the calling IR page.
The reason I did not pass the primary key only for new lookup access, is because i do not want to stress database performing new queries since all data are already loaded into page items. I've been an oracle DBA for twenty years and I know there is no need to re execute queries if you already have the information somewhere else.
These workarounds are not very useful for a product that bills itself as a RAD tool.
Just include a single quoted word in the select statement (Select col1, 'Randomword', col2 from table 1;)
Then define that column as a link and bingo! More items than 3 to select.

Resources