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.

Similar Messages

  • 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.

  • 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 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

  • 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?

  • 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

  • Installation error  : You have read-only access to oracle inventory

    Hi guys,
    In some versions of Linux eg. Fedora, Ubuntu .. whenever I am installing Hyperion products I get this error " You have read-only access to oracle inventory". and also the thing worth noticing is, if this error comes Oracle doesn't install " OpenLDAP" which is required to run shared services.
    With Oracle Enterprise Linux, and everything seems to be fine. and I didn't got the above error also OpenLDAP gets installed.
    any help would be appreciated. attached is the screen shot for the error.
    [https://docs.google.com/leaf?id=0BwB5xiYJ_HGwMDZkNjQ1OTEtMDg4Zi00NGM3LTk5NDAtYzE1ZmJkZTcyMzU0&hl=en]
    Thanks

    HI,
    1. This would be handy
    http://www.oracle.com/technology/products/bi/hyperion-supported-platforms.html
    2. In case OS is not supporting , you ll end up spending lot of time , and am sure openLDAP will trip time and again.
    Sandeep Reddy Enti
    HCC
    http://hyperionconsultancy.com/

  • 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

  • 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

  • All folders changed Read Only

    Okay, so recently, just about all my folders (including every subfolder in iTunes and the such) have become read only. So whenever i try to change something, i need to set that folder back to read and write for Me. This is very annoying, and I don't know what happened to make all the folders read only.
    Is there some way to change all the permissions on my disk back to Read and Write for Me (the administrator) without going through every single folder?

    first, whatever you do, don't try to make everything on your hard drive read+write for yourself. this will invariably brick the system and you'll have to reinstall. there is no other outcome possible.
    where exactly are the problem files located? only in your itunes folder? somewhere else in your home directory? what exactly does the permissions panel for such files say?

  • Re-installed photoshop elements 12. In folder correct copies, how to change read-only to edit photos? After printing photo how to return to grid view?

    Reinstalled photoshop elements 12. How to change photo after printing back to grid view? In folder correct copies one or more files is read only. How to change so these can be edited?

    Reinstalled photoshop elements 12. How to change photo after printing back to grid view? In folder correct copies one or more files is read only. How to change so these can be edited?

  • Changing 'Read Only' permissions....

    Hi i think i need to somehow change the read only permission
    with flash 9...is there a way to do this?

    Hi coralie85,
    What operating System are you using?
    If this is for a Macintosh, please see the following
    technote:
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=4aa64290

  • 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

  • Display value in hh:mm time format in SSRS Report

    Hi Everybody, I have an SSRS report where one of the column is sum of time values. When I do the summation, the values are coming in this format. In the last column the minute value is getting displayed more than 60. How can I format it to proper tim

  • How to force password policy requirements on password resets for user accounts reset by the Administrator?

    OS: Windows Server 2008 R2 Enterprise Domain Level: 2008 Forest Level: 2000 We have Domain Administrators in our domain that reset passwords for user accounts, and the passwords the Administrators set them to are not being enforced follow our default

  • Seagate Crystal Reports ActiveX Designer error '80043ac4'

    Website slows down when users are running reports. Users start getting errors when running any crystal report. After sometime main page itself stops loading and only static html is visible. Following is one of the errors users see: Seagate Crystal Re

  • Creative Vision:M question

    hey guys i have a question about the Creative Zen Vision:M i was wondering how you can transfer a song to the mp3 player .. because i have the Creative Rhomba myself.. and i can do it very easily when i have the player connected to the comp, no progr

  • Please help, 3D animation play button Java Script

    The U3D file embedded into the PDF contains 3 procedure animations I would like to add a play button for each procedure. But I do not see the Animation Objects in the model tree of the pdf and I do not know how to connect to these animations with Jav