Dynamic components

Hi,
In the case where I don't know how many buttons I'll need until runtime how can I dynamically generate button names? It would be something like this, in a shell script:
i = 0
n = <generated at runtime>
while (( i<n ))
do
    JButton b_$i = new JButton();
    i++;
doneLater I would call another loop to register buttons that had not already been registered, ie: if n goes higher than it was last time through this loop.
I also need to do this w/ checkboxes, where I want to put a checkbox at the beginning of each line but I don't know in advance how many lines I'll have.
Thanks,
Victor

you're not suggesting that the b_$i substition is legal are you? as in
b_1
b_2
b_3
I'll have to look into your suggestions.
As far as registering seperately the reason is I'll have to repaint this button panel and change the button names as the app is used. Picture a panel w/ 10 buttons each labeled w/ a fruit name, for example. If I add a fruit, say Apple, every button greater than Apple has to be shifted right so that the Apple button takes it's place in the sorted order. So I need to keep button initializations/management seperate. I never know how many fruit the user will add, nor what the fruit name will be. Don't even know how many fruit are in the file at startup time.

Similar Messages

  • Dynamic Components 1.2 not available in JSF 2.0 ?

    Hi,
    I would like to use Dynamic:form from "Dynamic Components 1.2" in 11g R2 (11.1.2.3.0) on a JSF. It seems that it is not possible to add a dynamic:form on a JSF. It does not appear when I drag and drop a data control. However, it appears when I drag and drop on a JSPX on the same project.
    Does it exist another way to have a dynamic:form on a JSF ? Is it going to be add ?
    All the tutorials I read always use JSPX, even in 11g R2, like this one:
    http://technology.amis.nl/2011/06/07/adf-11g-r2-adf-business-components-ui-categories-and-dynamic-forms-and-some-new-ide-features/
    Thanks,
    Alain

    The dynamic components are not part of the JSF2.0 part in 11.1.2.x.0. At the moment they only work for jspx files. If you use jspx files in 11.1.2.x.0 you can use the dynamic components.
    Timo

  • Adding dynamic components

    i have a frame cannot be resized. i have used box layout as the top level layout and on that i have used five panels with components having gridbag layout. Out of five panel one panel has set visible false, which is suppsed to get visible on the trigger of a Button.
    Problem : When i m clicking the button i m setting the visibility of the panel as true... but the panel is not showing on the screen(ideally should automatically get adjusted in the screen). i have done validate(). the problem which i could fig out was that its not getting adjusted in the given size as the resizable option of the frame is set to false. Now if i increase the size of the window dynamically i m able to see the component but i m get a flicking effect in the frame. Please ... suggest me some solution that enable me to add a panel in a frame that has a rezibale switched off.
    or some way by which i can setsize the frame , add the component without a flickering effect.

    example code:
    import java.awt.event.*;
    import java.awt.*;
    import java.util.Vector;
    public class AvoidFlicker extends Panel
    implements MouseMotionListener, MouseListener
       Vector lines = new Vector();
       int x, y;
       public AvoidFlicker()
          addMouseMotionListener (this);
          addMouseListener(this);
       public void mouseClicked  (MouseEvent e) { }
       public void mouseEntered  (MouseEvent e) { }
       public void mouseExited   (MouseEvent e) { }
       public void mouseMoved    (MouseEvent e) { }
       public void mouseReleased (MouseEvent e) { }
       public void mousePressed  (MouseEvent e)
          x = e.getX();
          y = e.getY();
       public void mouseDragged (MouseEvent e)
          lines.addElement (new Rectangle (x, y, e.getX(), e.getY()));
          x = e.getX();
          y = e.getY();
          repaint();
       protected void paintBackground (Graphics g)
          Dimension size = getSize();
          for (int y = 0; y < size.height; y += 2)
             int blue = 255 - (y % 256);
             Color color = new Color (255, 255, blue);
             g.setColor (color);
             g.fillRect (0, y, size.width, 2);
       public void paintForeground (Graphics g)
          g.setColor (Color.black);
          int numberOfPoints = lines.size();
          for (int i = 0; i < numberOfPoints; i++)
             Rectangle p = (Rectangle) lines.elementAt (i);
             g.drawLine (p.x, p.y, p.width, p.height);
       public void paint (Graphics g)
          paintBackground (g);
          paintForeground (g);
       public void update (Graphics g)
          // override to not clear the background first
          // paint (g);
          paintForeground (g);
       public static void main (String[] args)
          AvoidFlicker panel = new AvoidFlicker();
          Frame f = new Frame ("Avoiding Flicker");
          f.add ("Center", panel);
          f.setSize (300, 300);
          f.show();
    }

  • Populating dynamic components in a remotely connected desktop application

    Hii Javaties
    I develping a desktop appliaction, which will remotely connect to internet.
    My requiremnets for the project are
    1)- Combo boxes, lists are dynamic(they need 2 be populated from databse).Since user will not be always connected to internet , so i need to devise some other way 2 do this .
    the solution tht i m thinking upon is tht , the comboboxes ,lists will be populated fom XML file tht will be stored in user P.C(rather tht this file will be in jar file of the desktop application).
    So now whenever user has access to net, then he can click on a menu
    button (UPDATE FILES), so tht he can get the latest copy from the central server .
    In the central server , the data will be stored in an RDBMS , and this data will be sent 2 the application on client computer as an XML file.
    and this will rewrite the (XML)files , tht the appliaction needs for poplulating Combo boxes and lists.
    2)User needs to transmit data back to central server remotely.
    I plan to use XML for this.
    Now My questions are -------
    1) Is this approach Correct ?
    2) if the data is large , is it wise to store it as an XML file
    3) How 2 go abt it.
    If anythng is not clear , plz tell me ?
    U can also click on the link below to see the original question posted by me
    http://forum.java.sun.com/thread.jspa?threadID=734442

    I don't understand why you need xml for jcombobox content? A flat file for each combobox will serve its purpose quite well.the contents of combo boxes will be fetched , from a repository (XML) file, which will contain data from database.
    This repository can be aslo updated by connecting to server,and updating it with new data from database.
    If u still have dobt do tell me .?

  • ASMM - sga dynamic components and standby

    Are SGA dynamic modifications "transferred" from the primary to the standby?
    i.e: if __shared_pool is resized in primary will this also trigger standby?
    Trying to determine if dynamic pools may somehow end up being different upon switchover/failover or if it's possible that upon switchover standby's dynamic shared_pool size results smaller than that of former primary

    Absolutely, yet there are some things DG broker does upon switch over. Was wondering if somehow standby would be "updated" upon switcher...
    But then again, it's SGA as a hole may be smaller to begin with...
    Were you to tell if the following is true or false:
    "After activation standby database may have a SGA configuration different than that of primary"
    what would you say?
    Hole intention here is to determine whether after a switch over it's possible to start getting ORA-04031 on account of dynamic pools being different
    and oracle struggling to re-size them...
    Suppose we have a 6Gb SGA... primary has been working full steam for say 2 months and dynamic pools are set by oracle in the following way:
    shared_pool...3Gb
    cache...3Gb
    Now if standby has not acknowledged those dynamic changes, it may be using values of it's own... maybe a larger cache... say
    shared_pool...1Gb
    cache...5Gb
    Now we switch-over and if sga settings are not "synced", then new primary will have 2Gb less of shared pool...
    Application kicks in, shared pool runs low... Oracle will have to move 1 or 2Gbs from cache to shared pool, this will cause serious latching and most likely ORA-04031
    so is that likely to happen?

  • Let user drag drop dynamic components, resize them

    I'm just wondering how you can create UI components and let
    the user drag and drop them on the screen
    let the user resize the elements, change the text for example
    or rotate the element (just like scrapblog)
    Lets say you want to have an image object.
    Do have to create your own custom components that inhertis
    from the image component
    add some kind of handle objects and handle al the events so
    the user can change the size and rotate it
    Or is there a much easier way of doing this kind of cool
    stuff
    If anyone knows how this kind of technique is called, let me
    know its hard to find something about it (in any language,
    if i search for wysiwyg drag and drop in flex or .NET i
    mostly get results like FlexBuilder en Visual Studio not how to
    program such special components)
    grtz

    Did some more searching and already found some cool examples
    http://www.rogue-development.com/objectHandles.html
    http://blogs.adobe.com/flexdoc/2007/03/creating_resizable_and_draggab.html
    more examples are still welcome :)

  • JSF:adding dynamic components on update.

    Well I am using a same form for two purposes. One if for creating a new service and one for editing it. In this I have a button on clicking it I get two new input text boxes.
    <h:panelGrid binding="#{provisioning.localPanelGrid}" />
              <h:panelGrid columns="2" columnClasses="localhost_list_heading">
                   <h:commandButton value="Add LocalHost" type="submit"
                        action="#{provisioning.addNewLocalHost}" />
                   <h:commandButton value="Delete LocalHost" type="submit"
                        action="#{provisioning.deleteLocalHost}" />
              </h:panelGrid>In which on clicking Add LocalHost I perfom the function addNewLocalHost which adds two input boxes.
    public static int localid = 0;
    public String addNewLocalHost() {
              log.debug("In addNewLocalHost");
              try{          
                   /*------------------ Creating Local Host Name Input Text Component --------------------*/
                   log.debug("creating local host name Input Text");
                   log.debug("Local Host Input Box no is " + localid);
                   //Setting the value of host name to empty string
                   localhostName.setValue("");
                   //Setting id of the HtmlInputText.
                   localhostName.setId("localhost" + Integer.toString(localid));
                   log.debug("Input Text for host name created");
                   String val="#{provisioning.localhostname[" + Integer.toString(localid) + "]" + "}";
                   //Creating value binding for HtmlInput Text for localhost name.
                   ValueBinding value= app.createValueBinding(val);
                   //Setting value binding.
                   localhostName.setValueBinding("value",value);
                   /*------------------ Creating Local Host Port Input Text Component --------------------*/
                   log.debug("creating local host port Input Text");
                   //Setting the value of host port to empty string
                   localportNumber.setValue("");
                   //Settig id for port number
                   localportNumber.setId("localport" + Integer.toString(localid));
                   String portValue="#{provisioning.localport[" + Integer.toString(localid) + "]" + "}";
                   log.debug("Input Text for port created");
                   ValueBinding portvalue= app.createValueBinding(portValue);
                   log.debug(portvalue);
                   //setting value binding for port number.
                   localportNumber.setValueBinding("value",portvalue);
                   //Setting Converter Message.
                   log.debug("Setting Converter Message.");
                   localportNumber.setConverterMessage("Please Enter a numerical value.");
                   /*------------------------- Getting Local Panel Grid --------------------------*/
                   log.debug("Getting existing Local Host Name Grid");
                   localPanelGrid = getLocalPanelGrid();
                   /*------------ Add components to the Local Panel Grid --------------------------*/
                   log.debug("Grid:" + localPanelGrid);
                   localPanelGrid.setColumns(2);
                   localPanelGrid.getChildren().add(localhostName);
                   localPanelGrid.getChildren().add(localportNumber);
                   log.debug("Children Size of Local Panel Grid is " + localPanelGrid.getChildren().size());
                   log.debug("Children added");     
                   //incrementing the value of localid.
                   localid++;
                   log.debug("added new Local Host Component successfully");
                   return "success";
              catch(Exception e){
                   log.error("addNewComponent " + e.getMessage(),e);
                   return "failure";
         }Now I am facing the problem in case of update where I have the same form and after getting the values from database I want to add initially the no. of input boxes according to the size of data retrived. What should I do?
    I tried using a inputHidden field to do the same. I mentioned a input Hidden field in jsf page just above the panelGrid
    <h:inputHidden value="#{provisioning.createInputTextBoxes}" />and in its getter I included
    public String getCreateInputTextBoxes() {
              log.debug("Checking if update or not for host list input text boxes to be created");
              if(isModify()){
                   log.debug("Creating pages for input boxes");
                   for(int i=0;i<localHostListSize;i++){ //localHostListSize is the size retrived from database.
                        addNewLocalHost();
              return createInputTextBoxes;
         }Now the problem is that the function is getting called the same number of times as the localHostListSize but I am seeing only one inputbox and I am seeing no data in it whereas I have explicitly set the value of localhostname[] to the data retrieved and I am getting the data in logs (except for the last one).
    Logs for my page execution were :
    11:57:20,161 DEBUG ProvisioningManagedBean:85 - Checking if update or not for host list input text boxes to be created
    11:57:20,161 DEBUG ProvisioningManagedBean:87 - Creating pages for input boxes
    11:57:20,161 DEBUG ProvisioningDynamicComponents:84 - In addNewLocalHost
    11:57:20,161 DEBUG ProvisioningDynamicComponents:88 - creating local host name Input Text
    11:57:20,161 DEBUG ProvisioningDynamicComponents:89 - Local Host Input Box no is 0
    11:57:20,161 DEBUG ProvisioningDynamicComponents:94 - Input Text for host name created
    11:57:20,177 DEBUG ProvisioningDynamicComponents:104 - creating local host port Input Text
    11:57:20,177 DEBUG ProvisioningDynamicComponents:110 - Input Text for port created
    11:57:20,177 DEBUG ProvisioningDynamicComponents:112 - [email protected]cb98
    11:57:20,177 DEBUG ProvisioningDynamicComponents:116 - Setting Converter Message.
    11:57:20,177 DEBUG ProvisioningDynamicComponents:121 - Getting existing Local Host Name Grid
    11:57:20,177 DEBUG ProvisioningDynamicComponents:47 - Getting local panel grid
    11:57:20,177 DEBUG ProvisioningDynamicComponents:125 - Grid:javax.faces.component.html.HtmlPanelGrid@14c8822
    11:57:20,177 DEBUG ProvisioningDynamicComponents:129 - Children Size of Local Panel Grid is 2
    11:57:20,177 DEBUG ProvisioningDynamicComponents:130 - Children added
    11:57:20,177 DEBUG ProvisioningDynamicComponents:134 - added new Local Host Component successfully
    11:57:20,177 DEBUG ProvisioningDynamicComponents:84 - In addNewLocalHost
    11:57:20,177 DEBUG ProvisioningDynamicComponents:88 - creating local host name Input Text
    11:57:20,177 DEBUG ProvisioningDynamicComponents:89 - Local Host Input Box no is 1
    11:57:20,177 DEBUG ProvisioningDynamicComponents:94 - Input Text for host name created
    11:57:20,177 DEBUG ProvisioningDynamicComponents:104 - creating local host port Input Text
    11:57:20,177 DEBUG ProvisioningDynamicComponents:110 - Input Text for port created
    11:57:20,177 DEBUG ProvisioningDynamicComponents:112 - [email protected]cf59
    11:57:20,192 DEBUG ProvisioningDynamicComponents:116 - Setting Converter Message.
    11:57:20,192 DEBUG ProvisioningDynamicComponents:121 - Getting existing Local Host Name Grid
    11:57:20,192 DEBUG ProvisioningDynamicComponents:47 - Getting local panel grid
    11:57:20,192 DEBUG ProvisioningDynamicComponents:125 - Grid:javax.faces.component.html.HtmlPanelGrid@14c8822
    11:57:20,192 DEBUG ProvisioningDynamicComponents:129 - Children Size of Local Panel Grid is 2and the data was back as in the logs
    12:31:00,817 DEBUG ProvisioningManagedBean:890 - Local Host List
    12:31:00,817 DEBUG ProvisioningManagedBean:894 - Host = h6
    12:31:00,817 DEBUG ProvisioningManagedBean:895 - Port = 6
    12:31:00,817 DEBUG ProvisioningManagedBean:894 - Host = 123.12.0.15
    12:31:00,817 DEBUG ProvisioningManagedBean:895 - Port = 123
    12:31:00,817 DEBUG ProvisioningManagedBean:894 - Host =
    12:31:00,817 DEBUG ProvisioningManagedBean:895 - Port = 0What should i try?

    Why don't you make use of a h:dataTable? Just adding a new SomeObject to a List<SomeObject> would be enough then.

  • CRM SURVEY SUITE + Dynamic Components

    Hi, all !
    There are a lot of useful functionality described (http://help.sap.com/saphelp_crm50/helpdata/en/2c/2ddf3ac9ecc11de10000000a11402f/frameset.htm).
    But, unfortunately, a lack of knowledges HOW to realise this features. In particular, i'm interested in such features as:
    -- 1. Term replacement (You can personalize surveys by adding a greeting text and the name of the recipient, for example, “Hello Mr. Smith”).
    -- 2. Merge Java script (to check that appropriate data has been entered, this avoids inappropriate data being stored on Web sites, databases and tables).
    It seems to be very useful in marketing and customer loyality investigations.
    If anybody shares any information regarding above-mentioned things I will appreciate very much.
    Thank you in advance.

    Hi Vasil,
    As far as your first query of maintaining personalized surveys is, the option available is to create a personalized mail formm which can be send to the users. While creating this mail form using the tx code CRMD_EMAIL. Here you can enter the attributes like First Name, Last Name. Also conditions are available to send separate mail forms for Mr or Miss. and you can provide your survey link for the same. Thus you can have personalized surveys conducted.
    Hope this will help your understanding.
    Reward Points if of any help!!!!!!
    Regards,
    Rekha Dadwal

  • Creating a form with dynamic components

    I am rather new to LiveCycle, however I have made a few forms and distributed/collected them.  I would like to build a form where the user can fill in the fields and the info will be transposed to a different area of the form where the user can copy and paste it.
    Example:  Form has the following feilds: First Name:, Last Name:, Address:, City:, State:, Zip:,
    In another section of the form, these filled in fields would be displayed in full form as: Ex.
    John Doe
    124th St
    New york, NY, 55555
    Whereas the user could then copy and paste this info into another document.  Is this functionality possible with LiveCycle?
    Thank You in advance for any help with this matter.

    If the fields are displayed as fields (one for one mapping) then changing the binding to global and ensuring that the fieldnames are the same will ensure that the values are kept in sync. If the second occurance is a single field made up of a number of other fields then you will have to populate the second field by script. On the calculate event of the second field you woudl use something like this:
    this.rawValue = FirstName.rawValue + LastName.rawValue + "\n" + Address.rawValue + "\n" + City.rawValue + ", " + State.rawValue + "\n" + Zip.rawValue
    The \n is a newline character in javascript. This will force the line feed in the final multiline field.
    Paul

  • Dynamic Components in Survey Suite

    Hi, all !
       There are a lot of useful functionality described (http://help.sap.com/saphelp_crm50/helpdata/en/2c/2ddf3ac9ecc11de10000000a11402f/frameset.htm).
       But, unfortunately, a lack of knowledges HOW to realise this features. In particular, i'm interested in such features as:
      -- 1. Term replacement (You can personalize surveys by adding a greeting text and the name of the recipient, for example, “Hello Mr. Smith”).
      -- 2. Merge Java script (to check that appropriate data has been entered, this avoids inappropriate data being stored on Web sites, databases and tables).
    It seems to be very useful in marketing and customer loyality investigations.
    If anybody shares any information regarding above-mentioned things I will appreciate very much.
    Thank you in advance.

    Thank you Mr.Vohra for responding very quickly.
    And We have another sticky issue!
    The client doesn't want Application level CSS for each and every component .He needs the CSS to be changed depending on the page the user visited/type of the user,etc;for example ADF Table Component's CSS should be different in different modules is his expectation.
    Can we have multiple CSS files (or SKINS,in ADF terms) in a Single application?
    If possible , can you please give some idea, or point me to some link?
    Thanking you in advance,
    Samba.

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

  • Dynamic Structure creation and assigning data.

    Hi,
    I have a structure and a work area,
    DATA: begin of sample_struct,
          elem1 type xxx,
          elem2 type yyy,
          elem3 type zzz,
          end of sample_struct.
    DATA: wa_sample_struct type sample_struct.
    DATA: lr_rtti_struc TYPE REF TO cl_abap_structdescr.
    DATA: lt_comp       TYPE cl_abap_structdescr=>component_table.
    DATA: ls_comp       LIKE LINE OF lt_comp.
    DATA: l_index       TYPE string.
    DATA: lr_data       TYPE REF TO data.
    DATA: lr_table      TYPE REF TO
    I create a new structure at run time extending the sample_struct to add few more components at run time like this.
    lr_rtti_struc ?= cl_abap_structdescr=>describe_by_data(wa_sample_struct).
        lt_comp = lr_rtti_struc->get_components( ).
    do 10 times.
          l_index = sy-index
          concatename 'element' l_index into ls_comp-name
          ls_comp-type = cl_abap_elemdescr=>get_string( ).
          APPEND ls_comp TO lt_comp.
    enddo.
    Then i create a work area of this new structure like this.
    lr_rtti_struc = cl_abap_structdescr=>create( p_components = lt_comp ).
        CREATE DATA lr_data TYPE HANDLE lr_rtti_struc.
        ASSIGN lr_data->* TO <fs_data>.
    Now <fs_data> is a work area for the structure.
    I can move the data in wa_sample_struct into <fs_data> like this.
    move-corresponding wa_sample_struct to <fs_data>.
    My problem is how do i access the dynamic components of this work area so that i can assign data to those components.
    If anybody knows how to access the dynamically added components of <fs_data> so that I can assgin data to those.
    Thanks in advance
    Sesh
    Message was edited by: Seshatalpasai Madala

    Hi,
          Looks like the problem is not well stated as I am getting answers which are not relevent.
    My existing structure.
    DATA: begin of sample_struct,
    elem1 type xxx,
    elem2 type yyy,
    elem3 type zzz,
    end of sample_struct.
    I create a new structure using this structure at runtime by adding new fields which are in a internal table. I add the new fields as follows.
    loop at it_tab into wa_tab.
    ls_comp-name = wa_tab.
    ls_comp-type = cl_abap_elemdescr=>get_string( ).
    APPEND ls_comp TO lt_comp.
    endloop.
    This internal table is built using the user input. So I dont know how many and what are the values in the internal table.
    LT_COMP has the existing structure field's as well as the newly added fields for my new structure.
    I create a new structure using this component list LT_COMP.
    DATA: lr_rtti_struc TYPE REF TO cl_abap_structdescr.
    lr_rtti_struc = cl_abap_structdescr=>create( p_components = lt_comp ).
    Now I have an object of cl_abap_structdescr. Which I can use as a data type for defining Workarea and internal table of this structure like this.
    CREATE DATA lr_data TYPE HANDLE lr_rtti_struc.
    ASSIGN lr_data->* TO <fs_data>.
    I can access all the existing fields of the strucutre like this.
    <fs_data>-elem1
    <fs_data>-elem2
    My problem is how do i access the newly added fields of the strucutre as I dont know the names of the fileds(I know them only at runtime).
    I hope I have explained it well enough, hope to see a relevent answer for the above problem.
    Thanks in advance.
    Sesh

  • Copy paste of components are not working properly

    Hi,I am using ADF 11.1.1.3 and dynamic components.
    I had created a page fragment which has lots of components let say 60 components.
    Now i have to create another page which will also have the same no and type of components. I want to copy paste the components and create a new page.
    But I am not able to do the same.
    When i copy paste the page fragment its not working ...(bindings are not created on new page) and other issues also...
    Just wanted to know do we have to do any thing specific should be done to copy paste fragment code or its not possible.

    Hi,
    actually bindings are not copy and pasted. What you can do is to copy and paste the fragment, edit the DataBindings.cpx file and create an entry for the new fragment .jsff and point it to the PageDef file that already existed for the fragment you copy and pasted the content from.
    Alternatively (and my recommendation to you), create the content you otherwise would copy and paste in a page template and make sure the page template has a binding file (checkbox). Then build your fragments from the page template file and thus all will have data bound components
    Frank

  • Dynamic input form in ADF

    Hi,
    i need to create an input form in ADF, which contains radio groups ,check boxes ,LOV's and text boxes as form fields.
    these form fields i need to configure in DB specifying the type of the UI component(LOV,Text fields or Radio or check box)
    by reading the type, UI component has to be rendered and validations should be fired dynamically.
    is it possible in ADF?
    Thanks
    Indu

    ADF Faces offers a library of dynamic components that includes dynamic form and
    dynamic table widgets that you can drop from the Data Controls panel. Dynamic
    components differ from standard components in that all the binding metadata is
    created at runtime. This dynamic building of the bindings allows you set display
    information using control hints on a view object instead of configuring the information
    in the Edit Form Fields dialog as you drop the control onto the page. Then if you want
    to change how the data displays, you need only change it on the view object, and all
    dynamic components bound to that view object will change their display accordingly.
    With standard components, if you want to change any display attributes (such as the
    order or grouping of the attributes) you would need to change each page on which the
    data is displayed.

  • When to not use dynamic in C#

    I'm making a class similar to the following:
    public class KeyValue
    public readonly string key;
    public readonly object value;
    Value could be of any object type as a result of this design.
    Alternatively, I could just use dynamic for value and it'll make my life easier, because it would mean no type-casting, and also because, as far as I understand, I could use value types without needing to box/unbox.
    Is there any reason not to use dynamic and to use object instead? Because I can't think of any.
    Note: I realize generics are much more suited for this, but it doesn't work for my needs. The above is really a simplification just for the purposes of this question.

    Hi
    StrikeBT,
    >>Is there any reason not to use dynamic and to use object instead? Because I can't think of any.
    The compiler ignores the variables
    defined by dynamic. So it will brings some errors in runtime.
    For example:dynamic typing is that it often hides bugs that would be otherwise revealed during compilation. Such bug then only manifests on run-time, which of course makes it much harder to detect.
    Please take a look at the example in the following articles. Note the samples it would be helpful to understand more.
    What is the difference between “dynamic” and “object” keywords?
    dynamic type in C#.4.0  Where and how to use? How does it differ from var and object?
    >>Note: I realize generics are much more suited for this, but it doesn't work for my needs.
    Yes,  for example code as below
    public interface IXRefData
    // TODO: add definition here
    public class XRefComponent<TData>
    where TData : IXRefData
    public void Update() { }
    public class XRefPickData : IXRefData { }
    public class XRefPackData : IXRefData { }
    public class XRefUpdator
    private List<dynamic> components = new List<dynamic>();
    public List<dynamic> Components
    get { return components; }
    set { components = value; }
    class Program
    static void Main(string[] args)
    XRefUpdator updator = new XRefUpdator();
    // Now we can add two different classes to list Components
    updator.Components.Add(
    new XRefComponent<XRefPickData>());
    updator.Components.Add(
    new XRefComponent<XRefPackData>());
    Thanks,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • I just installed LV2011 and one dll from my vi won't load with the error "application configuration is incorrect"

    I just installed LV2011 and one dll from my vi won't load with the error "application configuration is incorrect", which is Windows lingo for "missing package dependencies".  All the computers at my company with 2010 loaded seem to do OK.  When I do

  • Opening Default Topic page in a new window

    Hi there, I am new to RoboHelp HTML. I have recently started using it for work and was asked to look into something. I am using version 7. The problem we have is that the RoboHelp html files are being incorporated into a web application. There is a l

  • Coming back after long layoff

    I used DW for 4 years, but have not done anything web related for the last 3 years and latest version i have is DWMX. Here is what I am wondering. A friend of mine came to me with a business idea and my responsibility would be creating a website. Her

  • Still photos from a DVD

    I am trying to capture and print still photos from commercial DVDs. Any suggestions of a mac compatible software that will do this. Hopefully one that doesn't cost a bizillion dollars. greg

  • Gather_database_stats_job_proc / gather auto

    Hi, I am trying to understand exactly what gather_database_stats_job_proc does, and how it uses the "gather auto" option. I've read article :http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14211/stats.htm#sthref1429 The GATHER_DATABASE_ST