Hi Stuart, Thanks for reporting the problem and sending the snippet.
I have created an issue: https://www.canoo.com/jira/browse/UBA-6989. It will be fixed in a future release. As a workaround please use: 1. setText(getText() + "text to append"); - this will increase the size of request if the text area has lot of text Or 2. Create an extension of ULCTextArea as shown in the snippet at the end of this mail. Thanks and regards, Janak >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] Behalf Of Stuart Booth >Sent: Wednesday, August 16, 2006 4:45 AM >To: [email protected] >Subject: [ULC-developer] ULCTextArea.append() bug? > > >I seem to have discovered a bug in how ULCTextArea.append() works. >Specifically, text added this way is lost when the focus returns to a >ULCTextArea component. > >I have included a class below that you can use to verify this, >followed by a >Swing class that is fuctionally identical but works as expected. > >To test: >1) Run the class and type "Hello" into the textarea. >2) Click the "append" button and you will see the contents of the >text area >get appended. >3) Click back in the textarea and the appended text will vanish. > >Please let me know if you can replicate this and whether you have any >resolutions or workarounds that I can employ. > >Thanks. >-Stuart Booth (Abacus Research) import com.ulcjava.base.application.AbstractApplication; import com.ulcjava.base.application.ULCBorderLayoutPane; import com.ulcjava.base.application.ULCButton; import com.ulcjava.base.application.ULCFrame; import com.ulcjava.base.application.ULCTextArea; import com.ulcjava.base.application.ULCTextField; import com.ulcjava.base.application.border.ULCEmptyBorder; import com.ulcjava.base.application.event.ActionEvent; import com.ulcjava.base.application.event.IActionListener; import com.ulcjava.base.client.UITextArea; import com.ulcjava.base.development.DevelopmentRunner; // Demonstrates the bug in ULCTextArea.append // To test: //1) Run the class and type "Hello" into the textarea. //2) Click the "append" button and you will see the contents of the text area get appended. //3) Click back in the textarea and the appended text will vanish. public class TextAreaAppendSnippet extends AbstractApplication { static int count = 0; public void start() { new BugsFrame().setVisible(true); } public static void main(String[] args) { DevelopmentRunner.setApplicationClass(TextAreaAppendSnippet.class); DevelopmentRunner.run(); } class BugsFrame extends ULCFrame { public BugsFrame() { super("Bugs"); setDefaultCloseOperation(ULCFrame.TERMINATE_ON_CLOSE); setSize(300, 300); addComponents(); } private void addComponents() { setContentPane(new ULCBorderLayoutPane()); setBorder(new ULCEmptyBorder(10, 10, 10, 10)); final ULCMyTextArea text = new ULCMyTextArea(); ULCButton button = new ULCButton("Append"); add(new ULCTextField(20), ULCBorderLayoutPane.NORTH); add(text, ULCBorderLayoutPane.CENTER); add(button, ULCBorderLayoutPane.SOUTH); button.addActionListener(new IActionListener() { public void actionPerformed(ActionEvent event) { text.append("Appended " + count++); //text.setText(text.getText() + "Appended " + count++); } }); } } public static class ULCMyTextArea extends ULCTextArea { @Override protected String typeString() { return UIMyTextArea.class.getName(); } } public static class UIMyTextArea extends UITextArea { @Override public void append(String text) { fLastInput = null; super.append(text); } } } _______________________________________________ ULC-developer mailing list [email protected] http://lists.canoo.com/mailman/listinfo/ulc-developer
