Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Tabular form error (apex 4.0.2)
Tabular form error [message #538317] Thu, 05 January 2012 04:22 Go to next message
Messages: 104
Registered: December 2011
Senior Member
Hello Smile

I'm getting an error on my tabular form, it is layed out as so:
 [ ]  Title      Lastname   Firstname   Company   Email
 [ ]  Mr/Ms/Mrs  [       ]  [        ]  [      ]  [        ]

-first column is a checkbox
-'title' is a select list default value "Mr"
-the rest are normal text boxes
-Validation:Lastname cannot be null
-validation Firstname cannot be null

Now the error occurs in only 1 situation:When you click the 'add row' button, but don't edit any boxes before you click 'save'.
If you do that you get an error saying cannot enter NULL into LASTNAME (which is because the database its going into doesn't allow a null value for that column)
If you change anything the validations stop you from advancing if lastname or firstname is null...so why don't the validations kick in until you change something? and why does the MRU process not ignore the empty row like the validations seem to?
It seems strange that they don't both act the same towards it...

My assumption is that it has something to do with the select list having a default value because I have several other tabular forms in my app and another has 4 select lists and it has the same error, but the ones that don't have a select list have no error...

So yeh any help/thoughts appreciated Smile

UPDATE: I've been fiddling round with the form and I have found that the select lists didn't actually have default values as such...they just weren't displaying the null value. So I tried 2 things
a)I changed it so that it does display the null value (not ideal but it worked)
b)I actually set a default value, which worked for static LOVs but I can't seem to set the default for a dynamic LOV...It displays the visit type (private or professional) and returns the ID ... So I tried setting the default vale to Private and to the corresponding Id but neither worked...
So I guess is there a way to do that?

[Updated on: Thu, 05 January 2012 05:27]

Report message to a moderator

Re: Tabular form error [message #538354 is a reply to message #538317] Thu, 05 January 2012 08:22 Go to previous message
Messages: 104
Registered: December 2011
Senior Member
Ok it took me a while but I've sorted it out.
What I've done is made items on the page with the tabular form in it for each of the columns with a select list with a dynamic LOV, where the source is an SQL query returning the ID I want as the default value. Then the column is set to have the default value of that item
I don't know if theres an easier way of doing this...but it works fine Smile
Previous Topic: Setting value of an item depending on the value of another item
Next Topic: Delete button on tabular form not working as it should
Goto Forum:

Current Time: Thu Jun 29 05:57:38 CDT 2017

Total time taken to generate the page: 0.09760 seconds