MRU - tabular presentation - Validation
HelloI have the following problem:
-J' have a tabular presentation
-This form has 4 columns
-the 3rd column has a text field to type a number (it is also declared as 'number' in the table)
-with a MRU certain changes in the 3rd column may be saved
--> The user must type in the quantity of items the found.
My problem:
Some users may type in a white (not 0). -> and if he wants to save it, an error message is: internal error in the routine mru... There is an invalid number.
My question:
How can I validate the 3rd column that the user can type only number and not characters?
Thank you very much
LISA
Lisa,
I had a similar problem, although I used it to validate a deletion: validation in the form of integrity constraint?
You can add validation: pl/sql returns the error message.
and then apex_application contains an array of items in the form of tables... so, you could do something like:
for i in 1..apex_application.g_f02.count loop
--insert logic here
if apex_application.g_f02(i) = 0 then
return 'Please remove any values that are equal to 0';
end if;
end loop;
g_f03 <-- that="" generally="" refers="" to="" the="" 3rd="" column,="" but="" you="" can="" confirm="" by="" inspecting="" the="" element,="" it="" will="" generally="" have="" a="" name="" of="" something="" like:="" f03="">--><--- that="" is="" what="" you="" use="">--->
Digital test: http://www.techonthenet.com/oracle/questions/isnumeric.php Van
Trent
Tags: Database
Similar Questions
-
Hello
I added a tabular presentation on my shape of the APEX. It has two columns, year and budget (to be seized of the user).
In addition, the total budget is spent in the URL and stored in a variable in the form of the APEX.
Now the required validation is the sum of the contribution of the individual budgets of the user for each year must be less than or equal to the budget total (stored in the variable in the form of the APEX.
If this is not the case, an error message should be displayed.
I am new to the development of the APEX and need help on that.
Hi David,
Just right click on the field and click on inspect element, you will get the details of the field.
If your issue is resolved, then close this thread by ticking the correct answer on the post that solved the problem.
That helps other users in the forum to solve their problem, if they have a similar question.
Kind regards
Jitendra
-
Tabular presentation - PK_DISPLAY with name
Hi all
Request Express 4.2.4.00.08I have setup an example on apex.oracle.com.
Workspace: BRENTDEMO
user: demo
PW:demo
On page 2, I have a dynamic action
jQuery.each($('input[name="f03"]'), function() { alert('Name = ' + $(this).val()); var deptno =$(this).closest('tr').children('td[headers="DEPTNO_DISPLAY"]').find('input[name="f02"]').val() alert('deptno = ' + deptno); })
If you use firebug on the page, the DEPTNO_DISPLAY column has no name/id associated so obviously that this action will not warn the correct value. How I would go about assigning an id/name of the DEPTNO_DISPLAY column to retrieve the value. I want to get this value it is because I have a how to remove custom that needs the PK ID. (Not in this application example).
I tried to make the column DEPTNO_DISPLAY a text field (changing names in dynamic action). However, it gives an error message of "current version of the data in the database has changed since the user initiated the update process. version of current line identifier = "6FC404C2EDDB998C91CD7473B6DDA6A5" line application version identifier = "D3B1B18D31905688985A3EA6D5F82FB2" (line 1).
On page 3, I tried to adjust the sql query to read
select "DEPTNO", "DEPTNO" DEPTNO_DISPLAY, "DNAME", "LOC", apex_item.text(10,deptno) as deptno_with_name from "#OWNER#"."DEPT"
With dynamic Action
jQuery.each($('input[name="f03"]'), function() { alert('Name = ' + $(this).val()); var deptno =$(this).closest('tr').children('td[headers="DEPTNO_WITH_NAME"]').find('input[name="f10"]').val() alert('deptno = ' + deptno); });
This allows all work fine, except when a validation fails on the page. If you set Dname null and try to send the page, the following error message is displayed in the form of tables:
error report:
ORA-01403: no data found
ORA-06510: PL/SQL: not supported by the user-defined exception
Now, if you are populating Dname with what either, and you're trying to send the page again, you receive the following error message:
Current version of the data in the database has changed since the user initiated the update process. version of current line identifier = "A884FA378C851786DDFE3A33709CB23C" line application version identifier = "6FC404C2EDDB998C91CD7473B6DDA6A5" (line 2)
I tried searching forums and I believe that page 3 does not work because the mixture of apex_items and a Query (updateable report) "SQL" does not work. Please correct me if that's wrong.
Does anyone have a solution on how I can retrieve the value of DEPTNO? Is the best solution to use a tabular presentation manual? If more information is needed, please let me know.
Thank you
Brett
What about just using the text() td value?
The javascript code for your dynamic action reads as as follows, and the alert shows what is desired:
jQuery.each($('input[name="f03"]'), function() { alert('Name = ' + $(this).val()); var deptno =$(this).closest('tr').children('td[headers="DEPTNO_DISPLAY"]').text(); alert('deptno = ' + deptno); });
-
Look for the lines selected on a tabular presentation
Hello guys and girls,
I have a small problem trying to understand if/how I can check by pressing the "submit" button if there where no records selected in my tabular presentation.
To explain better: I have a selection list in which the user select an employee. On this choice, a tabular presentation appears with the own products for this employee.
The user must check at least one of the lines to go further.
If the user does not select all and always press the "submit" button you should see an error message saying: "there are no selected product."
What I was doing until now (stupid I suppose) was to create a Boolean as validation:
DECLARE
vRow directory;
BEGIN
BECAUSE me in 1... apex_application.g_f01. COUNTY
LOOP
vRow: = apex_application.g_f01 (i);
If vRow is NULL then
Returns false;
on the other
Returns true;
end if;
END LOOP;
END;
But does not work. If I have no active records it will say nothing and let me go. If I check something even record.
Help, please.
There must be something that I have no idea about.
Thank you very much.
Gabriel
Checkboxes only support values for the lines. For example, a loop on the table will always return true since vRow will never be NULL. In addition, a table with a number equal = 0 will not be locked during all, again don't generate no errors.
No loop, just check apex_application.g_f01. COUNTY. If it is 0, no checkboxes have been verified.
-
Apex 4.2
Problems with the validation of the form in a table and not sure what type of validation to use:
My tabular presentation is based on a table SURVEY_JOB_TASKS:
Survey_Job_Task_ID PK
Percentage
Task_Id FK
Bundle_Id FK
I also have a TASK table that contains all the tasks
Task_Id
TaskName
In the validation form, the Survey_Job_task_Id is managed by a trigger. The percentage is an entrable field. The Task_Id is a selection list. The Bundle_Id is passed to the page; It is hidden.
The Task_Id / select list is created with the following query
Select task_name, task_id From TASKS
I want a validation so that a user cannot enter the same task_id. If the selection list should look like:
TaskName Task_Id
Apples 1
2 oranges
Bananas 3
Pears 4
If a user accesses the page, enters an information line and select bananas in the selection list. The user saves / submits and leaves the page. The user returns to the page and they seek to enter another line, if they choose bananas once again, then validation strikes by saying that they cannot enter a double task identifier. There is an already established constriant in place which does not allow to do so. It gives an error ORA, but I wanted to make the error message a bit more friendly user.
I tried some queries of variation of validation with type Exists or not exists but I may be missing it completely.
Any help on this would be greatly appreciated. Thanks in advance
plus extra extra extra... the logic should be a little different because otherwise it will always return false
IF (( APEX_APPLICATION.G_F03(I) = APEX_APPLICATION.G_F03(j)) AND I<>J ) THEN RETURN false; end if;
-
Tabular presentation - Trigger error
Hello
I have a question about the errors of a trigger seizures in a tabular presentation.
The situation:
I use a tabular form for insertion of a row in A table.
The trigger validates the insert and get a custom error [+ Raise_application_error ("-20001, ' INSERT NOT VALID"); +].
As I put "+ error message display location Inline in Notification +" with process Error Message: + #SQLERRM_TEXT #+.
I expect to get "1 error has occurred" with only the message "+ INVALID INSERT +".
But what I see is
INSERT NOT VALID ORA-06512: in "SCHEMA. TABLE_TRIGGER', line 23 ORA-04088: error during execution of trigger.
+' SCHEME. TABLE_TRIGGER' (1st row) +.
So is it possible to change this type of validation to only see that my custom error message?
Thanks in advance!Hi fyaa,.
Please take a look at the example of http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_error.htm#CABDJBGJ of error handling function
Especially the code block-- If an ORA error has been raised, for example a raise_application_error(-20xxx, '...') -- in a table trigger or in a PL/SQL package called by a process and we -- haven't found the error in our lookup table, then we just want to see -- the actual error text and not the full error stack with all the ORA error numbers. if p_error.ora_sqlcode is not null and l_result.message = p_error.message then l_result.message := apex_error.get_first_ora_error_text ( p_error => p_error ); end if;
is what you are looking for. If you are just curious to see the client error message and do not want to have everything, your error management function might look like
create or replace function apex_error_handling_example ( p_error in apex_error.t_error ) return apex_error.t_error_result is l_result apex_error.t_error_result; begin l_result := apex_error.init_error_result ( p_error => p_error ); if not p_error.is_internal_error then -- If an ORA error has been raised, for example a raise_application_error(-20xxx, '...') -- in a table trigger or in a PL/SQL package called by a process and we -- haven't found the error in our lookup table, then we just want to see -- the actual error text and not the full error stack with all the ORA error numbers. if p_error.ora_sqlcode is not null and l_result.message = p_error.message then l_result.message := apex_error.get_first_ora_error_text ( p_error => p_error ); end if; -- If no associated page item/tabular form column has been set, we can use -- apex_error.auto_set_associated_item to automatically guess the affected -- error field by examine the ORA error for constraint names or column names. if l_result.page_item_name is null and l_result.column_alias is null then apex_error.auto_set_associated_item ( p_error => p_error, p_error_result => l_result ); end if; end if; return l_result; end apex_error_handling_example;
Also take a look at my blog announcement at http://www.inside-oracle-apex.com/apex-4-1-error-handling-improvements-part-1/
Concerning
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
Best approach to call a javascript function in a tabular presentation
Hi all
I have a manual tabular presentation. In this form, I have a javascript function that disables hiredate column. The function is called on the deptno column change.
So, if I select the "Research" Department and hire date field is disabled for the selected line.
I need to run this function also executed automatically on page load. So, it checks if all rows with deptno as search and disable hiredate field for these lines.
Please let know us the best approach to achieve this goal, which does not affect the performance that the page has 2000 lines.
function test2 (pThis) {}
var v_item_value = pThis.value;
var v_hiredate_item = $(pThis).closest('tr').find ('td [headers = HIREDATE] input [name = f05]');
var v_hiredate_button = $(pThis).closest('tr').find ('td [headers = HIREDATE] button "");
var currIndex = $('select[name="'+pThis.name+'"]').index (pThis);
var currRow = currIndex + 1;
If (v_item_value == '20') {}
v_hiredate_item.prop ('readOnly', true);
v_hiredate_button.prop ("disabled", true);
document.getElementById("f08_"+[currRow]).disabled = true;
}
else {}
v_hiredate_item.prop ('readOnly', false);
v_hiredate_button.prop ("disabled", false);
document.getElementById("f08_"+[currRow]).disabled = false;
}
}
Thank you
Zkay
Try this:
Suppose that the deptno column name is "f08".
execute a javascript script that triggers the loading of the page
$("[name=f08]').change ();
-
Hi all
I haven't worked much on tabular forms and JS. I'm looking for help in this regard.
I'm working on a tabular presentation. with several editable fields... I need to disable a column (just for this single line), which contains an image, based on a field of LOV (static) list) (Y/N). The image column must be disabled if the value is N.
My SQL for the report is something like this: (will keep things simple)
Select
emp_id,
emp_name,
static_list,
(case when STATIC_LIST = "Y" THEN ' < a title = "Edit SAMPLE TBL" href = "f?) p = & APP_ID.:10: & APP_SESSION.:NO:P10_EMP_ID, P10_EMP_NAME :'|| EMP_ID | «, » || EMP_NAME | "" "> < img src =" "#IMAGE_PREFIX #SAMPLE.gif" border = '0' (> < /a > ' other ' ' end) as disable_col, "
dept_name
of sample_table
I scoured the topics in this forum. Most of them were made using the table ID f_001, f_002.
I tried to follow the same path by inspecting the item but the disable_col does not have any ID. Let's say, f_003 is for the static list and f_004 is assigned to dept_name.
I tried dynamic actions, but it did not work. Read in a topic that dynamic action does not work on tables. So I chose this approach. Is there a simpler way to solve this?
need your help on how to proceed with this scenario. Thank you in advance.
Versions: Apex: 4.2, DB: 11 g
Thank you
Daniel
Hi Daniel_A,
Daniel_A wrote:
I did my job in Page 4.
If the IS_VALID column is select as 'Yes' then the column hyper must be enabled, allowing the user to click on it. If she chose the 'no', then the column Hyper must be disabled for this line.
The initial question about toggle the hyperlink is resolved. Check your App-> Page 4 35160.
This is done with the help of two dynamic actions:
- DA first loading of the Page / after updating of region "tabular":
Event: After refresh
Selection type: region
Region: The other 'tabular '.
Condition: No strings attached
Action: Run the JavaScript Code
Fire on loading the Page: Yes
Code:
$( 'select[name="f08"]' ).each(function() { if ( $(this).val() === "N" ) { $(this).closest("tr").find('td[headers="HYPER"]').find("a").addClass("apex_disabled").unbind("click"); } });
Items concerned: no item affected
- Second DA on the evolution of the selection list:
Event: change
Selection type: jQuery Selector
jQuery Selector: select [name = "f08"]
Condition: No strings attached
Action: Run the JavaScript Code
Fire on loading the Page: No.
Code:
var el = this.triggeringElement; if ( el.value === "N" ) { $(el).closest("tr").find('td[headers="HYPER"]').find("a").addClass("apex_disabled").unbind("click"); } else { $(el).closest("tr").find('td[headers="HYPER"]').find("a").removeClass("apex_disabled").bind("click"); }
Items concerned: no item affected
NOTE: as the original question/topic related to toggle the image link in the column, for the problem with the Page 5, please create a new thread with the details.
Kind regards
Kiran
-
How to access a column value in a Select list in a tabular presentation for each line
Hello
Environment: Using Oracle APEX v4.2.1 on an Oracle 11 g 2 DB
In a tabular presentation using the following example query, i.e.:
select "EMPNO", "EMPNO" EMPNO_DISPLAY, "ENAME", "HIREDATE", "SAL", "DEPTNO", "MY_LOV" from"#OWNER#"."EMP"
I need access to every line of my sub form of table, the EMPNO of this line value, within a list of selection (query based LOV) in the column "MY_LOV."
So, basically, the MY_LOV column in my table presentation, would be a list of selection (query based LOV) where MY_EMPNO =: EMPNO (first column in the select statement above), for each line of the tabular presentation.
With the help of a picture ( Tom's Blog ) and assuming 'Deptno' column here is actually my new column, i.e. "MY_LOV, I want to know how this list of selection based on lov query would be able to access each EMPNO down in the form of tables, i.e. 7839, 7698, 7782 etc.?
Any help would be appreciated.
Thank you.
Tony.
Hi Tony,.
Take a look at the API APEX_ITEM for LOV
http://docs.Oracle.com/CD/E37097_01/doc/doc.42/e35127/apex_item.htm#AEAPI208
Kind regards
Brad
-
I need to rename a column for a tabular presentation
How to rename a column, I created for a tabular presentation?
I added a new column to a tabular presentation (using 'add a new link in the column') and he gave me a name of column, called "link column. I tried to change, but it does not - note: I can't change a sql column does not exist outside Apex - I created it for the display of a calculation.
I don't know that it can be done as I did before.
Does not change the name of so cannot reference in my calculation
Well, I found a way to do it anyway. This should be changed in the definition of region > source.
-
Is it possible to create an edit on a tabular presentation on Apex option?
Is it possible to create an edit as on an interactive report option. , But on a tabular presentation I want to make a link to a form for a selection of special line, which will have also one tabular presentation for another table.
found the way to do even when trying to do something else. pretty lucky.
-
Dynamically set read-only columns in the tabular presentation at record levels
Hello
Is it possible to activate and deactivate fields at the level of the line in a tabular presentation... I use OFA to create a page that should give the possibility to activate and deactivate certain fields in the table on the fly...
Here's the requirement:
examples of data
Item_code | Review | Point Attrib1 | Article attrib2 | Article attrib3 | Columna | ColumnB
1.234 100 A B _ A _
1.235 100 B _ B _ A
fields point attrib3 and Columnb should be read-only if the value of attrib1 point is A
Even if point value attrib1 is B columna and attrib2 of the element must be read-only...
I have PPR on item_attrb1 to manage the change of value in the attrib1 element, but I'm not able to make fields read only at the level of the line... Please help me if someone has work around this
Is this possible?
Thank you
Dilip
Hello..
It is possible. Made myself.
You must use SPEL for this.
Steps to follow:
1. the Caisse one type of transitional say as Boolean column ReadOnly
2 set the Readonly property for that column as ReadOnly
(Syntax FRO SPEL-> {oa. VO. ReadOnly})
3 al ' PPR after checking the status, the ReadOnly Anaïs value accordingly.
.
You can get the idea here.
https://blogs.Oracle.com/manojmadhusoodanan/entry/hiding_an_item_conditionally_through
-
What should I do for default values when a new line is created in a tabular presentation?
Hello all-
I have a tabular presentation that requires a few columns to be entered by the user when he or she creates a new line, but other fields in the column can just default to certain values. How to set these values by default so that the user doesn't have to be bothered with enter no data except those which MUST be entered?
An example:
Form1
CITY OF COUNTRIES IN THE REGION
APAC JAPAN TOKYO
SIDNEY AUSTRALIA, APAC
APAC KOREA-SEOUL
REGION is almost always APAC, then I want that by default. The user can always adjust if necessary, but I want to put it to the user, only to save having to enter a value. When the user clicks on the button to add a line, that I want to load this value immediately and leave the two empty fields so the user can enter what they want.
Thank you!
John
Hello
Go change this column.
Under attributes of tabular form, you will find options to set the default value
Kind regards
Jari -
Problem with BLOB in a tabular presentation manual
Hi all
I created a manual tabular presentation. One of the elements is a BLOB type and shown as file browse on the form.
I'm going to show a download link when the blob column is not null.
I searched the forum and tried many ways, but nothing has worked so far. The form is available at apex.oracle.com.
Here are the credentials to connect:
Workspace: bobforum
User: forum
Password: abc123
Application: 39196
Page: 1
http://Apex.Oracle.com/pls/Apex/f?p=39196:1
I would be grateful if someone can help on this please.
Thank you
Zkay
Hello
Check your sample now.
It should work, when inserting blob column files
Kind regards
Jari -
Hello world
I have a tabular presentation based on a collection. The column c050 (f30 cards) will be either Y/N. If it is there, then I would enable the column c024 (f24 cards) (which is be based on lov radio button). If the value of c050 = N, then disable c024. There are potentially as many lines, and the c024 element would only be enable / disabled for the specific line. So if line 1 is c050 = Y line 2 is C050 = N then rank 1 c024 is activated and 2nd c024 is disabled. Hope that makes sense.
I created a dynamic action called turn HMS fields.
event = CHANGE
selection type = jquery selector
jQuery selector = input [name = "f30"]
the condition EQUAL to
value Y
true action1 - enable, picker jquery, input [name = "f24"]
real action 2 - alert, you added a sort of HMS. There may be additional data to enter. Thank you
fake Action1 - disable jquery selector, input [name = "f24"]
false action2 - alert, no worries of hms.
Alerts in both cases show correctly... but nothing seems to happen to f24... What am I doing wrong?
Thank you
AGH! This is the first time you mention, that there is a radio button! That changes a lot! As you can see, the format is different (f24_0001_0001) than what we discussed (f24_0001).
Radio buttons have their own quirks. My bad, I should have asked what you had. But since you said your selectors original input were I just thought they are fields of text or something like that.
How replace you a right drop-down list so that you can see all the work? And understand it fully.
Then you can work on the radio button option.
If you don't get there... I will ask you to install an example in apex.oracle.com and give me credentials to sign in and have a look.
I could re - try the js on my side with a radio, but it will take time.
So, just to be clear... f30 is a drop down and f24 is a radio?
See this line:
$x_disableItem ("f24_" + row, true);
Will NEVER find the radio buttons because it lacks the 3rd 0001 and 0002 (how many options do you have?)
So maybe try you like this:
$x_disableItem ("f24_" + line + '_0001', true);
$x_disableItem ("f24_" + line + "_0002", true);
... keep for options...
Do the same for the fake, of course.
But I think that this needs a better approach if you have radio buttons. I just need to get out.
OK, go try things...
Thank you
-Jorge
Maybe you are looking for
-
Windows Server 2012R2 replication errors
Hi, just work through exams 2012R2 if it is in a lab environment, but would like some help on this one that I had trouble finding a solution on this one. Just to give you a little history, until recently, I had a single DC 2012R2 environment on my la
-
You can use a cd/dvd if the door is broken
original title: door cd/dvd I have a Dell Inspiron 530 desktop computer. Can I use a cd/dvd if my door is broken?
-
Error message appears after each start up toward the top of my computer.
Error loading: C:\Users\Michelle\AppData\Roaming\mousel.dllThe specified module could not be found
-
Conductor of telepresence + server without encryption?
I'm starting to get a little piece in our test environent with the free driver EGGS and telepresence server. By reading the conductor 2.2 deployment guide, he refers to encryption keys + SIP TLS as 'necessary' a lot. As our test environment does not
-
Premiere Pro can not access your file preference.
Hello. I just installed Premiere Pro 2015.3 and am getting an error that I was getting with the previous version. When I start the program I get this:"Unable to load third party audio plugins Premiere Pro can't access your Preferences file. Your user