Results 1 to 3 of 3

Thread: TableFormBuilder bind a component 2 times.

  1. #1
    Join Date
    Dec 2004
    Posts
    15

    Default TableFormBuilder bind a component 2 times.

    Code:
        public JComponent[] addTextArea(String propertyName, String attributes) {
            return addBinding(getBinding(propertyName, getTextArea(propertyName)), attributes, getLabelAttributes()
                    + " valign=top");
        }
    in AbstractFormBuilder:
    Code:
        protected JComponent getTextArea(String propertyName) {
            JTextArea textArea = GuiStandardUtils.createStandardTextArea(5, 40);
            JComponent component = new JScrollPane(getBindingFactory().bindControl(textArea, propertyName).getControl());
            return component;
        }
    This is the first time JTextArea is binded.

    Code:
        protected Binding getBinding(String propertyName, JComponent component) {
            return getBindingFactory().bindControl(component, propertyName);
        }
    This is the second time JTextArea is binded.

    And, the second binded throw a exception.

    Code:
    java.lang.IllegalArgumentException: Control must be an instance of JTextComponent.
    	at org.springframework.util.Assert.isTrue(Assert.java:64)
    	at org.springframework.richclient.form.binding.swing.TextComponentBinder.doBind(TextComponentBinder.java:38)
    	at org.springframework.richclient.form.binding.support.AbstractBinder.bind(AbstractBinder.java:86)
    	at org.springframework.richclient.form.binding.support.AbstractBindingFactory.bindControl(AbstractBindingFactory.java:84)
    	at org.springframework.richclient.form.binding.support.AbstractBindingFactory.bindControl(AbstractBindingFactory.java:62)
    	at org.springframework.richclient.form.builder.AbstractFormBuilder.getBinding(AbstractFormBuilder.java:77)
    	at org.springframework.richclient.form.builder.TableFormBuilder.addTextArea(TableFormBuilder.java:95)
    	at org.springframework.richclient.form.builder.TableFormBuilder.addTextArea(TableFormBuilder.java:91)

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    335

    Default

    Fixed.

    Thanks

  3. #3
    Join Date
    Dec 2004
    Posts
    15

    Default

    Quote Originally Posted by oliverhutchison
    Fixed.

    Thanks
    Thank you.
    but "addSelector" method have a same bug.

Similar Threads

  1. Reusable component architecture best practices?
    By rebornspirit in forum Architecture
    Replies: 3
    Last Post: Oct 18th, 2005, 07:57 AM
  2. datechooser component - first try
    By snpe in forum Swing
    Replies: 3
    Last Post: Mar 31st, 2005, 10:38 AM
  3. Newbie bind question: bind an entire form?
    By kendelong in forum Web
    Replies: 0
    Last Post: Feb 4th, 2005, 04:02 PM
  4. shared buisness component.
    By djeang in forum Architecture
    Replies: 1
    Last Post: Oct 25th, 2004, 03:38 AM
  5. Named Bind Variables
    By james.estes in forum Data
    Replies: 4
    Last Post: Sep 6th, 2004, 10:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •