[ 
https://issues.apache.org/jira/browse/PIVOT-994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roger Whitcomb closed PIVOT-994.
--------------------------------
    Resolution: Not A Problem

The more I look at this, the more I am convinced this is not a problem.  
Running the script via "ScriptApplication" where the window is clearly "open"ed 
in its own display, everything is fine.  Inside BXMLExplorer, the window is 
displayed, but the code substitutes a "FakeWindow" component that does not have 
the real "Window" as a child, so the "getDisplay" method will never find the 
Display ancestor of that FakeWindow, and thus the error.

And, the BXMLExplorer application is not meant to actually run the examples 
anyway, only to explore the BXML hierarchy and the components' styles and 
attributes.

> BXMLExplorer is getting a null display for a visible owner window.
> ------------------------------------------------------------------
>
>                 Key: PIVOT-994
>                 URL: https://issues.apache.org/jira/browse/PIVOT-994
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-beans
>    Affects Versions: 2.0.4, 2.1
>         Environment: All
>            Reporter: Roger Whitcomb
>            Assignee: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.1
>
>
> Run the BXML Explorer Tutorial application.  Open up the 
> "org/apache/pivot/tests/alert_prompt_test.bxml" file and try to bring up any 
> of the alerts or prompts.  There will be an IllegalArgumentException that 
> "display is null."
> The stack trace (for 2.0.x) shows this:
> java.lang.IllegalArgumentException: display is null.
>         at org.apache.pivot.wtk.Window.open(Window.java:630)
>         at org.apache.pivot.wtk.Dialog.open(Dialog.java:186)
>         at org.apache.pivot.wtk.Alert.alert(Alert.java:359)
>         at org.apache.pivot.wtk.Alert.alert(Alert.java:331)
>         at jdk.nashorn.internal.scripts.Script$3$\^eval\_.:program(<eval>:1)
>         at 
> jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
>         at 
> jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
>         at 
> jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
>         at 
> jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449)
>         at 
> jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
>         at 
> jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
>         at 
> jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
>         at javax.script.AbstractScriptEngine.eval(Unknown Source)
>         at 
> org.apache.pivot.beans.BXMLSerializer$AttributeInvocationHandler.invoke(BXMLSerializer.java:156)
> This sequence shows that "owner.getDisplay()" is returning null at 
> Alert.open() time, even though the owner window is clearly visible at the 
> time.
> This could possibly be due to Nashorn scripting issues with Java 8, since the 
> "window" variable would be set in the JS namespace, but this doesn't really 
> explain why the "display" value is null, and not the "window" value itself.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to