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).
Related
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
I have two database Datablock
In the First Block I have a Item called parameter name with LOV. While selecting that LOV ,it should populate Next Item Also that is Section
Now What i want is when I am selecting the Parameter name LOV from First Data Block. I want to populate the corresponding data in the list Value of the Second Data Block
For this i used post text item -->Inside that I used go block But it throws illegal restriction Error
Now I am out of ideas
If I understood you correctly, you're talking about cascading LoVs. If that's so, then the 1st LoV query looks like this:
select parameter_name, section
from some_table
where some_condition;
You set it to populate appropriate fields in the 1st data block (one of them is :block_1.parameter_name).
The second block's LoV would then "reference" the first block's field:
select another_column
from another_table
where parameter_name = :block_1.parameter_name --> this
and other_conditions;
You don't need any triggers; once you display 2nd block field's list of values, it'll use that where clause and display only values that match the condition.
I want to save a specific value that is on a specific row and column. How I can do this? I already search, but I didn't find anything
One doesn't save a value from the grid but rather from the underlying dataset. The following is for Delphi, but I understand that Lazarus is near enough the same. Let's say that the grid is displaying data from a query qTest that has fields id, surname, forename, date of birth (DOB). In Delphi, one can automatically have variables created with names qTestID, qTestSurname, etc. Another way of referring to the variables is by use of the 'fieldbyname' syntax - qTest.fieldbyname ('surname').asstring.
Write a dblClick handler for the grid: when one gets to the row that holds the required data, perform a double click. In the handler, the fields of the row will now be available as qTestID.asinteger, qTestSurname.asstring, etc.
Is it possible to dynamically hide rows in a table view without reloading everything? I have a (view based) table view with it's content member bound to an array controller (arrangedObjects) which itself gets its content from Core Data.
To enrich the UI I show group rows for sections with the same date (all entries in this set have a date in this case). But for certain tasks I need to hide these group rows (e.g. when sorting for something else but the date). In order to show them I already have to create a copy of the original data set and manually insert entries that serve as placeholders for the group rows (which is annyoing as it duplicates data), but I don't want to re-construct this constantly depending on whether the group rows must be shown or not. Is there a better way for this?
Hiding any row requires to rearrange the table view content anyway.
Create all rows including group rows and filter the group rows if needed by applying an appropriate filter predicate.
I have a subform with a table, where some fields are restricted to tables. The tables are sorted in the correct order, but when it is used in the subform, it is set to default sorting. I can't find the location of the correct place to set the sorting criteria. I tried using query instead of a table, but i could only sort either by ascending or descending (or nothing). All three options resultet in undesired order. Example of the phase being sorted as default despite the table settings:
Suggestions?
As Gustav suggests, add another field to your t_Phase table, which will be the order you want this list to appear in the drop-down (make sure it is a number field):
Supply the numeric order:
In your other table, you can use the ID field from your t_Phase table by selecting it through the lookup wizard:
Move across the ID and the new "Order" field you just created:
Use the "Order" field as the field you want to use for sorting and make sure "Ascending" is selected:
Continue through the wizard:
Select the field that has the data you want to go in to the record of your table (I assume it's the ID field rather than the Order field, so make sure ID is selected):
Finish the lookup wizard and go in to Datasheet View on your table and check that the dropdown is now in numeric order. You've probably noticed a problem though as it is showing both the ID and the Order columns:
To hide the unnecessary Order column, go back in to Design View and click on your phase field to select it.
At the bottom should be a "Lookup" tab. Click on this and notice the Column Widths property... it's showing 2 different widths values; the first one is the ID field and the second one is the Order field. Set the Order field to 0cm to hide it. I'd then recommend setting the remaining Id field width to something that will be wide enough to show all your ID field's options. Then I'd set the List Width property to the same width.
8cm, for example:
This should result in something like the following, which is hopefully what you're after.
If you're not adding a lookup field to the design structure of a table, but are instead using a combo-box on a form or subform, the principle is pretty much the same; you'll just have to amend the combo-box properties from the form's Property Sheet "Format" tab instead:
Combo- and listboxes always contain text, thus your column is not sorted numeric.
To have a numeric sort, add a column with the number only and - in the source - sort only on that. If you don't the number separately, create it from this expression:
Val(Mid([PhaseField], 7))