Input Field Disabled in WEB UI

Hi,
I am new to CRM WEB UI.
I have created Z Component and in that I have created controller and Views and model.
I have also added all the views and models to Runtime repository.
Created buttons for navigation which are working fine...
I have added some fields in view via view Configuration but all the input fields are coming as disabled when I test the application.

Hi ,
Thanks,  S Reddy for this Post , My issue had solved.
Thanks & Regard.
Pappu Kumar Mehta.

Similar Messages

  • Input Field disabled in Web Dynpro Application

    Hi,
    I created an application with three input fields and created the corresponding context. When I start the wd app the input fields are disabled and can not be edited. The property enabled if this fields is true!
    I compared the context with other wd app in my nwds and the only thing I recognize is that in other apps, at every attribute is a litte triangle. This attribute also have one property more - it is called "Input Element".
    So my questions are:
    1. What might be the reason why I can not edit the fields?
    2. How can I configure my attributes to get this triangle?
    I appreciate any comment!
    Regards

    Wow, that was more than fast :-D
    But you are absolutely right, THANKS!!! The input fields are enabled now.
    Do you might also know how I can get this triangle? I have this problem also in an other topic ([How-to Integrate Visual Composer UIs within a CE7.11 BPM Process|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2011e628-b317-2c10-9fa7-952155e10705]). Also see [Video|http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/6065bee4-a317-2c10-4c8c-cfa1c3eac185&overridelayout=true] at minute 06:05
    Regards

  • How to add an input field in the web UI of CRM 2007

    Hi everybody.
    I want add an Input field in the Web UI Screen. How it is possible.
    I want get the information with detailed descriptions if possible with screen shorts.
    What type of methods it will be generated and what are the code we entered in those methods.
    Take according to any example. But with detailed description.
    I am new for the CRM 2007. So, please give the screen shorts with proper data.
    Not only adding the field. If any data i entered in the adding field then that will be stored in the tables otherwise no use by adding the field.
    So, Can anybody please send a proper information according to this.
    Here another one How to Add our own table (Ztable) field in the Web UI Screen.
    How to add the same field in the BOL.
    Please expalin about those concepts with full of screen shorts messages.
    Thank You.
    Regards,
    Krishna.

    If you want to add extra standard fields (like one you mentioned), you can use Component Workbench and Copy the configuration and create your own configuration and make the "Available Fields" appear there.
    If the standrd field is not available, you can Add Context Node using wizard and make it visible.
    If its a custom field (a new one); you will have to use EEWB and add the fields and then make it visible in the UI using Component Workbench.
    Regards,
    Alin

  • Dynamic Table Input Field - Disabled in runtime

    Hi,
    I have dynamically created a node. The node as a string attribute X.
    Then dynamically created a IWDTable to bind to the node.
    In the table I have a column, then a tablecelleditor of inputfield.
    The inputfield 'value' is binded to node->X attribute info.
    inputField.bindValue(attributeInfo).
    Then I created a few entries of the node, populating X with some dummy value.
    In runtime, my inputfields are disabled, and the dummy values don't appear.
    I believe it is something to do with my binding.
    Then I replaced the inputfield with a textview. textview text is binded to the node->X
    attribute info.
    textview.bindText(attributeInfo)
    (i.e. exact same attribute info I used for the inputfield)
    In runtime I see my textview with the dummy values.
    Can anyone point me in the right direction?
    Cheers,
    Michael.

    Hi Guys,
    I think to be clear I better include my code here.
    I did bind the table to the nodeInfo, and I did bind the textView/inputfield to the particular attribute.
    As mentioned before, it does show for the textView, but not for the inputfield.
    Create the new node:
              IWDNodeInfo newNode = wdContext.getNodeInfo().getChild("nodeName");
                   newNode =
                        wdContext.getNodeInfo().addChild(
                             "nodeName",
                             null,
                             true,
                             true,
                             true,
                             false,
                             false,
                             true,
                             null,
                             null,
                             null);
    Create the attribute:
                   IWDAttributeInfo detailAttribute =
                        newNode.addAttribute(
                             "xyz",
                             "ddic:com.sap.dictionary.string");
    Get the node
                             IWDNode specificNode =
                                  wdContext.getChildNode(
                                       "nodeName",
                                       0);
    Create the element from the node
                             newElement =
                                       specificNode.createElement();
    Set the attribute value:
                                  newElement.setAttributeValue(
                                       "xyz",
                                       "1234");
    Add the new element:
                                  specificNode.addElement(newElement);
    Create the table now:
                   IWDTable someTable =
                        (IWDTable) view.createElement(
                             IWDTable.class,
                             "TAB_ArticleQty" + articleElement.getArticleId());
                   someTable.setEnabled(true);
                   someTable.setReadOnly(false);
                   someTable.setRowSelectable(true);
                   someTable.setFooterVisible(false);
                   someTable.setSelectionMode(WDTableSelectionMode.NONE);
                   someTable.setVisibleRowCount(-1);
                   someTable.bindDataSource(
                   specificNode.getNodeInfo());
                   TC.addChild(someTable);
    Loop at all the attributes and create the column
    The code for the textView has been commented out
    The code is now for the input field
                    * LOOP AT ALL THE ATTRIBUTES IN THE NODE:
                    * CREATE ONE COLUMN FOR EACH ATTRIBUTE
                   Iterator allAttributes =
                   specificNode.getNodeInfo().iterateAttributes();
                   while (allAttributes.hasNext()) {
                        IWDAttributeInfo attrInfo =
                             (IWDAttributeInfo) allAttributes.next();
                        String attrName = attrInfo.getName();
                                  // Text View
                                  IWDTextView TV_info =
                                       (IWDTextView) view.createElement(
                                            IWDTextView.class,
                                            "TV_AQ_"
                                                 + counter
                                                 + attrName);
                                  TV_info.bindText(attrInfo);
                                  COL_qty.setTableCellEditor(TV_info);
                                  //input field for the user to enter the value
                                  IWDInputField input_Qty =
                                       (IWDInputField) view.createElement(
                                            IWDInputField.class,
                                            "input_Qty"
                                                 + counter
                                                 + attrName);
                                  input_Qty.setEnabled(true);
                                  input_Qty.bindValue(attrInfo);
                                  input_Qty.setWidth("4");
                                  COL_qty.setTableCellEditor(input_Qty);
                             someTab.addColumn(COL_qty);

  • Input field validation in web dynpro abap

    Hi....i have a input field in a view, which is bound with dictionary object of char type ,through context.for this input field, i have to allow the end users to enter the numeric and float values only,but in my condition it accepting everything and returns runtime error.for this how to validate inputs other than numerics.
    Thanks & regards,
    pavan maganti.

      DATA lo_nd_itab2 TYPE REF TO if_wd_context_node.
      DATA lo_el_itab2 TYPE REF TO if_wd_context_element.
      DATA ls_itab2 TYPE wd_this->element_itab2.
      DATA lv_non_numeric TYPE wd_this->element_itab2-non_numeric.
    *     get message manager
      DATA lo_api_controller     TYPE REF TO if_wd_controller.
      DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
    * navigate from <CONTEXT> to <ITAB2> via lead selection
      lo_nd_itab2 = wd_context->get_child_node( name = wd_this->wdctx_itab2 ).
    * get element via lead selection
      lo_el_itab2 = lo_nd_itab2->get_element( ).
    * get single attribute
      lo_el_itab2->get_attribute(
        EXPORTING
          name =  `NON_NUMERIC`
        IMPORTING
          value = lv_non_numeric ).
      IF lv_non_numeric CO '1234567890'.
        lo_api_controller ?= wd_this->wd_get_api( ).
        CALL METHOD lo_api_controller->get_message_manager
          RECEIVING
            message_manager = lo_message_manager.
    *     report message
        CALL METHOD lo_message_manager->report_success
          EXPORTING
            message_text = 'All numeric'.
      ELSE.
        lo_api_controller ?= wd_this->wd_get_api( ).
        CALL METHOD lo_api_controller->get_message_manager
          RECEIVING
            message_manager = lo_message_manager.
    * report message
        CALL METHOD lo_message_manager->report_warning
          EXPORTING
            message_text = 'Contains characters'.
      ENDIF.

  • Changing color of  text in the input field

    hi
    when i disable the input field , the text written in it has very light color. How can i change the color of the displayed text in the input field.

    Hi Harsimran,
    changing the text color of an input field is not possible. However, you can build a workaround:
    1. take an expression box, place it exactly over your input field
    2. change its text color and take the value of your input field as value being displayed
    3. instead of making your input field disabled, make it hidden and show the expression box instead.
    Thus, instead of enabling/disabling your input field, switch between expression box/input field to be displayed. I hope it's clear what I mean. If not, don't hesitate to ask again.
    Best regards,
      Benni

  • How to enable/disable the input fields based on the data entered/user action in the web dynpro abap?

    How to enable/disable the input fields based on the data entered in the web dynpro application abap?  If the user enters data in one input field then only the next input field should be enabled else it should be in disabled state. Please guide.

    Hi,
    Try this code.
    First create a attribute with the name readonly of type wdy_boolean and bind it read_only property of input field of which is you want to enable or disable.
    Next go to Init method.
    Set the readonly value as 'X'.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
         DATA ls_context TYPE wd_this->element_context.
         DATA lv_visible TYPE wd_this->element_context-visible.
    *   get element via lead selection
         lo_el_context = wd_context->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_context IS INITIAL.
         ENDIF.
    *   @TODO fill attribute
    *   lv_visible = 1.
    *   set single attribute
         lo_el_context->set_attribute(
           name =  `READONLY`
           value = 'X').
    After that Go to the Action  ENTER.
    First read the input field ( first input field, which is value entered field) , next give a condition
    if input value is not initial  then set the readonly value is '  '.
    DATA lo_nd_input TYPE REF TO if_wd_context_node.
         DATA lo_el_input TYPE REF TO if_wd_context_element.
         DATA ls_input TYPE wd_this->element_input.
         DATA lv_vbeln TYPE wd_this->element_input-vbeln.
    *   navigate from <CONTEXT> to <INPUT> via lead selection
         lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
    *   @TODO handle non existant child
    *   IF lo_nd_input IS INITIAL.
    *   ENDIF.
    *   get element via lead selection
         lo_el_input = lo_nd_input->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_input IS INITIAL.
         ENDIF.
    *   get single attribute
         lo_el_input->get_attribute(
           EXPORTING
             name =  `VBELN`
           IMPORTING
             value = lv_vbeln ).
    if lv_vbeln IS not INITIAL.
        DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_visible TYPE wd_this->element_context-visible.
    *  get element via lead selection
        lo_el_context = wd_context->get_element( ).
    *  @TODO handle not set lead selection
        IF lo_el_context IS INITIAL.
        ENDIF.
    *  @TODO fill attribute
    *  lv_visible = 1.
    *  set single attribute
        lo_el_context->set_attribute(
          name =  `READONLY`
          value = ' ' ).

  • Items of input fields are disabled

    Hi All,
    I have created form using Web Dynpro. In this form, I have provided connnectivity with R/3 using RFC. After creation of the form, I noticed that input fields are disabled. Can you please suggest me the possible reason for this. I have mapped  input field with model's parameter.
    Regards,
    Gaurav

    Hi Gaurav,
    The mistake you are doing is, you have to initialize the newly created input object. check below
    /** Hook method called to initialize controller. */
    public void wdDoInit()
    //@@begin wdDoInit()
    // Create a new element in the Bapi_Flight_Getlist_Input node
    Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();
    wdContext.nodeBapi_Flight_Getlist_Input().bind(input);
    // Create new elements in the Destination_From and Destination_To nodes
    <u>input.setDestination_From(new Bapisfldst());
    input.setDestination_To(new Bapisfldst());</u>
    //@@end
    This means.. adding to sunitha's code.. you should do below
    public void wdDoInit()
    //@@Begin wdDoInit()
    Bapi<...>_Input input = new Bapi<...>_input ();
    wdContext.nodeBapi<...>_Input().bind(input);
    <u>input.setXXX(new expectingobjectvalue());</u>
    //@@end
    Check it...
    Thanks,
    Raags

  • Input Field: Value Range in IP Web Layout

    Hi Experts,
    I've created a Web Layout based on IP with a copy function (e.g. from actual 2008 to plan2009) over 12 calendar months. For choosing the months to be copied, I created a Variable (calmonths) and added an Input Field into my layout to enter the the months to be copied. I referred the variable to the input field and it's working...
    When I want to select several months to be copied, I can type in " 1; 2; 3; " into the input field, execute the planning function and only month 1, 2, 3 (i.e. Jan, Feb, Mar) are being copied. But when I want to copy all 12 months, i have to enter 1; 2; 3; 4;...11; 12 which is kind of anoying! Has somebody some experience whether I can use a value range like 1-12 (or something like that) to avoid entering all the months individually? (I tried 1-12; 1- 12; 1 - 12; 1:12 etc but nothing like this is working)
    It would be very helpful if someone has an idea
    All the best,
    Norbert

    Hi Mayank, hi Srinivas.
    Thanks a lot for your valuable input! Unfortunately I was not able until today to test your recommodations.
    I tried your Interval variable but then faced the problem that I cannot enter multiple months anymore (e.g. 5 - 8 worked, 1; 3; 5 not).  Then I inserted both variables, multiple values & interval, into the planning function as well as in the button group in WAD for executing the PF but was not able to execute the following example: 1; 8; 4 - 6. After trying out for some time I figured out that one has to type in the figures in the following order: 4 - 6; 1; 8. Only then I am able to execute the planning function for the months April-June & Jan & August. So, if you're facing the same problem in the future, maybe you have the solution
    Best regards,
    Norbert

  • Disable an Input field with the help of a radio button selection.

    Hi Guys,
    I know it is a very basic question and also has many threads for the mentioned query. None of the threads gave me a real clue about the problem. It is as follows:
    Simply, I have an input field and there are two more radio buttons on the screen, say rd1, and rd2.
    Initially Rb_gtgr is active and input field is blank and disabled, and when i select Rb_selgr, input field should be active and mandatory. It means when i try to execute the code with out entering any value after it is enabled, an error message should appear. For this the code is as follows:
    AT SELECTION-SCREEN OUTPUT.
      PERFORM screen_grace_on.
    AT SELECTION-SCREEN ON p_grace.
      PERFORM check_grace_days.
    FORM screen_grace_on .
      DATA: l_v_grace TYPE char2.
      CONSTANTS: l_c_grace TYPE char7 VALUE 'P_GRACE'.
    l_v_grace = p_grace.
    CLEAR p_grace.
      IF rb_selgr EQ c_x.
        LOOP AT SCREEN.
          IF screen-group1 = 'ABC'.
            screen-required = 1.
           screen-active = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-group1 = 'ABC'.
            screen-input = 0.
            screen-active = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " SCREEN_GRACE_ON
    FORM check_grace_days.
      IF rb_selgr EQ c_x AND  p_grace EQ 0.
        PERFORM screen_grace_on.
        MESSAGE e492(/ams/ramfcmess1).          " Enter the number of Grace days
      ELSEIF rb_selgr EQ c_x AND p_grace GE 0.
        PERFORM screen_grace_on.
      ENDIF.
    ENDFORM.
    Ideally this code should work since in the PBO i.e., At selection screen output i am enabling the fields, and also when i select the second radio button i am also checking for the value too..
    I am working on 4.7 version of SAP. The Most interesting observation is it works fine for few variants, and not with others.
    Thank you

    Hi,
    Go through this following code,
    selection-screen begin of block B2 with frame title TEXT-005.
    selection-screen begin of line.
    parameters:     P_BIRPT type C radiobutton group RAD1 default 'X' user-command UCOMM.
    selection-screen comment 3(20) TEXT-002 for field P_BIRPT.
    selection-screen end of line.
    selection-screen begin of line.
    parameters:     P_COLRPT type C radiobutton group RAD1.
    selection-screen comment 3(20) TEXT-003 for field P_COLRPT.
    selection-screen end of line.
    selection-screen begin of line.
    parameters:     P_PAYRPT type C radiobutton group RAD1.
    selection-screen comment 3(20) TEXT-004 for field P_PAYRPT.
    selection-screen end of line.
    selection-screen end   of block B2.
    selection-screen begin of block B1 with frame title TEXT-001.
    select-options: SO_KTOKD for  KNA1-KTOKD modif id M4,
              SO_BLART for  BSIS-BLART modif id M2.
    parameters:     P_PAID   type ZCLEAR     modif id M3 as listbox visible length 20.
    selection-screen end   of block B1.
    at selection-screen output.
      loop at screen.
        if P_BIRPT eq 'X'.
          if SCREEN-GROUP1   = 'M2' or SCREEN-GROUP1 = 'M3' .
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
        elseif P_COLRPT eq 'X'.
          if SCREEN-GROUP1   = 'M3'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
        elseif P_PAYRPT eq 'X'.
          if SCREEN-GROUP1   = 'M2'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
          if SCREEN-GROUP1   = 'M4'.
            SCREEN-INVISIBLE = '1'.
            SCREEN-ACTIVE    = '0'.
            modify screen.
          endif.
        endif.
      endloop.
    Thanks
    Anil D

  • Disable a button under certain circumstances and disable input fields

    Scenario: My user receives a PDF (dymanic XML) where they fill in fields and click a Submit button to send the data to the server. They receive a confirmation copy of the form back. In our older version of Livecycle, the confirmation form was locked down - no fields were editable, the Submit button was disabled. We still need the ability to not input/change any data on the confirmation copy and not be able to click the Submit button. Under ES4, everything started out editable.
    On the confirmation copy, there are messages that I check. When those messages are present I would like to hide the buttons (optimal solution) or at the very least, disable them so the user cannot resubmit the form again.
    I've managed to put Javascript in place to lock down all input fields, I just can't get the script to work to hide the buttons. I'm beginning to wonder if the script to lock down all input fields is causing the scripts to hide the buttons to not work.
    Sample code to disable editing of input fields:
    - had to provide this code at the table level so that when a table flows to a second page, the fields are locked. When I put it at the page level or top level of the hierarchy, it only worked on the one page when I need it to cover fields that have flowed on to a second page. Even at the table level, there are still some tables that remain open until a change is made, then the fields on the second page become locked.
    - when this is entered at the subform level, second page of the subform is modifiable
    rfqHeader.rfqHeader.IssuerInfo::ready:layout - (JavaScript, client)
    if (rfqHeader.rfqMessages.Message.rawValue != null)
    // Get the field containers from each page.
    for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++)
    var oFields = xfa.layout.pageContent(nPageCount, "field");
    var nNodesLength = oFields.length;
    // Set the field property.
    for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++)
    oFields.item(nNodeCount).access = "readOnly";
    Sample code to make the button hidden:
    rfqHeader.rfqFooter.button.SubmitButton::initialize - (JavaScript, client)
    if (rfqMessages.Message.rawValue != null)
    this.presence = "hidden" ;
    Any help and suggestions would be welcome!
    Thanks, Josie.

    Hi Josie,
    I think, for what you are trying to do, you must be in the doc:ready to be able to do this.
    All because the doc:ready is the last event to be fired when a form is reopen...
    rfqHeader.rfqFooter.button.SubmitButton::docReady - (JavaScript, client)
    if (rfqMessages.Message.rawValue ! = null)
    this.presence = "hidden" ;

  • How to check the visibility of a Web Dynpro input field

    Hi,
    In my application, one input field could be set as invisible by
    1, Component Configuration: The 3rd tab "Web Dynpro Built-in" -> Views and There Elements -> Visibility (Check the radio: No)
    2, Administrator configuration: While the Web Dynpro is accessed through URL with parameter "sap-config-mode=X", the administrator can configure the visibility of the UI element through right click menu "Settings for Current Configuration".
    Could any one tell me how could I know whether the input field is visible or not?
    I have tried that in the WDDOMODIFYVIEW method of the view, the method CL_WD_UIELEMENT->get_visible( ) always returns '02' even if the input field is invisible.
    Thanks in advance!
    Cheers,
    David

    Hello,
    See this: [Component and Application Configuration|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b52e13c3-0901-0010-8fa6-d11a51821b7c].
    Regards.

  • Disabling one input field if i enter text in second inputfield

    Hi,
    I am new to WebDynpro. My problem is very simple. I have two input fields. When i enter text in one input field i want the second input field to be disabled & Vice versa. The idea is that i want to give the user the option to enter in only 1 input field of his choice. The second input field should automatically get disabled. He can choose any input field of his choice. The second one should get disabled.
    EG: Assume that there are two input fields "Item No" & "Material". The user wants do a search using any one of these parameters, but not both. So, when he chooses to do a search based on "Item No", the "Material" input field should be greyed out(disabled). And, vice versa. The user may decide to choose any one of these fields.
    Please advise.

    This is not possible because there is no "onFocus" event on the input field.
    But you could use two radio buttons R1, R2 to enable exactly one of the input fields F1, F2 at a time.
    In the view designer, set R1.keyToSelect = "1", R2.keyToSelect = "2".
    Bind R1.selectedKey and R2.selectedKey to a common context attribute A (type string).
    If (at runtime) A contains "1", radio button R1 is selected, if A contains "2", radio button R2 is selected.
    To enable input field F1 exactly if R1 is selected:
    Create a calculated boolean attribute E1 that returns the boolean value ("1".equals(A)), bind property F1.enabled to E1. Do the same for F2.
    Armin

  • Convert Input Field in Picking List in the WEB UI interface

    Hi, Experts
    I´ve used the EEWB to create a new field (like a select-option) in the business transaction of opportunity in the new tab "Customer Fields". I´ve included it as a WEB UI, transaction BSP_WD_CMPWB.
    Using the transaction CRMD_ORDER the field appear as I want it. However in the WEB UI the field appears like a simple Input Field. I need to change the field´s type to Picking List, I imagine.
    But I don´t have idea how can I do it.
    Can anyone help me?
    tnks in advanced.

    Doug,
    Honestly the steps are pretty basic assuming you have an enhancement set setup in your client.  If not create one in table BSPWDV_EHSET_DEF and then assign it in view: BSPWDV_EHSET_ASG.
    1.  Find the name of the component and view that you need to enhance by hitting F2 on the screen in question.
    2.  In the SAP GUI go to transaction BSP_WD_CMPWB
    3.  Display the component that you want to enhance
    4.  Hit the enhance component button on display view of the screen
    5.  When prompted for a storage location name it Z<component_name>
    6.  Keep the repository.xml the same
    7.  Now that it is enhanced.. you see the screen as component xxxx enhancement set xxxx, you can right click on the view name in the tree and choose the enhance option.
    8.  Step through the screens to put in a transport request and then it should be ready to go.
    My blog here shows the basic steps:
    /people/stephen.johannes/blog/2008/01/25/crm-40-to-52-customerh-fields
    Keep in mind since you already have the field generated you don't have to do much else.
    Take care,
    Stephen
    Edited by: Stephen Johannes on Feb 12, 2009 11:20 AM

  • Validating Input field in Web Dynpro

    Hi All,
    Could you please tell me how do I use set_attribute and get_attribute methods to get the user input from the dynpro screen?
    The user enters some data in the input field. I need to get this data and validate it.
    Please tell me how to get the user input.
    Thanks & Regards,
    Srilakshmi B

    hi,
    you can go through it,might be your problem solve.
    Example for Using Messages
    The following example shows how you can use messages created in the Message Editor. In the example, both messages with static text and messages that are dependent on user inputs – that is, messages with dynamic text – are defined.
    Description of Example
    Users can create a domain in this sample application. They can then enter a number in the next input field and press Click here to validate. If the specified number lies in the previously specified range, the user is informed of this fact in a standard message. If the number does not lie within this domain, the user sees a warning message.
    Prerequisites
    You have created a Web Dynpro application and defined view “MainView” within a Web Dynpro component.
    Procedure
    Creating the View
    Define the view as illustrated below:
    Context Creation:
    The context that provides the data is created as follows:
           1.      Create a context node, UIElem
           2.      Set the propertycardinality to 1..1 for the context node.
           3.      Create the context attributes a, b, and TypeField.
           4.      Set the Type of the context attributes to Integer.
    Data Binding
    To make the messages dynamic with regard to specification of the domain, the user inputs have to be saved. To do this, the input fields have to be bound to the context.
    sss
    Object
    Object ID
    Data Binding to Attribute
    Path Within the Context Structure
    a
    Input Field
    A
      MainView.UIElem.a
    b
    Input Field
    B
      MainView.UIElem.b
    Children_2
    Input Field
    TypeField
      MainView.UIElem.TypField
    In addition, bind the Children_3 pushbutton to action ValidateAction, which you also have to create.
    Creating Messages in the Message Pool
    The Web Dynpro tools provide a special message editor for defining messages of different types. 
    A message is defined by a specified key, message type, and message text. The message types  error,  warning, and  standard are predefined.
    Create the following messages:
    Messages Defined in the Message Editor
    Message Key
    Message Type
    Message text
    key1
    warning
    Please enter a number between the range of and !
      and are placeholders for the user input (the domain), which changes dynamically.
    key2
    standard
    The value entered is within the valid range.
    Implementation
    Because the messages are only displayed when the user Chooses Click here to validate, the messages must be implemented in the method onActionValidateAction:
    Implementierung der Methode onActionValidateAction()
    //@@begin imports
    import com.sap.tc.webdynpro.progmodel.controller.MessageManager;
    import com.sap.test.errorhandlingtest1.wdp.IMessageErrorhandlingTest1;
    import com.sap.test.errorhandlingtest1.wdp.IPrivateMainView;
    //@@end
    public void onActionValidateAction(
                           com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent)
        //@@begin
       int i = wdContext.currentUIElemElement().getTypField();
       int a = wdContext.currentUIElemElement().getA();
       int b = wdContext.currentUIElemElement().getB();
       MessageManager msgMgr =
             (MessageManager)wdThis.wdGetAPI().getComponent().getMessageManager();
       if (a < i && i < b)
             msgMgr.reportMessage(IMessageErrorhandlingTest1.KEY2, null, true);
       else
             Object[] arg ={new Integer(a), new Integer(b)};
             msgMgr.reportMessage(IMessageErrorhandlingTest1.KEY1, arg, true);
        //@@end
    The following tasks have been implemented in this method:
           1.      Read user inputs:
    int I = wdContext.currentUIElemElement().getTypField();
    int a = wdContext.currentUIElemElement().getA();
    int b = wdContext.currentUIElemElement().getB();
    1.       Read messages from the Message Manager:
    MessageManager msgMgr =
                 (MessageManager) wdThis.wdGetAPI().getComponent().getMessageManager();
    2.       Does the input lie within the defined domain?
    if (a < i && I < b)
    3.       Call the  standard message when the input lies within the domain:
    MsgMgr.reportMessage(IMessageErrorhandlingTest1.KEY2, null);
    Method reportMessage can be used to read the messages from the Message Manager. In this way you define the key and the objects that you want to change dynamically in the messages. Because no dynamic text was defined in your standard messages, you define null as a parameter.
    4.       Call the  warning messages when the input does not lie within the domain:
    Object[] arg ={new Integer(a), new Integer(b)};
    MsgMgr.reportMessage(IMessageErrorhandlingTest1.KEY1, arg);
    Because the warning messages ( Please enter a number between the range of  and !) contain text that depends on the user input, you also have to define the parameters for the domain in an object array. In the messages, the first object is then called from the array with (and the second with , and so on).
    Result
    After you have built and deployed your application, you can call it by choosing Run.
    If the user enters a number that lies within the defined domain, a standard message is displayed:
    If the user enters a number that does not lie within the defined domain, a warning message is displayed:

Maybe you are looking for

  • Installing CC Photoshop CS6

    Just want to know if I can still use CS5 - ie: Does the insallation update and delete my CS5 version? I'm on a mac. OS 10.6.8. Thanks.

  • Iphoto version 7.1.5

    I use to be able to double-click on an event to then see all my photos within that event on one page. Now when I double click on an event it brings up one picture and in order to see any of the others I have to click edit. Then they will appear at th

  • Mass update from PSA to ODS in 3.5

    Hello friends, I am having nearly 100requests pending to load from PSA to ODS. I am doing manually one by one from RSMO. Is there is any way to do it in mass or automatically.. Thanks Tony

  • UWL - action in new window

    hi experts, I have a problem with the action buttons of the items of UWL, the action is set for the property launchInNewWindow = "yes" when I press the button the next step opens in a new window, but if I press the button again open another window wi

  • RMI application policy problem..

    Hi; Because i am very new in eclipse and java i will ask you an easy question which is realy hard to find out for me. I created an RMI project in eclipse and i put the codes inside. When i am trying to run it is says Security Manager loaded Exception