12-02-2010 01:07 PM
I am trying out a Flex Mobile project with Burrito and want to use the QNX components like QNXStageWebView (or any other QNX component for that matter) but with MXML (I don't think there is any other way right now to embed a browser, please correct me if I'm wrong). Trying to use <media:QNXStageWebView> does not work... Is there any way to even do this?
I think I've seen similar questions but I haven't found a solution. Someone said that wrapping the QNX components in the UIComponet wrapper worked ( http://supportforums.blackberry.com/t5/Tablet-OS-S
Also, if this is possible, are there any drawbacks to doing this?
Solved! Go to Solution.
12-02-2010 01:23 PM
QNX SDK does not supprt MXML, AS only.
If you created your own wrapper library, might offer MXML support, but with some amount of overhead. But if that overhead is minimum vs. productivity offered by MXML, then give it a shot.
public class MyLabelButton extends UIComponent
public var control : LabelButton = new LabelButton();
public function MyLableButton()
Let us know if this works in MXML.
12-02-2010 03:30 PM - edited 12-02-2010 04:25 PM
Like I mentioned in the webinar its not the best thing to do for the normal QNX UI components, but the QNXStageWebView might be an interesting use case. I'll post an example when i get a chance.
12-02-2010 03:36 PM
Thank for answering my question during the webcast. I need to do this for the app I currently building - I've tried a few things (like what @jtegen mentioned) but could not get it to work.... It would be great to see an example of how you'd accomplish this.
Any and all help would be greatly appreciated.
Also, would you happen to know if the StageWebView component will be supported so that in the future, developers would not need to use this workaround?
12-02-2010 03:39 PM
I haven't tried it but I believe StageWebView should work. QNXStageWebView probablys more api's then just StageWebView. Again i haven't tested it and with the current simulator state I am not sure what will change by release.
12-02-2010 04:22 PM
I dont think it is practical wrap QNX in MXML, you wont be able to edit wrapped components visually anyways, it can be done just for some and just in case you need them and they are not available as UIComponents.
In general if you want to add non-UICompoents component as a child of UIComponent you have to extent UIComponents and inside it put QNX components on Sprite of UIComponent with all related hassle like overriding updateDisplayList(...) to handle resizing and so on....
12-02-2010 05:13 PM
Ok the use case of using QNXStageWebView is easier then doing QNX UI components like has been said. To that end here is how you would do it:
Include the (0.9.0) qnx-air.swc to a Flex Mobile project (don't include the Flex Build Packaging -> BlackBerry Tabel -> include libraries checkbox as it has a compile error right now).
tage.stageHeight+" - " + startY; var rect:Rectangle = new Rectangle(0, startY, systemManager.stage.stageWidth, systemManager.stage.stageHeight - startY); webView.viewPort = rect; webView.autoFit = true; webView.stage = systemManager.stage; } ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:Button id="btnClick" label="Click to View My Blog" click="button1_clickHandler(event)" /> <s:Label id="lbl" text="Info" textAlign="right" width="60%" right="0" top="10" /> </s:View>
Full code and write up at my post here:
12-05-2010 03:30 AM
I went a step further and created some Container classes that extend QNX's Container class that allows you to use MXML with QNX UI components. MXML is not necessarily Flex. With my library you can create MXML apps with QNX UI that has no Flex UI components. Or that you can create Flex MXML apps that have parts of it in QNX UI components. For more details and the source code check out my post: