How to bind a UI element to the context

Hi Experts,
           I have a problem binding UI element to the context. In my code i have to create TabStrips dynamically and under this tabstrip number of UI elements would be there. For this i have a code like this..
IWDTransparentContainer theActionContainer =(IWDTransparentContainer)view.getElement("RootUIElementContainer");
     IWDTabStrip ts = (IWDTabStrip) view.createElement(IWDTabStrip.class,"TabStrip");
          IWDTab tab1 = (IWDTab) view.createElement(IWDTab.class,"Tab1");
          IWDInputField in = (IWDInputField) view.createElement(IWDInputField.class,"in");
          IWDCaption header1 = (IWDCaption) view.createElement(IWDCaption.class,"Header1");
          header1.setText("Tab1");
          tab1.setContent(in);
          ts.addTab(tab1);
          IWDTab tab2 = (IWDTab) view.createElement(IWDTab.class,"Tab2");
          IWDInputField in2 = (IWDInputField) view.createElement(IWDInputField.class,"in2");
          IWDCaption header2 = (IWDCaption) view.createElement(IWDCaption.class,"Header2");
          header2.setText("Tab2");
          tab2.setHeader(header2);
          ts.addTab(tab2);
          theActionContainer.addChild(ts);
<b>when i run this code it is giving following exceptions..</b>
The initial exception that caused the request to fail, was:
   com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Property 'value' of AbstractInputField with id 'in' in view 'LoginView' must be bound to the context
    at com.sap.tc.webdynpro.clientserver.uielib.standard.impl.AbstractInputField.getValue(AbstractInputField.java:1260)
    at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.InputFieldAdapter.getValue(InputFieldAdapter.java:582)
    at com.sap.tc.ur.renderer.ie6.InputFieldRenderer.render(InputFieldRenderer.java:56)
    at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:435)
    at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:134)
    ... 63 more
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Property 'value' of AbstractInputField with id 'in' in view 'LoginView' must be bound to the context
     at com.sap.tc.webdynpro.clientserver.uielib.standard.impl.AbstractInputField.getValue(AbstractInputField.java:1260)
     at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.InputFieldAdapter.getValue(InputFieldAdapter.java:582)
     at com.sap.tc.ur.renderer.ie6.InputFieldRenderer.render(InputFieldRenderer.java:56)
     at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:435)
     at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:134)
     at com.sap.tc.ur.renderer.ie6.TabStripRenderer.renderTabStripItemContentFragment(TabStripRenderer.java:1867)
     at com.sap.tc.ur.renderer.ie6.TabStripRenderer.renderTabStripFragment(TabStripRenderer.java:838)
From these exceptions what  i understood is, i need to bind these UI elements to context.
   Can any body tell me how to bind a UI element to the context if I understood the exceptions correct..
Thanks in Advance,
Murthy.

HI,
lets say Ctx is your context attribute,
IWDAttributeInfo attrInfo = wdContext.getNodeInfo.getAttribute("Ctx");
then , as per your code,
IWDInputField in = (IWDInputField) view.createElement(IWDInputField.class,"in");
<b>in.bindValue(attrInfo);</b>
if your contex attribute is child of some other node then do like this,
IWDAttributeInfo attrInfo = wdContext.getNodeInfo.getChildNode("SalesOrder",0)getAttribute("Ctx");
//this is when Ctx is child of node SalesOrder, and we are taking Ctx from its 0th element
then ,
IWDInputField in = (IWDInputField) view.createElement(IWDInputField.class,"in");
<b>in.bindValue(attrInfo);</b>
include this in your code ,
let me know if you face any problem
regards
reward points if it helps

Similar Messages

  • How to add a new Element to the Context

    Hello all.
    I created in the wdInit()
    ArrayList datas = new ArrayList();
         for (int i = 0; i < 25; i++) {
              MyData data = new MyData();
              data.setMethods();
              datas.add(data);
         wdContext.nodeMyData().bind(datas);
    Now, I want by clicking on the Button "Create new Element", forward user to the other View, which elements are connected with the same model -> context, the new element should be added to context, the user should fill the form and click Save-Button.
    How can I add a new Element to the Collection I created and choose it as a current element?
    If I do: wdContext.nodeMyData().bind(new MyData()) all information will be lost. And I will have only one field.
    If I do it like this:
    IWDNodeElement dynTabElem=(IWDNodeElement)wdContext.nodeMyData().createElement();
    wdContext.nodeMyData().addElement(dynTabElem);
    I get an error: com.sap.tc.webdynpro.progmodel.context.ContextException: NodeInfo(DataComp.MyData): value node is created without a reference
    Well I can pass to my new View a Collection as a parameter and then
    Collection.add(new MyData()) and then bind it. But I find this solution not good.
    Is there any possibility to get the existing Collection from the Context without passing it to the view?
    Can I just add a new element to the existing collection?
    Thanks in advance.

    Hallo Monalisa,
    I did as you said. But I can't add something to my model class, because it is not collection.
                            MyData data = wdContext.currentBelegElement().modelObject();
                   data.add() ???? - don't work
                   wdContext.nodeMyData().invalidate();

  • How can I create an element in the model node?

    Hi, Experts,
    I create a model node that name is containerNode in the contxt. Cadinility is: 1..n
    I write the code in the method:
      private String getDataForOutputTable( IWDNode wageTypePayslip, IWDNode containerNode ){
           String betrgSumStr = "";
         int index = 0;
         Vector containerVector = new Vector();
         int size = wageTypePayslip.size();
         IWDNodeElement element = containerNode.createElement();// The system report error when I run the application.
         BigDecimal betrgSum = new BigDecimal( 0 );
    I try to create a element in the containerNode, But the system report error when I run the application.
    java.lang.IllegalArgumentException: model object must not be null
         at com.sap.tc.webdynpro.progmodel.context.ModelNodeElement.<init>(ModelNodeElement.java:66)
         at besuretech.com.wdp.IPrivatePayDataDispView$IOContainerElement.<init>(IPrivatePayDataDispView.java:1537)
         at besuretech.com.wdp.IPrivatePayDataDispView$IContextNode.doCreateElement(IPrivatePayDataDispView.java:88)
         at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:884)
         at com.sap.tc.webdynpro.progmodel.context.Node.createElementInternal(Node.java:1351)
         at com.sap.tc.webdynpro.progmodel.context.Node.createElement(Node.java:1370)
         at besuretech.com.PayDataDispView.getDataForOutputTable(PayDataDispView.java:251)
         at besuretech.com.PayDataDispView.getAllData(PayDataDispView.java:196)
         at besuretech.com.PayDataDispView.onPlugPayListViewIn(PayDataDispView.java:154)
         at besuretech.com.wdp.InternalPayDataDispView.wdInvokeEventHandler(InternalPayDataDispView.java:391)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:826)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.navigate(ClientComponent.java:881)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doNavigation(WindowPhaseModel.java:498)
    How can I create an element in the model node ?
    Best regards,
    tao

    Hi,
    You need to execute the model before creating the element.
    Regards
    Ayyapparaj

  • How can i create a link in the context help from frontpanel elements like knobs and so on

    i want to create on context sensitive online help and therefore need to know how i can place a hyperlink in the context help from labVIEW of a frontpanel element

    lotto;
    You can place your help file in LabVIEW help directory, which should be in \help. If you place your help file in that directory, then when you start LabVIEW, you can access your help from LabVIEW's help menu (there will be an extra entry with the name of your help file.)
    To link your control or vi to this help file, open the front panel (or the panel where you edit the control) and open the VI setup. In the help path field write the following:
    :\name.hlp
    Where "name" in the name of your help file. in the "Help Tag" field you should enter the tag you already assigned to the topic in the help at design time. (I suggest the tag to be similar as the vi or control name.)
    After all this, the next time you start LabVIEW,
    you should be able to access the context help file to your control or vi by right-clicking on it and selecting "Online Help".
    IMPORTANT NOTE: Be aware that you may loose files you locate in special directories in LabVIEW, like the help, because those directories might be overwritten when you upgrade your software. Another option can be to locate your help file in a directory other than LabVIEW's help. The steps are almost the same, except that you won't be able to access your help file from LabVIEW's help menu.
    Best regards;
    Enrique
    www.vartortech.com

  • How to bindi a UI element to 2 model nodes different in the same view

    I want to know how I can bind a set of inputfields, in a form view, to 2 different model nodes ?
    <u>example:</u>
    Im working with 2 adaptional RFC, both working, in my Custom Context.
    Ztest_Search
    Ztest_Update
    In my ResultView I have 2 Model nodes (one for each RFC) I show a set of inputfields in a form view, binded to the Ztest_Search_output of Ztest_Search. This works.
    now I want to update the changes, but I can't find the ways of binding the same inputfields to my other Model node (Ztest_Update) in the context of ResultView.
    Note: If I create a duplicate set of inputfields , one for Ztest_Search binded to the Ztest_Update_output and the other to the Ztest_Update_Input Works. But I wanna avoid this duplicated set of inputfields.
    Thx

    Rodrigo,
    If I understood correctly, your problem is to get the data from the input fields which are bound to a
    model node, Ztest_Search_output and set it to the model node of another RFC, Ztest_Update.
    This can be done by getting the suitable values from the model attributes of Ztest_Search_output
    and setting it to Ztest_Update.
    <b>/**
    * valueOne, valueTwo are the name of the model   
    * attributes that are bound to the Input fields.
    */</b>
    String firstValue = wdContext.currentZtest_Search_outputElement
         ().get<valueOne>;
    String secondValue = wdContext.currentZtest_Search_outputElement
         ().get<valueTwo>;
    Ztest_Update_Input update = new Ztest_Update_Input();
    wdContext.nodeZtest_Update_Input().bind(update);
    <b>/*
    *<b>Zstructure is the structure of the model node under
    *Ztest_Update_Input to which the values have to be 
    *updated.</b>
    */</b>
    ZStructure structure = new ZStruture();
    structure.setValueOne(valueOne);
    structure.setValueTwo(valueTwo);
    update.addZStructure(structure);
    try
       update.execute();     
    catch (Exception ex)
       wdComponentAPI.getMessageManager().reportException(ex.getMessage(), false);                     
    wdContext.nodeZtest_Update_Output().invalidate();
    Bala

  • How to make a UI element at the horizontal middle of a View?

    a browser like IE , if  the computer screen size is different,  UI Element position will change.
    How can i make the UI in the middle of the screen. like the WebDynpro Longon page.

    Hi Jason,
    You will have to use three transparent containers in the view.
    Adjust your transparent containers so that it will cover the 100% area of
    the view.
    Use matrix layout for root container and put all three transparent containers
    one below other i.e. in a single column. Apply matrix head data for two
    containers.
    Now put all your UI elements in the middle transparent container in a group.
    so that you can apply grid layout to your 'group' UI element.
    I hope this will solve your problem as this solution helped me in my
    developement.
    Or else,
    Just use the system logon, it's already pre-configured. The link is:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ff/c7de3fc6c6ec06e10000000a1550b0/frameset.htm
    Always use UI elements so that 100% area can be used. Because this will automatically adjust your screen for different computer screen sizes. Do not use UI elements in pixels. These might vary as per the screen size.
    Cheers,
    Darshna.

  • How to include a response element in the ESB database adapter.

    hi,
    i am using the dbadapter to insert the data into the table successfully.
    The problem is when i am using a db adapter it doesnot include a response element in its wsdl.I want to send a response to the client as and when the data got inserted from the dbadapter for that transaction.
    i tried using the pl/sql procedure with a out parameter which returns the response but the problem is the pl/sql is called by adapter only once though i am using for each constructor.
    i tried to modify the xsd generated by the dbadapter by including the response element,but the xsd is not getting parsed and throwing error.
    how to overcome this problem and send a immediate response to the client as and when the adapter inserts the data into oracle?
    thanks in advance.

    Although not the cleanest solution, but can't you create another routing service which defines a request (equal to the request element of the original routing service) and reply element (defining a single element called success or something).
    Then have this new routing service invoke your original routing service which invokes the database adapter. Now define a XSLT map for the reply of the new routing service and put an XSL text there with the value "success" or something?
    So:
    Routing_service_new --> Routing_service_original --> database_adapter
    Regards, Ronald

  • How do I download Photoshop Elements with the Adobe Download Assistant?

    It used to be pretty straight forward, you would launch ADA and it would show all the programs available for download.
    Now it just shows "Products you may like", which doesn't show Elements (at least not that I can find).
    So how do I get Photoshop Elements? Am I looking in the wrong place?

    If you have tried a different web browser and are still facing problems please try initiating a direct download of the software by following the steps listed at http://prodesigntools.com/photoshop-elements-11-direct-download-links-pse-premiere-pre.htm l.  Please be advised that you need to complete the Very Important Instructions section prior to clicking on the link to download the software.

  • How to goTo a specific element in the sap.m.list

    Hi everyone,
    I have a long list of elements in the sap.m.list.
    I wish to allow the users to get to a specific element of the list without the users having to scroll the long list.
    Is that an api to allow the list to automatically "scroll to" a specific element?
    Regards,
    Chris

    Hi Chris,
    may be you can provide SearchField to go to specific element. have a look at JS Bin - Collaborative JavaScript Debugging&lt;/title&gt; &lt;link rel=&quot;icon&quot; href=&quot;http://static.jsbin.… I have not implemented search function but this will give you an idea what I am trying to convey.
    Regards,
    Chandra

  • How to bind data (from database) to the Dictionary structure in Web Dynpro

    Hi,
    I am getting Hashtable object from the database related classes and I want to bind this data to the Dictionary field in Web Dynpro. So, I can bind this Dictionary field type to the Context variable.
    Please let me know the detailed procedure.
    Thanks
    Tatayya M

    Tatayya,
    Look at this sample tutorial , It will defintely help you with the Data Dictionary .
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/bad3e990-0201-0010-3985-fa0936d901b4
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/38650ecd-0401-0010-10a0-f9d8fd37edee

  • How to transfer my container element to the bor object

    Hello
    I am quite new to workflow. I have created a workflow with a task and in this task I have a container element that is an Id for a campaign element and I can see that the container is filled correctly. In my task I call a BOR object amd a method and I want to transfer my campaign Id to this method, but when I debug I can see the ID is getting into the bor object. How do I get the id into the bor object
    Thanks
    Claus

    Hi Claus
       After binding from task to method. You will get the data in the method parameters but to transfer the data from parameter to method you need to use this code in your method.
    SWC_GET_ELEMENT CONTAINER 'CONTAINER NAME' VARIABLE NAME.
    SWC_SET_ELEMENT CONTAINER 'CONTAINER NAME' VARIABLE NAME.
      Use this statement to get the data to the method container.
    Regards
    vijay

  • How to put an xml element in the header field?

    Hello friends,
    My requirement is like I've a particular element that needs to be printed on the header filed
    for ex --dept_no and dept_name in the header field...please let me know how..
    Thanks

    For each occurrence of DEPT_GROUP, a new section is created.
    These sections can have different header/footer.
    In case, you want different values to be displayed in header/footer section(as your requirement) or you want the page numbers to be reset for each group, you can use this command.
    Check the user guide http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/e12187/T421739T481157.htm#4535398

  • How to use '*' as data Element in the NTE(Edi 850) Segment

    Hi All,
    I am facing a field level error while using '*' in EDI 850 (NTE segment). '*' is also used as Data Element.
    For Eg: NTE*GEN*My Text *goes here
    Here, NTE02 should be My Text *goes here. So, how can I use "*" here without changing anything in the EDI message?
    I have asked this question before
    http://social.msdn.microsoft.com/Forums/en-US/1668e8d8-ee99-4d79-961b-8d26f3a496f8/error-while-using-in-the-nte-edi-850-segment-where-is-also-used-as-data-element?forum=biztalkediandas2
    The answer in the above forum was to ask client modify the EDI message.
    Previously, our client was using a different technology (other than BizTalk) which was working fine with this format. So, they are insisting on this format only.
    Thanks,

    Sorry, the answer is the same.
    It doesn't matter what EDI platform either side is using, the '*' in the field content conflicts with the '*' that is the element delimiter. That is invalid EDI, there is no way around that short of writing a custom EDI parser.
    It's not clear if you're sending or receiving this message.  But again, it's really doesn't matter.
    1. Change the Element Delimiter to something other than '*'.  < or > are not uncommon.
    2. If you are receiving the EDI, create a custom Pipeline Component that "handles" NTE02 either by replacing the '*' with a substitute char or deleting it.
    3. If you are receiving, you could add extra elements to NTE to accommodate extra fields (since that's how the parser will see them).  Then you can join them again in a Map.

  • How to bind data to table in the view

    Structure in  context:
    Result(0....n)
    |-----lmAcctbPK(1...1)
    |         |-----acctno
    |         |------retrieveDate (type: Calendar)
    |---closeBalance
    |----availableBalance
    How can I bind the list to a table in the view?
    Thanks in advance.
    Message was edited by:
            shen peng

    Thanks for your feedback.
    In a word, lmAcctbPK is a composite  primary key, just like closeBalance and availableBalance, is property of an object.
    Output like this:
    acctNo                                                |   closeAvailableBalance |  closeBalance
    YPp6QfwWepzm1h0q7EoCcJ8iEXL4k83u   |    125.0   |     1243.87
                                                                    |    125.0   |     1243.87
                                                                    |    2125.0  |        3000.0
                                                                    |    125.0    |        1243.87
                                                                    |     1111.0  |       43794.87

  • How to get Focused UI element on the Window in 7.01

    HI,
      We were on 7.00 and recently upgraded to 7.01. we have a problem with the upgrade.. The window object no more holds the Focus . Here is the code ...  lo_curr_window->focus is blank all the  times.. This was working fine till 7.00 and now it stopped working..
    data:lo_window_manager      type ref to if_wd_window_manager,
            lo_api_component       type ref to if_wd_component.
      data: lo_clnt_appl type ref to cl_wdr_client_component,"CL_WDR_CLIENT_APPLICATION,
              ls_view_mgrs type wdr_viewman_line,
              lo_curr_window type ref to cl_wdr_window,
              ls_focus type wdr_focus,
              lo_uielem type ref to cl_wd_uielement,
              lv_path type string,
              lo_selected_elem type ref to if_wd_context_element,
              lt_strtab type table of string,
              lv_colname type string,
              lv_tablen type int4.
      lo_api_component  = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
      lo_clnt_appl ?= lo_window_manager.
      read table lo_clnt_appl->view_managers_for_window
                  into ls_view_mgrs with key name = `ZWD_TEST`.
      if sy-subrc = 0.
      get the window in which this interface view is embedded
        lo_curr_window = ls_view_mgrs-view_manager->get_window_recursive( ).
        if lo_curr_window is initial.
          lo_curr_window = wdr_task=>application->application_window->get_active_modal_window( ).
        endif.
        if lo_curr_window is not initial.
          ls_focus = lo_curr_window->focus.
          lo_uielem ?= ls_focus-view_element.
       endif.
      endif.
    Thanks
    Mahesh

    You seem to be utlitzing SAP internal APIs - so a change in behaviour between releases certainly seems possible. Refer to the online help to find out which APIs are safe to use:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/64/be5b4150b38147e10000000a1550b0/frameset.htm
    What exactly are you trying to acomplish?  From your code you seem to be trying to get the UI element that has the current focus. Is that correct?  To what purpose?
    Perhaps you should review the online help section on Focus Handling:
    vhttp://help.sap.com/saphelp_nw70ehp1/helpdata/en/c0/800f02bb734dd9977a64a8a7e87fe3/frameset.htm

Maybe you are looking for