Generating Dynamic form from static context.

Hi All
I have  static context node structure
Section  (Node)
      QuestionText  (Attribute)
       AnsText  (Attribute)
I have populated the values in this node from an RFC in my code .
Now i need to create a form dynamically with QuestionText as labels and AnsText as input fields.
I have written the following code
for(int i = 0; i< wdContext.nodeSection().getSize; i++)
IWDInputField  inp_Ans = (IWDInputField)view.createElement(IWDInputField.class,"ID"+i);
IWDAttributeInfo ansAtrib = wdContext.nodeSection().getNodeInfo().getAttribute("AnsText");
inp_Ans.bindValue(ansAtrib);
This way i have bound  a single attribute to all inputfields.
So the value in the first element of AnsText appears in all inputfields.
In case of tables it works fine but i need to create the form.
Kindly help me in solving the issue.
Regards
Sonal

It is not possible to bind UI elements against node elements, only inside context-driven UI elements like Table, RowRepeater etc.
What you can do is
- use a RowRepeater, or
- create separate context attributes instead of node elements and bind the programmatically created Label and InputField elements to these attributes
Armin

Similar Messages

  • Using a function from static context..

    Well I have a command line app; and it has a public static void main. Now, I made a function that writes to a file, and tried calling it from the main section, and it got mad saying I can't call it from static context. Anyway to allow it to be called from both static and non static contexts?

    otherwise create object of the class, from that object you can call a method

  • Non-static variable from static context?

    Hi,
    I've created a program using swing components
    and I've set up a addActionListener to a button,
    button.addActionListener(this);
    when try and compile I get the following error:
    non-static variable this cannot be referenced from a
    static context
    button.addActionListener(this);
    I've checked site and my notes I don't seem to have
    done anything different from programs that have compiled
    in the past.
    I'm currently doing a programming course so I'm fairly
    new to Java, try not to get to advanced on me :)
    Thx in advance for any help.
    Chris

    Well what is declared static? If I remeber right this error means that you have a static method that is trying to access data it does not have access to. Static methods cannot access data that is intance data because they do not exist in the instance (not 100% sure about this but I believe it is true, at the very least I know they do not have access to any non-static data). Post some more of your code like where you declare this (like class def) and where you set up the button.

  • How do I translate a dynamic form from english into spanish?

    With your assistance, I was able to create a dynamic form with expandable text fields. Now I am being tasked with translating this form from English into Spanish.  I do not know how to edit the words in the text box captions so that the appropriate accents are added.  Currently, the text font is Myriad Pro.

    Hi,
    check my example.
    It explains how to design multiligual forms.
    http://thelivecycle.blogspot.com/2010/01/multiligual-forms.html

  • Removing the dynamic attributes from view context

    Hi,
    I have added an attribute dynamically using the following line of code in wdDoModifyView():
    wdThis.wdGetContext().getContext().getRootNodeInfo ().addAttribute(<attributename>, <datatype>);
    Now I want to remove the dynamically created attribute from the context.
    Pls suggest me in this regard.
    Regards,
    Ramesh.

    Hi Ramesh,
    You can use the following code to remove the attribute dynamically:
    Iterator itr = wdContext.node<NodeName>().getNodeInfo().iterateAttributes();
    <i>// If the node where you are making these attributes is a context node then just do:</i>
    // <b>wdContext.getNodeInfo().iterateAttributes()</b>, <i>for iterator</i>
    while(itr.hasNext()){
         IWDAttributeInfo attrInfo = (IWDAttributeInfo)itr.next();
         attrInfo.remove();
    This will solve your problem.
    Regards
    Pravesh
    PS: Please consider rewarding points if helpful and solved.

  • Converting dynamic form to static

    Hi I am new to Livecyle designer (8.0) and I have created a dynamic form which expands as users complete it.  However I need to be able to combine these forms into one PDF not as a package to form a final report.
    Is there some way that the when the PDF is sent by e-mail it can be sent back as a static form?  Or how do I convert the completed dynamic form to a static form which I can combine? 

    If the form has dynamic fields added to it then even users using the free Adobe Reader will be able to fill in the form. However, if it is save-off-line that you are looking for then you will need to extend the form using Reader Extensions.
    Can you be more specific about your requirements?

  • Generating Dynamic UI from XML structure

    Hi All,
    I have a requirement in which I need to select an entry in the first view and based on this, the second view would come come. But there are 30 different values that can be selected and each of them will have a different set of UI elements in the second screen. So if I go for normal static UI creation, then I need to create 30 odd views which is something we do not want.
    The second option is to dynamically generate the UI elements in wdDoModify() method. But for 30 different conditions to check all the time will lead to performance issue.
    So we are thinking if there is a way for webdynpro to dynamically read an XML structure that defines attributes and generates a layout for us dynamically.
    Please provide your inputs on this. Also kindly suggest any other better ways for the solution.
    Thanks and Regards,
    Sayan Ghosh

    Hello!
    I think you should go with second one. But I don't know any "ready to use" solutions, so you have to
    - Create your own XML structure, something like
    <section type="yourCondition">
    <input name="somePropertyName" type="text"/>
    <!-- and so on -->
    </section>
    - Parse this XML into Java Model (on application startup for example)
    - On user selection choose requred UI Model from memory and pass it to view
    - In wdDoModify() build UI(elements, context attributes, mappings etc.) according to this model
    It will be rather complicated for huge UI, but possible.
    Thanks, Mikhail

  • How can I populate a dynamic form from Excel data (beginner)

    I am reasonably certain this is beginner-level but I cannot seem to figure out how to do this. I have data in an ecxel file and I would like to import that data into a form using LS. I need to distribute the unique data to each recipient. (I have included an example below) I would really appreciate any advice. If there is a tutorial that explains this I would be happy to go through that. Thanks in advance.
    Customer
    Acct No
    Equipment
    Sales Rep
    Email
    Pear Computing
    1
    Motherboard A
    Jim Smith
    [email protected]
    Pear Computing
    1
    Video Card A
    Jim Smith
    [email protected]
    Orange Computing
    2
    Motherboard B
    Jim Smith
    [email protected]
    Orange Computing
    2
    Super Mouse
    Jim Smith
    [email protected]
    Plum Computing
    3
    Awesome Monitor
    Tanya Smith
    [email protected]
    Apple Computing
    4
    Motherboard S
    Tanya Smith
    [email protected]
    Apple Computing
    4
    Super Mouse II
    Tanya Smith
    [email protected]
    Raisin Computing
    5
    Motherboard R
    Bob Smith
    [email protected]
    Cherry Computing
    6
    SoundLoud Soundcard
    Bob Smith
    [email protected]
    I would like to send a template e-mail to each sales rep at "PC.com" that says:
    Dear <SalesRep>,
    <Customer> has the following equipment:
    <Account No> | <Customer> | <Equipment>
    I would like all the data for each customer to go to the sales rep. For instance, Jim should get an e-mail stating that "Pear Computing" has two items, and a separate e-mail stating that "Orange Computing" has two items. What I want to avoid is the MS Word mail merge solution that equates to Jim getting 4 emails. I would like the equipment to be grouped by customer number or account number. I would prefer to have a dynamic layout with flowed page as the number of items per customer will vary.
    PLEASE HELP!
    JD

    you can copy/paste data from Excel to Illustrator

  • Adding dynamic attributes to static context node

    Hi All,
    I have defined a context node LINES with several attributes. This is done staticly during developmenttime.
    During run-time node LINES is extended with several attributes dynamicly. See below:
    10     HEADER_GUID               ->
    11     DETAIL_GUID               ->
    12     EXTERNAL_ID               ->
    13     OBJECT_TYPE               ->
    14     IN_OUT_PLAN               ->
    15     TRAFFIC_LIGHT_1               ->
    16     TRAFFIC_LIGHT_2               ->
    17     TRAFFIC_LIGHT_3               ->
    18     TRAFFIC_LIGHT_4               ->
    19     _LOCATION          \TYPE=STRING     ->
    20     _ZZTOPGROUPING     \TYPE=STRING     ->
    21     _STATUS          \TYPE=STRING     ->
    22     _100000200          \TYPE=STRING     ->
    19..22 are added dynamicly.
    I have an internal table that matches de new context. This <fs_tb_tree_new> I want to bind like:
    *&- bind table
      lr_node->bind_table( new_items =  <fs_tb_tree_new>
                           set_initial_elements = abap_true ).
    In <fs_tb_tree_new> the dynamicly added attrbutes contains values e.g. (the static attributes also have values via <fs_tb_tree_new>):
                         _LOCATION   _ZZTOPGROUPING  _STATUS              _100000200                   
    5     Africa     0002     Reporting Entity     0.000
    6     Russia, CIS     0003     Identify                          0.000
    An ALV presents the values of the attribute. But.... only the values of the static part are presented, not the dynamic attributes added during runtime.
    Please advise what I forget or do wrong .
    Thanks in advance.
    John

    I solved the issue:
    If you use a combination of static attributes added with dynanic attributes (during runtime) for dynamic ALV, I advise to create a new node and bind the values to this new created node:
    Cheers, John
    wd_this->extend_context( EXPORTING im_struc_descr =  lr_cl_abap_structdescr
                               IMPORTING ex_node = lr_node_alv ).
    Method:
    *&- Create new dynamic context LINES_DYN
    Node for alv-table
      lr_node_info = wd_context->get_node_info( ).
      CALL METHOD lr_node_info->add_new_child_node
        EXPORTING
          name                  = 'LINES_NEW'
          static_element_rtti   = im_struc_descr
          is_static             = abap_true
          is_multiple           = abap_true
          is_multiple_selection = abap_false
        RECEIVING
          child_node_info       = lr_subnode_info.
    lr_node = lr_subnode_info->get_parent( ).
      lr_node = wd_context->get_child_node( 'LINES_NEW' ).
      ex_node = lr_node.
    *&- bind table for alv
      lr_node_alv->bind_table( new_items =  <fs_tb_tree_new>
                               set_initial_elements = abap_true ).

  • PDF preview of form in WDJ doens't show a dynamic form but static.

    Hi,
    I designed a pdf form in standalone adobe designer 7.1. I saved the file as DYNAMIC pdf.
    I have a WDJ with a view, which contains an Interactive Form element. I linked the dynamic pdf to the designer by importing the file in the designer.
    But when the WDJ runs and shows the PDF in the browser, the PDF is static and NOT dynamic. What is the reason for this?
    The PDF should be dynamic, because I have buttons on it and they do not respond anymore.
    Anyhelp will be rewarded.
    Kind regards,
    Sandhya

    This is a known problem with forms that have been saved with the Preview application. For more information, see:
    http://kb2.adobe.com/community/publishing/885/cpsid_88564.html

  • Dynamic forms from 2 tables

    Hi, (Sorry for the long post)
    DB Table one contains 4 fields:
    EventName
    Venue
    Price
    Date
    Form one is used by the owner to enter the data for an event into the DB Table One - there are several different events.
    DB Table two contains 7 fields (4 of the fields to retrieve data from table one)
    Name
    contact
    email
    Event Name
    Venue
    Price
    Date
    Form two is for a person registering for one of the events entered into DB table one.
    I set up a recordset called rsListEvents and then used the "Insert Record Form Wizard" to create form two with the following fields:
    EventName
    Venue
    Price
    eDate
    which I set to defaults
    {rsListEvents.EventName}
    {rsListEvents.Venue}
    {rsListEvents.Price}
    {rsListEvents.eDate}
    I have a page listing the events and when register for this event is clicked I was hoping the data from table one would be entered into form two and the user then fills in the rest manually where all the data is entered into DB table two.
    Unfortunately even though the URL indicates that the correct information from table one should be entered into form two .php?id_event=2
    The data from DB table one row id_event=1 is always displayed no matter what the record number is.
    Can anyone tell me where I have gone wrong
    Thanks
    laurence

    I am simplyfing this so I can get help on a basic level ( Mr basic)
    Why does this not work?
    I set up a Dynamic List using DB Table 1 and set the detailed page.
    I set up a record set on the detailed page using the same table.
    SELECT *
    FROM addEvents
    When I test I get the results from ID 1 no matter which one I choose. But when I test the RS I get both dummy entries 1 and 2
    So I am missing something that needs to be appended to the URL.
    L

  • Creating dynamic caches from static config

    Hi, we normally create our caches using static config, using the std xml config.
    Example, in our cache-mapping, we'll have a cache like the below:
    <cache-name>account</cache-name>
                <scheme-name>distributed-persistent-write-thru</scheme-name>
                <init-params>
                    <init-param>
                        <param-name>cache-store-class-name</param-name>
                        <param-value>spring-bean:accountCacheStore</param-value>
                    </init-param>
                    <init-param>
                        <param-name>expiry-time</param-name>
                        <param-value>7d</param-value>
                    </init-param>
                    <init-param>
                        <param-name>high-units-param</param-name>
                        <param-value>6075000</param-value>
                    </init-param>
                    <init-param>
                        <param-name>low-units-param</param-name>
                        <param-value>4556251</param-value>
                    </init-param>
                </init-params>And in our schemes, we'll have something like:
       <distributed-scheme>
                <scheme-name>distributed-persistent-write-thru</scheme-name>
                <service-name>DistributedWriteThrough</service-name>
                <backing-map-scheme>
                    <read-write-backing-map-scheme>
                        <class-name>com.mycom.coherence.ExceptionLoggingBackingMap</class-name>
                        <internal-cache-scheme>
                            <local-scheme>
                                <scheme-ref>local-hybrid-eviction</scheme-ref>
                                <expiry-delay>{expiry-time}</expiry-delay>
                                <high-units>{high-units-param}</high-units>
                                <low-units>{low-units-param}</low-units>
                            </local-scheme>
                        </internal-cache-scheme>
                        <cachestore-scheme>
                            <class-scheme>
                                <class-name>{cache-store-class-name}</class-name>
                            </class-scheme>
                        </cachestore-scheme>
                        <write-delay>0</write-delay>
                    </read-write-backing-map-scheme>
                </backing-map-scheme>
                <autostart>true</autostart>
                <backup-count-after-writebehind>0</backup-count-after-writebehind>
            </distributed-scheme>However, now we need to be more dynamic. What i'd like to do is create N caches, that all look like the "account" cache above; so it's like i want to use the config as a template. I don't know how many of these caches i'll need, so i can't configure them statically. The number of caches will be given to the server at startup.
    Something like:
    List cacheList = new ArrayList<NamedCache>();
    NamedCache templateCache = CacheFactory.getCache("account");
    cacheList.add( templateCache );
    for( int i=0; i<count; i++) {
       cacheList.add( CacheFactory.createFromCache( templateCache, "account"+i ) );
    }So what's "best practice" for doing something like this?
    Thx.
    Edited by: user9222505 on Jul 9, 2012 4:52 PM

    Ahh.. I see. There are a few ways to do this.
    Presumably then you can create the cache store from Spring for a given cache name. So create a factory class with a static method that takes a String parameter, which will be the cache name, and returns a Cache Store. For example...
    package com.jk;
    public class CacheStoreFactory {
        public static CacheStore createCacheStore(String cacheName) {
            // in here goes your code to get the cache store instance from Spring
    }Now change your cache configuration to use the Factory for your cache store like this
    <cache-mapping>
        <cache-name>account*</cache-name>
        <scheme-name>distributed-persistent-write-thru</scheme-name>
        <init-params>
            <init-param>
                <param-name>expiry-time</param-name>
                <param-value>7d</param-value>
            </init-param>
            <init-param>
                <param-name>high-units-param</param-name>
                <param-value>6075000</param-value>
            </init-param>
            <init-param>
                <param-name>low-units-param</param-name>
                <param-value>4556251</param-value>
            </init-param>
        </init-params>
    </cache-mapping>
    <caching-schemes>
        <distributed-scheme>
            <scheme-name>distributed-persistent-write-thru</scheme-name>
            <service-name>DistributedWriteThrough</service-name>
            <backing-map-scheme>
                <read-write-backing-map-scheme>
                    <class-name>com.mycom.coherence.ExceptionLoggingBackingMap</class-name>
                    <internal-cache-scheme>
                        <local-scheme>
                            <scheme-ref>local-hybrid-eviction</scheme-ref>
                            <expiry-delay>{expiry-time}</expiry-delay>
                            <high-units>{high-units-param}</high-units>
                            <low-units>{low-units-param}</low-units>
                        </local-scheme>
                    </internal-cache-scheme>
                    <cachestore-scheme>
                        <class-scheme>
                            <class-factory-name>com.jk.CacheStoreFactory</class-factory-name>
                            <method-name>createCacheStore</method-name>
                            <init-params>
                                <init-param>
                                    <param-type>String</param-type>
                                    <param-value>{cache-name}</param-value>
                                </init-param>
                            </init-params>
                        </class-scheme>
                    </cachestore-scheme>
                    <write-delay>0</write-delay>
                </read-write-backing-map-scheme>
            </backing-map-scheme>
            <autostart>true</autostart>
            <backup-count-after-writebehind>0</backup-count-after-writebehind>
        </distributed-scheme>
    </caching-schemes>When Coherence comes to create a cache it will pass the name to the factory method to create the cache store.
    JK

  • Product for Generating Dynamic Forms

    Hi,
    Adobe has a myriad of products.  Which product is suitable to create dynamic PDF forms, downloadable to client (not necessary to integrate with browser).  The "dynamicity" of the forms are dependent on questions answered by the user - which in all likelihood would be better asked "outside" the Adobe form.  In other words, generate a PDF Form for entry using Adobe technology in conjunction with a web technology like ASP, Java or other?
    Regards,
    Gawie

    Stars, snowflakes? A database for Data Warehouse with facts and measures connected in a star/snowflake like schema? It remains a database. And SSIS already has stock components for processing DW as SSAS Cube processing, merging data, lookups, you name it.
    They are graphical.
    You can achieve all this by just using SSIS which is tailored exactly to doing that.
    The rest, if there is a gap, there are third party components available for as BIML http://varigence.com/Products/Biml/Capabilities that can automate things and take away the routine.
    Arthur My Blog

  • How to Generate Dynamic Columns from SQL

    Hi Friends,
    I want to create a data fromat like This
    Showroom / date    01-01-09        02-01-09     03-01-09     04-01-09      05-01-09     06-01-09     07-01-09   
    S1                           20                      10              09            90             90                  10            100
    S2                           10                       1                1              2               6                    2             10
    S3                            5                        7                 9             1               2                    3             12This Data is Just like Matriz Reports....................................
    Here i Want to Generate Date column value Dynamically.....................is it possible through SQL
    the values are Sales value for each showroom for diffrent date value
    all sale,showroom and Date Column are in one Table......................
    It should Generate date Dynamically depending on User VAlues./..............
    Thanks in Advance

    something to play with (not tested as I don't have database access)
    declare
    /* assuming table showroom_sales has columns a_showroom,a_date,a_sale */
      the_sql varchar2(32000) := 'select a_showroom';
      day_from date := to_date('20090101','yyyymmdd');
      day_till date := to_date('20090107','yyyymmdd');
    begin
      for d in (select a_date from showroom_sales where a_date between day_from and day_till)
      loop
        the_sql := the_sql ||
                   ',max(decode(a_date,to_date('''||to_char(d.a_date,'yyyymmdd')||''',''yyyymmdd''),a_sale,null)) "'||to_char(d.a_date,'dd-mm-rr')||'"'
      end loop;
      the_sql := the_sql || ' from showroom_sales group by a_showroom order by a_showroom ';
      dbms_output.put_line(the_sql);  /* to verify if query is correct or not */
    end;the code above should generate something like (provided all those dates appear in your showroom_sales table)
    select a_showroom,
           max(decode(a_date,to_date('20090101','yyyymmdd'),a_sale,null)) "01-01-09",
           max(decode(a_date,to_date('20090102','yyyymmdd'),a_sale,null)) "02-01-09",
           max(decode(a_date,to_date('20090103','yyyymmdd'),a_sale,null)) "03-01-09",
           max(decode(a_date,to_date('20090104','yyyymmdd'),a_sale,null)) "04-01-09",
           max(decode(a_date,to_date('20090105','yyyymmdd'),a_sale,null)) "05-01-09",
           max(decode(a_date,to_date('20090106','yyyymmdd'),a_sale,null)) "06-01-09",
           max(decode(a_date,to_date('20090107','yyyymmdd'),a_sale,null)) "07-01-09"
      from showroom_sales
    group by a_showroom
    order by a_showroom to be executed to get the result as required
    Regards
    Etbin

  • Non-static method paint cannot be referenced from static context

    i cant seem to figure out this error dealing method paint:
    public class TemplateCanvas extends Canvas implements Runnable {
        //static
        public static final int STATE_IDLE      = 0;
        public static final int STATE_ACTIVE    = 1;
        public static final int STATE_DONE      = 2;
        private int     width;
        private int     height;
        private Font    font;
        private Command start;   
        private int state;
        private String message;
        public TemplateCanvas() {
            width = getWidth();
            height = getHeight();       
            font = Font.getDefaultFont();
            //// set up a command button to start network fetch
            start = new Command("Start", Command.SCREEN, 1);
            addCommand(start);
        public void paint(Graphics g) {
            g.setColor(0xffffff);
            g.fillRect(0, 0, width, height);
            g.setColor(0);
            g.setFont(font);
            if (state == STATE_ACTIVE) {
                Animation.paint(g);
            } else if (state == STATE_DONE) {
                g.drawString(message, width >> 1, height >> 1, Graphics.TOP | Graphics.HCENTER);
        public void commandAction(Command c, Displayable d) {
            if (c == start) {
                removeCommand(start);
                //// start fetching in a new thread
                Thread t = new Thread(this);
                t.start();
        public void run() {
            state = STATE_ACTIVE;
            //// start network fetch
            Network network = new Network();
            network.start();
            //// start busy animation
            Animation anim = new Animation(this);
            anim.start();
            //// wait for network to finish
            synchronized (network) {
                try {
                    wait();
                } catch (InterruptedException ie) { }
            //// end animation
            anim.end();
            //// get message from network
            message = network.getResult();
            //// repaint message
            state = STATE_DONE;
            repaint();
    }TemplateCanvas.java:38: non-static method paint(javax.microedition.lcdui.Graphics) cannot be referenced from a static context

    Animation.paint(g); paint() is not a static method. That means you have to call it on an instance of an Animation class (an object), not on the class itself. This is designed this way because the paint() method uses variables that have to be instantiated, so if you don't have an instance to use, it can't access the variables it needs. Static methods don't use instance variables, they only use what's passed in to them, so they don't need to be called on an object. Hope that was clear.

Maybe you are looking for

  • Uploading open sales orders from sap

    hi all, i need to upload open sales orders from legacy to sap. pls advice what steps need to be followed for the same. 1) how we will we download open sales order from legacy and where..... is it to some flat file or some other option is  there . pls

  • In-built camera in Macbook Air with OS X version 10.9.1 is not working

    In-built camera in Macbook Air with OS X version 10.9.1 is not working. Can anyone help?

  • Using variables in Hyperion IR

    Hi, I am trying to accept a range from the user in Hyperion IR using the dashboard feature and want to use the inputed range in a few computed columns in the results tab. Does anyone know how I can achieve this ? Thanks, Murali

  • How to add few more columns in UWL screen

    Hi all Currently by default we are able to see the columns in UWL header as "Subject", "From", "Sent Date" , "Due Date" , "Status" . now i want to add few more columns  apart from standard columns. can you please let me know how to add our own column

  • Writing functions in jsp

    I want to write functions which can take some parameter and returns an array in jsp