CIO  Dynamic component

I need to add a component dynamically to a runtime node of typ non_BOM. I feel this can be done with a functional companion. But I do not know the class/method I need to use. Any guidance would be greatly appreciated.

Louis,
You need to use the autoConfigure method within the FunctionalCompanion class. Be aware that dynamic elements are modeled as Component objects, but at runtime these exist under a ComponentSet. ComponentSet is an invisible placeholder for a set of indexed child Components.
Your programming must use the add() method on the ComponentSet. For performance reasons, be sure to add all components to your tree prior to setting any features in the new elements.
Hope this helps,
Bill Brand
I need to add a component dynamically to a runtime node of typ non_BOM. I feel this can be done with a functional companion. But I do not know the class/method I need to use. Any guidance would be greatly appreciated.

Similar Messages

  • Dynamic component in WHERE-condition for LOOP AT ?

    i want to make
    loop at itab where  (dynamic field) > 0
    how i can make it...
    Edited by: Thomas Zloch on Mar 2, 2010 2:47 PM

    I thought it's funny.
    And the problem can maybe be solved by using a completely dynamic where-condition, not just a dynamic component.
    http://help.sap.com/abapdocu_70/en/ABAPLOOP_AT_ITAB_COND.htm#!ABAP_ADDITION_4@4@
    Thomas
    P.S. meaningless subject enhanced, and please take the time to say hi and please when asking for help. Thanks.

  • Web Dynpro Abap - Dynamic Component Usage - parameters

    Hi,
    I have a this scenario:
    by a main WD component (COMP_MAIN) I have to call others WD components (COMP_1, COMP_2, COMP_3,...)
    I use Dynamic Component Usage
    l_view_controller_api->prepare_dynamic_navigation(
                        source_window_name          = 'W_SC'
                        source_vusage_name          = 'V_SC_USAGE_1'
                        source_plug_name            = 'TO_USAGE'
                        target_component_name       = l_wa_cmp_usages-used_component
                        target_component_usage      = l_wa_cmp_usages-component_usage_name
                        target_view_name            = ls_cmp_usage_group-interface_view
                        target_plug_name            = ls_cmp_usage_group-inbound_plug
                        target_embedding_position   = l_wa_cmp_usages-embedding_position ).
    l_wa_cmp_usages-component_usage->create_component( l_wa_cmp_usages-used_component ).
    I ask :
    is possible to write context nodes of COMP_MAIN into COMP_x?
    If yes, how can I do that?
    Thank you
    Al

    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

  • How to get values from dynamic component?

    Hi:
    I am displaying dynamic components based on user selection, where InputText and OutputText display properly. But now i want to read that component value on
    button click. Can any body help me in that?
    Source code is as follow,
    text.xhtml
    *<code>*
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:p="http://primefaces.prime.com.tr/ui"
         xmlns:ice="http://www.icesoft.com/icefaces/component"
         template="/WEB-INF/includes/templates/page-template.xhtml">
         <ui:define name="page-content">
              <div class="exampleBox splashContainer"
                   style="background: url('./xmlhttp/css/rime/css-images/contentContainer_bg.gif') top repeat-x">
              <table>
                   <tr>
                        <td colspan="2">
                        <h2>Set Request Process Flow</h2>
                        </td>
                   </tr>
                   <tr>
                        <td colspan="2"><ice:messages style="color:red;" /></td>
                   </tr>
                   <tr>
                        <td><ice:outputText value="Request Type*"></ice:outputText></td>
                        <td><ice:selectOneMenu value="#{offlinereq.requestno}"
                             valueChangeListener="#{offlinereq.requestChange}"
                             partialSubmit="true">
                             <f:selectItem itemValue="" itemLabel="--Select--" />
                             <f:selectItems value="#{offlinereq.requests}" />
                        </ice:selectOneMenu></td>
                   </tr>
                   <tr>
                        <td>*<h:panelGroup binding="#{offlinereq.panelBind}">*
    *                    </h:panelGroup>*</td>
                   </tr>
                   <tr>
                        <td colspan="4"><ice:commandButton value="Add"
                             actionListener="#{offlinereq.add}" /> <ice:commandButton
                             value="Update" actionListener="#{offlinereq.update}" /> <ice:commandButton
                             value="Delete" actionListener="#{offlinereq.delete}" /> <ice:commandButton
                             value="Reset" actionListener="#{offlinereq.reset}" /></td>
                   </tr>
              </table>
              </div>
         </ui:define>
    </ui:composition>
    *</code>*
    bean.java
    *<code>*
    //ValuechangeListener
         public void requestChange(ValueChangeEvent e){
              System.out.println("Select Value is::"+e.getNewValue()+"::"+userid);
              Connection conn=null;
              try {
                        if(!panelBind.getChildren().isEmpty())
                             panelBind.getChildren().clear();
                   Class.forName ("oracle.jdbc.OracleDriver");
                   conn = JdbcUtil.getConnection();
                   Statement stmt = conn.createStatement();
                   String sql="select * from IB_CUSTOMER_REQUEST_PARAMETERS where IB_REQMAST_SRNO='"+e.getNewValue()+"'";
                   ResultSet rs = stmt.executeQuery(sql);     
                   String out="out";
                   int i=1;
                   String ii;
                   while(rs.next()) {          
                        FacesContext facesContext = FacesContext.getCurrentInstance();
              Application application = facesContext.getApplication();
              HtmlPanelGrid grid = (HtmlPanelGrid)application.createComponent(HtmlPanelGrid.COMPONENT_TYPE);
                   grid.setColumns(2);
              HtmlOutputText output = (HtmlOutputText)application.createComponent(HtmlOutputText.COMPONENT_TYPE);
                   output.setValue(rs.getString("IB_CUSTREQSTPARA_NAME"));
                   ii=Integer.toString(i);
                   output.setId("a"+ii.toString());
                   System.out.println("id"+ii);
                   HtmlInputText input = (HtmlInputText)application.createComponent(HtmlInputText.COMPONENT_TYPE);
                   //input.setValue(rs.getString(1));
                   grid.getChildren().add(output);
                   grid.getChildren().add(input);
                   panelBind.getChildren().add(grid);
                   i++;
              catch(Exception e1)
                   System.out.println(e1);
         //Action listeners
         public void add(ActionEvent e)
              System.out.println("ADD");
    *</code>*
    Thank You,
    Anup

    Where are you stuck? find the component (UIComponent.findComponent) in the JSF component tree by its ID and get the value from it. This article might help:
    http://illegalargumentexception.blogspot.com/2009/02/jsf-working-with-component-ids.html
    Note: the code tag is \                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problem creating dynamic component children with RestoreState of JSF 1.2

    Hello everybody,
    With JSF 1.1, it was possible to create children of a component dynamically in the constructor of a component.
    But now, with JSF 1.2, there is an issue with the RestoreState as a new instance of each component of the tree is created.
    Does someone has an idea on how to solve this issue?
    One possibility is to create the children not in the component, but in the renderer of the component.
    But I'm not really convinced of this solution...
    Thank you in advance.
    bgOnline

    You can create a new component dynamically in the method setParent() according to the following code snippet:
    public void setParent(UIComponent parent) {
    if (parent != null) {
    List<UIComponent> children = parent.getChildren();
    Application application = FacesContext.getCurrentInstance().getApplication();
         componentLabel = (HtmlOutputLabel) application
         .createComponent(HtmlOutputLabel.COMPONENT_TYPE);
         componentLabel.setTransient(true);
         children.add(componentLabel);
         } else if (parent == null) {
         if (componentLabel != null) {
         List<UIComponent> children = getParent().getChildren();
              children.remove(componentLabel);
              super.setParent(parent);
         }

  • MyFaces'  JspTilesViewHandlerImpl   &   dynamic component rendering

    Hi,
    First -- if you're on the myfaces user list, this is a repeat post. Skip!
    Second, I don't mean to offend the RI dev guys with this myfaces post!
    Has anyone dynamically rendered JSF components while using myfaces� JspTilesViewHandlerImpl view handler?
    I have a WebGalileoFaces tabbed panel component. Its listener attaches sub-tabs to it dynamically. The rendering works without using the view handler above. Yet, when I use the myfaces handler, I get an NPE. My listener impl is below.
    The view handler appears to cut off access to the actual UIViewRoot so the form cannot be found. I�ve tried a couple calls directly to the handler using context.getApplication().getViewHandler() yet, none of the methods gave me access to it (well, that I could figure out).
    Ideas anyone?
    Thanks
    Lorinda
        public void processTabSelected(TabSelectedEvent event)
                throws AbortProcessingException {
            context = FacesContext.getCurrentInstance();
            // who sent the event?
            FacesTabbedPanel eventSource = (FacesTabbedPanel) event.getSource();
            UIComponent tabbedPanel = event.getComponent();
            String tabName = tabbedPanel.getId();
            String formId = tabbedPanel.getParent().getId();
            LOG.info("Tab selected:   " + tabName);
            LOG.info("Parent form:   " + formId);
         UIForm form = (UIForm) context.getViewRoot().findComponent(formId);             
    NPE HERE ----  UIPanel panel =  (UIPanel) form.findComponent("childTabsGrid");
    // NOTE:  the childTabsGrid must be used to attach children.
            if (panel == null) {
                LOG.error("PanelGrid   'childTabsGrid'   could not be found.  ");
            } else {
    //  ATTACH SUB TABS
                // clear the childTabsGrid to prevent stacking child tabs      
                panel.getChildren().clear();
              ListSelectionModel selectionModel = eventSource.getListSelectionModel();
               UIComponent newTabbedPanel = createSubTabbedPanel(selectionModel);
               panel.getChildren().add(newTabbedPanel);
            }

    Yes, i have created a complete portal page using a custom portal tab and JspTilesViewHandlerImpl with all components dynamically rendered and inserted by tiles: dynamic partal tabs, i18n implementation for mesages and SelectItems, dynamically change company layout with its own look-and-feel if a requested information belongs to a company (division, department, branch office, etc). There is some abnormality and how i go around to get the solution up and running. I will post the details in myfaces dev list in the next couple days.
    In essence, the navigation page dispatched by JspTilesViewHandlerImpl works properly with all Jsf UI components. However, within this tile definition and its own layout, any fragment inserted by tiles such as portlets in the left/right columns and the display fragment does not have jsf <h:commandButton> and <h:commandLink> correctly picked up the action while <h:outputLink> properly linked to the intended page.
    I temporarily solve the issue to get the portal up and running. However, this is only a temporary solution since it will severly limit a complete integration of Jsf+Tiles. A complete solution needs to be addressed, which i thing myfaces developers can quickly patch it.
    BaTien
    DBGROUPS

  • Dynamic component addition in JSF

    I have a loan application that I've done using JSF.
    The form has, among other things, fields for previous addresses as well as previous employers. Initially I'm only including enough fields for the user to enter 2 address and 2 employers.
    Since we're requiring that the user give us employers and addresses for the last 5 years this may not be enough.
    So I'm looking for the best way to allow the user to add more employers and addresses dynamically;
    An "add another address" link that when clicked returns a page with another address field, for example.
    I have a controller bean in which I could create many (say 10) employee and address beans but that's wasteful. And I experimented with a vector of employers and addresses but couldn't figure out how to do it.
    There must be a simple (JSF) way to do this.

    How about using the value of rows attribute of
    <h:dataTable dynamically by value binding or in a
    event handler method you could do:
    facesContext.getViewRoot().getChildren().add(component
    Thank you, i'll give it a try.
    I also found this thread to be helpful:
    http://forums.java.sun.com/thread.jspa?threadID=555626&messageID=2816029

  • 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?

  • OFT test dynamic Component

    Hi,
    i'am using OFT 8.40 to test a webapp with javascript build content.
    The documentation says "Oracle Functional Testing for Web Applications uses a heuristic program to determine and exclude machine-generated components of Web page source that can change dynamically ... they ... will not be tested".
    There are important componets omitted, but i want to test them.
    Can the heuristic program be truned off, so all recordet content is compared to playback content.
    In OTM config i only can add comparison exclusions?, is there another way ?.
    Regards,
    Mark
    Edited by: user12882573 on 28.04.2010 02:56

    Based on your code, looks like reference pointing to interface controller is wrong.
    Here is the sample code which i use to create the dynamic selection screen. It may help you:
      DATA: lt_range_table TYPE REF TO data,
            rt_range_tablle TYPE REF TO data,
            read_only TYPE abap_bool,
            typename TYPE string.
      DATA: lr_componentcontroller TYPE REF TO ig_componentcontroller,
            l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
    * Create the used component
      l_ref_cmp_usage = wd_this->wd_cpuse_select_options( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
    * Get a pointer to the interface controller of the select options
    *component
      wd_this->m_wd_select_options = wd_this->wd_cpifc_select_options( ).
    * Init the select screen.
    wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).
    * Create the Range table that consists of new data element
    lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'S_CARR_ID').
    *Add new field to the selection
    wd_this->m_handler->add_selection_field( i_id = 'S_CARR_ID'
                                             it_result = lt_range_table
                                             i_read_only = read_only ).
    * Create the Range table that consists of this new data element
    lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'S_CONN_ID').
    *Add new field to the selection
    wd_this->m_handler->add_selection_field( i_id = 'S_CONN_ID'
                                             it_result = lt_range_table
                                             i_read_only = read_only ).
    Raja T

  • 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 in Table Column

    JDev 11.1.1.6
    Can anyone give me guidance on how to change the component that a table column uses at runtime?
    Basically, I want to have an Input Text on Column B when the value on the Output Text on Column A is within a list of strings.
    Otherwise, I want to have an image on Column B.
    Here is the long-winded scenerio:
    I have a table with 2 columns (Column A and Column B).
    Column A is an OutputText.
    Column B is an InputText.
    The user is only allowed to enter data into Column B when Column A is 'A', 'B', or 'C'.
    If Column A is something other than 'A', 'B', or 'C', I would like to display an image in Column B that alerts the user that they cannot enter any data in this field.
    I tried making the InputText read only, but that doesn't look very good.
    Any help would be appreciated.
    Ray

    You can add image component to the same column and use rendered property on both af:inputText and af:image to show/hide them.
    Dario

  • Dynamic component interface context mapping

    Hi all,
      I got 2 component A and B. Component A use component B.
      I would like to know how to set interface context attribute value of comonent B within a view of component A in programatic mode.
      It should be something like this:
    wdThis.wdGetCompBInterface().wdGetContext.setAttr1("OK");
    is it possible???
    thank u in advance,
    Stefano

    Hi
    In your query consider B has BA Context which you want to fill from main componetn A
    Yes it is possible to add values from A to B but I did it only through context mapping instead of direct refrence of interface controller .
    For that you need to do context mapping .
    1) Add  B into A as used Web dynpro component .
    2) Add controller refrence in Component controller using properties of WDC.
    3) Map the context element from Interface controller to Component controller
        Set values of context of component controller which will set values for context 
        of A
    4) Only issue here is if you want to refresh values frequently you might need to create and destroy component each time . Not sure about it . In my case I m intitalising all context of B in  init of A itself.
    Regards
    Srushti

  • AS class file - error defining dynamic component method

    In the constructor of my custom class, I have a loop set up
    that creates a number of CheckBox instances based on the results of
    a remoting query.
    This loop works fine, and I see the new component instances
    on the stage.
    However, when I try to define the "click" method for each of
    those checkboxes, I'm getting a compiler error:
    "There is no property with the name 'click'."
    I've included the CheckBox class using the import statement
    at the top of my AS file (import mx.controls.CheckBox;).
    Here is the block of code throwing the error:

    click isn't a property but an event. If you want to respond
    to that event, you have to setup a listener. Hit F1 and search for
    Checkbox.click

  • 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

  • Dynamically component position

    hello all,
    In a screen is a component(dropdown list) which must be positioned always at the center of the screen. How to set its position accorded to the screen size?
    thank you a lot
    Bogdan

    i am not sure but you can drag and drop any column in screen. also you have column number feature in attribute

Maybe you are looking for