Thread: Tabular Form: Fields read only unless record is new


Permlink Replies: 5 - Pages: 1 - Last Post: Apr 1, 2008 2:32 PM Last Post By: David Pulliam
David Pulliam

Posts: 455
Registered: 06/14/06
Tabular Form: Fields read only unless record is new
Posted: Apr 1, 2008 7:49 AM
Click to report abuse...   Click to reply to this thread Reply
In my case I basically want to disable the update ability of a tabular form. I would like for all rows to show up like a normal non-updatable report until someone clicks add. At that point then I would like the new row to behave like a tabular form. I want to keep the ease of adding rows and deleting rows but I want it locked down so that once a row is added it cannot be edited.

Any Thoughts?
Luis Cabral

Posts: 578
Registered: 12/08/05
Re: Tabular Form: Fields read only unless record is new
Posted: Apr 1, 2008 8:25 AM   in response to: David Pulliam in response to: David Pulliam
Click to report abuse...   Click to reply to this thread Reply
Hi

There is not declarative way to do it, though I think that can be done using javascript (e.g. on the onLoad event, disable all fields in the tabular form except if they are in a new row).

However, I don't think this solution looks good (all fields grayed out), I think it is more elegant and easier to maintain to use a separate page to add new records. So you use the tabular form only to query and delete rows.

Not exactly what you asked for, but just a suggestion... I hope it helps.

Luis
Denes Kubicek

Posts: 4,839
Registered: 06/22/00
Re: Tabular Form: Fields read only unless record is new
Posted: Apr 1, 2008 10:25 AM   in response to: David Pulliam in response to: David Pulliam
Click to report abuse...   Click to reply to this thread Reply
David,

This can be done by creating a tabular form manually. See this example:

http://htmldb.oracle.com/pls/otn/f?p=31517:170

Unfortunately, the example in how-to's is outdated and not correct.

Denes Kubicek

http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://htmldb.oracle.com/pls/otn/f?p=31517:1

David Pulliam

Posts: 455
Registered: 06/14/06
Re: Tabular Form: Fields read only unless record is new
Posted: Apr 1, 2008 1:41 PM   in response to: Denes Kubicek in response to: Denes Kubicek
Click to report abuse...   Click to reply to this thread Reply
Just an observation from looking at this...it looks like it might not be too big a leap to select only text in the first part of the report then in the select from dual portion use actual fields. Would this actually break the tabular form if in the static part of the query (what runs before add row is requested) were standard report columns or is there an APEX functional requirement that all fields in the report must actually be apex_item fields?
Denes Kubicek

Posts: 4,839
Registered: 06/22/00
Re: Tabular Form: Fields read only unless record is new
Posted: Apr 1, 2008 2:21 PM   in response to: David Pulliam in response to: David Pulliam
Click to report abuse...   Click to reply to this thread Reply
David,

I think for adding rows you need to have a region of type SQL Query (updatable report). This
example is showing how to do the same with a "normal" report (if this was the answer to
your question).

Denes Kubicek

http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://htmldb.oracle.com/pls/otn/f?p=31517:1

David Pulliam

Posts: 455
Registered: 06/14/06
Re: Tabular Form: Fields read only unless record is new
Posted: Apr 1, 2008 2:32 PM   in response to: Denes Kubicek in response to: Denes Kubicek
Click to report abuse...   Click to reply to this thread Reply
ok. I just noticed in the example most of the report was all just disabled fields. I had thought from looking at it that all of your database results were in updateable fields just disabled. I will look at it closer though and see.
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums