Dynamic create Component usage and embed it in view container

There is a view_container_uielement VC_TEST  in view V_MAIN, in wd component ZTEST.
I created a web dynpro component named ZWDR_TEST and add it into the wd component ZTEST.
    gr_comp_test = component->create_cmp_usage_group(
      name = 'TEST_GROUP'
      used_component = 'ZWDR_TEST' ).
    lr_comp_usage = me->gr_comp_test->add_component_usage(
      embedding_position = 'V_MAIN/VC_TEST'
      name = 'TEST'
      used_component = 'ZWDR_TEST' ).
    if lr_comp_usage->has_active_component( ) is initial.
      lr_comp_usage->create_component( component_name = 'ZWDR_TEST' ).
    endif.
    ifc_test ?= lr_comp_usage->get_interface_controller( ).
I thought the wdr ZWDR_TEST was embeded in the view V_MAIN in the position VC_TEST by the embedding_position parameter.
But in the result web page, there is no ZWDR_TEST in the position of VC_TEST.
Could any one explain why?
Thanks

Hi,
for dynamic comp usage.. check this..
http://help.sap.com/saphelp_nw70/helpdata/en/bc/191a427ff6db2ce10000000a1550b0/frameset.htm
Dynamic Component Usage
embed view
Dynamic View embed
How to create a webdynpro view dynamically and embed into view container?
Cheers,
Kris.

Similar Messages

  • Dynamic created component, problem to set position

    hello,
    I want to create in dynamic way label component and put it on GridPanel in given position. How can I set this position(x,y) to created component?
    thanks in advance

    Hi, Jeff.
    Just don't want to cross post the same answer all over the forum. So I gave some inputs on the topic in this message: http://forums.sdn.sap.com/thread.jspa?messageID=11127647&#11127647
    Hope this will help you.

  • How dynamically create connection pool and Datasource

    Hi
    How I can dynamically create a connection pool and Data source in Oracle 10g Application server. In our J2EE application the user will be login with db user name, password and database name. I want to create connection pool and data source on the fly while login the user with database name. I our application we have access approximate 80 Databases. so my approach is given bellow
    1) Planning to create 80 connection pools and 80 Data sources so when user logs in while selecting the db name i will call the appropriate data source and create the DB connection. Is there any limitation to create number of data sources in oracle app server?
    2) Create DB connection with out using connection pool and data source. But i am not prefer this approach coz we need to handle some transaction in our application.
    Kindly throw some light on managing connection pool programmatically or in application run time.
    I would really appreciate if any one can provide any links or any inormation on this issue.
    Thanks in advance.

    Kindly let me know is there any drawbacks to create 80 Data Sources to connect 80 database in Oracle 10G App server and each data sources should have one connection pool. so i need to create 80 connection pool. Please let me know is this right approach or any work around to create Data source on fly for each request for corresponding database.

  • Disappearing of Web Parts and a custom List Views containing XSL

    Hello!
    Recently, on the sites with Web Parts
    containing XSL or on List Views (.aspx-pages) containing
    XSL a message appears:
    Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.
    Correlation ID:98bcff3d-5cc0-42b6-819c-41d36a4aa335
    And so it is as long as I do not take
    certain actions: indicated below as I
    struggled with this. In a day or two it
    repeats.
    Web Parts and List Views without XSL
    are displayed normal.
    Related LOGs for such Web Parts and List View containing XSL:
    Error while executing web part: System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at Microsoft.Xslt.MethodCollection.ResolveMethodDef(Int32 tokenNum)
    at Microsoft.Xslt.MethodCollection.GetMethodInfo(Int32 methodNumber)
    at Microsoft.Xslt.STransform.GetCompiledTransform()
    at Microsoft.SharePoint.WebPartPages.BaseXsltListWebPart.LoadXslCompiledTransform(WSSXmlUrlResolver someXmlResolver)
    at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXslCompiledTransform()
    at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)
    Herewith:
    1. Updates have been installed on the server
    with a further rebooting.
    2. No doubt the correctness of XSL:
    previously these web parts and list views were displayed.
    And it is displayed in SP Designer.
    My actions for troubleshooting (a day or two
    it reappears):
    For Web Parts containing XSL:
    - Server rebooting does not help.
    - Resaving of Web Part settings
    helps (Web Part menu -> Change Web Part -> OK).
    - Sometimes resaving of Web Part settings does not help. In this case restarting of Application Pool 'SharePoint - 80' with further
    resaving of Web Part settings helps.
    For List Views containing XSL:
    - Server rebooting does not help.
    - Server updating with futher rebooting
    helps.
    - Restarting of Application Pool 'SharePoint - 80'
    helps.

    Hi,
    According to your post, my understanding is that Web Parts and List Views with XSL were displayed unnormal.
    The error message is caused by that the time allowed for doing the XSL transformation was exceeded.
    In SharePoint 2010 the XSL transform cannot take longer than 1 second.
    There is now a hot fix available from Microsoft to resolve this issue,  the solution are at this page:
    http://support.microsoft.com/kb/2639184. 
    In addition, you can install  sharepointfoundation2010-kb2597136-fullfile-x64-glb.exe and use the PowerShell
    script below to make the change to the Timeout value
    If the issue still exists, you can perform an AppPool recycle in IIS.
    More information:
    http://englando.wordpress.com/2012/01/05/unable-to-display-this-web-part-xsltlistview-and-xsltdataview-web-part-issues-in-ie/
    http://hsdhaarsma.blogspot.in/2013/06/indexoutofrangeexception-in.html#!/2013/06/indexoutofrangeexception-in.html
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Dynamically create component

    Same project as my last post but figured the context is different enough to merit a new thread.
    I have a flex application called app.mxml and a component called dummy.mxml, the component consists of a text area and a button.
    The application consists of 5 textInputs and a Canvas.
    Is it possible that when the user types something into one of these text fields that there is an instance of dummy created within the canvas and the text area within dummy contains the text within the input field?

    I'll try and explain it a little better,
    in my main application I have a panel that contains 5 empty textInput boxes, these are all blank, next to the panel I have a canvas, this has nothing in it at all at this point.
    there is also a component (dummyComponent.mxml) in the application that consits of a textArea and a radio button.
    this component is not used within the application prior to runtime.
    Runtime -->
    user enters the text "testing 123" into the first textInput box. ad this point an instance of dummyComponent is created within the canvas and the contents of its text area mimic that of the input box.
    The same effect could be achieved by having 5 textAreas within the canvs that each bind to the 5 textInputs, but i don't want these textAreas to exist unless they are needed.
    Cheers
    Tim

  • MethodnotFound Exception for dynamically created component(menuItem)

    Hi
    I have created menuItem component and tried to create Action Listener object and setting it to the component in the backing bean.
    but it is throwing methodnot found exception.
    javax.el.MethodNotFoundException: Method not found: [email protected]()
    javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: Method not found: [email protected]()
         at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:92)
    Below is my code..
    MenuItem item1 = new MenuItem();
    item1.setValue(key);
    Application app = FacesContext.getCurrentInstance().getApplication();
    javax.faces.el.MethodBinding actionListener = app.createMethodBinding("#{breadCrumbBean.test}", null);
    item1.setActionListener(actionListener);
    Let me know whether i created actionListener object or not.
    Any suggestions...
    Thanks
    Edited by: _user on Jan 20, 2011 9:27 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi,
    I tried this it works for me...
    Try to set as below...
    MethodExpression ee = context.getApplication().getExpressionFactory().createMethodExpression(context.getELContext(), "#{breadCrumbBean.test}", String.class, new Class[] { });
    item1.setActionExpression(ee);
    Regards,
    Suganth.G

  • About dynamic creating component instance

    my project is a lib project , and I can not create a mxml
    component using getdedinitionbyname then new the class .
    because the class reference I can not received using
    getdedinitionbyname! Has any body know something about it?

    Why,there is so little developpers!But luckily I find the
    answer,Just add a compiler parameter -include-librarirs to resoleve
    it!!

  • Dynamically create empty mcs and asign elements from array and loadmovie

    I'm creating an educational game for my school students.
    A little boy is flying through the city when he encounters objects flying from left to right.
    He hears a SOUND eg: Dog - he must go and click the dog image with the flying cursor. There are at least 5 DIFFERENT objects that should be flying on the screen. There could be various of them at any one time.
    I have the roots of the images in an xml file. And the actual swf are in a file called IMAGE and the sounds in SOUND.
    My problem is that most tutorials I see use the attachmovie method but I don't want to put all the swf's in the library as there are hundreds.
    I have to use the loadmovie method.
    I take it I have to loop through the array and assign each element to an empty movieclip which in turn is in the loop so you get 5 empty clips - I will use i (index). It doesn't seem to be working. I shall keep trying and post back here if I get any luck but I'm running out of ideas.
    Then the objects have to float across the screen. Don't know whether to use tween object or onEnterFrame handler or other. AND someone has mentioned using setinterval to "spit out" the objects.
    BUT if I have five flying across the screen I'm left without clips to stick in any more.
    Oh my head hurts but I will keep going.
    CHEERS if any help is around. This should be quite a standard thng for game developpers. Code at the moment
    function loadEnemies():Void {
    enemy_xml = new XML();
    enemy_xml.ignoreWhite = true;
    enemy_xml.onLoad = function(success:Boolean) {
    if (success) {
    _root.parseEnemyXML();
    //enemy_xml.load("level_"+level+".xml");
    enemy_xml.load("data/animal_catch.xml");
    function parseEnemyXML():Void {
    rows = enemy_xml.firstChild.childNodes.length;
    for (var i:Number = 0; i<rows; i++) {
    var row_string:String = String(enemy_xml.firstChild.childNodes[i].firstChild.firstChild);
    _root["row_"+i+"_array"] = row_string; //MAIN ARRAY holds an array images/dog_a.swf/ images/cat_a.swf etc... all five
    _root.createEmptyMovieClip("enemyObjects", 1);
    enemyObjects.createEmptyMovieClip("holder_"+i, i);
    _root["object"+i] = new Sound(enemyObjects["holder_"+i]);
    trace(row_string);
    loadMovie["row_"+i+"_array"], ["holder_"+i]
    if (level == 1) {
    alerts_mc.play();
    } else {
    currRow = 0;
    rowCounter = 0;
    OK got to about here BUT
    a. I started to get confused around the createEmptyMovieClip part
    b. I KNOW I shouldn't have Sound(enemyObjetcs etc... BUT I copied the code from a tutorial and I don't know what to replace it with.
    I'm close but I need a little polishing.

    It doesn't do you much good to work with borrowed code that you do not understand.  Your best bet will be to start small, creating one functional piece of the puzzle at a time, and work your way up.  Start with making sure you are loading and parsing the xml properly, then set about loading the external content, then see about making that content move around, etc...
    In the code you show, your loadMovie line of code does not resemble anything I have seen before, looking more like (but not quite like) a multi-dimensional array element than a loadMovie() function call.  If you find you need to have control of the items as soon as they load, then you should consider using MovieClipLoader.loadClip instead of loadMovie.  The MovieClipLoader class provides features, such as to be able to determine when items have fully loaded.

  • Dynamically add and embed WD components without predefining an interface

    Hey Community,
    I have the following problem:
    I have a view with many ViewContainers in it. When I start the programm I want to decide dynamically which components should be used and displayed in these containers. Bbefore I start the programm I do not know which components I am going to load.
    I already saw the possibility to predefine an interface for all components but in my case there would be no common interface. Beside that I tried it with the Interface IF_WD_VIEW_CONTROLLER and its method Prepare_dynamic_navigation. This method looks very similar, but I don' want a navigation, I just want to display it in an existing view.
    So my question:
    Is it possible to add WD components and embed their views to existing view cointainers during runtime?
    Thank you for your help!

    Have a look at the MAIN view of the FPM_GAF_COMPONENT in the WDDOINIT method. It creates a component usage and embeds the used component view into current view.
      DATA: lr_usage_group TYPE REF TO if_wd_component_usage_group.
      DATA: lr_component TYPE REF TO if_wd_component.
      lr_component = wd_comp_controller->wd_get_api( ).
      lr_usage_group = lr_component->create_cmp_usage_group(
                           name            = 'MESSAGE_AREA_USAGES'
                           used_component  = 'FPM_MESSAGE_MANAGER' ).
      wd_this->mo_message_area_usage = lr_usage_group->add_component_usage( 'MESSAGE_AREA_USAGE' ).
      wd_this->mo_message_area_usage->create_component( 'FPM_MESSAGE_MANAGER' ).
      DATA: lr_view_controller_api TYPE REF TO if_wd_view_controller.
      lr_view_controller_api = wd_this->wd_get_api( ).
      lr_view_controller_api->prepare_dynamic_navigation(
                      source_window_name          = 'FPM_WINDOW'
                      source_vusage_name          = 'MAIN_USAGE_1'
                      source_plug_name            = 'OUT'
                      target_component_name       = 'FPM_MESSAGE_MANAGER'
                      target_component_usage      = 'MESSAGE_AREA_USAGE'
                      target_view_name            = 'MESSAGES'
                      target_plug_name            = 'DEFAULT'
                      target_embedding_position   = 'MAIN/VC_MESSAGE_AREA' ).
      wd_this->fire_out_plg( ).
    I can't see why you couldn't repeat this multiple times!
    given that what you are asking to do is what the FPM does - it certainly should be possible!
    Hope this code snippit helps.

  • Dynamic create elements and drag drop

    Hi,
    Where can I find an example of dynamic creating swing elements
    and drag-drop them?
    Thanks,
    Luiz Fernando

    totalnewby wrote:
    The following procedure doesn't compile if sequence SEQ_ADR does not exist before compilation. I had to create the sequence manually before being able to compile this procedure. How can I avoid this manual generation?
    PROCEDURE A_270(proc_id number) IS
    seq_cnt number;
    curr_max number;
    BEGIN
    select count(*) into seq_cnt from user_sequences where sequence_name='SEQ_ADR';
    if seq_cnt > 0 then
    execute immediate 'drop sequence SEQ_ADR';
    end if;
    select max(id)+1 into curr_max from adress;
    execute immediate 'create sequence SEQ_ADR start with '||curr_max||'';
    insert into adress(ID,
    IMPORTED_DT
    select
    SEQ_ADR.nextval ID,
    sysdate IMPORTED_DT
    from new_adress;
    END;Edited by: totalnewby on Aug 23, 2012 6:41 AMEssentially the same question asked by 'gogol' two days ago at creating and using sequence inside a proc
    It was a bad idea then. It is a bad idea now.

  • How to switch between different instances of component usage?

    Hi All,
    Need your help.
    My application is about "Program Management", there is a table on the upper level which displays several program header data. in the lower level of the screen, I have a view container in which I embed another component to display program details.For instance,if you make a lead selection on one row of the table above, then the lower part will display the program detail.
    Here is the problem: e.g. first, I make a selection on program '001', then I'll create a component usage of the program detail and I put it into a component uage group, second, I make a selection on program '002', then the same like above, I create another component usage and put it into a component usage group. Now I have two instances of program detail component usage, when I select program '001' again, how can I switch back to program '001' detail.
    So, I'm trying to achieve multiple instances of program detail so that user don't need to wait for loading program details everytime.
    Thanks in advance.
    Regards,
    Aaron
    Edited by: Aaron Shen No.2 on Sep 22, 2009 3:44 AM

    Hi Aaron,
    As you are using two separate components, they would be having two separate views to display the required information.
    In the onleadselect of your main view ( where you are using the individual views of the other components via the viewcontainerUI ), you have to embed the following code:
      DATA lo_api_main TYPE REF TO if_wd_view_controller.
      lo_api_main = wd_this->wd_get_api( ).
      CALL METHOD LO_API_MAIN->FIRE_PLUG
        EXPORTING
         PARAMETERS =
          PLUG_NAME  = 'OP_TO_TWO'
    Create two outbound plugs in your window, and link them to the inbound plugs of the individual views of used components.
    I am embedding the code of my onleadselection:
    method ONACTIONSELECTED .
        DATA lo_nd_table_data TYPE REF TO if_wd_context_node.
        DATA lo_el_table_data TYPE REF TO if_wd_context_element.
        DATA ls_table_data TYPE wd_this->element_table_data.
        DATA lt_table_data TYPE wd_this->elements_table_data.
        data lv_selected_index type i.
      navigate from <CONTEXT> to <TABLE_DATA> via lead selection
        lo_nd_table_data = wd_context->get_child_node( name = wd_this->wdctx_table_data ).
      get element via lead selection
        lo_el_table_data = lo_nd_table_data->get_element(  ).
         CALL METHOD LO_EL_TABLE_DATA->GET_INDEX
           RECEIVING
             MY_INDEX = lv_selected_index
    case lv_selected_index.
    when 1.
    data lo_cmp_usage type ref to if_wd_component_usage.
    lo_cmp_usage =   wd_this->wd_cpuse_comp_one( ).
    if lo_cmp_usage->has_active_component( ) is initial.
       lo_cmp_usage->create_component( ).
    endif.
       DATA lo_api_main TYPE REF TO if_wd_view_controller.
      lo_api_main = wd_this->wd_get_api( ).
      CALL METHOD LO_API_MAIN->FIRE_PLUG
        EXPORTING
         PARAMETERS =
          PLUG_NAME  = 'OP_TO_ONE'
    clear lo_cmp_usage.
    when 2.
    DATA lo_api_main TYPE REF TO if_wd_view_controller.
      lo_api_main = wd_this->wd_get_api( ).
      CALL METHOD LO_API_MAIN->FIRE_PLUG
        EXPORTING
         PARAMETERS =
          PLUG_NAME  = 'OP_TO_TWO'
      data lo_cmp_usage type ref to if_wd_component_usage.
       lo_cmp_usage =   wd_this->wd_cpuse_comp_two( ).
       if lo_cmp_usage->has_active_component( ) is initial.
         lo_cmp_usage->create_component( ).
       endif.
    endcase.
    endmethod.
    Regards,
    Prosenjit.

  • Problem in component usage

    Hi All
    I am using std component HRASR00_EMPLOYEE_SEARCH in my custom comp. i craated view container ui element, and i done embed view. in view i created controller usage in used controllers of view. but when i am trying to execute i am not getting component usage view?? any problem?
    Thanks,
    kris.

    Hi All
    I am using std component HRASR00_EMPLOYEE_SEARCH in my custom comp. i craated view container ui element, and i done embed view. in view i created controller usage in used controllers of view. same part i done in component controller and window controller as well. but when i am trying to execute i am not getting component usage view?? i have to done any initialization for this component? anyone have any idea in this component?? please help me...
    Thanks,
    kris.

  • Adding f:Attribute dynamically to a dynamically created Button

    Hi ,
    I am trying to dynamically create a CommandButton and attach a f:Attribute to the same. But somehow I am not able to get hold of the correct API to do the same -
    >RichCommandButton button=new RichCommandButton();
    >button.setText("Ok");
    >AttributeTag attr=new AttributeTag();
    >attr.setValue("DC_OPERATION_BINDING", "bindings.DENY");
    >button.getChildren().add(attr);
    The issue is that the add method expects a UIComponent and attr is of type com.sun.faces.taglib.jsf_core.AttributeTag

    gues u can use it like
    button.getAttributes().put(DC_OPERATION_BINDING", "bindings.DENY");
    {code}
    http://docs.oracle.com/cd/E17802_01/j2ee/j2ee/javaserverfaces/1.2/docs/api/javax/faces/component/UIComponent.html#getAttributes%28%29                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Component usage in web dynpro abap

    Hi everyone,
    I am basically SAP ABAP consultant and I am very new to SAP EP, can anybody please help me out what is Component usage in web dynpro abap?If anyone please can refer the process how to create Component usage it will be clearer to understand.
    Thanks,
    Sonali.

    Hi,
    Please go through below pdf document which will help in understanding the componenet usage in webdynpro ABAP.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2e71ce83-0b01-0010-11a4-98c28a33195f
    Hope it will help you.
    Raghu

  • Component Usage in Select Options

    Hi
    I need to bring Profit Center Hierarchy in Select Options of Webdynpro for Profit Center field.
    For this have created component Usage with hierarchy which works fine in case of input field but I want to make it work on select options field for using the select options functionality.
    Pls suggest if there is any way by which we can link component usage on Select Options field.
    Regards
    Vishal

    Hi Madhu,
    When i am trying this way, it is giving me the following dump
    "Component usage PRCTR_F4 does not exist"
    The component PRCTR_F4 is there in the Component use list.
    Also only OVS can be used for select option?? b'coz hwen i debugg the application whe using this search help, i can see only OVS as component usage.
    Waiting for your reply....
    Thanks & Regards,
    Arvind

Maybe you are looking for