Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » LOV return all value if null SELECTED (APEX4.0.2)
LOV return all value if null SELECTED [message #651246] Fri, 13 May 2016 09:35 Go to next message
pcouas
Messages: 112
Registered: February 2016
Senior Member
Hi,


Currently i have an LOV component like this


SELECT grp.TEU_GROUP_NAME display_value,
grp.TEU_GROUP_UID return_value
FROM LO_TEU_GROUP grp,
lo_vessel ve,
lo_teu teu

Then i have define in APEX defined
Null Display Value ALL Null Return Value ALL

So could i modify Query or APEX page for returning all LISTBOX values if null or ALL is selected ?


Regards
Phil
Re: LOV return all value if null SELECTED [message #651266 is a reply to message #651246] Fri, 13 May 2016 13:53 Go to previous messageGo to next message
Littlefoot
Messages: 21616
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
First of all, if that's your real SELECT statement, do you realize that - without any WHERE conditions - it will perform a massive Cartesian product of all three tables involved in the FROM clause?

As of your question: what do you plan to do? Suppose that your query returns 1000 values. What would you do if you select ALL, as a return value? Where would you store those 1000 values and what would you do with them? Doesn't sound like a very good idea to me.

Anyway: there's the "Allow multi selection" property you might try to use.

Alternatively, consider using a Shuttle item instead. It allows you to easily select all values
Re: LOV return all value if null SELECTED [message #651268 is a reply to message #651266] Fri, 13 May 2016 23:18 Go to previous messageGo to next message
pcouas
Messages: 112
Registered: February 2016
Senior Member
Hi

My Lov component return string value "ALL" when null is selected.
Currently there is twenty records in this list.
I search when user select "ALL" that all values are returned by LOV Component

Regards
Re: LOV return all value if null SELECTED [message #651289 is a reply to message #651268] Sat, 14 May 2016 13:57 Go to previous messageGo to next message
Littlefoot
Messages: 21616
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:

I search when user select "ALL" that all values are returned by LOV Component

Returned where? Into what?

Did you read my previous message? Did you understand what I said?
Re: LOV return all value if null SELECTED [message #651300 is a reply to message #651289] Sun, 15 May 2016 02:00 Go to previous messageGo to next message
pcouas
Messages: 112
Registered: February 2016
Senior Member
Hi

This LOV component doesn't return 1000 values.
My LOV component is

SELECT grp.TEU_GROUP_NAME display_value,
grp.TEU_GROUP_UID return_value
FROM LO_TEU_GROUP grp,
lo_vessel ve,
lo_teu teu

Then i have define in APEX defined
Null Display Value ALL Null Return Value ALL

So could i modify Query or APEX page for returning all LISTBOX values if null or ALL is selected ?

Re: LOV return all value if null SELECTED [message #651435 is a reply to message #651300] Tue, 17 May 2016 15:44 Go to previous message
Littlefoot
Messages: 21616
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, re-posting the original message doesn't help much. It appears that we don't understand each other.

It doesn't matter that the above query (which is, once again, most probably wrong as it doesn't join these 3 tables) does not return 1000 records but only 20. My reply would be the same if it returned only 2 records. So, if it is not a problem, imagine it returns two records. Where would you want to put those two (return) values? A LoV is attached to a single item, not to two (nor 20) of them. Therefore, it can select one value into one item. It can not put 2 values into 1 item unless you are satisfied with a solution which I described previously, using the shuttle item (I didn't try to select multiple values via a LoV): it enables you to select several values and put all of them into a single item. They are separated by a colon sign.

For example, if shuttle item shows this (display + return value in parenthesis):
New York    (1)       --> you select this one,
London      (2)       --> this one and
Rome        (3)
Zagreb      (4)       --> this one

The result - stored into an item - would be
1:2:4

Is this what you are looking for?

Or, would you like to populate (say) 20 rows in a tabular form with all values LoV's query returns? If so, that can be done using a loop and Apex array.

A simpler option would be to directly insert new records into an underlying table (using the SQL INSERT statement) and refreshing the layout.

Anyway: I still don't know what you are really trying to do. If possible, take a screenshot of that Apex page and describe what would you want to do with it.
Previous Topic: Classic Report- Sum based on Condition
Next Topic: Forms to APEX conversion
Goto Forum:
  


Current Time: Sat Oct 31 03:09:11 CDT 2020