How do JComboBoxes paint outside their bounds?

I'm making a little widget That is essentially a text field, but as the user starts typing in it it does a query to a jdbc table and lists posible completions in a drop down box. Rather like a combobox really, except I tried doing this as an extension of the JComboBox class, but then the combobox feel interfered with the feel I wanted for this widget. (Focus issues, issues with the ComboBoxEditor and how it handles values as items.)
I started with an implementation where I kept the list of completions in an undecorated JDialog that positioned itself nicely under the text field whenever it was shown, however there were problems when moving the window the field was in, and if the size of the list changed, and much trouble in general.
I've now got an implementation where I've made a custom LayoutManager to position the list correctly, and it works perfectly except that the list isn't "floating". That is, I must add it to the widget component and when I want to draw it I must make sure the widget's bounds are large enough to hold the list. This doesn't really work since this leaves a large blank area under the text field when the list is hidden.
So what I really want to know is: How do JComboBoxes do their popups? How do they keep the bounds of the actual component small, and yet allow the popup to paint over other components? I tried overriding the paintComponent() method and changing the Graphics object's clipRect before painting the popup, still didn't work.
First a screenshot of what it looks like if I inflate the preferredSize of the widget in the layout manager: (Sorry about norwegian text on labels)
http://img238.imageshack.us/my.php?image=indexbrowserwidget5gw.jpg
You can see that the drop down list gets cut off where the bounds of the widget ends.
Here's the code for what I've got now:
(I just noticed while previewing that this ended up VERY long. Sorry about that. The interesting bit is the actual LayoutManager.)
package no.fldt.sdb.swing;
import java.awt.*;
import java.awt.event.*;
import java.math.BigDecimal;
import java.sql.*;
import java.util.*;
import java.util.Timer;
import javax.swing.*;
import javax.swing.event.*;
import no.fldt.sdb.sql.SVDatabaseManager;
@SuppressWarnings("serial")
public class SVIndexBrowserOriginal extends JPanel {
     private int numDesc;
     private final String stringSQL;
     private final String pkSQL;
     private PreparedStatement selectStringStatement;
     private PreparedStatement selectPKStatement;
     private SearchableCache cache = new SearchableCache();
     private Value value;
     private JTextField field = new JTextField();
     private FieldKeyListener keyListener = new FieldKeyListener();
     private JButton browseButton = new JButton();
     private JList popupList = new JList();
     private JScrollPane popupPane = new JScrollPane(popupList);
     public SVIndexBrowserOriginal(String tableName, String pkName, String ... descriptionNames) {
          super.setLayout(new BrowserLayout(field,browseButton,popupPane));
          super.add(field);
          super.add(browseButton);
          super.add(popupPane);
          popupPane.setVisible(false);
          field.addFocusListener(new FocusAdapter(){
               public void focusLost(FocusEvent e) {
                    if(e.getOppositeComponent() == popupList) return; //OK to yield to this
                    if(popupPane.isVisible()) hideHintPopup();
          browseButton.setFocusable(false);
          browseButton.setMargin(new Insets(0,1,0,0));
          browseButton.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent e) {
                    keyListener.cancel();
                    if(populateHintList() == -1)
                         hideHintPopup();
                    else
                         displayHintPopup();
          field.addKeyListener(keyListener);
          field.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent e) {
                    if(popupPane.isVisible()){
                         doPopupSelection();
          popupList.addKeyListener(new KeyAdapter(){
               boolean loopedThrough = false;
               public void keyPressed(KeyEvent e) {
                    switch(e.getKeyCode()){
                         case KeyEvent.VK_ESCAPE:
                              cancelPopupSelection();
                              break;
                         case KeyEvent.VK_ENTER:
                         case KeyEvent.VK_TAB:
                              doPopupSelection();
                              break;
          this.stringSQL = generateStringSQL(tableName, pkName, descriptionNames);
          this.pkSQL = generatePKSQL(tableName, pkName, descriptionNames);
          this.numDesc = descriptionNames.length;
          try {
               this.selectStringStatement = SVDatabaseManager.prepareStatement(stringSQL);
               this.selectPKStatement = SVDatabaseManager.prepareStatement(pkSQL);
               reBuildStringCache();
          } catch (SQLException ex) {
               // ex.printStackTrace();
     // The hint popup:
     private Vector<Value> displayList = new Vector<Value>();
     private int populateHintList() {
          popupList.setForeground(Color.BLACK);
          String start = field.getText();
          int sStart = field.getSelectionStart();
          start = start.substring(0,sStart);
          displayList.clear();
          if(start.length() > 0){
               try {
                    Long.parseLong(start);
                    displayList.addAll(getPossibleMatchesForPK(start));
               } catch (Exception ex) {
                    displayList.addAll(cache.getPossibleMatchesForDesc(start));
          if(displayList.size() == 1){
               setValue(displayList.get(0));
               return 1;
          if(displayList.isEmpty() && start.length() > 0){
               displayList.add(NO_VALUE);
               popupList.setForeground(Color.GRAY);
          popupList.setModel(new DefaultComboBoxModel(displayList));
          popupList.setSelectedIndex(0);
          if(displayList.size() > 0){
               Value v = displayList.get(0);
               if(!v.isNoValue()){
                    int cp = start.length();
                    field.setText(v.desc);
                    field.setCaretPosition(v.desc.length());
                    //To select the text that is suggested so if the user continues typing it will be overwritten.
                    field.moveCaretPosition(cp);
          int retVal = displayList.size() == 1 ? 0 :
               displayList.size() == 0 ? -1 : displayList.size();
          return retVal;
     public void displayHintPopup() {
          if(popupPane.isVisible()) return;
          popupPane.setVisible(true);
          field.requestFocus();
     public void hideHintPopup(){
          popupPane.setVisible(false);
     public void doPopupSelection() {
          Value nv = null;
          int i = popupList.getSelectedIndex();
          if(i != -1)
               nv = displayList.get(i);
          if(nv != null && ! nv.isNoValue()){
               setValue(nv);
          hideHintPopup();
          field.requestFocusInWindow();
     public void cancelPopupSelection(){
          hideHintPopup();
          field.requestFocusInWindow();
     // The layout
     private class BrowserLayout implements LayoutManager {
          private JTextField field;
          private JButton button;
          private JScrollPane listPane;
          BrowserLayout(JTextField field, JButton button, JScrollPane listPane){
               this.field = field;
               this.button = button;
               this.listPane = listPane;
          public void addLayoutComponent(String name, Component comp) {
          public void removeLayoutComponent(Component comp) {
          public Dimension preferredLayoutSize(Container parent) {
               return new Dimension(
                         button.getPreferredSize().width+field.getPreferredSize().width,
                         field.getPreferredSize().height
          public Dimension minimumLayoutSize(Container parent) {
               return new Dimension(
                         button.getMinimumSize().width+field.getMinimumSize().width,
                         field.getMinimumSize().height
          public void layoutContainer(Container parent) {
               Dimension size = parent.getSize();
               Rectangle bounds = new Rectangle();
               bounds.setSize(button.getPreferredSize().width,size.height);
               bounds.setLocation(size.width,0);
               bounds.translate((-1 * bounds.width),0);
               button.setBounds(bounds);
               bounds.width = size.width - bounds.width;
               bounds.setLocation(0,0);
               field.setBounds(bounds);
               bounds.translate(0,bounds.height);
               bounds.width = size.width-1;
               bounds.height = listPane.getPreferredSize().height;
               listPane.setBounds(bounds);
     // SQL stuff:
     private void reBuildStringCache() throws SQLException {
          //Not so important for the forum
     private Vector<Value> getPossibleMatchesForPK(String start)
               throws SQLException {
          //Not so important for the forum
     private String generateStringSQL(String tableName, String pkName,
               String[] descriptionNames) {
          //Not so important for the forum
     private String generatePKSQL(String tableName, String pkName,
               String[] descriptionNames) {
          //Not so important for the forum
     // Keylistener:
     private class FieldKeyListener extends KeyAdapter {
          private TimerTask popupTask = null;
          private Timer popupTimer = new Timer();
          public void cancel() {
               if (popupTask != null) {
                    popupTask.cancel();
                    popupTask = null;
          public void keyTyped(KeyEvent e) {
               cancel();
               if(e.getKeyChar() == 27) return; //VK_ESCAPE
               popupTask = new TimerTask() {
                    public void run() {
                         if(Math.abs(populateHintList()) == 1){
                              hideHintPopup();
                              return;
                         displayHintPopup();
               popupTimer.schedule(popupTask, 1000);
          public void keyPressed(KeyEvent e) {
               if (e.getKeyCode() == KeyEvent.VK_DOWN) {
                    cancel();
                    if(Math.abs(populateHintList()) == 1){
                         hideHintPopup();
                         return;
                    displayHintPopup();
                    popupList.requestFocus();
               }else if(e.getKeyCode() == KeyEvent.VK_ESCAPE) {
                    cancel();
                    hideHintPopup();
     // Cache:
     private class SearchableCache {
          public void put(String key, BigDecimal value) {
               //Not too important for the forum
          public BigDecimal get(String key) {
               //Not too important for the forum
          public Vector<Value> getPossibleMatchesForDesc(String start) {
               //Not too important for the forum
     public static final Value NO_VALUE = new Value(){{desc = "<No matches>"; pk = null;}};
     public static class Value {
          public BigDecimal pk = null;
          public String desc;
          public String toString(){
               return desc;
          public boolean equals(Object other){
               if (other != null && other instanceof Value) {
                    return this.pk.equals(((Value)other).pk);
               return false;
          public boolean isNoValue(){
               return this.pk == null;
     public void clearValue(){
          this.value = null;
          this.field.setText("");
     public Value getValue() {
          return this.value;
     public void setValue(Value value) {
          this.value = value;
          field.setText(value.desc);
     @Override
     public void setBackground(Color bg) {
          if(field != null)
               field.setBackground(bg);
}Any help with getting the popup to paint correctly or any hints towards a different approach woule be greatly appreciated.

I can think of three possible choices for a solution:
1) Use JWindow. But that is very like your first try with an undecorated JDialog.
I would assume that you will get similar problems as you describe
2) Use the PopupFactory (in javax.swing). With this you get real popups.
When the bounds of the popup fits in the parent window it will show as
a medium-weight component (AWT-component!). When the bounds
doesn't fit it will show as a heavy-weight component (own window).
3) Another possibility is JPopupMenu! You can add any Swing-Component
in a JPopupMenu! :-)
And the answer for your initial question: how is it done in JComboBox: if you have a look in javax.swing.plaf.basic.BasicComboBoxUI and the BasicComboPopup-class you will see, that it is 3) -> the JPopupMenu that is used here!

Similar Messages

  • How can I write outside of the targetCompositeChannels.bound?

    I want to warp a layer and store the result in the targetCompositeChannels. Because the result may be so large that some
    pixels are outside the bound of the targetCompositeChannels, the result can not be stored completely.
    PS: In the sample code "PoorMansTypeTool", in a image 100*100, when i set the fontsize large, i.e. 32, the result is only a part of "HELLO WORLD". the plugin doesn't write outside the bound.
    what should i do?
    Thanks in advance!

        JenJenTen,
    I understand that having a preset text that you did not want can be a bit frustrating when sending out text. To clarify, is the preset message like a signature at the end of your text? Does this only happen in text messages or when your send emails also? Is your SMS delivery confirmation on? Messaging>Settings>SMS delivery confirmation.
    LindseyT_VZW
    Follow us on Twitter @VZWSupport

  • How to prevent others use their iDevices to remote control apple tv?

    Hi All,
    I'm wondering that does anyone know how to prevent others use their iDevices to remote control my apple tv?
    settings
    1. the apple tv is in the school.
    2. all students could access the Internet
    3. The apple tv is sharing the same Internet with students.

    Welcome to the Apple Community.
    The remote app uses homesharing, therefore anyone wanting to control an Apple TV with the remote app would need to know the home sharing ID and password.

  • We have a corporate iPad in our auto showroom to show guests how to use features on their vehicles. Someone locked it with their account. It was not an employee. How can I get in? I did a restore of the software already?

    We have a corporate iPad in our auto showroom to show guests how to use features on their vehicles. Someone locked it with their account. It was not an employee. How can I get in? I did a restore of the software already?

    Gather up the proof that the dealership is the original purchaser of the iPad,
    and take the iPad & that proof to a physical Apple store for possible assistance.
    It is highly suggested that you make a genius bar appointment to avoid delay
    at the store:
    Make a Genius Bar Reservation
    http://www.apple.com/retail/geniusbar/
    If no Apple store close by, get the information mentioned above and contact
    Apple Contact Us for assistance.
    Once the problem is resolved, you may wish it use Guided Access to limit
    what customers can do with the iPad.
         iOS: About Guided Access - Apple Support

  • Claims authentication: "Server was unable to process request. --- Index was outside the bounds of the array"

    Hi there,
    I recently got a peculiar error when users tried to log-in into a SP 2010 portal using claims based authentication.
    The following error is logged in the event viewer of the SP server in question:
    Event ID 8306 - Claims authentication
    An exception occurred when trying to issue security token: Server was unable to process request. ---> Index was outside the bounds of the array.
    I also found an IIS warning entry with a similar message:
    Event ID 1309 - Web Event
    Exception type: FaultException
    Exception message: Server was unable to process request. ---> Index was outside the bounds of the array.
    I simply could not find an answer to why this happened, but an iisreset seemed to have fixed the issue. I was wondering if anyone here would know a possible root cause for this issue?
    Thanks in advance for your help.
    Regards,
    P.

    Hi,
    Thanks for posting your issue, Kindly browse below mentioned URLs to fix this issue
    http://underthehood.ironworks.com/2011/05/sharepoint-2010-an-exception-occurred-when-trying-to-issue-security-token-the-server-was-unable-to-p-1.html
    http://nearbaseline.com/blog/2011/01/claims-exception-occurred-issuing-a-security-token/
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • After creating a table, how do I type outside of it?   I can't get a cursor to come up.

    After creating a table, how do I type outside of it?   I can't get a cursor to come up.

    Barker,
    If by "outside" you mean "on the right or left of" a table, you must make the Table a Floating Object to do that.
    If you must use Inline Tables, you can do this:
    Add a Floating Text Box with the text that needs to be "outside" the table. Arrange, then Group the Text Box with the Floating Table, and then set the Group to Inline.
    Jerry

  • How to open file in their native application

    How to open file in their native application form web browser?
    if associated .txt file should open in editplus then from web browser if I try to open .txt file it should open in editplus rather then open in notepad(default), If on other computer if I associate .txt file should open in word, it should open in word. I am using Tomcat Web Server.

    that's nothing you could influence from a servlet or jsp.
    all you could do is specifying the content type of your response.
    Next you might hope that the client requesting your content uses a browser that relates the given content type to a special application (e.g. "text/plain" -> editplus or notepad or kedit or word or ...)

  • How to allow user print their draft anwsers before sending it as final ?

    How to allow user print their draft anwsers before sending it as final in a form central questionnaire ?

    Hey MTdev,
    Panel close? events cannot be triggered on a VI being viewed or controlled remotely. Some more information on that can be found in the help here:http://zone.ni.com/reference/en-XX/help/371361E-01/lvprop/vi_panel_closeq/.  My suggestion would be to set the Title Bar on the front panel of your remote VI to not be visible so that their only option for closing the window is to click the logout button.  Are you using Remote Front Panels(http://zone.ni.com/devzone/cda/tut/p/id/3277) to do this instrument control?  Using remote front panels allows you to manage a lot of the multiple people accesssing at the same-time type issues so it may be something to look into if you are not already using this method.  
    Regards,
    Kevin
    Product Support Engineer
    National Instruments

  • How to transfer Painter 12 with my custom brushes from old iMac to a new iMac both running Mavericks

    Hi,
    I just purchased a new iMac. Have Painter 12 on my older iMac and want to be able to transfer Painter 12, with my custom brushes to my new iMac. Tried Airdrop but got a message that it was damaged and that I should trash it. Does any know how to get  Painter 12 with all my custom brushes to my new machine? Both are running Mavericks.
    Thank you,
    Jim

    etresoft,
    Thank you for your response. I did try to use Migration Assistant and I got as far as the two machines trying to communicate with each other. So I guess the answer to your question would be I tried, I failed and it worked until a certain point. I understand that there are other ways to connect the machines, I would have to see if I have the proper cables to do so. Airdrop did get data to my new machine and that tells me that they do see each other on the network. I do not know why they did not see each other via Migration Assistant. I assume that I could go to Corel's site and download Painter 12 to my new machine, ( my new machine does not have a disk drive ), but I will not have my custom brushes etc. and would have to totally make them up in the fresh install version and I am trying to avoid that.
    You are probably correct in saying that Painter 12 probably needs a full reinstallation to work properly. Am I to assume that Migration Assistant will do a full reinstallation, including my custom brushes? I guess I am a little confused here.
    Jim

  • Confused about how to use paint()

    Hi, I have been working really hard to try to get the following program to work but I am really confused on how to use paint(). I do not have anyone to ask so I thought this forum could help. Anyways, here is my problem...
    I am trying to recursively figure out the Sierpinski fractal. I cannot figure out if my math works or not because I do not know how to call the paint() recursively to draw my triangles.
    Please have a look at the following code. Thank you!
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    public class DrawTriangle extends Frame {
      Point a = new Point(20,480),
            b = new Point(350,40),
            c = new Point(680,480),
            halfB,
            halfC,
            halfB2,
            halfC2,
            halfC3;
      int width;
      public DrawTriangle() {
        super("Sierpinski Fractal");
        addWindowListener( new WindowAdapter() {
          public void windowClosing( WindowEvent we ) {
            dispose();
            System.exit( 0 );
        setBackground( Color.white );
        setSize(700, 500);
        setVisible(true);
      public void paint(Graphics g, Point a, Point b, Point c) {
        width = c.x - a.x;
        if (width < 6){return;}
        g.setColor( Color.GREEN );
        g.drawPolygon( new int[] { a.x, b.x, c.x }, new int[] { a.y, b.y, c.y }, 3 );
        halfC.x = c.x/2;
        halfC.y = c.y;
        halfB.y = b.y/2;
        halfB.x = b.x;
        halfB2.y = halfB.y + a.y;
        halfB2.x = a.x;
        halfC2.x = halfC.x + a.x;
        halfC2.y = a.y;
        halfC3.x = halfC.x/2 + a.x;
        halfC3.y = halfB2.y;
        paint(g, a, halfC, halfB);
        paint(g, halfC3, halfC, halfB);
        paint(g, halfC2, halfC, halfB);
      public static void main(String[] args) {
         new DrawTriangle();

    thanks jsalonen, your tip let me start working on the math to correct it.
    I have a new problem now. My math is correct but I am having problems with the recursion. I can draw only the top , left , or right triangles. I cannot get them all to work together. See code and comments below.
    Any ideas why I cant call all three of the paint()s toegther and have them work?
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    public class DrawTriangle extends Frame {
      Point a = new Point(20,480),
            b = new Point(350,40),
            c = new Point(680,480),
            halfA,
            halfB,
            halfC;
      int width;
      public DrawTriangle() {
        super("Sierpinski Fractal");
        addWindowListener( new WindowAdapter() {
          public void windowClosing( WindowEvent we ) {
            dispose();
            System.exit( 0 );
        setBackground( Color.white );
        setSize(700, 500);
        setVisible(true);
      public void paint(Graphics g)
      paint(g, a, b, c);
      public void paint(Graphics g, Point a, Point b, Point c) {
        width = c.x - a.x;
        if (width < 6){return;}
        halfA = new Point((a.x+b.x)/2, (a.y+b.y)/2);
        halfB = new Point((a.x+c.x)/2, (a.y+c.y)/2);
        halfC = new Point((b.x+c.x)/2, (b.y+c.y)/2);
        g.setColor( Color.GREEN ); //draw left triangle in green
        g.drawPolygon( new int[] { a.x, halfA.x, halfB.x }, new int[] { a.y, halfA.y, halfB.y }, 3 );
        g.setColor( Color.RED ); //draw top triangle in red
        g.drawPolygon( new int[] { b.x, halfA.x, halfC.x }, new int[] { b.y, halfA.y, halfC.y }, 3 );
        g.setColor( Color.BLUE ); //draw right triangle in blue
        g.drawPolygon( new int[] { c.x, halfB.x, halfC.x }, new int[] { c.y, halfB.y, halfC.y }, 3 );
        /*If you were to comment our two of these paint() calls the one will work correctly alone.
         *But my problem is that they do not work together! */
        //g, left point, top point, right point
        paint(g, halfA, b, halfC); //top triangle
        paint(g, halfC, halfB, c); //right triangle
        paint(g, a, halfA, halfB); //left triangle
      public static void main(String[] args) {
         new DrawTriangle();
    }

  • Call Bapi_Material_Availability Error : Index was outside the bounds ...

    I am coding .net 2003 (VB)  and  .NET connector 2.0  Call Bapi_Material_Availability . It Error  Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.
    This my code:
       Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim Batch As String
            Dim Check_Rule As String
            Dim Customer As String
            Dim Dec_For_Rounding As Short
            Dim Dec_For_Rounding_X As String
            Dim Doc_Number As String
            Dim Itm_Number As String
            Dim Material As String
            Dim Material_Evg As Test6.BAPIMGVMATNR
            Dim Plant As String
            Dim Read_Atp_Lock As String
            Dim Read_Atp_Lock_X As String
            Dim Stge_Loc As String
            Dim Stock_Ind As String
            Dim Unit As String
            Dim Wbs_Elem As String
            Dim Av_Qty_Plt As Decimal
            Dim Dialogflag As String
            Dim Endleadtme As String
            Dim Return0 As Test6.BAPIRETURN
            Dim Wmdvex As Test6.BAPIWMDVETable
            Dim Wmdvsx As Test6.BAPIWMDVSTable
            Material = "100-400"
            Plant = "1000"
            Unit = "ST"
            Try
                SapProxy11.Bapi_Material_Availability(Batch, _
                Check_Rule, _
                Customer, _
                Dec_For_Rounding, _
                Dec_For_Rounding_X, _
                Doc_Number, _
                Itm_Number, _
                Material, _
                Material_Evg, _
                Plant, _
                Read_Atp_Lock, _
                Read_Atp_Lock_X, _
                Stge_Loc, _
                Stock_Ind, _
                Unit, _
                Wbs_Elem, _
                Av_Qty_Plt, _
                Dialogflag, _
                Endleadtme, _
                Return0, _
                Wmdvex, _
                Wmdvsx)
                Me.TextBox1.Text = Av_Qty_Plt.ToString()
            Catch ex As SAP.Connector.RfcAbapException
                MsgBox(ex.Message.ToString)
            End Try
        End Sub
    ========
    <i>Source Error:
    Line 157:     ByRef Wmdvsx As BAPIWMDVSTable)
    Line 158:        Dim results As Object()
    Line 159:        results = SAPInvoke("Bapi_Material_Availability", new Object() { _
    Line 160:                            Batch,Check_Rule,Customer,Dec_For_Rounding,Dec_For_Rounding_X,Doc_Number,Itm_Number,Material,Material_Evg,Plant,Read_Atp_Lock,Read_Atp_Lock_X,Stge_Loc,Stock_Ind,Unit,Wbs_Elem,Wmdvex,Wmdvsx })
    Line 161:        Av_Qty_Plt = CType(results(0), Decimal)
    Source File: E:\SAP\BAPI\Test6\SAPProxy1.vb    Line: 159
    Stack Trace:
    [IndexOutOfRangeException: Index was outside the bounds of the array.]
       SAP.Connector.Rfc.RfcClient.RfcInvoke(SAPClient proxy, String method, Object[] methodParamsIn) +1229
       SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn) +70
       Test6.SAPProxy1.Bapi_Material_Availability(String Batch, String Check_Rule, String Customer, Int16 Dec_For_Rounding, String Dec_For_Rounding_X, String Doc_Number, String Itm_Number, String Material, BAPIMGVMATNR Material_Evg, String Plant, String Read_Atp_Lock, String Read_Atp_Lock_X, String Stge_Loc, String Stock_Ind, String Unit, String Wbs_Elem, Decimal& Av_Qty_Plt, String& Dialogflag, String& Endleadtme, BAPIRETURN& Return0, BAPIWMDVETable& Wmdvex, BAPIWMDVSTable& Wmdvsx) in E:\SAP\BAPI\Test6\SAPProxy1.vb:159
       Test6.WebForm1.Button1_Click(Object sender, EventArgs e) in E:\SAP\BAPI\Test6\Default.aspx.vb:64
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain() +1292
    </i>
    Pls. help me.
    Thank you.

    Hi Kreangsak,
    It seems that you need to initialize you tables, parameters for rfc function
    Dim Wmdvex As Test6.BAPIWMDVETable
    Dim Wmdvsx As Test6.BAPIWMDVSTable
    Wmdvex = new Test6.BAPIWMDVETable()
    Wmdvsx = new Test6.BAPIWMDVSTable()
    If there is other table, you need to initialize them with new operator. Null tables does not accepted.
    If you problem goes set the call stack's "show non-user code" property and send the stack.
    Best Regards,
    Huseyin Akturk
    SW Engineer & SAP ABAP Consultant
    www.huseyinakturk.net

  • How to check was the object bound or not without exception handling?

    context.lookup("someName");throws NameNotFoundException in case object was not bound to someName.
    How to check was the object bound or not without exception handling?

    context.lookup("someName");throws NameNotFoundException in case object was not bound to someName.
    How to check was the object bound or not without exception handling?

  • How many JComboBox in my panel?

    Hi,
    I'm writing a simple JPanel which contains three JComboBox, one for the day, one for the month and one for the year. It works fine and the constructor is the following:
    public class DatePanel extends JPanel implements ItemListener{
         * The combobox for the day.
        protected JComboBox comboDay = null;
         * The combobox for the month.
        protected JComboBox comboMonth = null;
         * The year.
        protected JComboBox comboYear = null;
         * A flag that indicates if the user has manually changed the date.
        protected boolean dateHasChanged = false;
         * Creates and set up each component of this panel.
        protected void setUpGUI(){
         // get the current date
         Calendar today = Calendar.getInstance();
         // create the components
         this.comboDay = new JComboBox();
         for(int i=1; i<=31; i++)
             this.comboDay.addItem(i);
         this.comboMonth = new JComboBox();
         for(int i=1; i<=12; i++)
             this.comboMonth.addItem(i);
         this.comboYear = new JComboBox();
         int currentYear = today.get(Calendar.YEAR);
         for( int i= (currentYear - 60); i< (currentYear + 5); i++)
             this.comboYear.addItem(i);
         // add the null values
         this.comboDay.addItem("--");
         this.comboMonth.addItem("--");
         this.comboYear.addItem("--");
         this.comboDay.setSelectedItem("--");
         this.comboMonth.setSelectedItem("--");
         this.comboYear.setSelectedItem("--");
         // add the listener
         this.comboDay.addItemListener(this);
         this.comboMonth.addItemListener(this);
         this.comboYear.addItemListener(this);
         // display components
         this.setLayout( new FlowLayout() );
         this.add(this.comboDay);
         this.add(this.comboMonth);
         this.add(this.comboYear);
         * Builds a panel without initializing it with a specific date.
        public DatePanel(){
         super();
         this.setUpGUI();
        }then I've got a subclass of the above panel which adds two comboes, one for the hour and one for minute. This is also working fine, and I've got a flag that says if the above three comboes should appear or not in the panel:
    public class TimePanel extends DatePanel {
         * The comboHour selection combo box.
        protected JComboBox comboHour = null;
         * The comboMinute selection combo box.
        protected JComboBox comboMinute = null;
         * Builds the time panel with the specific comboboxes.
         * @param alsoDates true if also the dates should be visibles
        public TimePanel(boolean alsoDates){
         super();
         this.setUpGUI();
         // shuld the dates be available?
         if( ! alsoDates ){
             this.comboDay.setEnabled(false);
             this.comboMonth.setEnabled(false);
             this.comboYear.setEnabled(false);
             this.remove(this.comboDay);
             this.remove(this.comboMonth);
             this.remove(this.comboYear);
         * Sets up the components.
        @Override
        protected void setUpGUI() {
         super.setUpGUI();
         // add the time components
         this.comboHour = new JComboBox();
         for( int i=0; i<24; i++ )
             this.comboHour.addItem(i);
         this.comboHour.addItemListener(this);
         this.comboMinute = new JComboBox();
         for(int i=0; i<60; i++)
             this.comboMinute.addItem(i);
         this.comboMinute.addItemListener(this);
         this.add(new JLabel("hh:"));
         this.add(this.comboHour);
         this.add(new JLabel("mm:"));
         this.add(this.comboMinute);
        }As you can see, when I pass false to the constructor of the TimePanel, the comboes of the date panel are removed from the layout of the panel itself, thus showing only the hour and minute ones.
    Now I was writing a JUnit test for this, and surprisingly when I run a code like the following:
         TimePanel tp1 = timePanel = new TimePanel(false);
         Component[] components = tp1.getComponents();
         int comboCount = 0;
         // count how many jcombobox there are, since it has been initialized
         // with the time only, it should contain only 2 combobox (hour and minutes)
         for(int i=0;i<components.length; i++ )
             if( components[i] instanceof JComboBox )
              comboCount ++;I found that the number of comboes on my panel are 7[, that is more than the max (5) when all the components are displayed. What is wrong here?
    Thanks,
    Luca

    I found that the problem seems to be in the setUpGui method, that is called from the parent constructor and from the child constructor, thus displaying 7 comboes. But if I remove the call from the child constructor then it seems as the parent comboes are uninitialized and thus I got a nullpointer exception.
    If I modify the constructor of the TimePanel into this:
       public TimePanel(boolean alsoDates){
         this.setUpGUI();
         // shuld the dates be available?
         if( ! alsoDates ){
             this.comboDay.setEnabled(false);
             this.comboMonth.setEnabled(false);
             this.comboYear.setEnabled(false);
             this.remove(this.comboDay);
             this.remove(this.comboMonth);
             this.remove(this.comboYear);
        }and explicity call the super.setupgui into the setupgui method
      protected void setUpGUI() {
         super.setUpGUI();
         // add the time components
         this.comboHour = new JComboBox();
         for( int i=0; i<24; i++ )
             this.comboHour.addItem(i);
         this.comboHour.addItemListener(this);
         this.comboMinute = new JComboBox();
         for(int i=0; i<60; i++)
             this.comboMinute.addItem(i);
         this.comboMinute.addItemListener(this);
         this.add(new JLabel("hh:"));
         this.add(this.comboHour);
         this.add(new JLabel("mm:"));
         this.add(this.comboMinute);
        }I got that the hour and minute comboes are added twice, and moreover the day,month and year are not removed. What is the right way to call the setupgui method to do what I'd like?
    Luca

  • Error during Addon Installation Index was outside the bounds of array

    Hi  wen im trying to install addon on x64 2003 server its throwing me error
    Customer library
    "Error during Addon Installation Index was outside the bounds of array."
    "Error(-2) at EndInstallEx(False) at the end of the addon installation"
    Please provide me a solution for this.
    Thanks
    Rekha

    Hi Rekha,
    You may check this: Add-on Installer Issue
    Is this your add-on or SAP add-on? If it is 3rd party add-on, post it to the other forum
    Thanks,
    Gordon

  • Release Management 2013 Index was outside the bounds of the array

    I am getting "Index was outside the bounds of the array." error when Release Management 2013 is in Deploy step .
    Status: Rejected
    Command Output show "3589 File(s) copied" at the end of file
    The build of solution was Build succeeded completed.
    i try run release again and it no show log file
    Thanks for your help.
    steve

    Hi 
    I follow the steps to tracking Release management log and i see the error, a component have in the field "File extension filter" the value "*.*", i change this value to "*.config" and deploy is done 
    the complete error:
    - Index was outside the bounds of the array.: \r\n\r\n   at Microsoft.TeamFoundation.Release.Common.Helpers.TextFileEncodingDetector.DetectSuspiciousUtf8SequenceLength(Byte[] sampleBytes, Int64 currentPos)
       at Microsoft.TeamFoundation.Release.Common.Helpers.TextFileEncodingDetector.DetectUnicodeInByteSampleByHeuristics(Byte[] sampleBytes)
       at Microsoft.TeamFoundation.Release.Common.Helpers.TextFileEncodingDetector.DetectTextFileEncoding(FileStream inputFileStream, Int64 heuristicSampleSize, Boolean& hasBom)
       at Microsoft.TeamFoundation.Release.Common.Helpers.TextFileEncodingDetector.DetectTextFileEncoding(String inputFilename)
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.ReplaceConfigurationVariablesInFilesImplementation(String path, String searchPattern, Func`4 directoryFileRetriever, Func`2 readAllText, Func`2 detectTextFileEncoding,
    Func`3 replaceConfigurationVariables, Action`3 writeAllTextWithEncoding, Action`2 writeAllText)
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.ReplaceConfigurationVariablesInFiles(String path, String searchPattern)
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.ReplaceConfigurationVariablesPostImplementation(Action`2 replaceConfigurationVariablesInFiles)
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.DeployComponent()
    THANKS FOR YOUR HELP
    steve

Maybe you are looking for

  • Apple, let us downgrade to iOS 6.0!

    Well, this battery drain issue is coming from iOS 6.1 to me and it seems that it is common on almost every iPhone model (4, 4S, 5, etc). It maybe not the iOS itself, perhaps from this version, the iOS gives some opportunity to some Apps to do some st

  • Error RSTRAN525 while activating transformation

    Hi, In my transformation one date field get updated using three source field (date, GR Process time, Plant) and logic written in routine is Result = date + GR Process time. GR Process time (source field WEBAZ) mapped with info object 0GR_PR_TIME. Whi

  • Adobe Reader for iOS cannot open IRM-protected PDF documents.

    Hi, trying to open IRM-protected documents on an iPhone or iPad. (Reader-version is 10.1.0 (49458) - on iOS5 final). When X509-authentication and anonymous authentication is switched on, there is an error-message, that the connection to the IRM-serve

  • ITunes Library "damaged"? All my songs are gone now! =(

    So i start itunes the other day, and it gives me a message that my itunes library has been "damaged" and now all my songs/playlists/purchased music is gone. The files are still there in their folders, but gone from itunes. I did some research online

  • Indesign pdf form

    I have created a pdf form from Indesign. Is there a way to enable the person filling out the form to then click a button (created in indesign) that collects their answers and exports them in a preformatted pdf? It's not something I'm aware of but a c