Home » Developer & Programmer » Forms » Make field non editable
Make field non editable [message #468347] Thu, 29 July 2010 16:23 Go to next message
coolguy01
Messages: 64
Registered: August 2006
Member
HI,
I have a field on the form which is a database field and the value is populated by a LOV. The user should not be able to edit the value selected or enter his own values in the field. Basically the field should only be populated by the lov and should not be editable.

I tried using the SET_ITEM_PROPERTY('XX.XX', UPDATE_ALLOWED, PROPERTY_FALSE); but this only disable update against existing value. If a user selects a new value from LOV that can be edited. Let me know how to solve this
Re: Make field non editable [message #468351 is a reply to message #468347] Thu, 29 July 2010 18:05 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why not just set validate from list to Yes?
Re: Make field non editable [message #468406 is a reply to message #468351] Fri, 30 July 2010 00:50 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Another step is to disable use of a LoV (KEY-LISTVAL) if the item already has a value.

However, that's stupid - users won't have a chance to fix errors they (accidentally) make. All values from the LoV should be allowed, and that's what Cookiemonster said.
Re: Make field non editable [message #468514 is a reply to message #468406] Fri, 30 July 2010 07:32 Go to previous messageGo to next message
Kevin58
Messages: 79
Registered: January 2009
Member
Why not just change the item to a list item?
Populate the list at the WNFI trigger. Smile
Re: Make field non editable [message #468515 is a reply to message #468514] Fri, 30 July 2010 07:59 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Depends how long the list is, if it is long an LOV is easier.
Re: Make field non editable [message #468516 is a reply to message #468347] Fri, 30 July 2010 08:26 Go to previous messageGo to next message
Kevin58
Messages: 79
Registered: January 2009
Member
Only offering a suggestion. It is up to the designer to filter a LOV if it becomes too long. My suggestion solves both issues of valid entries and not letting the user enter "creative" data. Smile
Re: Make field non editable [message #468519 is a reply to message #468516] Fri, 30 July 2010 08:54 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
So does validate from list.
I'm not saying your wrong necesarily, guess it depends on your definition of long, I'm not a big fan of list items where the item count goes into double digits.
Re: Make field non editable [message #468523 is a reply to message #468519] Fri, 30 July 2010 09:21 Go to previous messageGo to next message
Kevin58
Messages: 79
Registered: January 2009
Member
Cool. I think I would like to explore your suggestion of the validate from list. Sounds like a good solution also!
Thanks Smile
Re: Make field non editable [message #468525 is a reply to message #468523] Fri, 30 July 2010 09:30 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Some thing else to bare in mind - if the list isn't static LOV's are a lot better than list items.

Reason being that if you try to query a record where the current value of the column used for the list item doesn't match any of the values the list item currently allows, then oracle forms silently rejects the record. It doesn't appear and forms doesn't tell you it's skipped it. That's caused more than a few panics over the years - "Where's my data gone!!!".

You can get around that by setting the "Mapping of Other Values" property but I very rarely used that since you can't normally say it's ok to treat some value as some other value.

You can get the same issue with radio groups as well.
Previous Topic: why the commit is not getting effect?
Next Topic: storing outlook express mail into oracle database
Goto Forum:
  


Current Time: Thu Sep 19 12:58:30 CDT 2024