Conditional read only radiogroup item losing value when saving

Apex 3.2
I have a radiogroup item that is set to read only after it's populated and the user is not in the ADMIN Role. When non ADMIN users edit the page, it shows the value and they cannot change it, but if they save the page, it loses the value. Works fine if the user has ADMIN role.
This is the Pl/SQL function in the "Item is read only when" section
begin
if :p3_event_detail_id is not null and :p3_notification_period_id != -1 and not apex_util.public_check_authorization('ADMIN') then
return true;
else
return false;
end if;
end;
There is also a Not Null validation on this radiogroup item.
I changed the item type to select list and it works fine, but user like the radiogroup button.
Any ideas?

It's using a shared component LOV cleverly called LOV_YN which consists of a static LOV with
1 Display=Yes, Return=Y
2 Display=No, Return=N
The settings in the LOV section on the item iteself:
Named LOV: LOV_YN
Display Extra values: No Dynamic translation: Not translated
Number of columns: 2 Display null: No
Null display value is blank as is null return value
Item was setup as a radio group and was only converted over to a select list to work around this issue. Let me know what else you need and thanks again.
Rgds/Mark M.

Similar Messages

  • Read-only radio group losing value on validation error

    It took quite a while to track this down, but I think I've got it narrowed down properly. I have an APEX form for updating a record in a databse table with a radio group which is conditionally read-only. If that radio group has a value AND is read-only, when the form is submitted and hits a validation error, the value of the radio group is lost.
    For example, the radio group SUBMITTED_FOR_APPROVAL is set to Y and is read-only for a given user. That user then changes something else on the form and submits it. However, the form now hits a validation error for some field. When the form reloads with the validation error displayed, all the fields are restored except the read-only radio group which is now blank. If a select list is used with the identical read-only condition, it works fine. Likewise, if a radio group is used, but the read-only condition is removed, it works fine. It is only when it is a radio group and it is read-only, that the value does not appear to be submitted to the session with all the form values whent he form is submitted.
    Is this a bug or am I simply missing something?
    Apex 3.1.2
    Rgds/Mark M.

    It's using a shared component LOV cleverly called LOV_YN which consists of a static LOV with
    1 Display=Yes, Return=Y
    2 Display=No, Return=N
    The settings in the LOV section on the item iteself:
    Named LOV: LOV_YN
    Display Extra values: No Dynamic translation: Not translated
    Number of columns: 2 Display null: No
    Null display value is blank as is null return value
    Item was setup as a radio group and was only converted over to a select list to work around this issue. Let me know what else you need and thanks again.
    Rgds/Mark M.

  • How stop File Browse item losing value when a validation occurs

    G'Day Apex gurus,
    I am using Apex 3.1.0 and Firefox in an XP PC and have a file browse page item on my page but whenever i experience a validation error on the page, the value entered into this box is lost.
    Every other field on the page retains its entered value, but the file browser item loses its value.
    This is frustrating because the user will have to reselect the file.
    Is there a way to retain the value upon a validation error?
    I appreciate any assistance with this
    Carlos

    Hey creyes,
    I don't think this is possible.
    Because of security implications (scripts setting the value, and then attempting to retrieve files of your computer) the value of the fileupload form field is read only. Therefore you cannot set, or reset the value.
    A solution could be that you make validations with javascript if possible (but keep validations on the database side also!).
    Kind regards,
    Oli

  • Read only text Items uses the maximum width

    Folks,
    I have a form with 3 regions and each region has 6 or more text items each with a different width (40, 30 24, 2...). I am using a Read Only Condition Type on all these items to disable them. I am setting the background color as bgcolor="#DCDCDC" in the Read Only Element Table Cell Attributes.
    All my elements are disabled (Gray color) but with the maximum width of 40 bytes. I don't want a 2 byte text item 40 bytes long and grayed out. How can I set a specific width for individual items in Read only Condition? Please help
    Thanks
    Raje.

    Try this alternative by disabling the HTML Form Item at the required process point.
    I added this JavaScript to the HTML Header of the page which will allow me to disable the required item, plus set its background and color:-
    <script language="JavaScript1.1" type="text/javascript">
        function disableFormItem(p_item, p_background, p_color){
                        disItem = document.getElementById(p_item);
                        disItem.style.background = p_background;
                        disItem.disabled = true;
                        disItem.style.color = p_color;
    </script>In the Region Footer of the Region where my items are located I added this JavaScript code:-
    <script language="JavaScript" type="text/javascript">
       ** Only disable the required Form Items if the Primary Key value is present,
       ** in this case it is P12_UEI. (Won't be present for new records as populated
       ** by on-insert db trigger and sequence.)
       if (html_GetElement('P12_UEI').value > 0)
          disableFormItem('P12_URESI', 'lightyellow', 'black');
          disableFormItem('P12_UZI', 'lightgray', 'black');
          disableFormItem('P12_UBI', 'lightgray', 'black');
    </script> The resulting page is a lot better looking than using the APEX read only text item.
    Regards,
    Phil

  • Implement Conditional Read-Only of Column Across Two Tables

    Hello,
    I would like to implement a "conditional read-only" mechanism on a column in a table with two tables in total being involved in this situation.
    I have a demo/proof of concept of this and things are working as expected in the tests I have performed; however, I would like any input as to whether there is a better way, etc.
    Here's a contrived demo but which illustrates the key ingredients nevertheless. Oracle version 10.2.0.4 64-bit on Windows Server 2008 Release 2 64-bit.
    - Table DDL and small sample data
    create table band(
      band_id   number primary key,
      band_name varchar2(20),
      status    varchar2(20)
    create table band_member(
      band_id references band,
      member_name varchar2(20)
    insert into band values(3, 'The Rutles', 'prefab4');
    insert into band values(4, 'The Beatles', 'established');
    commit;
    insert into band_member values(3, 'Ron Nasty');
    insert into band_member values(3, 'Dirk McQuickly');
    insert into band_member values(3, 'Stig O''Hara');
    insert into band_member values(3, 'Barrington Womble');
    commit;
    insert into band_member values(4, 'John Lennon');
    insert into band_member values(4, 'Paul McCartney');
    insert into band_member values(4, 'George Harrison');
    insert into band_member values(4, 'Ringo Starr');
    commit;- The rules regarding the conditional read-only goal
    1. Not permitted to update band.band_name when band.status='prefab4'
    2. Not permitted to insert/update/delete any rows in band_member when the parent row has band.status='prefab4'
    - Triggers used to implement the goal (current solution)
    create or replace trigger t1
    before update of band_name on band
    for each row
    when (old.status = 'prefab4' or new.status = 'prefab4')
    begin
      raise_application_error(-20010,
        'can not update band_name when status=''prefab4''');
    end;
    create or replace trigger t2
    before insert or update or delete on band_member
    for each row
    declare
      l_status band.status%type;
      l_band_id band_member.band_id%type;
      cursor l_cursor (p_band_id number) is
      select status from band
      where band_id = p_band_id
      for update;
    begin
      if updating or inserting then
        l_band_id := :new.band_id;
      else
        l_band_id := :old.band_id;
      end if;
      open l_cursor(l_band_id);
      fetch l_cursor into l_status;
      close l_cursor;
      if l_status = 'prefab4' then
        raise_application_error(-20011,
          'can not update child when parent status=''prefab4''');
      end if;
    end;
    /- Quick sample test for each condition
    update band
    set    band_name = 'THE RUTLES'
    where  band_id = 3;
    update band
    ERROR at line 1:
    ORA-20010: can not update band_name when status='prefab4'
    ORA-06512: at "DEMO.T1", line 2
    ORA-04088: error during execution of trigger 'DEMO.T1'
    update band_member
    set    member_name = 'RON NASTY'
    where  member_name = 'Ron Nasty';
    update band_member
    ERROR at line 1:
    ORA-20011: can not update child when parent status='prefab4'
    ORA-06512: at "DEMO.T2", line 18
    ORA-04088: error during execution of trigger 'DEMO.T2'As I say, whilst my simple tests look to show the correct results, I'm left wondering if there might be a better way to implement said functionality.
    I've attempted to provide the required information, but if I've managed to omit anything, please let me know.
    Cheers,
    Chalfont

    Hi, Chalfont,
    user13146957 wrote:
    I went the cursor route to add the "for update" clause to force serialisation on the row - i.e. the idea was to avoid the case where another session might have wanted to update the status an instant after my fetch but before the remainder of the code completed. Does that make sense?No not really. The trigger on band prevents anyone from ever changing status from 'prefab4' to anything else (or vice-versa).
    Even aside from that, you're putting in some effor to prevent something that will be allowed a split second later (or maybe the other way around). What's so significant about that split second?
    I've been thinking of other ideas rather than the trigger approach, but have come up empty, as it were, thus far. I'm open to using other approaches and making some schema changes is not off the table either.FGA (Fine Grained Access), or its older sibling VPD (Virtual Private Database) can also do what you want, but, instead of raising an error, they just ignore the illegal action. This may be an advantage or a disadvantage, depending on your requirements.
    Another approach is for the owner of the table not to grant INSERT, UPDATE or DELETE privileges to anyone: all DML must be done through a procedure (or procedures) owned by the table owner, who grants EXECUTE privileges instead of the other privileges.

  • Is there a way to obtain the text item's value when the mouse pointer at?

    Hi,
    Is there a way to obtain the text item's value when the mouse pointer at? Mouse pointer may be located somewhere out of current record and even out of current block.

    There is a when-mouse-over trigger and that works fine in client-server mode for Forms 5/6/6i, but that is less indicated when deployed using Application Server.
    In that trigger you may write whatever code is necessary, restricted package procedures.
    Still, I think, for your case, if you do not have to deal with a multi-record block, you should use the HINT property for that item and set_item_property with the HINT argument for that item in order to set the hint to the item's value - this should set_item_property should be called on the when-new-record-instance .

  • Field Read Only based on a value of another field

    Hello,
    In our project we´d like to have Field A made Read Only based on a value of Field B. Otherwise it should be R/W.
    Would this be possible in OnDemand ?
    Txs. a lot for any help.
    Antonio

    If your field is the key field that helps in dynamic layout then this is possible. If not try doing a validation on the field.

  • I am unable to purchase anything because " I do not have the correct privelages".But when I check in properties and the security tab, everything seem to be checked. Also the read only box is checked and when I uncheck it seems ok but it has not unchecked

    I am unable to purchase anything because " I do not have the correct privelages".But when I check in properties and the security tab, everything seems to be checked.
    Also the read only box is checked and when I uncheck it seems ok but if I check again it is still checked.

    Hello,
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • Read-only radiogroup with default doesn't save state in 2.0

    Hi,
    I upgraded to HTMLDB 2.0 and noticed a change in behavior. Namely, when I have a read-only radio group with a default value and a not-null validation, the validation claims fails although a radio button is selected from the disabled radio group.
    Here's a small app I generated to demonstrate the issue:
    http://htmldb.oracle.com/pls/otn/f?p=34464
    Go there and try to create a new EMP.
    The only things added after the generation are:
    1. Not-null validations on several of the fields
    2. Changed MGR to a "Select List"
    3. Changed DEPTNO to a radio group with these properties:
    a) default value type: static; default value: 20
    b) read-only when: P2_EMPNO is Null
    This used to work fine in 1.6 - namely, the default value got it to the session state and consequently the validation succeeded and the new record was created with the default value.
    It also works fine if the Radio Group is not read-only.
    I was able to fix the problem by adding a calculation to the P2_DEPTNO item to set the default value there. This of course does not show the default on the form for the new record, so I had to keep the default on the item level as well - which is a potential source of bugs when those two defaults somehow get different values (e.g., when I change only one of them and forget about the other) - the user will see one thing displayed while another will be saved. So any solutions involving keeping the default value on only one place AND visible to the end user when creating new records are welcome.
    I haven't had time yet to test with other item types - maybe next week...
    Have a nice weekend!
    Flado

    Scott,
    Yes, in 1.6 this used to work fine - the radiogroup was displayed as disabled, and the default value was selected, and the not-null validation succeeded, and all I did was set the default value of the radiogroup. I have no 1.6 environment anymore to test it, but I'm sure it was working, because after I upgraded to 2.0, it stopped working and I got a bug report from a user very, very quickly :-(.
    By "adding a calculation to the P2_DEPTNO item" I mean "adding a computation of the P2_DEPTNO item to the page". Sorry about me being lazy here. It was (still is, in my production application) a conditional after-submit computation (if <primary key item> is null, set <radiogroup item> to <default value>)
    Thank you for the suggestion. I implemented it in the demo app. What I did was:
    1. remove the default value from P2_DEPTNO
    2. Add an unconditional after-header computation that assigns P2_DEPTNO with the static value 20
    I am able to create new EMPs now, but nothing is selected in the disabled radiogroup on the create page, although the value 20 is saved in the session state before the items are rendered, according to the debug info (you can try it out and see).
    To recap, I still need to keep the default value in two places: default of the radiogroup (to get it displayed on the create form), and in a computation (to set the session state).
    Cheers,
    Flado

  • Problem with HTML in a read only textarea item

    I'm working on a messaging system for our site. For the body of the message, we use a standard textarea item. However, if we come to the messaging page from a certain page in our system, then we pre-load the textarea item, and make it read only. The only problem with this is that there are HTML tags in the body that we try to pre-load. This is causing problems because they aren't being interpreted as tags, but are being displayed as text. If I make the textarea editable, then everything looks fine, it's just when I set the area to be read only that it doesn't work. Any thoughts on how to fix this? Thanks!

    Not always. A user is allowed to edit that area in most circumstances except for when the user arrives at the page coming from 1 page in particular. In this case, then the field is read-only. At all other times though, it is editable.
    As a workaround, whenever I know I'm coming from this page, I set a variable, and if the variable is set, then I use a Display Only item and then hide the Textarea. If the variable is not set, then I hide my Display Only item and show the Textarea. Not very elegant, but it works.

  • How to create read only Apex items

    Hi,
    I'm creating a report using Apex items to display the result values inside editable text boxes. They are then referred by using APEX_APPLICATION.G_F02 etc.
    My requirement is to make the last row of this report (the values for "Total") as non editable or read only. Can anybody help me with the code that i would need to add in the query? The query goes something like this:
    apex_item.text(7, TO_CHAR(nvl(year_4,0),'999,999,999'), 12, 12, 'style="text-align:right;font-weight:bold"',ROWNUM) "YEAR_4", ..

    Surprising. I would have expected there to be a CSS style to disable a form item.
    Depending on your reasons for wanting to use APEX_ITEM, you could:
    Select your required value as part of the query (without using apex_item.)
    Visit your report attributes, then the attributes for your specific column.
    Change the column type to text field.
    Add readonly=true into the item attributes.
    Rgds
    Ben

  • Dependent Values read only or all possible values

    Hello
    I have read the following instructions.
    [How to Configure Predefined Properties with Dependent Values (NW7.0)]|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30b1ec90-0201-0010-6192-d3de721f8ae4?quicklink=index&overridelayout=true]
    I need this scenario in the Portal search.
    So my question is:
    Is it possible, if Country is empty, that the field City is read only.
    In the How to guide you can see , if no city is selected the property city is a text field(not Dropdown) and you can enter a sting.
    Or it is possible, if no country is selected that the field city shows all possible cities, not restricted by countries.
    For example no country is selected and the field city shows all cities.
    or no country is selected and the field city is read only.
    The html code of dropdown list country is
    <option value="&lt;empty&gt;"><option value="Germany">Germany<option value="France">France
    Value of no selection
    &lt;empty&gt = <empty>
    If no country is selected the selected value is &lt;empty&gt or <empty>.
    I tried this:
    "dependon=Country,*=allcities,Germany=GermanyCity,France=FrenchCity" and so on.
    "dependon=Country,<empty>=allcities,Germany=GermanyCity,France=FrenchCity" and so on.
    "dependon=Country,&lt;empty&gt=allcities,Germany=GermanyCity,France=FrenchCity" and so on.
    without success
    Can some one help?
    Edited by: Dirk Wiegele on Jan 23, 2011 12:21 PM
    Edited by: Dirk Wiegele on Jan 23, 2011 12:22 PM

    Hi
    Yes, it is possible to generate an excel file in SAP. You can use any of the following FM's for the same:
    1. EXCEL_OLE_STANDARD_DAT
    2. GUI_DOWNLOAD
    3. XXL_FULL_API
    Hope it will help.
    Regards,
    Nikita

  • "The selected cells are read-only" error on Custom Field when trying to insert in Datasheet mode

    I have a custom field that works completely fine. Yesterday our QA team found out that when trying to insert in Datasheet format, the error "The selected cells are read-only" was thrown. Any ideas? I tried passing the following property to my fldtypes_field.xml file:
        <Field Name="ReadOnly">FALSE</Field>
    No luck.Victor Palma

    Unfortunately it did not work. I also developed the code and access the field and checked its property called "ReadOnlyField"  which is already set to false.
    Below is the xml that i am using. Can you please share the xml that you had used?
    <?xml version="1.0" encoding="utf-8"?>
    <FieldTypes>
      <FieldType>
        <Field Name="TypeName">MyCustomField</Field>
        <Field Name="ParentType">Text</Field>
        <Field Name="TypeDisplayName"> My Custom Field</Field>
        <Field Name="TypeShortDescription"> My Custom Field</Field>
        <Field Name="AllowBaseTypeRendering">True</Field>
        <Field Name="ReadOnlyField">False</Field>
        <Field Name="UserCreatable">TRUE</Field>
        <Field Name="ShowInListCreate">TRUE</Field>
        <Field Name="ShowInSurveyCreate">TRUE</Field>
        <Field Name="ShowInDocumentLibraryCreate">TRUE</Field>
        <Field Name="ShowInColumnTemplateCreate">TRUE</Field>
        <Field Name="FieldTypeClass">My Assembly Information goes here</Field>
      </FieldType>
    </FieldTypes>

  • How to make a field conditional Read Only

    Hi,
    There is a "Close date" field. I need to check if the date today, and the "Close date" falls in the same quarter. If it does, then, a particular field has to be made editable otherwise not.
    (Better, if it could be done by using business component user properties)

    Hi,
    Surely i can give you details.
    The LOV Type is - QTR_DET which has the following values -
    1.Description - 04/03/2009 & Display Value - "Q2-2009"
    2.Description - 07/05/2009 & Display Value - "Q3-2009"
    3.Description - 10/02/2009 & Display Value - "Q4-2009"
    These 4 quarter values are updated for every year
    Hence, I need to compare values, on the basis of these values.
    The Quarter for the Close Date has to be compared to Quarter which includes "Today"
    As far as i know, JulianQuarter divides the year into exactly 4 parts, but as you can see, the values are not same as the quarter values, i need to use.
    It would be surely great if you could help me solve this, as i am new to siebel.
    I was trying to try with Lookup as well.
    (The Following way, i was trying, but did not work
    -Field1 is a calculated field - Lookup(QTR_DET,[Close Date])
    -Field2 is a calculated field - Lookup(QTR_DET,Today())
    -InPresentQuarter is a calculated field - IIF((Field1 = Field2), "N", "Y")
    And this was further used for the Field Read Only Field: [Field Name] to make it read only)
    Also please let me know, if this is the right way.

  • Is it possible to mark as read only an item instance?

    Hi friends,
    in Apps R12,.. imagine you have a multirecord page.... (10 rows i.e.)
    I would want to mark as read only the first item (or the item that would be not null) of the first row as read only... but.. the others items in the same column would be not readonly... (really they are the same "item", but not the same "Instance"....
    It would be the same as in forms.. do a set_item_instance_property
    Any ideas?
    Thanks

    you can use SPEL expression to achieve this.
    Create a new boolean attribute in your VO.
    In getBooleanXXX() of VORowImpl write your readonly logic. Return true if you want to make it readonly, false if not.
    In the Page -> table -> Column's, set the Read Only property to ${BooleanXXX}.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • App-V packages won't run until they are fully download - App-V 5.0 SP2

    Hey guys we're using App-V 5.0 in our Pooled VDI environment we waited for HF4 for a long time to be able to upgrade from SP1 to SP2 now we have a new Base Image with that client and with %APPDATA% folder redirection (unlike the Base Image with SP1 c

  • Blue Screen with Error Code B8156CEO

    Hi,my printer shows this error code after turning it on. All the lights are blinking. Plugging off the power supply or trying to reset by holding the power on button doesnt work. Seems to be in a firmware loop. There is some rest of connection to the

  • Printing in Black and White issue

    I have a school project that I need to do and it involves pictures. So I went to google, drug pictures to my desktop, and then drug them into pages. So then I tried to print and it printed in Black and White and it needs color because you can not und

  • In search of Unity 5 ES89

    Does anyone know if ES89 is available, just not public? Trying to setup Digital Networking or Unity to Unity Connection Interchange and understand that for Unity 5 you need ES89. http://www.cisco.com/en/US/partner/docs/voice_ip_comm/unity/compatibili

  • Forecast and consumption in APO for Third-party order processing

    Has anyone tried to forecast in DP for the standard 3rd party order processing process in R3? The business wants to enter a forecast in DP, Release it to SNP and do planning as though it is a normal process. They also want the sales order entered in