[ https://issues.apache.org/jira/browse/PIVOT-888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13553608#comment-13553608 ]
Karel Hübl commented on PIVOT-888: ---------------------------------- Stack trace is here: java.lang.NullPointerException at org.apache.pivot.wtk.TextArea.access$500(TextArea.java:38) at org.apache.pivot.wtk.TextArea$Paragraph.insertText(TextArea.java:121) at org.apache.pivot.wtk.TextArea.insertText(TextArea.java:785) at org.apache.pivot.wtk.TextArea.insertText(TextArea.java:743) at org.apache.pivot.wtk.skin.TextAreaSkin.keyTyped(TextAreaSkin.java:944) at org.apache.pivot.wtk.Component$ComponentKeyListenerList.keyTyped(Component.java:533) at org.apache.pivot.wtk.Component.keyTyped(Component.java:2839) at org.apache.pivot.wtk.ApplicationContext$DisplayHost.processKeyEvent(ApplicationContext.java:1399) at java.awt.Component.processEvent(Unknown Source) at org.apache.pivot.wtk.ApplicationContext$DisplayHost.processEvent(ApplicationContext.java:792) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$000(Unknown Source) at java.awt.EventQueue$1.run(Unknown Source) at java.awt.EventQueue$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$2.run(Unknown Source) at java.awt.EventQueue$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) The textArea instance variable is set to null on line 119 in TextArea.java while processing text changend event on property bindings - so I get NullPointerException on line 121... Regards Karel > Nullpointer Exception while editing TextArea with text property two-way > bounded > ------------------------------------------------------------------------------- > > Key: PIVOT-888 > URL: https://issues.apache.org/jira/browse/PIVOT-888 > Project: Pivot > Issue Type: Bug > Components: wtk > Affects Versions: 2.0.2 > Reporter: Karel Hübl > Assignee: Roger Whitcomb > Priority: Trivial > Fix For: 2.0.3 > > > I am getting NullPointer exception trace printed to System.out when I edit > TextArea, which text property is two-way data bounded. > The issue is fixed when I extend TextArea and override the setText mehtod to > do nothing, if the text equals to current text value: > Fixed class: > public class TwoWayBindableTextArea extends TextArea { > public void setText(String text) { > if (text != null && text.equals(this.getText())) { > return; > } > super.setText(text); > } > } > Problematic bxml: > <Form styles="{padding:5}" > xmlns="org.apache.pivot.wtk" > xmlns:view="com.dirigent.gui.component" > xmlns:bxml="http://pivot.apache.org/bxml" width="300" height="200"> > <Form.Section> > <TextInput bxml:id="textInput" text="${textArea.text}"/> > <Border> > <FillPane minimumWidth="300" minimumHeight="100"> > <!--<view:TwoWayBindableTextArea bxml:id="textArea" > text="${textInput.text}"/>--> > <TextArea bxml:id="textArea" text="${textInput.text}"/> > </FillPane> > </Border> > </Form.Section> > </Form> -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira