Dynamic Creation of Buttons and Actions HELP

Hi there,
I have got a problem (or maybe even two) with the dynamic Creation of buttons. The code below creates the buttons.
My main problem is, that the parameter created for the button's action isn't propagated to the assigned event handler. I get a null, though the name of the parameter in the event handler and the name of the parameter added to the action are the same.
Could it also be that I'm always using the same action? I.e. does wdThis.wdGetAddElementAction() always return the same action instance? If yes, how can I create individual actions for each button?
Any help is appreciated!
Cheers,
Heiko
"    for(int i=rootContainer.getChildren().length; i<wdContext.nodeFeature().size();i++)
               IPrivateVCT_Feature.IFeatureElement featureElement = wdContext.nodeFeature().getFeatureElementAt(i);
               IWDTray featureTray = (IWDTray) view.createElement(IWDTray.class, featureElement.getName());
               IWDCaption header = (IWDCaption) view.createElement(IWDCaption.class, featureElement.getName()+"_Header");
               header.setText(featureElement.getName());
               featureTray.setHeader(header);
               featureTray.setExpanded(false);
               rootContainer.addChild(featureTray);
               IWDButton button = (IWDButton) view.createElement(IWDButton.class, featureElement.getName()+"_Button_AddElement");
               IWDAction actionAddElement = wdThis.wdGetAddElementAction();
               actionAddElement.getActionParameters().addParameter("featureIndex", new Integer(i).toString());
               button.setOnAction(actionAddElement);
               button.setText("Add Element");
               featureTray.addChild(button);

Hi Heiko,
You have done everything correctly....except for 1 line
in the code...
Replace the following line in your code:
actionAddElement.getActionParameters().addParameter("featureIndex", new Integer(i).toString());
Replace the above line with this code:
button.mappingOfOnAction().addParameter("featureIndex",i);
Actually in your code, you are not associating the parameter with the button...
Note that addParameter(...) comes with two signatures: addParameter(String param, String value) and addParameter(String param, int value). You can use any of them based on yuor need.
Hope it helps,
Thanks and Regards,
Vishnu Prasad Hegde

Similar Messages

  • Duplicating Buttons and Actions?

    I am creating an Interactive PDF and will be using buttons to show and hide many of the features. I would like to replicate many of the buttons and the actions. However, when I try and copy and paste (or use option) to do this actions attached to the button would not export to the PDF. Is there anything I can do to fix this or accomplish the same thing?

    If a button is not working correctly, here are the typical culprits.
    1. PDF viewer. Interactive elements may not work on various PDF viewers, but in your case, you're using Reader. 
    2. Corruption. An Indesign document (especially one with with many interactive elements) can become corrupt. Export to IDML, open IDML back into ID, export to PDF and test.
    3. Faulty Inspection. A button can be a complex interaction of actions, events and visibility. A button can have multiple actions assigned to multiple events. The complexity is compounded with many buttons using show/hide actions. The task of determining whether all attributes are applied correctly is tedious. Make sure to toggle each event in panel and inspect each action, along with checking the visibility of other buttons.

  • Help needed regarding buttons and action listeners!

    Hey,
    Im designing an applet and im trying to create it so that when a button is pressed a new Draw object is drawn, I have read up about action listeners but im not totally sure where they need to be inserted
    Ive posted my code below so hopefully someone out there wll be able to see what im working with!
    Thank you in advance
    public class ImageWithMulti extends Applet {
        Image image;
        public void init () {
            image = getImage(getDocumentBase(),
                getParameter("Channel"));
        public void paint(Graphics g) {
            g.drawImage(image, 0, 0, this);
            drawMultiDown1
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);   //2nd number changes left sided position up or down
            drawMultiUp1
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);
            drawMultiUp2
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);
            drawMultiDown2
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white); 
            drawMultiUp3
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);   
           drawMultiDown3
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);
           drawMultiUp4
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);
           drawMultiDown4
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);
           drawMultiUp5
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);

    hi,
    i've modify your code. but i've commented your some original code because i was getting error...
    please check the code...
    import java.awt.event.*;
    import java.applet.*;
    import java.awt.*;
      <applet code="ImageWithMulti.class" width=100 height=140></applet>
    public class ImageWithMulti extends Applet implements ActionListener {
        Image image;
        Button btnClick = null;
        public void init () {
            /*image = getImage(getDocumentBase(),
                getParameter("Channel"));*/
              btnClick = new Button("Click");
              add(btnClick);
              btnClick.addActionListener(this);
        public void paint(Graphics g) {
            g.drawImage(image, 0, 0, this);
           /* drawMultiDown1
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);   //2nd number changes left sided position up or down
            drawMultiUp1
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);
            drawMultiUp2
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);
            drawMultiDown2
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white); 
            drawMultiUp3
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);   
           drawMultiDown3
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);
           drawMultiUp4
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);
           drawMultiDown4
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);
           drawMultiUp5
        (g, 0, 0, getSize().width, getSize().height, 25, new Color(0).white);*/
         public void actionPerformed(ActionEvent ae){
              if(ae.getSource() == btnClick){
                   System.out.println("Hey");
    }dhaval..

  • Help!!! Button and action sequence...

    I am creating a relatively simple web site in FC, but I have run into a problem. I purchased a stock .mov file, which I converted in Flash CS5 to use as an intro to the site. In Flash, I added a button to enter the site. My resulting .swf intro works perfectly in Flash; but when I import into FC, the button no longer functions (the button states are preserved, but there is no interactivity - even when I use the "Add Interaction" panel in FC). Where did I go wrong?
    And, is there any way to access a specific frame of a file in FC?
    Thanks!
    Jane

    There is a nice converter in the CS5 suite called something like Adobe Media Converter I think. Use that tool and convert it to a flv instead. There is lots of things in Flash that I think runs in conflict if you embed a .swf with a FLVplayer from flash.

  • Buttons and Action Script 3 in Flash CS4

    Hi, I am new to Flash. I am working on creating a photo gallery and I am having an issue trying to figure out how to add AS3 code to link buttons to a point in a timeline.  I have 5 buttons each with an alpha transparency change that works fine and now I want to establish an action on each button that on CLICK will bring up a particular photo in my timeline. Help!  Thanks

    I can't tell you what is involved with bringing up a photo on your timeline, but to code a button to do something, first you assign it an instance name via the properties panel.  Let's say you name it btn1.
    Then, normally in layer dedicated to actionscript, in the same frame as that button you assign an event listener and an event handler to go with it...
    function btn1Handler(evt:MouseEvent):void {
         gotoAndStop("framelabel"); // or frame number
    btn1.addEventListener(MouseEvent.CLICK, btn1Handler);
    For that example it shows how to have the button make things move to a different frame in the timeline.

  • Buttons and Action script 3

    I have purchased Flash CS3 and have created a small
    animation. I would like the user to press the button in order for
    the animation to play. With the previouse version of flash I would
    drag the button onto the stage open the action script window and
    start entering the script e.g. on(release){gotoandPlay(5);}
    However with the new version I cannot write scripts for the
    buttons.... I am confused or am I missing something? Please help me
    out.

    you're missing actionscript3. and if you don't care to learn
    and use it, just use the actionscript2 publish settings and use
    actionscript2 coding in your projects.

  • Buttons and actionlistener help.

    the following code has 2 buttons, how would i use a button to get me differnt graphics but inside the same window,
    say i clicked next the graphics would be slightly altered which I will do but it wont open a new window it will be in the same window, but different shapes.
    I am having trouble with action listeners and really need help in how they work iv read up but dont understand, and how this would be implemented for this.
    much help would be appreciated.
    import java.awt.BasicStroke;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.GridLayout;
    import java.awt.RenderingHints;
    import java.awt.Stroke;
    import java.awt.geom.Ellipse2D;
    import java.awt.geom.Rectangle2D;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    public class square extends JPanel
        public square()
            setPreferredSize(new Dimension(800, 700));
            int eb = 80;
            setBorder(BorderFactory.createEmptyBorder(eb, eb, eb, eb));
            setLayout(new BorderLayout(5, 10));
           JPanel buttonPanel = createButtonPanel();
             add(buttonPanel, BorderLayout.SOUTH);
        private JPanel createButtonPanel()
            JPanel bp = new JPanel();
            bp.setOpaque(false);
                   JButton btn2 = new JButton("<-  Back Step ");
                    JButton btn = new JButton("Next Step   ->");
                    bp.add(btn2);
                    bp.add(btn);
            return bp;
        @Override
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D) g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                    RenderingHints.VALUE_ANTIALIAS_ON);
            Rectangle2D rect = new Rectangle2D.Double(250, 150, 100, 100);
            Rectangle2D     rect2 = new Rectangle2D.Double(400, 150, 100, 100);
             Rectangle2D     rect3 = new Rectangle2D.Double(550, 150, 100, 100);
             Rectangle2D     rect4 = new Rectangle2D.Double(250, 300, 100, 100);
             Rectangle2D     rect5 = new Rectangle2D.Double(400, 300, 100, 100);
             Rectangle2D     rect6 = new Rectangle2D.Double(550, 300, 100, 100);
             Rectangle2D     rect7 = new Rectangle2D.Double(250, 450, 100, 100);
             Rectangle2D     rect8 = new Rectangle2D.Double(400, 450, 100, 100);
             Rectangle2D     rect9 = new Rectangle2D.Double(550, 450, 100, 100);
             g.drawString("b0,0", 300, 130);
            g.drawString("b1,0", 300, 110);
             g.drawString("b2,0", 300, 90);
                 g.drawString("b0,1", 450, 110);
            g.drawString("b1,1", 450, 90);
            g.drawString("b2,1", 450, 70);
                 g.drawString("b0,2", 600, 90);
            g.drawString("b1,2", 600, 70);
            g.drawString("b2,2", 600, 50);
             g.drawString("a0,0", 200, 200);
            g.drawString("a1,0", 150, 200);
             g.drawString("a2,0", 100, 200);
                 g.drawString("a0,1", 150, 350);
            g.drawString("a1,1", 100, 350);
            g.drawString("a2,1", 50, 350);
                   g.drawString("a0,2", 100, 500);
            g.drawString("a1,2", 50, 500);
            g.drawString("a2,2", 15, 500);
            g2.setPaint(Color.black);
            g2.draw(rect);
            g2.draw(rect);
              g2.draw(rect2);
             g2.draw(rect3);
              g2.draw(rect4);
             g2.draw(rect5);
              g2.draw(rect6);
             g2.draw(rect7);
              g2.draw(rect8);
              g2.draw(rect9);
            Stroke oldStroke = g2.getStroke();
            g2.setStroke(new BasicStroke(5));
            g2.setStroke(oldStroke);
        private static void createAndShowUI()
            JFrame frame = new JFrame("Matrix Multiplication - Step by Step ");
            frame.getContentPane().add(new square());
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
        public static void main(String[] args)
            java.awt.EventQueue.invokeLater(new Runnable()
                public void run()
                    createAndShowUI();
    }

    ok I had a look over it, I got this
    import java.awt.BasicStroke;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.GridLayout;
    import java.awt.RenderingHints;
    import java.awt.Stroke;
    import java.awt.geom.Ellipse2D;
    import java.awt.geom.Rectangle2D;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    public class square extends JPanel implements ActionListener
        public square()
            setPreferredSize(new Dimension(800, 700));
            int eb = 80;
            setBorder(BorderFactory.createEmptyBorder(eb, eb, eb, eb));
            setLayout(new BorderLayout(5, 10));
           JPanel buttonPanel = createButtonPanel();
             add(buttonPanel, BorderLayout.SOUTH);
      public void actionPerformed(ActionEvent e) {
            System.out.println("hello");
        private JPanel createButtonPanel()
            JPanel bp = new JPanel();
            bp.setOpaque(false);
                   JButton btn2 = new JButton("<-  Back Step ");
                    JButton btn = new JButton("Next Step   ->");
                    bp.add(btn2);
                    bp.add(btn);
             btn.addActionListener(this);
            return bp;
        @Override
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D) g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                    RenderingHints.VALUE_ANTIALIAS_ON);
            Rectangle2D rect = new Rectangle2D.Double(250, 150, 100, 100);
            Rectangle2D     rect2 = new Rectangle2D.Double(400, 150, 100, 100);
             Rectangle2D     rect3 = new Rectangle2D.Double(550, 150, 100, 100);
             Rectangle2D     rect4 = new Rectangle2D.Double(250, 300, 100, 100);
             Rectangle2D     rect5 = new Rectangle2D.Double(400, 300, 100, 100);
             Rectangle2D     rect6 = new Rectangle2D.Double(550, 300, 100, 100);
             Rectangle2D     rect7 = new Rectangle2D.Double(250, 450, 100, 100);
             Rectangle2D     rect8 = new Rectangle2D.Double(400, 450, 100, 100);
             Rectangle2D     rect9 = new Rectangle2D.Double(550, 450, 100, 100);
             g.drawString("b0,0", 300, 130);
            g.drawString("b1,0", 300, 110);
             g.drawString("b2,0", 300, 90);
                 g.drawString("b0,1", 450, 110);
            g.drawString("b1,1", 450, 90);
            g.drawString("b2,1", 450, 70);
                 g.drawString("b0,2", 600, 90);
            g.drawString("b1,2", 600, 70);
            g.drawString("b2,2", 600, 50);
             g.drawString("a0,0", 200, 200);
            g.drawString("a1,0", 150, 200);
             g.drawString("a2,0", 100, 200);
                 g.drawString("a0,1", 150, 350);
            g.drawString("a1,1", 100, 350);
            g.drawString("a2,1", 50, 350);
                   g.drawString("a0,2", 100, 500);
            g.drawString("a1,2", 50, 500);
            g.drawString("a2,2", 15, 500);
            g2.setPaint(Color.black);
            g2.draw(rect);
            g2.draw(rect);
              g2.draw(rect2);
             g2.draw(rect3);
              g2.draw(rect4);
             g2.draw(rect5);
              g2.draw(rect6);
             g2.draw(rect7);
              g2.draw(rect8);
              g2.draw(rect9);
            Stroke oldStroke = g2.getStroke();
            g2.setStroke(new BasicStroke(5));
            g2.setStroke(oldStroke);
        private static void createAndShowUI()
            JFrame frame = new JFrame("Matrix Multiplication - Step by Step ");
            frame.getContentPane().add(new square());
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
        public static void main(String[] args)
            java.awt.EventQueue.invokeLater(new Runnable()
                public void run()
                    createAndShowUI();
    }it produces hello once I click the button, but how would I produce the same frame once the button is clicked, not a new frame, the same one iv got with slight adjustments inside it..which i will do.

  • Dynamic creation of ItemListBox and binding a child node

    Hello @all,
    I have the following context structure
    root
    --category
    -- --report
    -- -- --id
    -- -- --name
    -- --id
    -- --name
    the parent node is "category" with attributes "id" and "name" and the child node is "report" with "id" and "name".
    Now I want on an onAction-Event of a Button, that for every category an itemListBox will be created with the according report names. the creation of the itemList is not the problem, but the binding of the datasource and/or the descriptivetext.
    my code:
    public void initItemListBox( )
        //@@begin initItemListBox()
        IWDView view = wdContext.currentContextElement().getSelectView();
        IWDGroup group = (IWDGroup) view.getElement("ItemListGroup");
        if (group.hasChildren())
          group.removeAllChildren();
        for (int i = 0; i < wdContext.nodeCategory().size(); i++)
          ICategoryElement catEl = wdContext.nodeCategory().getCategoryElementAt(i);
          wdContext.nodeCategory().setLeadSelection(i);
          generateItemLists(wdContext.currentContextElement().getSelectView(), wdContext, catEl);
        //@@end
    public void generateItemLists( com.sap.tc.webdynpro.progmodel.api.IWDView view, de.mgi.portaldev.bc.mdw.msi.wdp.IPrivateCRSReportView.IContextNode wdContext, de.mgi.portaldev.bc.mdw.msi.wdp.IPrivateCRSReportView.ICategoryElement category )
        //@@begin generateItemLists()
        //    ItemListBox
        IWDGroup group;
        IWDGroup catGroup;
        IWDLabel label;
        String groupId = "group_" + category.getName();
        catGroup = (IWDGroup) view.createElement(IWDGroup.class, groupId);
        IWDMatrixLayout matrLayout = (IWDMatrixLayout) catGroup.createLayout(IWDMatrixLayout.class);
        String labelId = "label_" + category.getName();
        label = (IWDLabel) view.createElement(IWDLabel.class, labelId);
        label.setText(category.getName());
        IWDMatrixData layout = (IWDMatrixData) label.createLayoutData(IWDMatrixData.class);
        layout.setVAlign(WDCellVAlign.TOP);
        String itemListId = "itemList_" + category.getName();
        IWDItemListBox itemListBox = (IWDItemListBox) view.createElement(IWDItemListBox.class, itemListId);
        label.setLabelFor(itemListId);
        IWDMatrixData itemlayout = (IWDMatrixData) itemListBox.createLayoutData(IWDMatrixData.class);
        itemListBox.bindDescriptiveText("crsReporting.category.report.name");
        IWDNodeInfo reportNodeInfo = category.nodeReport().getNodeInfo();
    //    itemListBox.bindText(reportNodeInfo.getAttribute("name"));
        itemListBox.setVisibleItems(5);
        IWDMatrixHeadData matrixHead = (IWDMatrixHeadData) itemListBox.createLayoutData(IWDMatrixHeadData.class);
        IWDAction itemListAct = (IWDAction) wdThis.wdGetItemSelectAction();
        itemListBox.setOnLeadSelect(itemListAct);
    //    itemListBox.bindDataSource(reportNodeInfo);
        itemListBox.bindDataSource("crsReporting.category.report");
        catGroup.addChild(label);
        catGroup.addChild(itemListBox);
        group = (IWDGroup) view.getElement("ItemListGroup");
        group.addChild(catGroup);
        //    END ITEMLIST
        //@@end
    What am I doing wrong? in every ItemListbox there are only the report names of the last category.
    thanks.

    RowRepeater is available in WD Java since NW CE (7.1). With RowRepeater, the solution is trivial and can be done completely by declaration in view designer.
    In earlier releases, you can solve it as follows (non-trivial)
    - For each category, create a separate context node "Category_i" with an attribute "name"
    - Inside each category node, create a non-singleton node "Reports" with an attribute "name"
    - Foreach report, add a node element to the reports subnode of its category node <b>element</b>
    All this has to be done using the generic context API.
    On each change of the data, reset the context and re-create these nodes.
    In wdDoModifyView(), check if data have changes and create UI elements programmatically.
    - For each category, create a group, bind header text to category name.
    - Inside each group, create a ItemListBox, bind "dataSource" to reports sub-node of category (non-singleton!) and bind "text" to text attribute of report node.
    Sample code:
    To build context structure:
    private void createCategories()
        for (int i = 0; i < 3; ++i)
          IWDNodeInfo categoryNodeInfo = wdContext.getNodeInfo().addChild("Category" + i, null, true, CMICardinality.ONE, CMICardinality.ONE, true, null);
          IWDAttributeInfo att = categoryNodeInfo.addAttribute("name", "ddic:com.sap.dictionary.string");
          IWDNode categoryNode = wdContext.getChildNode(categoryNodeInfo.getName(), 0);
          categoryNode.getElementAt(0).setAttributeValue(att.getName(), "Category #" + i);
          IWDNodeInfo reportNodeInfo = categoryNodeInfo.addChild("Reports", null, false, CMICardinality.MANY, CMICardinality.ZERO_TO_ONE, true, null);
          IWDAttributeInfo attReportName = reportNodeInfo.addAttribute("name", "ddic:com.sap.dictionary.string");
          IWDNode reportNode = categoryNode.getChildNode("Reports", 0);
          for (int j = 0; j < 5; ++j)
            IWDNodeElement report = reportNode.createAndAddElement();
            report.setAttributeValue("name", "Report #" + j);
    To recreate UI:
    if (<data_have_changed>)
          IWDTransparentContainer root = (IWDTransparentContainer) view.getRootElement();
          for (int i = 0; i < 3; ++i)
            IWDNode categoryNode = wdContext.getChildNode("Category" + i, 0);
            IWDAttributeInfo attName = categoryNode.getNodeInfo().getAttribute("name");
            IWDGroup group = view.createElement(IWDGroup.class);
            root.addChild(group);
            IWDCaption header = view.createElement(IWDCaption.class);
            group.setHeader(header);
            header.bindText(attName);
            IWDNode reportsNode = categoryNode.getChildNode("Reports", 0);
            IWDAttributeInfo attReportName = reportsNode.getNodeInfo().getAttribute("name");
            IWDItemListBox list = view.createElement(IWDItemListBox.class);
            group.addChild(list);
            list.bindDataSource(reportsNode.getNodeInfo());
            list.bindText(attReportName);
    Armin
    Fixed code tags

  • Dynamic creation of Buttons, mouseClick

    Hi,
    I'm creating the buttons in dynamic way.
            for (int i = 0; i <parameters.length; i++ ) {
                InputDataSource_Array=parameters.get_InputDataSource().split("\\.");
    caption=InputDataSource_Array[(InputDataSource_Array.length-1)]+":"+parameters[i].get_Algorithm().UID();
    ToggleButtons[i] = new javax.swing.JToggleButton();
    ToggleButtons[i].setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/parameter-red.gif")));
    ToggleButtons[i].setText(caption);
    ToggleButtons[i].setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    ToggleButtons[i].addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(java.awt.event.MouseEvent evt) {
    togglePanel(i);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = (i+1)*2-1;
    //System.out.println(gridBagConstraints.gridy);
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 100.0;
    add(ToggleButtons[i], gridBagConstraints);
    and I want to invoke togglePanel(i) on mouseClick.
    But compilator says that "local variable i is accessed from within inner class".
    How can I do it properly?
    Thank you!

    Swing related questions should be posted in the Swing forum.
    You should be using a generic listener as mentioned above, but I would just use the ActionCommand to differentiate each button. Maybe this simple example, from the Swing forum. will get your started:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=609795

  • Logon customization adding the button and action

    HI,
    I have a com.sap.portal.runtime.par file I imported and umLogonpage.JSp I added the pictures.
    Here I have to provide the extra button like Guest user if user clicks that button the srm_guest user id and pass: 1234 for every guest user that navigates to the portal with guest user roles.
    Can any one help me in this same.

    Why another way? Just typejava.lang.Object source = ...Kind regards,
      Levi

  • Dynamic creation of variables and alv grid output/internal table

    Dear Experts
    I am stuck in an inventory ageing report which is to be done year wise. the scenario is as follow.
    selection screen i enter the year 2011 or 2010 or 2009.
    the output should show me 2011-2007 or 2010-2007 or 2009-2007. the alv grid should always start from 2007 and end at the year that is entered in the selection screen.
    Now how can i create a dynamic variables to store the values of the corresponding yr and also how can i create a dynamic internal table to store these values.
    Thanks & Regards
    Zamir Parkar

    Hi Zamir,
    if you are new to ABAP you may leave old and buggy techniques behind.
    If you want to create the table dynamically, please do not use l_alv_table_create=>create_dynamic_table because it is limited and always triggers a possibly unwanted database commit.
    You better use RTTS dynamic runtime type services, i.e. check the example for [Creating Flat and Complex Internal Tables Dynamically using RTTI|http://wiki.sdn.sap.com/wiki/display/Snippets/CreatingFlatandComplexInternalTablesDynamicallyusingRTTI].
    As done here, leave all outdated ALV technologies behind and start with CL_SALV_TABLE. It is following the object-oriented approach and does not need a field catalog.
    You will get used to field-symbols that can be compared to the data referenced by a pointer. For dynamic fields, you may build the field names dynamically, i.e.
    DATA:
          lo_structdescr         TYPE REF TO cl_abap_structdescr,
          lo_typedescr           TYPE REF TO cl_abap_typedescr,
          lo_tabledescr          TYPE REF TO cl_abap_tabledescr,
          lr_data                TYPE REF TO data,
          lt_comp_all            TYPE cl_abap_structdescr=>component_table,
          lv_index               TYPE numc2.
        FIELD-SYMBOLS:
          <any>                  TYPE ANY,
          <component>            TYPE LINE OF abap_component_tab,
           <table>                TYPE table.
        DO nnn TIMES.
          lv_index = sy-index.
          lo_typedescr   =  cl_abap_typedescr=>describe_by_name( <name of data element> ).
          APPEND INITIAL LINE TO lt_comp_all ASSIGNING <component>.
          <component>-type ?= lo_typedescr.
          CONCATENATE 'YEARVAL' lc_underscore lv_index INTO <component>-name.
          <component>-as_include  = abap_true.
          CONCATENATE lc_underscore lv_index INTO <component>-suffix.
        ENDDO.
    * create description object for structured type
        lo_structdescr = cl_abap_structdescr=>create( lt_comp_all ).
    *  create table description object for this
        lo_tabledescr = cl_abap_tabledescr=>create(
                        p_line_type  = lo_structdescr
                        p_table_kind = cl_abap_tabledescr=>tablekind_std
                        p_unique     = abap_false ).
    * create data object
        CREATE DATA lr_data TYPE HANDLE lo_tabledescr.
    ASSIGN lr_data->* to <table>.
    This is a fragment. Please adapt to your needs.
    Regards,
    Clemens

  • Stuck Hold Button and Replacement Help

    My Ipod wouldn't turn on a few days ago.
    I finally realized that it was because my hold button is broken. It's stuck on hold. I have tried moving it in a lot of ways and it won't unhold.
    Before I discovered this I sent in a replacement/repair request to Ipod. the box arrived today. The problem I described was that the ipod would not turn on etc.
    I'm really nervous now though, cause it said on the policy etc that if they don't have the part/find it not broken etc they charge you up to 100 dollars. I'm afraid that my description will be incorrect or that it knocking around in the box or something will make it not broken anymore.
    Should I send it back in the box that came? what else should I try?
    I don't want to pay anything for repairs. I bought this at the end of august so it's still under warranty
    Harrison

    "cause it said on the policy etc that if they don't have the part/find it not broken etc they charge you up to 100 dollars."
    I think you'll find that this very rarely happens. The usual thing if Apple finds no problem with the iPod is to return it and there's no charge.
    If you pack it properly in the box it shouldn't get knocked around.

  • Dynamic creation of tables and data insertion in BODS

    Specific requirement : We need to extract multiple tables from ERP system and stage them in BODS SQL server database.
    As the need is for lot of tables , we want to come up with a generic Job which can be used for all the tables which have different sructures.
    So BODS Job should create tables on the fly and also load data into different tables not having same structure. We can maintain a config table of all the tables to be extracted.
    Any ideas?

    Dirk,
    The job should be generic to cater to n number of tables , we are looking at one job where the source /Target structures are not imported so that it becomes generic and we don't know the count of tables that we will be extracting . We just like one job , which can extract tables as and when we add table names in the config table.......

  • Dynamic creation of class and calling methods

    I've got and interface called Transformation and then two implementations called TxA and TxB, where TxA and TxB have their own attribtues and setter and getters for these attributes.
    The question is, I need to create instances of TxA and TxB and called the setter and getters where I at runtime I only know the attribute to set, how can I create and instance and call the right getters and setters methods?
    Thanks in advance

    Smart money says your design sucks and needs to be rethought entirely. Can we get specifics?
    Drake

  • Dynamic Creation of Table and assign Datasource.

    Hi Experts
    My scenario is like this..
    There are more than one RFC models and the output list of these models I need to display in a table format.. The display should happen conditionally as per the availabity of the data in the output list..I need to display the data from multiple models at the same time the said table..
    Please let me know the methods to create a table with 5 columns and also how to assign the datasource programatically..
    THanks and Regards
    SU

    Hi,
    Use only one Table View context.
    Model Contexts:
    RFC1,           RFC2,            RFC3
    I_Attr11         I_Attr21          I_Attr31
    I_Attr12         I_Attr22          I_Attr32
    I_Attr13         I_Attr23          I_Attr33
    I_Attr14         I_Attr24          I_Attr34
    I_Attr15         I_Attr25          I_Attr35
    Table Control Context:
    Table
    I_Attr1
    I_Attr2
    I_Attr3
    I_Attr4
    I_Attr5
    Execute each model individually and loop through all model contexts...append the rows from each model context to table context.
    //access the table node
    IWDTableNode tableNode = wdContext.nodeTable();
    IWDTableElement tableElem;
    //loop thugh the models
    for(int i=0; i<RFC1.size(); i++)
    tableElem = tableNode.createTableElement();
    tableElem.setAttr1(RFC1.getRFC1ElementAt(i).getAttr11);
    tableElem.setAttr2(RFC1.getRFC1ElementAt(i).getAttr12);
    tableElem.setAttr3(RFC1.getRFC1ElementAt(i).getAttr13);
    tableElem.setAttr4(RFC1.getRFC1ElementAt(i).getAttr14);
    tableElem.setAttr5(RFC1.getRFC1ElementAt(i).getAttr15);
    tableNode.addElement(tableElem);
    //similarly loop thrugh the remaining 2 models and append the table context
    Regards
    Srikanth

Maybe you are looking for

  • Cant find ipod music player on my ipad 1

    Hi I recently updated itunes on my PC - I have windows vista. I have lost all the music that was on my ipad after the update and now my PC refuses to sync my previous purchases back to my ipad. Can anyone help

  • Suport issues

    hi, what r the type of issues we will get in bdc,scripts,smartforms,ale and idocs.

  • Error creating the air file

    Hello, this is my first time Air Trial: Using a simple Webpage (including Text, one jpeg and one  gif-file, I tried to creat an air file, using the air extension in dreamweaver CS4. Following the instruction I made up the air application & installer

  • Is it possible to set songs at different volumes?

    Some songs are way louder than others in a mix. How do you fix it?

  • Addthis toolbar error code 203 when installing

    I am trying to download addthis toolbar and it gets to end of download and has Installation error code 203, please help for Firefox == Operating system == Windows Vista