I am having issues to remove a PopUp form my application. In fact I have a title Window with a component in it. In the component I have a Button, which when clicked should remove the TitleWindow (the PopUp). I am getting the error :
TypeError: Error #1009: Cannot access a property or method of a null object reference.
My Title Window is as follows:
<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" left="10"
width="1366" height="768">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.managers.PopUpManager;
public function removeTitleWindow():void {
PopUpManager.removePopUp(this);
}
]]>
</fx:Script>
<s:VGroup width="100%" height="100%" horizontalAlign="left">
<comps:SearchEngine />
<comps:SearchResults />
</s:VGroup>
</s:TitleWindow>
My Component is as follows:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="400 " height="300">
<fx:Declarations>
</fx:Declarations>
<fx:Script>
<![CDATA[
]]>
</fx:Script>
<s:Button label="Cancel" click="parentApplication.parentApplication.removeTitleWindow()"/>
</s:VGroup>
</s:Group>
Can someone help me on this?
Thanks
Got it Mates :)
I tried using parentApplication or rather flexGlobals.top... It didnt work.
Hence I used parentDocument.methodName().
This solved the issue.
Related
I am getting Binary XML file line #1: Binary XML file line #1: Error inflating class error occure for AppCompat error while trying to add tabbar and toolbar in android.Can anybody help me to come out of it.refering this link AppCompact
Here is my code. This is Style`
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<style name="MyTheme" parent="MyTheme.Base">
</style>
<style name="MyTheme.Splash" parent ="Theme.AppCompat.Light">
<item name="android:windowBackground">#drawable/Splash</item>
<item name="android:windowNoTitle">true</item>
</style>
<style name="MyTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#color/primary</item>
<item name="colorPrimaryDark">#color/primaryDark</item>
<item name="colorAccent">#color/accent</item>
<item name="android:windowBackground">#color/window_background</item>
<item name="windowActionModeOverlay">true</item>
</style>
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">#FF4081</item>
</style>
</resources>
This is code in Tabbar.axml and toolbar.axml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.TabLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:tabIndicatorColor="#android:color/white"
app:tabGravity="fill"
app:tabMode="fixed" />
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"/>
and main activity
public class FormsActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity//FormsApplicationActivity//
{ protected override void OnCreate (Bundle savedInstanceState)
{
FormsAppCompatActivity.ToolbarResource = Resource.Layout.Toolbar;
FormsAppCompatActivity.TabLayoutResource = Resource.Layout.Tabbar;
base.OnCreate (savedInstanceState);}
`
Try to uninstall the Xamarin.Forms, do a full clean, delete bin/obj folder, restart VS, install back the Xamarin.Forms, rebuild whole solution.
I need to do a simple task but it looks like very heavy for me, i need to create XULRUNNER system which opens WWW.test.com in default window without address bar or any menu and nothing more, here are my codes but it doesn't seem to be working, can anybody help?
main.js
function url() {
windowObjectReference = window.open("http://www.test.com/", "test_WindowName", strWindowFeatures);
}
main.xul
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="main" title="My App" width="500" height="500" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://myapp/content/main.js"/>
</window>
pref.js
pref("toolkit.defaultChromeURI", "chrome://myapp/content/main.xul");
pref("toolkit.defaultChromeFeatures", "chrome,dialog=no,all");
pref("toolkit.singletonWindowType", "xulmine");
/* debugging prefs, disable these before you deploy your application! */
pref("browser.dom.window.dump.enabled", true);
pref("javascript.options.showInConsole", true);
pref("javascript.options.strict", true);
pref("nglayout.debug.disable_xul_cache", true);
pref("nglayout.debug.disable_xul_fastload", true);
Just use the <browser> element
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="main" title="My App" width="500" height="500" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://myapp/content/main.js"/>
<vbox id="browerbox" flex="1">
<browser flex="1" id="testbrowser" src="http://www.test.com/ />
</vbox>
</window>
The browser is very powerful element I would read up on all Attributes, Properties and Methods that you can use with it, https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/browser. What I gave you above will work but depending on what you ultimately need to do, you may need make a few changes.
How to get iOS 7 action bar look in flex mobile application, I want my action bar to be completely flat and semi transparent too, I have seen few posts; those talks about making action bar flat by custom skin but no one talks about transparency.... any help or point to right direction would be greatly appreciated....
All you need to do is set the alpha property on your custom skin:
From Adobe's help documentation:
I added a transparent fill to the button's background/border <s:Rect>
<?xml version="1.0" encoding="utf-8"?>
<!-- SparkSkinning/GlobalVariableAccessorExample.mxml -->
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Script>
public var myLabelString:String = "Hello World";
</fx:Script>
<s:Button skinClass="mySkins.GlobalVariableAccessorSkin"/>
</s:Application>
<?xml version="1.0" encoding="utf-8"?>
<!-- SparkSkinning\mySkins\GlobalVariableAccessorSkin.mxml -->
<s:Skin
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark"
minWidth="21" minHeight="21">
<fx:Metadata>
[HostComponent("spark.components.Button")]
</fx:Metadata>
<fx:Script>
import mx.core.FlexGlobals;
[Bindable]
private var localString:String = FlexGlobals.topLevelApplication.myLabelString;
</fx:Script>
<!-- Specify one state for each SkinState metadata in the host component's class -->
<s:states>
<s:State name="up"/>
<s:State name="over"/>
<s:State name="down"/>
<s:State name="disabled"/>
</s:states>
<s:Rect
left="0" right="0"
top="0" bottom="0"
width="69" height="20"
radiusX="2" radiusY="2">
<s:stroke>
<s:SolidColorStroke color="0x000000" weight="1"/>
</s:stroke>
<!--
This section added to demonstrate
-->
<s:fill>
<s:SolidColor color="0x999999" alpha="0.5"/>
</s:fill>
<!-- ----------------------- -->
</s:Rect>
<s:Label id="labelDisplay"
text="{localString}"
horizontalCenter="0" verticalCenter="1"
left="10" right="10" top="2" bottom="2">
</s:Label>
</s:Skin>
I am supposed to access a a publicly accessible API (https://ABCInsuranceCoreApp.ng.bluemix.net/ABCInsurance/ProductService) using POST method. It accepts an XML Payload of the form
<Customer>
<Age>40</Age>
<Gender>M</Gender>
<Location>IBM</Location>
</Customer>
and returns a list of products. The API works in a REST-Client and tested.
What I have done in the Apigee API Dev Platform is as follows.
Default ProxyEndpoint:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
<Flows>
<Flow name="default">
<Request>
<Step>
<Name>AssignCustomerData</Name>
</Step>
<Step>
<Name>ExecuteProductService</Name>
</Step>
</Request>
<Response>
<Step>
<Name>ParseProductList</Name>
</Step>
</Response>
</Flow>
</Flows>
<HTTPProxyConnection>
<BasePath>/v1/abcinsproductservice</BasePath>
<VirtualHost>default</VirtualHost>
</HTTPProxyConnection>
<RouteRule name="default"/>
</ProxyEndpoint>
AssignCustomerData is an AssignMessage Policy and it looks like..
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignCustomerData">
<DisplayName>AssignCustomerData</DisplayName>
<AssignTo createNew="true" type="request">CustomerData</AssignTo>
<Set>
<Payload contentType="text/xml">
<Customer>
<Age>40</Age>
<Gender>M</Gender>
<Location>IBM</Location>
</Customer>
</Payload>
<Verb>POST</Verb>
</Set>
</AssignMessage>
ExecuteProductService is a service callout and it looks like..
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="false" continueOnError="false" enabled="true" name="ExecuteProductService">
<!-- Send the message we just made to the target, and save the result -->
<Request variable="CustomerData"/>
<Response>ProductList</Response>
<HTTPTargetConnection>
<URL>https://ABCInsuranceCoreApp.ng.bluemix.net/ABCInsurance/ProductService</URL>
</HTTPTargetConnection>
</ServiceCallout>
and ParseProductList is an ExtractVriable Policy which looks like..
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true" name="ParseProductList">
<DisplayName>ParseProductList</DisplayName>
<FaultRules/>
<Properties/>
<VariablePrefix>products</VariablePrefix>
<XMLPayload>
<Variable name="name" type="string">
<XPath>//Products/Product[1]/Name</XPath>
</Variable>
</XMLPayload>
</ExtractVariables>
I have dilligently followed the samples, however the arrangement does not work. I am confused as to where the error is.
The trace is not working either..
Can you pls help out..
Many thanks in advance
Amitava
I looks like you need to add Source to your ExtractVariables policy, as in:
<Source clearPayload="false">ProductList</Source>
Also, I'm curious why you are doing this with a ServiceCallout (rather than just routing to your target service via a TargetEndpoint)? I don't see a RouteRule in your ProxyEndpoint. Without a RouteRule, you are creating an Echo Server will will simply reflect back whatever comes in. To stop that from happening, you would need to add a RaiseFault policy after your ExtractVariables policy to terminate the call.
Or, perhaps you are just showing us a snippet and there is really more to it?
The way I see it is,
<Step>
<Name>ParseProductList</Name>
</Step>
Should be a Request Step.
So your proxy becomes,
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
<Flows>
<Flow name="default">
<Request>
<Step>
<Name>AssignCustomerData</Name>
</Step>
<Step>
<Name>ExecuteProductService</Name>
</Step>
<Step>
<Name>ParseProductList</Name>
</Step>
</Request>
<Response/>
</Flow>
</Flows>
<HTTPProxyConnection>
<BasePath>/v1/abcinsproductservice</BasePath>
<VirtualHost>default</VirtualHost>
</HTTPProxyConnection>
<RouteRule name="default"/>
</ProxyEndpoint>
I created a simple flex application which contains following line of codes
<?xml version="1.0" encoding="utf-8"?>
<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:HGroup>
When I run this application in flex I got the following error on the browser
VerifyError: Error #1014: Class spark.components::HGroup could not be found.
also there is a warning on the my flash builder console which follows
`This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.`
after that i setted -static-link-runtime-shared-libraries=true option in additional compiler arguments after that the above warning become error which follows
`Unable to locate specified base class 'spark.components.HGroup' for component class 'com.region.IRegion'.`
my flex sdk version is flex 4.6.0
Also I have the same problem in the case of s:Button
Can you please suggest a solution for this problem?
Your flex application cannot have the root as HGroup. It need to be
For flex web apps
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:Application>
And for AIR apps:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:WindowedApplication>