Dynamical change read only property of  columns based on a profile option

Hi,
We are attempting to change a Oracle iProcurement(ShoppingCartPG) which has certain readonly columns by default.
However, we need to make these columns updateable based on a responsibility level profile option. The code goes something like this.
if readonly_profile_option = "TRUE"
{make columnA property = readonly}
else if readonly_profile_option = "FALSE"
{make columnA property = updateable}
I read the guide about switchers and it seems confusing (to me). So if someone can provide an example with some pseudocode that will be helpful.
Also, can I dynamically add an LOV to column A if readonly is false? Of course the LOV should be disabled if readonly.
Thanks a lot

Hi,
Thanks for the feedback.
Tapash,
Switchers definitely don't make sense.
Raffy,
Didn't know it was that simple. I always thought that the controller fires--> then the page renders --> then the VO attributes get poulated. Basing my understanding on this flow, I though that the bean properties can only be set in controllers and not in VOs(via SPEL). I'll try it tomorrow.
Aprreciate your comments on the following.
Our requirement is to make an Oracle seeded field(SupplierName in iProcurement) updateable and with an LOV . Oracle has seeded it as ReadOnly.
I have two options.
1. If I change the readonly property in jedeveloper(I cannot access it via personalization) and add SPEL that would be upgrade 'unsafe' customizing - I think.
2. So I thought I'll extend the controller, substitute it and use
messageLOVInputText SupplierNameBean=webbean.findChildRecursive("SupplierName");
if{profle=not_read_only)
{SupplierNameBean.setReadOnly(false)};
else
{SupplierNameBean.setReadOnly(true)};
This is more upgrade safe. I have talked to the iProc development team and they are fine with it.

Similar Messages

  • 11.5.10 : Modifying read only property of columns

    Hi All,
    I am having an advanced table with 4 columns and all of them are editable [value is entered through an LOV].
    My requirement is that if user enters value in one column then all other columns should become read only [in that row only].
    Can somebody suggest some way out? Should i go for EL or PPR?
    A sample code will be of great help.
    Regards
    Lokesh

    Hi,
    Please correct if im wrong...
    U have impleted 3 lov item in advance table RN lov1,lov2,lov3
    if any one selected remaing 2 should moved to read only....
    for this
    use ppr for this,cretae 3 tr attributes and chnage the read only prpty using SPEL ...
    then in CODE.:
    if("lov1".equals(pageContext.getParameter(SOURCE_PARAM)) && "lovValidate".equals(pageContext.getParameter(EVENT_PARAM)))
    write the code for making remaing 2 lov read only.
    else if("lov2".equals(pageContext.getParameter(SOURCE_PARAM)) && "lovValidate".equals(pageContext.getParameter(EVENT_PARAM)))
    write the code for making remaing 2 lov read only.
    else if("lov3".equals(pageContext.getParameter(SOURCE_PARAM)) && "lovValidate".equals(pageContext.getParameter(EVENT_PARAM)))
    write the code for making remaing 2 lov read only.
    im sure try this u can achive this issue..
    Nani
    Edited by: Nani652595 on May 31, 2010 11:15 PM

  • WDA error in changing read only property of fields at runtime

    Hello Friends,
    I am creating a custom Web Dynpro ABAP Application for FI module in ECC 6.0
    I need to make a set of fields uneditable/grayed out based on a value in a dropdown list. If the user chooses the other value (out of the 2 values provided) in the dropdown list, the set of fields need to made editable.
    I created a context attribute of type WDY_BOOLEAN and bound this attribute to the "readOnly" property of the aforementioned fields. When defining context binding, I chose the option "Bind Directly to the Selected Attribute".
    I have written the following code in the OnSelect event handler method for the dropdown:
    I read the value in the dropdown which is stored in the variable "lv_payment_instrument". Based on this value, I am changing the value of the context attribute:
    if lv_payment_instrument = 'X'.
      DATA lo_nd_check_fields1 TYPE REF TO if_wd_context_node.
      DATA lo_el_check_fields1 TYPE REF TO if_wd_context_element.
      DATA ls_check_fields1 TYPE wd_this->Element_check_fields.
      DATA lv_editable1 TYPE wd_this->Element_check_fields-editable.
    navigate from <CONTEXT> to <CHECK_FIELDS> via lead selection
      lo_nd_check_fields1 = wd_context->get_child_node( name = wd_this->wdctx_check_fields ).
    @TODO handle non existant child
    IF lo_nd_check_fields IS INITIAL.
    ENDIF.
    get element via lead selection
      lo_el_check_fields1 = lo_nd_check_fields1->get_element( ).
    @TODO handle not set lead selection
      IF lo_el_check_fields1 IS INITIAL.
      ENDIF.
    @TODO fill attribute
    lv_editable = 1.
    set single attribute
      lo_el_check_fields1->set_attribute(
        name =  `EDITABLE`
        value = 'ABAP_FALSE' ).
    elseif lv_payment_instrument = 'Q'.
      DATA lo_nd_check_fields TYPE REF TO if_wd_context_node.
        DATA lo_el_check_fields TYPE REF TO if_wd_context_element.
        DATA ls_check_fields TYPE wd_this->Element_check_fields.
        DATA lv_editable TYPE wd_this->Element_check_fields-editable.
    *navigate from <CONTEXT> to <CHECK_FIELDS> via lead selection
        lo_nd_check_fields = wd_context->get_child_node( name = wd_this->wdctx_check_fields ).
    *@TODO handle non existant child
       IF lo_nd_check_fields IS INITIAL.
       ENDIF.
    *get element via lead selection
        lo_el_check_fields = lo_nd_check_fields->get_element( ).
    *@TODO handle not set lead selection
        IF lo_el_check_fields IS INITIAL.
        ENDIF.
    *@TODO fill attribute
       lv_editable = 1.
    *set single attribute
        lo_el_check_fields->set_attribute(
          name =  `EDITABLE`
          value =  'ABAP_TRUE' ).
    endif.
    When the user chooses either of the 2 values in the dropdown, the set of fields are made uneditable. I am unable to make them editable again.
    I would greatly appreciate your inputs/thoughts on how to rectify this error.
    Regards,
    Arun.

    Hi,
    Create one attribute of type WDY_BOOLEAN , i think u already done.
    First get selected dropdown value into one variable.
    For example  :
    lo_el_segment1 = WDEVENT->GET_CONTEXT_ELEMENT( 'CONTEXT_ELEMENT' ).
    get all declared attributes
    lo_el_segment1->get_static_attributes(
    IMPORTING
    static_attributes = ls_segment1 ).
    now ls_segment1 has selected drop down value.
    DATA : lv_dropdown type string .
    lv_dropdown = ls_segment1-segment.
    If lv_dropdown = 'X'.
    set single attribute
    lo_el_check_fields1->set_attribute(
    name = `EDITABLE`
    value = ABAP_FALSE ). // No Quotes, ABAP_TRUE or false not works use 1 0r 2 or ' ' 'X' .
    elseif lv_dropdown = 'Q'.
    set single attribute
    lo_el_check_fields1->set_attribute(
    name = `EDITABLE`
    value = ABAP_FALSE ).
    else.
    set single attribute
    lo_el_check_fields1->set_attribute(
    name = `EDITABLE`
    value = ABAP_TRUE ).
    Hope it solves..
    cheers,
    Kris.

  • How to set the read only property for dynamic ALV column

    Hi All,
    I have built one dynamiv ALV and I have one name column inside that ALV for which I have to set read only property based on two column fields that exist in the same ALV,say IS_SP and IS_CORP of type boolean.
    If any one of the flag is 'X',i have to make that name column as display only and
    If both flag are not set,it should be displayed as ediatable column.
    I have written one method as INIT_ALV which gets called when ALV is loaded.
    Code is as  follows:
      lr_column_settings ?= wd_this->alv_all_roles.
      lt_columns = lr_column_settings->get_columns( ).
    LOOP AT lt_columns INTO ls_column.
    CASE ls_column-id.
       WHEN <NAMECOLUMN>. "name column which should be editable/display
    Create Input Field
            CREATE OBJECT lr_uie_input_field_ro
              EXPORTING
                value_fieldname = ls_column-id.
         ls_column-r_column->set_cell_editor( lr_uie_input_field_ro ).
        After this,I have to set the read only property based on IS_SP and IS_CORP values,
              CALL METHOD lr_uie_input_field_ro->set_read_only_fieldname
              EXPORTING
                *value = 'IS_SP' or 'IS_CORP'
    ENDLOOP.
    I dont want to use cell variants also.
    Help me to achieve this.
    Thanks and Regards,
    Divya

    Divya - I have done it in the past following these documents. Please read it and try it it will work.
    Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement) 
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b?quicklink=index&overridelayout=true
    thanks!
    Jason PV

  • Problem when I make Read Only Property True

    Dear Members,
    I have an OAF Page on which I have the below two items:
    1/ item1
    2/ item2
    These two items are message input text items and these two items will always have some value.
    To meet one of my requirement, I am making the READ ONLY property of these two items to TRUE in processRequest method of page CO using PPR Concept. After this when I am trying to access the values of these two parameters in processFormRequest method using pageContext.getParameter method I am getting the Null Pointer Exception error.
    Kindly please help me in resolving the above error.
    Note: I have created a transient variable hdr1Trans and attached this variable to the both the items i.e., item1 & item2
    Code in my processRequest method is as follows:_
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject pvo = (OAViewObject)am.findViewObject("pprPVO1");
    pvo.setMaxFetchSize(0);
    Row newRow = pvo.createRow();
    pvo.insertRow(newRow);
    OAViewObject vo = (OAViewObject)am.findViewObject("Headers_VO1");
    String status="";
    status=vo.getCurrentRow().getAttribute("Status").toString();
    if(status!=null && !("".equalsIgnoreCase(status)))
    if(status.equalsIgnoreCase("IN PROCESS"))
    pvo.getCurrentRow().setAttribute("hdr1Trans",Boolean.TRUE);
    else if(status.equalsIgnoreCase("NEW"))
    pvo.getCurrentRow().setAttribute("hdr1Trans",Boolean.FALSE);
    Code in my processFormRequest method is as follows:_
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    String headerId ="";
    System.out.println("test-1");
    String item1=pageContext.getParameter("item1").toString();
    String item2=pageContext.getParameter("item2").toString();
    I am getting the NPE error when I am trying to access a record with status value IN PROCESS.
    Once I make the read only property to TRUE for both the above 2 items and after that if iam trying to access their value using pageContext.getParameter Iam getting this error.
    Kindly please help me in resolving this error.
    Many thanks in advance.
    Best Regards,
    Arun Reddy D.

    Arun,
    When you set item as readonly field, it will always show null when you will use pageContext.getParameter("<itemID>").
    If there is a VO attached with these items eg- item1, item2 then you can get the value using below code
    OAViewObject vo = (OAViewObject)am.findViewObject("<Some Vo>");
    String item1=(String) vo.getCurrentRow().getAttribute("<Attribute Name>");Regards,
    Gyan

  • How to change read only folders into normal ones...i can't get any filed from my harddrive

    how to change read only folders into normal ones...i can't get any filed from my hard drive..it shows read only

    Which HDD are you referring to, an external one, or the internal SSD?
    If external, which format is it in?

  • Dynamically making read only for a field in get_data(CL_EHHSS_INC_BINFA_UI_FRM)

    Hi Experts,
    I am making read only for a field based on condition in get_data method of class CL_EHHSS_INC_BINFA_UI_FRM.
    But it is not working. Pls find the code for the same.
    LOOP AT CT_FIELD_USAGE INTO lw_field WHERE NAME = 'OC_INC_TYPE'.
       lw_field-read_only = ABAP_TRUE.
       MODIFY ct_field_usage FROM lw_field TRANSPORTING read_only.
       ev_field_usage_changed = 'X'.
    ENDLOOP.
    Pls help me what is wrong in this coding.
    Regards,
    Reny Richard

    Hi Richard,
    Please check if   this loop is executing for the correct desired event(say on click or from the start ). & the field name specified is correct or not through debugging. And check by placing the parameter ev_field_usage_changed = 'X'. after the loop statement.
    Below is a sample code for making the field read only.
    field-SYMBOLS: <fs_field> like line of CT_FIELD_USAGE.
       loop at CT_FIELD_USAGE ASSIGNING <FS_FIELD>.
         case <FS_FIELD>-NAME.
         when 'OC_INC_TYPE'. " name of the field
             <FS_FIELD>-READ_ONLY = 'X'.                " ' ' for editable
         ENDCASE.
    CV_FIELD_USAGE_CHANGED = abap_true.
    Regards,
    Harsha

  • WD ALV  read only property

    Hi,
    Is there a read only property for the cell editor in the ALV table?
    (I prefer it to the enabled/disabled) visually.
    Many thanks!

    CL_SALV_WD_UIE_INPUT_FIELD

  • [svn:fx-3.x] 13374: Expose a public read-only property httpService on HTTPOperation.

    Revision: 13374
    Revision: 13374
    Author:   [email protected]
    Date:     2010-01-08 07:43:33 -0800 (Fri, 08 Jan 2010)
    Log Message:
    Expose a public read-only property httpService on HTTPOperation. HTTPOperation.service will still return null as a consequence of an old design decision (HTTPService does not extend AbstractService), but a warning is now logged to inform the user that they should use HTTPOperation.httpService to access the containing service.
    Doc notes: Please explain that if a standard HTTPService is used, the event.target on the ResultEvent from this service is an instance of HTTPOperation, and users can access the originating HTTPService with event.target.httpService. (see bug for use-case)
    Bugs: SDK-24775
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24775
    Modified Paths:
        flex/sdk/branches/3.x/frameworks/projects/rpc/src/mx/rpc/http/HTTPService.as

    For a TwoWay binding to work the source property must have public setter and an anonymous object (like the one your select new LINQ query creates) has not.
    But since you are binding to the Text property of TextBlocks you could just remove Mode=TwoWay from the bindings in the ItemTemplate of the ListBox:
    <TextBox Name="txtOrderID" Text="{Binding Path=OrderID,Mode=OneWay}" Margin="5,0,10,0" Width="30"/>
    <TextBlock Text="Order Date:" TextAlignment="Right" Width="80"/>
    <TextBlock Name="txtOrderDate" Text="{Binding Path=OrderDate,StringFormat={}{0:MM/dd/yyyy}}" Margin="5,0,10,0" Width="75"/>
    <TextBlock Text="Required Date:" TextAlignment="Right" Width="80"/>
    <TextBlock Name="txtRequiredDate" Text="{Binding Path=RequiredDate,StringFormat={}{0:MM/dd/yyyy}}" Margin="5,0,10,0" Width="75"/>
    There is no reason to bind TwoWay to a TextBlock.
    Hope that helps.
    Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

  • How to Enable/Disable MessageTextInput Read Only property in PFR?

    Dear All,
    When i click on a submit button i need to enable/disable the Read only property of MessageTextInput item.
    Can any one tell me how to do this?
    I am executing the code
    if (pageContext.getParameter("EnableBT") != null) {
    OAMessageTextInputBean beanEmployeeIdCL = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("EmployeeIdCL");
    beanEmployeeIdCL.setReadOnly(false);
    When i used the above code in Process Form Request method it is showing developer mode exception in run time as we can call the above code only in Process Request form.
    Request to please help regarding this.
    Thanks & Regards,
    CAK

    CAK,
    You need to make use of Partial Page Rendering (PPR) & SPELL. Modifying the bean property in PFR is not supported in OAF.
    Refer - PPR section of Devguide for more.
    Regards
    Gyan

  • Change field from read only and override calculation based on radio button

    Hi,
    I have a form in which one of the fields has a simple sum calculation and is set to read only so the user can't change it as it sets a print amount as well.
    But if one of the radio buttons is ticked there is a chance that the print amount needs changing but it can be different based on a few other options so I have managed to set the field so the user can edit it depending on an option but the calculation that sets the value overrides what the user enters. I would like to know if it is possible to change this?
    I use
    this.getField("Quantity_Boxes").readonly = false;
    So the user can edit the field when they select the radio button 'yes' under Mesh_b
    and
    this.getField("Quantity_Boxes").readonly = true;
    So the field goes back to read only when the user selects the 'no' under Mesh_b
    and in the Quantity_Boxes field I use:
    Quantity_Curtains / csn
    Just as a simplified division sum with the decimal places set to 0 so a whole number appears.
    csn is just a hidden field that has an amount set depending on the size of curtain.
    Thanks,
    Bruce

    I have found a solution but caused another problem (well more of an irritation than a problem)
    I have made it so the can field throws a dialogue box asking how many of the item fit into a box, the only problem is that the dialogue box will appear more then once.
    For example I have made a new size know as bespoke and when I select that size and hit return the dialogue box pops up which is fine but when the amount of the product is changed it throws the dialogue box again. I guess this is because the calculation has to be run again but is there anyway of stopping this?
    Here is the code I use in the can field which defines how many curtains are in the box and is used to calculate how many labels need printing out.
    if(this.getField("SizeDrop").value=='LG'){
    event.value = "5"
    } else if (this.getField("SizeDrop").value=='ST'){
    event.value = "8"
    } else if (this.getField("SizeDrop").value=='ME'){
    event.value = "10"
    } else if (this.getField("SizeDrop").value=='SM'){
    event.value = "15"
    } else if (this.getField("SizeDrop").value=='BE'){
    var resp = +app.response("Enter the amount of curtains in a box","","1");
    event.value = resp
    } else {
    event.value = " "
    Thanks,
    Bruce
    EDIT:
    I have found that the dialogue box will appear every time something is changed on the form (even while in the editor as well)

  • UIX - Changing read-only-table row colors

    Hi
    I have the requirement to alternate the background-row-color in an UIX read-only-table dependent on a value in the row.
    Can anybody point me in the right direction of a solution please?
    I'm familiar enough with the styles in the XSS style sheets, and using EL to dynamically change attributes of a UIX web page when rendered. However in the default <table> UIX tag generated by JDeveloper when dragging a data control onto a UIX web page, there doesn't appear to be a <row> tag for changing the background colour?
    Any help appreciated
    I'm using JDeveloper 9.0.5.2.
    Cheers,
    CM.

    I don't know if this works in JDeveloper 9.0.5.2, but there's a solution at least for JDevloper 10.1.2. You have to define a different styleClass (a CSS) for each column, depending on a condition. This solutions works as well together with row banding:
    <column>
      <columnHeader>
        <sortableHeader model="${ctrl:createSortableHeaderModel(bindings.MyView,'Seats')}" text="Seats"/>
      </columnHeader>
      <contents>
        <rowLayout width="100%" styleClass="${ui:cond(uix.current.IsLocked == 'J', 'OraTableCellLocked', '')}">
          <contents>
            <cellFormat>
              <contents>
                <textInput model="${ui:defaulting(uix.current.Seats, ' ')}" columns="10" readOnly="true"/>
              </contents>
            </cellFormat>
          </contents>
        </rowLayout>
      </contents>
    </column>The styleClass "OraTableCellLocked" has to be defined in the file "base-desktop.xss". An example ("Locked" cells are displayed with a red background):
       <style selector=".OraTableCellLocked">
        <includeStyle name="TableCellDataText"/>
        <includeStyle name="TableCellDataVerticalAlign"/>
        <!--<includeStyle name="TableCellDataBackgroundColor"/>-->
        <includeStyle name="TableCellDataBorderColor"/>
        <property name="background-color">#FFA4A4</property>
      </style>Hope this helps, although the original is very old.
    Regards,
    Georg

  • Dynamically changing break order property

    I have a report that has four different fields that the user can break on. Does anyone know how to dynamically change the break order depending on which field the user choses as a parameter.
    Thanks

    Alias the break columns.
    select &p_col1 break, col2...
    from tablename
    then send to the report the name of the break group column.
    The initial value of p_col1 should be set to 'xxxxxxxxxxxxxxxxx' enclose in quotes. Take care at the length of the string. This is the only thing that determines the length of the field.

  • Changing display of item in column based on its value

    Hi,
    I'm confused as to how I can change the display attributes of an item in a column based on that items value. I've grepped through the forums and it seems there are ways to do this in the report query but that seems inefficient. My preferred method would be at the column level, I could set up some logic that says "if the value is X then display A and if the value is Y then display B". In this case A and B could be a snippet of HTML to display an image that represents the value.
    Seems reasonable that this app would have this functionality and I'm sure it's there, I just can't seem to find it.
    Help! Suggestions welcome, heckling encouraged!
    Thanks,
    Jon

    Jon,
    You should probably start storing the images in a custom table as described here:
    http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm
    The following column is taken from the Products query in the sample application (page 3):
    decode(nvl(dbms_lob.getlength(p.product_image),0),0,null,'<img src="'||apex_util.get_blob_file_src('P6_PRODUCT_IMAGE',p.product_id)||'" height="75" width="75" />') img
    Note, getting this configured is a little tricky the first time. Notice that there is an item from page 6 referenced. Page 6 contains that item and a DML process both of which are needed for everything to work. Read more here:
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/advnc.htm#BCGGJHEF
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • Setting read-only property for a RTL inputtext.

    HI,
    I am using JDeveloper version 11.1.2.2.0. In my fusion web application, in the af:inputtext field, if the language is, RTL or LTR the value is displaying according to that. Suppose, if it is English, the value is displaying left to right. If it is, Arabic, the value is displaying from left to right. But if I set the column value is read-only, everything is displaying as left to right. Here is the code of my input text field.
    <af:column sortProperty="#{bindings.PhraseTranslationView3.hints.Description.name}"
    sortable="true"
    headerText="#{bundle['PhraseTranslation.des']}"
    id="c5">
    <af:inputText value="#{row.Description}" id="ot6"
    inlineStyle="border-style:none; overflow:hidden;border-color:rgb(255,255,255);direction:#{row.TextDirection};border-width:thin;height:16px; font-weight:bold; color:rgb(0,0,0); font-size:8.0pt;font-family:Arial Unicode MS;"
    label="Label 6">
    </af:inputText>
    </af:column>
    What is going wrong in this?

    Yeah, I have set it to 'True'. If I set it, the value is not displaying from left to right.
    Here is the code.
    <af:inputText value="#{row.Description}" id="ot6"
    inlineStyle="border-style:none; overflow:hidden;border-color:rgb(255,255,255);direction:#{row.TextDirection};border-width:thin;height:16px; font-weight:bold; color:rgb(0,0,0); font-size:8.0pt;font-family:Arial Unicode MS;"
    label="Label 6"
    styleClass="rtl" readOnly="true">
    </af:inputText>
    Regards,
    Infy

Maybe you are looking for