Adding TextBox in FORM with AddNew Button - oracle

I am working in Oracle Apex .i want to add TextBox i-e Disease from AddNew Button because i have Multiple Entries for one TextBox.The entries will be selected from another table through POPUP LOV. Below is the picture.

I don't think I can explain it step by step here, but it sounds like you could make use of a Tabular Form in your case.
In a Tabular form, you can dynamically add-update-delete new rows with a button, and for each field you can have Popop LOVS or Comboboxes to select data from.
Here are a few things to note:
When you insert a Tabular Form in your page, you'll instantly get three processes; one for Automated Row Fetching and two for save-update operations. By default, these processes are triggered through a button. You might want to change that since you have other items to submit in your page.
In a tabular form, you define a SQL query and the resulting columns of that query becomes your fields. For each field, you can select whether you want it to be a Combobox, Popup LOV etc.

Since you want to use a single column "DISEASE" in your treatment table, you can use one of the list item types that support multiple values (generally separated by colons (:)) - for example, a Shuttle.

Related

How to enable interactive grid cell validation in Oracle Apex Master-Detail page?

I have created a Master-Detail page in my Oracle APEX application. Basically i have a list of rows from one table and I can add values to it though a form. That works correctly, validations also work (every column from Master form can be accessed by adding ":" in front and that works in this case). I also have an option to edit click pencil icon in front of every row which lets me to update current row and also displays the Detail part of that row. Detail part is a list of values from another table that is connected to the first one using foreign key (Master-Detail: one to many). It is automatically displayed as interactive grid, so when editing my Master table value I can also add new rows to Detail table, but the validations don't work for Detail table. I tried accessing it's columns the same way as before, but it just doesn't work (tried to add PL/SQL expression validation:
:column >= 0
but that didn't work. How can I enable the validation for interactive grid, because I've looked into some resources about it, but they just show the first way, that doesn't work for me?
For a validation on an Interactive Grid you need to set the attribute "Editable Region" for the validation to your interactive grid. That works ok for me. I tried with a Master Detail on Dept (Master) and Emp (Detail) with a validation on detail of :SAL > 1000

Oracle Apex 5.1: Report column based on LOV(List of values) showing returned value not display value

I have created an interactive report with a form. In the form I have two select lists. The first select list is a list of values defined in the shared component. And the second select list is another list of values which is also defined in the shared component but this select list populates its LOV based on the selected item in the first select list.
Let the names of the select lists are:
Region.
Country(which is dependent on the selected item in Region field).
Now when I press save/create button in the form, a row is created in the report. The Region column and Country column in the report are both "Plain Text(based on List of Values)". But what I see is the Region column is showing the correct display value of the LOV but the Country column is showing the returned value of the LOV.
I want both of these columns show the display values rather than the returned value. Could anyone help me find the solution?
Are you using the same LOVs in form and interactive report? If so and in the conditional LOV (countries) you refer your form item (ex. PX_REGION) it will not work correctly in IR. Probably IR is showing the returned value because the option "show extra values" is checked.
If this is the case my suggestion is to change your IR and instead of a "Plain Text(based on List of Values)" you make it plain text and change the query to an inline query in IR query to obtain the value you want to show.
If you don't want/like to put your LOV queries in different places I suggest you to use this approach shared by Nick Buytaert
Hope this helps you solve your problem.

Using XPath to locate on a button within a table

I have a table with several columns. The first column contains unique data, the 5th contains three buttons (Edit, Assignments and Delete).
I would like to use an XPath expression to locate on the edit button for one of the rows by indentifying the row using the unique data from column one (think that made sense).
I have built some expressions which will allow me to locate on the first column and edit button independantly as follows:
//td[text()='Managers']
and
tr[2]//button[text()='Edit']
The closest I can get to doing what I want is:
//td[text()='Managers'] | //tr[2]//button[text()='Edit']
...However this will locate on the data/button in column 1 AND 5 at the same time, what I want is just for the button in column 5.
The reason I want to do it this way, is so later I can pass in 'Managers' as a varaible in order to select the row (as its unique and meaningful data), and then press the edit button in a different column on that row.
Hope this makes sense!
Thanks
The question isn't very clear as posted, especially because I can't see any relevant part of the HTML. But if I understand this correctly, you can try to select the row that has Manager in it then get corresponding Edit button like so :
//tr[.//td='Managers']//button[.='Edit']

What's the best way to control a NSTableView's selection using checkboxes?

For some user interfaces it makes sense to have explicit checkboxes to allow users to select the items in a table. What's the best way to accomplish this using cocoa? In other words, how can I link the state of a checkbox in each row to whether or not the row is currently selected?
Tony,
if I get you correctly, you want to add a leading column to your NSTableView so you can select the corresponding column(s), separate from the usual selection of the tableView.
What is your datasource of the table view? A core data stuff or an array/dictionary? if you do not want to modify your data model, you could set up a distinct array (mutable), to keep track of the selection. bind it to the checkbox column (you would want to add as first column) and keep the array in sync with the number of items in the general datasource for the table that displays your valuable data.
You could also enhance your data model with a column "selected", make it BOOL and bind it to the checkboxes. This would also allow you to easily save the last selection to you database or file, whatever you are using.
Can you update your question with some more information on your data model?
sya - living.

How to populate dynamically generated select boxes with ajax

I haven't been able to find a solution for the particular problem I'm having with this project. I need to the following: dynamically add rows to a table that contain two select boxes AND use ajax to auto-populate the select options of the 2nd select box, based on the value of the first select box... in the respective table row (that was dynamically added on the fly by some js).
Still with me?
I can easily populate, dynamically, a select drop-down using ajax/javascript based on the value of the first drop-down, in the first row. I can even populate three or more select boxes in the same row, using ajax/js functions to load each additional select. Yet, this is not my goal.
Here's what I have... My form contains a simple table with 3 columns. First is a checkbox, the second is the "State" select box and the third column is the "City" select box. I have two buttons above the table that allow me to "Add Row" and "Delete Row". Mind you, the first row (which is programmed-in), works perfectly for loading the city names of a state using ajax.
Upon clicking the Add Row button, I'm able to create the second row dynamically, which contains the checkbox, state select and city select fields. The state select is populated based on the innerHTML content of the original column, but the city select is obviously null because it is expecting ajax to fill it. Note: the names and ID names of these fields are iterative... city_id, city_id_1, city_id_2, city_id_3 and so on... so I have that uniqueness to work with.
My problem lies in the fact that when I select a state from the 2nd or 3rd (and so on) rows, only the firstcity select changes. Why? Because the js/ajax processing function says to operate only on the element with name "city_id"!! Which is the name of the city select box in the first row.
I have not (yet) found a way to dynamically pass the name of the element I need updated to the onreadystate ajax function. When I've needed to populate two or three select boxes in a row (same row), I've had to have complementary ajax functions for each drop-down - which are static, mind you... but what if I create the element dynamically?? I can't pre-program that many functions into my page... or must I?
If you have any ideas on how to accomplish this I would be soo damn appreciative!!!
Thanks!
var i=1; // put here the number of the column being added now.
var x=document.getElementById("city_id_"+i);
// populate x

Resources