Custom controller context value attribute

Hello,
I have a custom controller with one value attribute. In the wdDoInit() method of the custom controller I can not access this attribute using:
wdContext.currentContextElement().setAttrib()
Why?
The same works without any problems using the component controller instead of the custom controller.
Thanks, cheers,
Felix

Hi,
I have created the custom controller and within that I have created the attribute.
Now I am able to access the attribute by using thr same code.
wdContext.currentContextElement().setAge(" ");
After creation of custom controller you just save all metadata. Then check it.
I think you will get  the attribute.
Thanks
Chandan

Similar Messages

  • Sending controller context value attributes to web service model

    Hi,
    I have put some parameters (value Attributes) in controller context and mapped to different views. Is there any way by which i can send the values to the web service model , each time the web service is called? like through header or some thing like that??

    Hi Sujesh,
    Read those value attributes in your controller using following code:
    wdcontext.currentContextElement().get<attribute>();
    and then set these value in your web service model.
    <model name> model = new <model name>();
    model.set<attribute>(<value>);
    wdcontext.node<nodename of your web service model>().bind(model);
    wdcontext.current<nodename of your web service model>element().modelobject().execute();
    Regards,
    Bhavik

  • How to map single context value attribute to multiple value attributes?

    Hello,
    is there any way to map a single value attribute
    from view's context into several value attributes
    in controller's context?
    The business context of what I want to achieve
    is the following: I have a view which can be called
    in two modes: read only (RO) and read-write (RW).
    The input parameters to the view are the same for
    both modes, however when in RO mode, the view calls
    a different set of web services than when called
    in RW mode. Before calling each of the web services
    I need to populate their context value attributes
    with appropriate input values.
    I know I can do it in Java code, but is it possible
    to do it without any programming (doing it in the
    source code is prone to errors)?
    Any help highly appreciated.
    Greetings,
    Tomek.

    Hi Kishore,
    than you very much for your kind help.
    I have already created a value attribute of type
    boolean and mapped it into the read-only property
    of the UI elements. This however does not solve all
    of the problems... I will describe it with an
    example:
    Let's say the form I want to implement will be
    used to: create (read-write mode), update (read-
    write mode) or show (read-only mode) customer's
    data. The customer's data is complex (lots of
    data, including tree structures).
    The problem is that:
    - when the form is called in read-only mode,
      it should populate its fields with values
      provided by the getCustomerData web service,
    - when the form is called to create a new
      customer (in read-write) mode, it should
      not use the getCustomerData web service.
      Instead it should map the input values
      entered by the user into input parameters
      of the createNewCustomer web service,
    - when the form is called to update customer's
      data, it should first display values returned
      by the getCustomerData web service, and then
      it should map the modified values entered by
      the user into input parameters of the
      updateCustomer web service,
    In all the above cases I must map my view's
    context data to different controller's context
    elements. Doing it directly in the source code
    is not a nice solution. Is there any other
    way to achieve this? 
    Calling a form in different modes in not an
    unusual thing, so I was hoping that maybe
    there are any built-in mechanisms that would
    solve the obove problem...
    Greetings,
    Tomek.

  • Setting property  for context value attributes

    hi experts,
      created a value attribute[XYZ] in context and i want to set that value attribute type as
    com.sap.tc.webdynpro.services.session.api.IWDWindow
    From properties am not finding the above path.
    please provide the valuable information.

    hi sham,
               my question is solved.thank's for u r help
    my next task is connecting the backend  BW using jco connections.
    SingleServer
                               Host Name:
                                System Number:
                                 SAP Router:
    User Account:
                                                                              Client:
                                                                                Logon name :
                                                                                 Password:
                                                                                 language:
    where do i get  these details .is this possible to get these details from development mechine.i do have access to enterprise portal.
    Thank's&Regard's,
    Prashanth.

  • Interface Controller context model attribute error

    I am trying to create a controller interface as such:  I created a DC that goes out and retrieves SAP ID using a RFC call.  My controller context is bound to a RFC model.  I'd like to expose the SAP ID that comes back from that call within a model attribute to other components.  I try to create a model node and corresponding model attribute within the Interface Controller, setting the isInputElement = true.  However, as soon as I do this I get a number of compile errors:
    "The context model node has not been bound to a model class", "The context model attribute has not been bound to a model property". 
    Are you not allowed to map model nodes to an interface?

    Karla,
    First, set isInputElement to false. Think again, you are exposint "result" outside but not collecting "input" from outer component.
    Next, calculated attributes to the rescue here.
    Say, in component controller you have 1..1 / 0..1 model node <i>SapIdQuery_Input</i> with 1..1/0..1 child <i>SapIdQuery_Output</i> that holds <i>System_Id</i> attribute, type <i>string</i>.
    Now create in component controller context (right below root node) attribute <i>System_Id</i> of type <i>string</i>, set read-only to true and calculated to true. Switch to source editor and write the following for generated attribute "getter":
    if (wdContext.currentSapIdQuery_InputElement() != null &&
        wdContext.currentSapIdQuery_OutputElement() != null)
      return (String)wdContext
        .currentSapIdQuery_OutputElement()
          .getAttributeValue("System_Id");
    else
      return null;
    Now add controller usage (of component controller) in interface controller and map attribute in interface controller to calculated attribute in component controller.
    If you expirienced problems with mapping, try to create calculated attribute in 1..1 subnode of root context node.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • Need to bind value attributes of Component controller with value attributes

    Hi,
    I am developing a Java Web Dynpro application which is importing RFC Model.

    Hi Kaushik,
    It is very simple to enter values in webdynpro and to update the ztable through RFC
    All you hav to do is
    1. Create the ztable , RFC to import data into that table,
    2. Create the model in webdynpro with that RFC
    3. First map the ModelInputElements to the component controller(say zid, zname) (you can have your own value attribute in component controller say id , name )
    4. Map the attributes to the view where the input field is there
    5. Now write the code as follows,
    Zxxx in = new Zxxx();
    wdContext.nodeZxx_InputElement.bind(in);
    in.setZid(wdcontext.currentContextElement().getId()); // getId component controllers attribute and getZid is model' s mapped attributre
    in.setZname(wdcontext.currentContextElement().getName()); // getName component controllers attribute and getZname is model's mapped attributre
    /* u need not have to map that model attrobute to component attribute for that */
    try
    in.execute();
    Catch(Eception e)
    e.printStackTrace();
    Regards,
    Sam Charles J.

  • Custom controller causes DFF attribute values to be overwritten when usinf

    Hi,
    I have customised an Oracle seeded controller to handle the DFF field for the ReadOnly property.
    have used BoundValueUtil.bindReadOnlyAttr(flex, "MSSupReadOnly").
    There are 3 DFF field but for some reason if there are 2 lines on that page and I update one line one of the DFF segment values gets updated on the other and the value on that line is overwritten.If I remove the customization it works fine and it happens just for 1 field I am handling another DFF segemnt same way but it works fine.
    i also tried using
    flex1.setAttributeValue(OAWebBeanConstants.READ_ONLY_ATTR,new OADataBoundValueViewObject(flex1, "MSSupItemReadOnly"));

    Put some debugging statements in the code and follow the processing logic. That should give you some idea on where its getting wrong.
    --Shiv                                                                                                                                                                                                                                                                                               

  • Values not passing from form to context attributes (value attributes)

    Hi Experts,
    I have bound the properties of theadobe interactive form (WD-Java) to the context attributes but the values are not passing to the value attributes at runtime.
    For your information I have not bound the pdfsource binary attribute of the view to the custom controller pdfsource binary attribute.
    Please advise.
    Thanks,
    Shobhit

    Context
       GetData - ModelNode mapped to controller context (DataSource)
             Attribute1 - Value Attribute (Form Field)
    Is it allright to have the Data Source as a ModelNode (mapped to the controller context node) and then have Value Attributes under the ModelNode which are then bound to the adobe form input fields.
    I know its frustrating to advise on such questions without looking at the code actually. But I would definitely need your support.
    If possible could you mail me a project of yours where you have the form being PREFILLED with some values coming from a RFC FM and then the same form gets posted to SAP though another RFC FM.
    Thanks,
    [email protected]
    OK. When I create a Fresh Adobe Interactive Form application, it works fine.
    The problem Im facing is in the case, when Im using an existing PDF file created in the ABAP stack (TCode SFP). I am importing this PDF file into the WebDynpro Java Application and then binding the fields. So in this case the context binding does not work.
    You guyz are right, I need to check if there is any other script which exists. But still what are views after this update?
    Message was edited by:
            Shobhit Swarup Mathur

  • Error while creating the custom controller

    Hi experts,
    I am working on a web dynpro object where i need to create an application configuration.I created a custom controller context.I mapped it to main view.I am using the attribute of custom controller context in main view so that another view view1 is displayed based on this attribute.
    custom controller context
    node1 --> display_view1
    mapped above node to main view.
    view1 is triggered in main view onaction method based on display_view1 value.
    Presently i am getting the dump " node1.1.main doesnot have elements."
    Please help.
    Edited by: ch_ravi_sap on Nov 22, 2011 2:11 PM

    Hi I get rid off the error.
    Changes i have made are cardinality from 0:n to 1:n. selection 0:n
    But presently i am changing the attribute of custom controller in component configuration browser.I am not able to see the changed value in main view ( where i have used this attribute ).
    Any help is appreciated
    Edited by: ch_ravi_sap on Nov 23, 2011 12:17 PM

  • Can i Bind more than one Model object to the Custom controller or not

    Hi All, I trying to bind more than one model object to the custom controller, Both the model objects contains same attribute name called ( output). Both model objects created on to top of the BAPI. So when i bind first model object to the custom controller will work fine. When i am trying to bind the second model object to the same controller. This second model object also having the same attribute name called "output" . So it is giving an error of "Duplicate context element "Detail". Rename or uncheck duplicate elements.
    can i assign more than one model object to the single controller or not?
    But in the reference document, it has given that , we can create model object with more than one bapi.So in this case if both the bapis contains any element with the same name will also be problem. Any body give me the solution.
    Initially we have created one custom controller for each model object. But later i realized that, why con't we use same controller for all the model object. Because, the custom controller context is the public context. this context shared across all the view controllers.
    The concept which I am trying to do is right or wrong?

    Hi Vishal,
    of course, you can bind one controler to many models. When the same name occours you can simply RENAME binded node in controler.
    Regards
    Bogdan

  • How to call a custom controller method from view

    Hi,
    I ve created a simple web service and consumed it in a model. Mapped the input & output parameters to custom controller context which in turn mapped to component controller's context which in turn to view's contexts.
    How to call a custom controller method from view?
    Please explain the syntax.
    Regards,
    Manoj.

    Hi Patralekha,
    Give some idea for the below scenario:
    I ve created a simple web service and consumed it in a model. What I did was
    1) for the input parameters, mapped the node from view->custom controller->model
    2)for the output parameter, mapping from model->custom controller->view.
    It works fine.
    But I don't want to access model nodes directly, rather I want to set the input param in somewhere else (like custom controller) before calling the appropriate method, same for the response also.
    Share me your thoughts.
    Regards,
    Manoj.

  • Self defined type how to create value attribute

    Hello!
    How can I create a new context "value attribute" if its
    type is doesn't exist in the drop down list
    where you can choose either a primitive data types
    or a java Type. It is an self defined class.
    It's name is  "Notebook". I want to bind all the Notebooks
    with a value attribute. The method returns a  Notebooks-Array.
    How can I deal in such cases?
    Regards
    sas

    Hi,
    You need to put your java file inside src-->your package. As you said it is already there, then try to reload and rebuild your project. It must show in the java native types when you browse.
    Even check the package statement of your java file.
    thanks & regards,
    Manoj

  • How to read the details in the context node of the custom controller

    Hi friends,
        My requirement is i enhanced the component ICCMP_BP_DETAILS , now on EH_ONSAVE i want to read the details of the Context node in the Custom COntroller .
    In custom controller from ICCMP_BP_DETAIL/CuCoBPDuplicate  From this in context node CUSTOMER is there in that attributes first name last name is there i want to read those details
    so can u pls provide the logic for this how can i get the values.
      am very new to the BSP programming
    Regards
    Yogesh

    Hi Suchitha,
    when i am following the above code the lr_entity is not Bound, so can u pls suggest is there any thing is missing
    i used the below mention code but lr_entity is not bound
    DATA: lr_cuco type ref to CL_ICCMP_BP_CUCOBPDUPLICA_IMPL.
                lr_entity type ref to cl_crm_bol_entity.
    lr_cuco ?= me->get_custom_controller( 'ICCMP_BP_DETAIL/CuCoBPDuplicate') .
    CHECK lr_cuco IS BOUND.
    lr_entity ?= lr_cuco->typed_context->customer->collection_wrapper->get_current( ) .
    CHECK lr_entity IS BOUND .
    lr_entityIF_BOL_BO_PROPERTY_ACCESSGET_PROPERTY_AS_VALUE( iv_attibute =  'FIRST_NAME' ev_attribute = lv_firstname ) .
    Please correct the code if any thing is missing
    Regards,
    Yogesh

  • Passing field values from View Controller to Custom Controller

    Hi Experts,
    I am working on a customer requirment in which customer want to see the values of field from one view in another view. The Context node & Context node attribute are the same in both the views.
    I am aware that we need to pass the field values from view controller to custom controller in order to see the field in the subsequent view. I would like to kow how i can achieve that technically?
    Kindly let me your valueable suggesions.
    Best Regards,
    Prabahar

    Hi Carsten,
    Thank you for the detailed feedback.
    I want the fields ID_TYPE & ID_TYPE_DESCRIPTION from IUICMD/SearchAccount to be available in IUICMD/DetailAccount. I have created a context node u201CSEARCHu201D in view IUICMD/DetailAccount. I have created the context node with out choosing u201CCreate with Instanceu201D.  This Context node (SEARCH) is already available in IUICMD/SearchAccount as part of the standard.
    Below given is contents of the Method CREATE_SEARCH of my context class ZL_IUICMD_DETAILACCOUNT_CTXT of view IUICMD/DetailAccount, which is created by the Wizard during enhancement.
    method CREATE_SEARCH.
        DATA:
          model        TYPE REF TO if_bsp_model,
          coll_wrapper TYPE REF TO cl_bsp_wd_collection_wrapper,
          entity       TYPE REF TO cl_crm_bol_entity,    "#EC *
          entity_col   TYPE REF TO if_bol_entity_col.    "#EC *
        model = owner->create_model(
            class_name     = 'ZL_IUICMD_DETAILACCOUNT_CN00'
            model_id       = 'SEARCH' ). "#EC NOTEXT
        SEARCH ?= model.
        CLEAR model.
    bind to custom controller
      owner->do_context_node_binding(
               iv_controller_type = CL_BSP_WD_CONTROLLER=>CO_TYPE_CUSTOM
               iv_name = 'IUICMD/CuCoMD' "#EC NOTEXT
               iv_target_node_name = 'BUILHEADERSEARCH'
               iv_node_2_bind = SEARCH ).
    endmethod.
    I have enhanced the Custom Controller. Now it have new implementation class u201CZL_IUICMD_CUCOMD_IMPLu201D
    Let me know where I am doing mistake
    Thanks in advance
    Best Regards,
    Prabahar
    Edited by: Prabahar Raju on Sep 2, 2009 10:47 AM
    Edited by: Prabahar Raju on Sep 2, 2009 10:52 AM

  • Create Partial Fire action on DFF context value in controller extension

    Hi All,
    I have a requirement where I will have to default the DFF attribute value based on the context value chosen in the same DFF.
    Since the page is a seeded page i have done that using Controller Extension.
    I have followed the below steps.
    1.I have created one class file XXR2R_AR_BANK_ACCT_EXTCO
    2. In that file I have written the following piece of code
    +public class XXR2R_AR_BANK_ACCT_EXTCO extends UpdateExtBankAcctCO {+
    public void processRequest(OAPageContext oapageContext,
    OAWebBean webBean)
    +{+
    super.processRequest(oapageContext, webBean);
    OADescriptiveFlexBean dfb =
    +(OADescriptiveFlexBean)webBean.findChildRecursive("FlexField");+ // This is the ID of the flexfield defined in seeded page
    FireAction firePartialAction = new FirePartialAction("contextvalchng");
    +}+
    public void processFormRequest(OAPageContext pageContext,OAWebBean webBean)
    +{+
    super.processFormRequest(pageContext, webBean);
    if ("contextvalchng".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    +{+              
    super.processFormRequest(pageContext, webBean);
    OADescriptiveFlexBean dffBean =
    +(OADescriptiveFlexBean)webBean.findChildRecursive("FlexField");+
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject extVO =
    +(OAViewObject)am.findViewObject("ExtBankAccountsVO");+ *// This is the view name corresponding to the DFF fields*
    String str = "" ;
    OARow row = null;
    if (extVO!=null)
    +{+
    row = (OARow) extVO.getCurrentRow();
    if (row!=null)
    +{+
    str = (String)row.getAttribute("ATTRIBUTE_CATEGORY"); *// here I have retrieved the context value of the DFF*
    +}+
    +}+
    dffBean.processFlex(pageContext);
    if ("DEN".equals(str)) *// if the context value is "DEN" then only the defaulting will be done*
    +{+
    OAMessageTextInputBean mnum = (OAMessageTextInputBean)webBean.findChildRecursive("FlexField1");
    mnum.setText("599956");
    row.setAttribute("ATTRIBUTE13","6995");
    +}+
    3. After compiling the .jave file I have placed the .class file in the CUSTOM_JAVA_TOP location and in the seeded page I have placed this CUSTOM_JAVA_TOP top path (in the personalize page section)exactly in the same way where the .class file is.
    But when I am changing the context value in the DFF nothing is actually happening.It is never including the custom file behavior.
    Please let me know if I am wrong in my coding or my approach.
    Thanks
    Sudie
    Edited by: user10816003 on Jun 21, 2010 5:54 AM
    Edited by: user10816003 on Jun 21, 2010 5:55 AM

    Hi,
    I think you need to set PPR on one of the segment of the DFF. Following is the code snippet I found few days back in forum. Use this in processRequest() method to set the PPR.
    OADescriptiveFlexBean oadescriptiveflexbean = (OADescriptiveFlexBean)webBean.findIndexedChildRecursive("ASNPrdtAddInfoFF"); //DFF ID...in your case it is "FlexField"
    if(null != oadescriptiveflexbean)
         oadescriptiveflexbean.processFlex(pageContext);
         //oadescriptiveflexbean.setFlexTableRendered(false); -- useful, if we want to render the items on our own.
         int cnt = oadescriptiveflexbean.getIndexedChildCount(pageContext.getRenderingContext());
         for(int i=0; i<cnt; i++)
              OAWebBean uiNode = (OAWebBean)oadescriptiveflexbean.getIndexedChild(pageContext.getRenderingContext(),i);
              if(null != uiNode && uiNode instanceof OAMessageTextInputBean )
                   System.out.println(i + "::::" + uiNode.getLabel() + "::::" + uiNode.getUINodeName()+ "\n");
                   if(uiNode.getUINodeName().equalsIgnoreCase("ASNPrdtAddInfoFF2")) //Segment ID...you need to find it out..on which segment you want to do PPR
                        FireAction firePartialAction = new FirePartialAction("Event.termChangeEvent", true); //This is I am not sure but it must be the event name
                        uiNode.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,firePartialAction);
    Now you need to check for this event in processFormRequest() method. If this event fetched iterate the Vo rows and check the Attribute value there. if the value matched then do the defaulting process.
    Hope this helps..
    Regards,
    Mukesh Uchaniya

Maybe you are looking for

  • How to transfer Data of One internal table to another

    Dear Guru, I have an internal table DATA: BEGIN OF t_cust OCCURS 0,             kschl  LIKE rv13a-kschl,             werks LIKE komg-werks,             matnr LIKE komg-matnr,             kbetr  LIKE konp-kbetr,             datab LIKE rv13a-datab,    

  • Why can't I downgrade my account?

    I Have been charged for storage on icloud that I am not using and I want to downgrade my account. I have followed the instructions to do this but I can't confirm it because the 'done' button is greyed out.why is this happening?

  • Oracle 10g Lite-Sync Error

    Hi, I am Using Oracle 10g"Lite" Database, I am doing manual SYNC Process. Today I started the manual Sync Process i Got this Error Message in the Screen "POL-3201 Invalid Slot Number" I referred a document Shows this information POL-3201 Invalid slot

  • 5.0.4 : Objects Vanishing - PLEASE HELP!

    Placed, dragged or created objects (images, text, vectors) are mysteriously disappearing in the latest version of inDesign, but only on certain pages. It appears to happen very randomly. Once they vanish they cannot be selected using the selection to

  • Two reports's entries to the same form, the DELETE button works unproperly.

    I have two reports refrencing one form in which I have one item whose value is set by the refrencing report. In the form I build two branches back to the two resports by the item's value(conditional branch). when press the SAVE or CREATE button all w