1 Reply Latest reply: Jun 14, 2013 6:15 PM by Tyson Jouglet RSS

    LOV based items - Other value


      APEX 4.2.2


      In a survey-type application, where the page items are mostly LOV-based, the item has a pre-defined list of choices (e.g. Chocolate, Vanilla, Strawberry). There is a need to allow for a Other choice with a text field next to it to specify the write-in.  The text field is set to Source=Always/Always Null and there iis a after-submit computation to set the LOV page item to the text field only if the text field is not null. The LOV item is defined as Allow Extra Values=Yes so the APEX engine takes care of merging the extra value with the defined LOV and showing it as the current value for the item.


      This seems to work well. I was curious to know if there is a better way to handle this sort of use case. Ideas welcome.



        • 1. Re: LOV based items - Other value
          Tyson Jouglet

          Hey Vanj,


          Another way I have seen this situation handled is to have an autocomplete item which you can freely type into which will save the id of the selection into a hidden item if it already exists in the db. Come submit time, if the hidden item id is null and the autocomplete has a value then it is a new item and you can handle it accordingly.


          If you want to spice up the application a little bit, you can have the style of the autocomplete change based on if the item entered exists or not. This will help if you fatfinger "Strawbrerry" and you know that value should exist. The drawback to this method is that it is likely that you will encounter more fatfingered entries that are not truly "others" that were never corrected.


          Good Luck,