View Methods / Dynamic component creation

Hi,
I'm dealing with an issue I wasn't able to bypass for the moment:
depending on the value of the parameters in the URL of my application, i need to pick
a differrent component usage, and apply it in a view container on my main view.
the problem is, that when i want to load the component usage, it has to be done
before wddomodifyview, but there's no way to do it in de wddoinit, because whan that
last one is called, my dohandledefault (to catch the url) is not yet executed.
the components are now added in a method in my view (MAIN) is there a way to call
this method from the dohandledefault? or is there another option? for example making
the do_dynamic_navigation executed in a window method? Which gives at my side
an error because the plugs are not defined (??)
grtz
Koen

Hi Koen,
WDDOINIT of the default view is called before the inbound plug handler of the window is called.
You have 2 possible solutions:
1. Declare an inbound plug at your view and declare it as "default" in your window assembly. Then this method is called later and you can create your component usages there.
2. Do not set this view as default view, but embed an emptyview and set it to default. Then navigate to to new view in your window inbound plug.
Ciao, Regina

Similar Messages

  • Calling view method from component controller

    Hi Experts,
    How to refer a view method from component controller?

    if you have the view Instance, then you can call using the view instance. But this is not the correct apporach.

  • Dynamic component creation and population

    I'm trying to create a page such that , based upon some backing bean, a different component would be rendered and populated based upon a property in that bean.
    For instance
    public class MyBean {
      private int type;
      private String data;
      getters/setters...
    }Say the type can be sex (a radio button component), level of user (selectOne with the values of gold, platinum and silver) or location (a textfield) (these are an example of the type of data--there are many more entries that are of one of these three component types that need to be handled). I have a list of these beans that could go in a dataTable or whatnot, so I'd like to be able to dynamically generate the components. Does anyone have any suggestions or input?
    My guess is a component will need to be returned from the bean that describes how it should be rendered--I'm just looking for a jumpstart on the best way to do this, see if anyone has code snippets, references, etc.
    TIA.
    P.S. Apologies if this is posted twice...some errors when I tried to post this the first time...

    So, are you saying to have all three types of components in a given line of the datatable, wire each up to do have the appropriate values (male/female or silver/gold/platinum) and then have a rendered argument read a bean property such as isRadio, isSelect or isText and just render the appropriate one?

  • Dynamic Component Creation Question

    I have a process that looks up fields names from a database. I then loop through and create HtmlInputText components dynamically. The question I have is how do I create a value binding to these components? I have been trying to think of a way to create a separate class that can be applied to each field name I retrieve from the database. But I just can't think of a good solution for this. I assume people have had to do this before.
    Thanks

    Let it bind to a List<String> or Map<String, String>. To get/set elements in a List you can use the brace notation, e.g. #{list[0]} for the 1st element (list.get(0)). For map you can use the key name as propertyname, e.g. #{map.key} for the entry associated with key "key" (map.get("key")).

  • Dynamic Component Creation

    Hi,
    Can someone tell me if there is a way to get the following code to work or another way to get the same effect? I want to be able to create buttons on demand, when the user clicks an "add" button.
    JPanel numpanel = new JPanel();
    int i;
    for(i = 1; i<13; i++){
    JButton ("num"+i) = new JButton(("Num-" + i));
    numpanel.add(("num"+i));
    }

    Do you need to hold a reference to the buttons or do yo just want to add them to the panel?
    If you just need to keep adding buttons, then use this:
    //asssume count is a class level variable
    numpanel.add(new JButton("Num-" + count++));If you need to hold a reference to each button (quite likely), then use an ArrayList/Vector to hold the buttons
    JButton b = new JButton("Num-" + count++);
    list.add(b);
    //--- list is the ArrayList that has been created and initialised.
    numpanel.add(b);When you need to retrieve any button, use list.get(i).

  • Creation of view in a component

    Hi ,
    may I have the step by step procedure  for the creation of view in a component.
    I have created the Enhancement set .
    then in BSP_WD_CMPWB I enter the component and say enhance it took me to the area where all views are in display mode and after I selected the views and started the wizard of view creation .
    I require info on the data to be given in the wizard and the procedures after that.
    plz provide some inputs ,
    Thanks and regards,
    Sree.

    Hi Sree,
    In your view.htm are you using the code to get the configuration?
    Example:
    <%@page language="abap"%><%@ extension name="htmlb" prefix="htmlb"%><%@ extension name="xhtmlb" prefix="xhtmlb"%><%@ extension name="crm_bsp_ic" prefix="crmic"%><%@ extension name="bsp" prefix="bsp"%>
    <%@extension name="chtmlb" prefix="chtmlb" %>
    <%
      data: lv_xml    type string.
      lv_xml    = controller->CONFIGURATION_DESCR->GET_CONFIG_DATA( ).
    %>
    <chtmlb:config xml  = "<%= lv_xml %>"
                   mode = "RUNTIME" />
    Best regards,
    Caíque Escaler

  • Call a view's method from Component Controller.

    Hi
    Is it possible to call a view's method from Component Controller.
    Regards
    Nikhil

    Hi Tummuru,
    I have created an event in Component Controller by the name toMenuView. Now I created a method in which this event is getting fired. Foll. is the code of the method.
      public void fireToMenuView( )
       wdComponentAPI.getMessageManager().reportSuccess("fireToMenuView");
       wdThis.wdFireEventToMenuView();
    Now I have created an event handler "handleToMenuView" in the MenuView and subscribed the event handler to the event in Component Controller.
    The control is reaching to the fire event in component controller but not to the Event handler in view controller.
    What am I missing.
    Regards
    Nikhil

  • Calling view controller method from component controller method

    Hi,
    Is there any way to call view controller method from component controller method?
    Thanks,

    Hi Khandal.
    You should not make you component controller dependent from a view controller.
    But what you can do is to define an event in the component controller. The view
    controller can register for this event.
    In the stage where you currently want to call the view controller method just fire
    the event. In the event handler method in the view controller you can call the
    method then.
    Why do you need to call a view controller method? Can you give more details
    about the scenario?
    Cheers,
    Sascha

  • Pre,Post,OverWrite Exit for web dynpro ABAP methods of component,view

    Hi,
    my question is i have created overwrite exit for method of component controller in one enhancement implementaion say ENH1, and i also created overwrite exit for same method in another enhancement implemenation say ENH2, it means i have two different implemenations now, 
    My questions here is, will both Enhancement implemenations will "execute", if yes in what order..
    Please clarify.
    Thanks.

    I'm afraid the information that Manas gave you is incorrect.  In an overwrite method, the enhancement completely overrides and replaces the original method.  Both versions are NOT executed.  This is the risk you run with the Overwrite enhancement - you are choosing to completely replace the SAP delivered logic. 
    From the Online Help:
    The overwrite exit method takes on the signature of the original method and overwrites it.  This means that an overwrite exit is executed instead of the original method.
    At runtime only one overwrite exit can be active. If several overwrite exits are active, a runtime error occurs.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/dc/e6ba426b81da11e10000000a155106/frameset.htm

  • Adding a view in a component of BSP application

    Hi All,
    I want to create new component for a BSP and add a view to it.
    my scenario is : I have a problem in creating a pop-up view whenever a button in a WEB UI is clicked.
    I have added a button in the items tab of sales order creation(in WEB UI),so when that button is clicked a pop-up view has to be generated.
    the view i am creating is a ineractive view where the user can enter some data and press a button in the pop-up window so that the data is copied in the items tab.
    the pop-up contains a table grid where the user can enter the data and press the button in pop-up window.
    so could you please let me know how to create this type of pop-up window.
    Regarding this some one has send me a solution of creating a new component with a new view.but unfortunately i am not able to create a view because it is asking for nodes and BOL entity.
    so could you all provide me some input inorder to create the component and view.
    Thanks
    Tanveer

    Hi Tanveer,
    I have done the Similar Case.
    By now I hope you have Created a New Component.
    Ensure the Following Points before you Proceed.
    1. Create a Window/View Set and View.
    2. As you are saying yours is Table View while Creating View Specify it as Value Node and assign Corresponding Attributes to the Value Node.
    3. Specify Type of View is Table Type.
    4. Now in Runtime Repository Add the Created Window.
    5. Now add the Created ViewSet and View to the Window and Save.
    6. Create a New Interface View which is ( Window Name ) in Runtime Repository.
    7. Add Component Usage in Runtime Repository.( In Source Component where Button is Present )
        a. Give ID and Interface View for the Component Usage and give Used Component
            Name. If View is created in same component then give same name other wise
             Give another component name.
    8. After create View/Window/Component Interface/Component Usage Now to get the
       Table View in Popup Screen
       Modify the Standard Code similar to the Table View in HTML Page.
       For Reference:
    <chtmlb:tableExtension tableId = "Table"
                           layout  = "FIXED" >
      <chtmlb:configTable id              = "Table"
                          navigationMode  = "BYPAGE"
                          onRowSelection  = "select"
                          selectedRowIndex      = "<%= CONTEXTNODE->SELECTED_INDEX %>"
                          selectedRowIndexTable = "<%= CONTEXTNODE->->SELECTION_TAB %>"
                          selectionMode         = "<%= CONTEXTNODE->->SELECTION_MODE %>"
                          table           = "//CONTEXTNODE->/Table"
                          usage           = "SEARCHRESULT"
                          visibleRowCount = "10"
                          width           = "100%"
                          showNoMatchText = "FALSE"
    />
    </chtmlb:tableExtension>
    CONTEXTNODE is the Context Node in View.
    Now to get the Values in the Table View when popup gets displayed.
    Go to the Newly Created View and add Code to populate Values in Table View
    Method CL_BSP_WD_CONTEXT_NODE_TV - > IF_BSP_MODEL~INIT.
    Now,to Call the Created View as a popup from the New Component when Buton is Clicked
    Use the Following Code in the Event of Button Click.
    DATA: lr_popup TYPE REF TO if_bsp_wd_popup.
      IF lr_popup IS NOT BOUND.
        lr_popup = me->comp_controller->window_manager->create_popup( )
        (Specify Parameters Interface View,Component Usage and Title for Window in the above Method._
        lr_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ).
      ENDIF.
    Set the callback event on the imported controller ( Specify Event Name which needs to get Triggered when Popup is Closed.)
      lr_popup->set_on_close_event( iv_event_name = "EVENT_NAME"
                                           iv_view = me ).
    *Set the width of the popup
      CALL METHOD lr_popup->set_window_width
        EXPORTING
          iv_width = 500.
    *Open the popup
      lr_popup->open( ).
    This will help in Getting a View as a Popup when Button is Clicked.

  • [CRM 5.2] Component Creation

    Hi Gurus,
    we encountered a problem during creation of a new component in SAP CRM 5.2!
    we've created a new ZComponent and generated a new overview page in view node.
    then we associated two external views of another component in Component Usages in Runtime Repository.
    After we associated them to the viewset, put them in the Configuration tab and finally we tested the component.
    We retrieve the followign error:
    Context initialization failed in view CRMCMP_GS_WC/SearchLinks
    An exception has occurred Exception Class  CX_SY_REF_IS_INITIAL - Dereferencing of the NULL reference 
    Method:  CL_CRMCMP_G_SEARCHLINKS_IMPL=>GET_NBS_LINKS 
    Source Text Row:  14
    Initialization of view CRMCMP_GS_WC/SearchLinks failed
    An exception has occurred Exception Class  CX_SY_REF_IS_INITIAL - Dereferencing of the NULL reference 
    Method:  CL_CRMCMP_G_SEARCHLINKS_IMPL=>GET_NBS_LINKS 
    Source Text Row:  14
    Cannot display view IFVSearchLinks
    An exception has occurred Exception Class  CX_SY_REF_IS_INITIAL - Dereferencing of the NULL reference 
    Method:  CL_CRMCMP_G_SEARCHLINKS_IMPL=>GET_NBS_LINKS 
    Source Text Row:  14
    Initialization of view IFVSearchLinks failed
    An exception has occurred Exception Class  CX_BSP_WD_RUNTIME_ERROR - View CRMCMP_GS_WC/SearchLinks could not be bound 
    Method:  CL_BSP_WD_VIEW_CONTROLLER=>BIND_VIEW 
    Source Text Row:  162
    Cannot display view ZCOCKPIT4/ZMYVIEW
    An exception has occurred Exception Class  CX_BSP_WD_RUNTIME_ERROR - View CRMCMP_GS_WC/SearchLinks could not be bound 
    Method:  CL_BSP_WD_VIEW_CONTROLLER=>BIND_VIEW 
    Source Text Row:  162
    Cannot display window ZCOCKPIT4/MainWindow.
    An exception has occurred Exception Class  CX_BSP_WD_RUNTIME_ERROR - View Search.IFVSearchLinks could not be bound 
    Method:  CL_BSP_WD_VIEW_CONTROLLER=>BIND_VIEW 
    Source Text Row:  162
    Do you know where is the issue? Do you know if there is a guide of component creation?  Can you help us?
    Thanks!

    Martijn,
    For questions on steps 1&3 they are related.  When you "enhance" a view on a component you actually perform the first step of making the component ready for enhancements.
    This is done by displaying the component and clicking on the "enhance component" button.  This creates a "Z" storage area for your enhancements.  I need to take a further look at the copy details to remember exactly where the copy should be stored.
    For your question 5, yes once you add it to the repository it will appear in your customizing.
    Well for that piece let's say it is a transaction list, that is an entirely new concept to make the list appear differently.  You would have to adjust the underlying bol objects to make that work.  By chance what is the name of the view that you are trying to copy and adjust?
    There are no books available, but you can buy electronic access to the OKP materials from SAP.  For more information goto service.sap.com/okp
    Good luck,
    Stephen

  • Select-options are not destroyed while calling view of used component popup

    Hi Friends ,
    I'm facing a unique problem. I'm calling a view of a component within another component. the view that I'm calling has some select-options. When I close the popup window ( using close 'X' of popup ) and then try to reopen the popup system give me a dump. I debugged and found that select-options are not destroyed by system and once it tries to create the select-options again it dumps because they are already there.  
    This is the source code extract of that dump for your reference .
    1 method if_wd_select_options~add_selection_field.
    2
    3   data:
    4     lr_table_descr       type ref to cl_abap_tabledescr,
    5     lr_struct_descr      type ref to cl_abap_structdescr,
    6     lr_value_field_descr type ref to cl_abap_elemdescr,
    7     added_field          like line of mt_added_fields,
    8     dfies                type dfies,
    9     description          type string,
    10     complex_restrictions type if_wd_select_options=>t_complex_restrictions.
    11
    12   field-symbols:
    13     <it_result> type index table.
    14
    15 * check of someone wants to add a field that already exists
    16   read table mt_fields
    17        with key m_id = i_id
    18        transporting no fields.
    19   if sy-subrc = 0.
    20 *   might be deleted - recreating a field with different setting is of course allowed
    21     read table mt_all_removed_fields
    22          with key table_line = i_id
    23          transporting no fields.
    24     if sy-subrc <> 0.
    >>>       message x000(00).
    26     endif.
    27
    28 *   remove the existing field in order to avoid duplicates
    29     delete table mt_fields with table key m_id = i_id.
    30   endif.
    I've already tried using REMOVE_ALL_SEL_SCREEN_ITEMS( ) method of interface IF_WD_SELECT_OPTIONS before creating new elements ( select-options ). If any one can help me in this It would really help and I'll appreciate it.
    Thanks in advance,
    Laeeq

    I've sloved the problem

  • Creating and Binding View Objects dynamically : Oracle Jdeveloper 11g

    Hello,
    We are trying to create and bind view objects dynamically to adf data visualization components.
    The view object is a result of multiple tables.
    We are using Oracle JDeveloper 11g Technical Preview. ( can't upgrade to TP2 or TP3 now).
    We have found this : http://radio.weblogs.com/0118231/stories/2003/07/15/creatingUpdateableMultientityViewObjectDefinitionsDynamically.html on our search for the same.
    The sample application however, is in 10g , hence required migration.
    Also, it was a standalone application with the TestClient.java having a main() method.
    Our requirement is for Web Application; we use Adf+jsf .
    Guidance of any sort is very much appreciated.
    Thanks in advance.
    -Anil Golla

    Hi,
    there also exist a forum for JDeveloper 11: JDeveloper and OC4J 11g Technology Preview
    What you are trying todo is not trivial because you need to not only dynamically create the VO, you would also dynamically need to create the binding meta data for it (assuming you use ADF). Not sure if the API to modify the binding is public, so posting it on the JDeveloper 11 forum bears a glimpse of hope for an answer
    In JDeveloper 10.1.3 you can't do this
    Frank

  • How to call specific view of used component

    Hi All,
    I have the following problem:
    I have component 1 which have two views: 1A and 1B. They are included in one window. Default view is 1A.
      Navigation between view 1A and 1B it made with buttons and plugs ("go to 1A", "go to 1B").
    I have main component 2 which uses component 1 (used component). Component 2 has view 2A and 2B. I have button "Z" in view 2A which calls method of component 1 and navigates to view 2B (where used component 1 is embedded).
    First time I press button I navigate to view 1A, its correct. Then I navigate to view 1B (within used component 1).
    when I go back (in main component 2) and press button "Z" again, the used component 1 is open with view 1B, not 1A (which is default). That is, used component 1 remember which view the navigation stayed on.
    I nee to always see view 1A first when I navigate with button "Z" (open used component).
    How I can do that?

    hi ,
    u must be using component usage ..
    in ur component2 , place the view 1B of ur used component in separate window
    pls refer this thread as well :
    How to call a Particular View from a View of Current Component
    regards,
    amit

  • Reading the data from one component view into another component view

    Hi All,
    I have requirement to read the data from one component into another component while creating the service order. Here are the details.
    Main View for Service order: BT116H_SRVO in that we have two assignment blocks like Organizational data(BTORGSET) and amount allocation(BTAMNTALL).This two blocks are two different component which are associated with main component(BT116H_SRVO).
    I need to read the sales org data from component/View(BTORGSET/Orgsetdata) into Component/View(BTAMNTALL(HdrBillPlanDet) method DO_VALIDATE_INPUT.
    I searched in SDN but all the posts are related to the data exchange between two views in same component. But My scenario is different as explained above.
    Refer the attachments for the component link..
    Please let me know how we can achieve this one..
    Thanks,
    Sapsar.

    Finally I was able to fix my code...My Mistakes were need to read the parent node above three levels and need to use the relation entity name while reading the data..
    Below is the correction code
    IF iv_index IS NOT INITIAL.
         lr_iterator ?= collection_wrapper->get_iterator( ).
         lr_current ?= lr_iterator->get_by_index( iv_index ).
         lr_entity ?= lr_iterator->get_by_index( iv_index ).
       ELSE.
         lr_current = collection_wrapper->get_current( ).
       ENDIF.
    *loop back to root entity
             WHILE lr_entity->get_name( ) NE 'BTAdminH'.
               lr_entity = lr_entity->get_parent( ).
             ENDWHILE.
    *Get the related entity
             IF lr_entity IS BOUND.
               lr_collection ?= lr_entity->get_related_entities( iv_relation_name = 'BTHeaderOrgmanSet' ) .
               IF lr_collection IS BOUND.
                 lr_orgset_m = lr_collection->get_current( ).
    *            lr_orgset = lr_orgset_m->get_related_entity( iv_relation_name = 'BTOrgSet' ).
                 lr_orgset = lr_orgset_m->get_property_as_string( 'SALES_ORG' ).
               ENDIF.
             ENDIF.
    Thanks,
    Sapsar.

Maybe you are looking for

  • BACKUP THROUGH DB13

    Hi Gurus ,                  In DB13 T-code , what is the difference between the Full Database online + redolog backup and Whole database online + redolog backup ? Kindly tell which type the best one to take backup daily . Regards Selvan

  • Scanner/Photoshop conflict

    I have an apparent conflict with my scanner and Photoshop.  Am running Windows Vista 64 bit.  Scanner is a Canoscan 9950F.  In order to scan a pdf using the software utility that came with it, the scanner uses a 64 bit TWAIN driver.  Photoshop CS4 re

  • Can not upgrade from Panther 10.3.9 to Tiger 10.4

    I have a PMG4 AGP 1.4 ghz (upgrade from OWC) 2 GB ram and three SCSI hard drives 147/147/40 (upgrades from OWC). I upgraded to Tiger 10.4 from Panther about six months ago. And the upgrade never worked. After the upgrade for Tiger, the screen would l

  • [Solved]Failed to start Load Kernel Modules

    When I boot up Arch it says that it Failed to start Load Kernel Modules and when I get into my Desktop, the screen is tearing. Using the latest kernel with i3wm my systemctl status systemd-modules-load ● systemd-modules-load.service - Load Kernel Mod

  • Should I replace WRT54GL v1.1

    I have a WRT54GL v 1.1 and after reading the problems people have encountered updating the firmware, I've decided it may be best, since my router is old anyways and doesn't support n, to upgrade to a new router. I of course would rather not spend any