background image somehow covers up all the controls adobe flash builder 4.6 - flash-builder

I created a skin using an image as background.
When my View imported the skin as skinClass, it covers up all the other controls.
How do i make all the controls display above the skin?
This is my Skin code called Background.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<!-- host component -->
<fx:Metadata>
[HostComponent("spark.components.supportClasses.SkinnableComponent")]
</fx:Metadata>
<s:Image source="assets/Sunflower.gif" smooth="true" left="0" right="0" top="0" bottom="0">
</s:Image>
<s:states>
<s:State name="normal" />
</s:states>
</s:Skin>
This is the main view under default package
<?xml version="1.0" encoding="utf-8"?>
<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160"
skinClass="BackgroundImage"
>
<s:ViewNavigator label="Add" width="100%" height="100%" firstView="views.AddView"/>
<s:ViewNavigator label="List" width="100%" height="100%" firstView="views.ListView"/>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:TabbedViewNavigatorApplication>

It looks like your Z index should be adjusted for the controls.
You can change your z-index like this:
parent.setChildIndex(childObject, i)
So for example if you want your controls to always be on front you need:
myControls.parent.setChildIndex(myControls, myControls.parent.numChildren -1)
Hope this helps you, even tho it's hard to answer it without any code...

Related

Moqui form shows up disabled

I am following the Moqui getting started tutorial. I have created a create form as below.
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://staging.azpire.co.in/xsd/xml-screen-2.1.xsd"
require-authentication="anonymous-all">
<transition name="findTutorial"><default-response url="."/></transition>
<transition name="createTutorial">
<service-call name="create#tutorial.Tutorial"></service-call>
<default-response url="."/>
</transition>
<actions>
<entity-find entity-name="tutorial.Tutorial" list="tutorialList">
<search-form-inputs/>
</entity-find>
</actions>
<widgets>
<container-dialog button-text="Create Tutorial" id="CreateTutorialDialog">
<form-single name="CreateTutorial" transition="createTutorial">
<auto-fields-entity entity-name="tutorial.Tutorial" field-type="edit"/>
<field name="submitButton">
<default-field title="Create"><submit/></default-field>
</field>
</form-single>
</container-dialog>
<form-list name="ListTutorials" list="tutorialList" transition="findTutorial">
<auto-fields-entity entity-name="tutorial.Tutorial" field-type="find-display"/>
</form-list>
</widgets>
</screen>
When I click "Create Tutorial", the form shows up. But, it is disabled(read only) including the submit button.
If you are following the Moqui getting started tutorial, you need import data about security screen as follow to fix this problem:
<moqui.security.ArtifactGroup artifactGroupId="TUTORIAL" description="Tutorial"/>
<moqui.security.ArtifactGroupMember artifactGroupId="TUTORIAL" artifactTypeEnumId="AT_XML_SCREEN"
inheritAuthz="Y" artifactName="component://tutorial/screen/tutorial.xml"/>
<!-- Full permissions for the ADMIN user group -->
<moqui.security.ArtifactAuthz artifactAuthzId="TUTORIAL_AUTHZ_ALL" userGroupId="ADMIN" artifactGroupId="TUTORIAL"
authzTypeEnumId="AUTHZT_ALWAYS" authzActionEnumId="AUTHZA_ALL"/>
If you are required temporary solution for one transition then you can use:
<transition name="createTutorial" read-only="true">
<service-call name="create#tutorial.Tutorial"></service-call>
<default-response url="."/>
</transition>
If you are required a temporary solution but for more transition then you can use:
<always-actions>
<script>ec.artifactExecution.disableAuthz()</script>
</always-actions>
<transition name="createTutorial">
<service-call name="create#tutorial.Tutorial"></service-call>
<default-response url="."/>
</transition>
<transition name="createEmployee">
<service-call name="create#employee.Employee"></service-call>
<default-response url="."/>
</transition>
If you want permanent solution then create below seed data records:
If you want to authrize for availabe UserGroup(ADMIN) then you have to add following seed data:
<moqui.security.ArtifactGroup artifactGroupId="ADMIN_ARTIFACTS" description="Administrators"/>
<!-- for screen path -->
<moqui.security.ArtifactGroupMember artifactGroupId="ADMIN_ARTIFACTS" artifactTypeEnumId="AT_XML_SCREEN" nameIsPattern="N" inheritAuthz="Y" artifactName="component://tutorial/screen/tutorial.xml"/>
<!-- for rest calls -->
<moqui.security.ArtifactGroupMember artifactGroupId="ADMIN_ARTIFACTS" artifactName="/tutorial/fetch-records" artifactTypeEnumId="AT_REST_PATH" nameIsPattern="N" inheritAuthz="Y"/>
<!-- for service path -->
<moqui.security.ArtifactGroupMember artifactGroupId="ADMIN_ARTIFACTS" artifactName="TutorialServices.create#Records" artifactTypeEnumId="AT_SERVICE" nameIsPattern="N" inheritAuthz="Y"/>
<!-- Give authrization to UserGroup: -->
<moqui.security.ArtifactAuthz artifactAuthzId="ADMIN_AUTHZ" userGroupId="ADMIN" artifactGroupId="ADMIN_ARTIFACTS"
authzTypeEnumId="AUTHZT_ALWAYS" authzActionEnumId="AUTHZA_ALL"/>
If you want to create your own UserGroupType then you have to add following seed data:
<moqui.basic.Enumeration enumTypeId="UserGroupType" enumId="UgtMyAdmin" description="My Administrators"/>
// If you want to create your own UserGroup then you have to add following seed data:
<moqui.security.UserGroup groupTypeEnumId="UgtMyAdmin" userGroupId="MyAdmin" description="My Administrators"/>
// you can also create artifact group separately:
<moqui.security.ArtifactGroup artifactGroupId="MY_ADMIN_ARTIFACTS" description="My Administrators"/>
// Now you have to give screen permission to your own created UserGroup:
<!-- for screen path -->
<moqui.security.ArtifactGroupMember artifactGroupId="MY_ADMIN_ARTIFACTS" artifactTypeEnumId="AT_XML_SCREEN" nameIsPattern="N" inheritAuthz="Y" artifactName="component://tutorial/screen/tutorial.xml"/>
<!-- for rest calls -->
<moqui.security.ArtifactGroupMember artifactGroupId="MY_ADMIN_ARTIFACTS" artifactName="/tutorial/fetch-records" artifactTypeEnumId="AT_REST_PATH" nameIsPattern="N" inheritAuthz="Y"/>
<!-- for service path -->
<moqui.security.ArtifactGroupMember artifactGroupId="MY_ADMIN_ARTIFACTS" artifactName="TutorialServices.create#Records" artifactTypeEnumId="AT_SERVICE" nameIsPattern="N" inheritAuthz="Y"/>
<!-- Give authrization to UserGroup: -->
<moqui.security.ArtifactAuthz artifactAuthzId="MY_ADMIN_AUTH" userGroupId="MyAdmin" artifactGroupId="MY_ADMIN_ARTIFACTS" authzTypeEnumId="AUTHZT_ALWAYS" authzActionEnumId="AUTHZA_ALL"/>
You can also clone an example component from git:
I hope this will help!
If the transition exist and the user has permission to access it, then all fields disabled is a bug, please report it by create a issue.

Debugging vsto ribbon callbacks

I have a VSTO Outlook ribbon (context menu), which works as expected:
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<contextMenus>
<contextMenu idMso="ContextMenuMailItem">
<button id="DoThis"
label="Label"
onAction="DoThis"
getVisible="GetVisible"/>
</contextMenu>
</customUI>
However, if I have a getLabel attribute, then the context menu does not show up at all anymore. I guess I must be screwing something up, but there is no indication what; no log, no exception, nothing. Furthermore, I can't find anywhere that documents what the definition of each callback should be. I just tried the obvious, that getLabel should return a string, but it does not seem to work. getVisible works just fine (returning a bool).
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<contextMenus>
<contextMenu idMso="ContextMenuMailItem">
<button id="DoThis"
label="Label"
onAction="DoThis"
getVisible="GetVisible"
getLabel="GetLabelMoveToReviewFolderMultiple"/>
</contextMenu>
</customUI>
and the code behind (other methods not shown):
[ComVisible(true)]
public class ContextMenu : Office.IRibbonExtensibility
{
public string GetLabelMoveToReviewFolderMultiple(Office.IRibbonControl control)
{
return "Custom Label";
}
}
Do not use both label and getLabel. Also, enable addin errors in File | Options | Advanced | Developer to see all ribbon XML errors.
Well, while writing the question, I tried removing the label attribute for the context menu using getLabel, and that does resolve the issue; context menu works fine after that. I (initially) thought it might make sense to keep label as a default.
The documentation explains what is mutually exclusive.

Eclipse plug-in: nameFilter of propertyPages takes a strange effect

I use Eclipse SDK Mars.1(4.5.1). I create a propertyPages plug-in.
In plugin.xml:
If I change value of “nameFilter” to “.txt”, then only when I select .txt file, the propertyPage item can appear in left of the properties dialog;
If I change value of “nameFilter” to “.java” or “.xml” or even “.*”, then still only when I select .txt file, the propertyPage item can appear.
Here is my plugin.xml:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.propertyPages">
<page
id="com.def.btp_property_3.properties.BTPPropertyPage"
name="BTP Page"
class="com.def.btp_property_3.properties.BTPPropertyPage"
nameFilter="*.java">
<enabledWhen>
<instanceof
value="org.eclipse.core.resources.IFile">
</instanceof>
</enabledWhen>
</page>
</extension>
</plugin>
Can anyone tell me the reason and give me a solution.
For the enableWhen use:
<enabledWhen>
<or>
<instanceof
value="org.eclipse.core.resources.IFile">
</instanceof>
<adapt
type="org.eclipse.core.resources.IFile">
</adapt>
</or>
</enabledWhen>
User interface elements in views are often not instances of IFile, instead they are some other object which can be 'adapted' to IFile. This enabledWhen deals with this case.

Element created with XSLT templating not visible by Selenium

The problem is that when I try to set a value to an input, selenium return the following error:
RuntimeError: Element is not currently visible and so may not be interacted with
Howhever, the input is completly visible. In this test I'm using Firefox because is the browser where the application is correctly loaded.
I can't change the application code and the app has a lot of legacy code but I have recreated the most simple example where you can see the issue.
Do you know any workaround without modifying the application code?
I'm using webdriverio:
this.browser
.url('http://localhost/main.xml')
.setValue('[name=inputId]', 'aaaaaaaa')
.close()
.then(callback)
main.xml content:
<?xml version="1.0" encoding="iso-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="main.xsl" ?>
<CONTEXTO></CONTEXTO>
main.xsl content:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1"/>
<xsl:include href="helper.xsl"/>
<xsl:template match="CONTEXTO">
<html>
<head>
<title>Test main</title>
<style>
* { margin:0; }
form { position: absolute; }
input { border: 1px black solid; }
</style>
</head>
<body>
<form name="" action="" method="POST">
<label for="inputId">inputId
<input type="text" name="inputId" id="inputId" value="" />
</label>
</form>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
helper.xsl content:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<script></script>
<xsl:apply-templates select="CONTEXTO"/>
</xsl:template>
</xsl:stylesheet>
Perhaps you have hit a limitation with Selenium with XML content, as it is treated differently by browsers than HTML content. You can try to fix this by using SendKeys instead. But if it cannot find the element, you will have to get to the element by key navigation, which can be tricky.
Alternatively, try finding the element with find_element_by_name or find_element_by_id or use XPath or this webdriver.io alternative. If none work, you can find out by traversing the tree from root node to the next. If none work, then my guess is, that Selenium sees the XML DOM (try to find the root element), not the XSLT-generated DOM.
Trying waiting for the input value to exist first:
.waitForExist('[name=inputId]', 1000)
.setValue('[name=inputId]', 'aaaaaaaa')
The problem is that the XSL is generating a malformed HTML. The helper is going to match / and generate a script tag and apply the CONTEXTO template, leading to a document such as:
<script></script>
<html>....</html>
That doesn't have too much sense as HTML.
For some reason firefox's TransformiIX engine in this situation is ignoring the output method HTML and is falling back to text output, which leads to the inclusion of a wrapper tag called transformiix:result. (see this link for reference).
You can check this, like I did, by issuing a getPageSource() to the webdriver and printing it to the log. You'll see the resulting output of the transformation is:
<transformiix:result>
<script></script>
<html>....</html>
</transformiix:result>
This is making webdriver be totally unable to interact with the page.
The recommended way to solve it is to fix the XSLT. If that's not an option (very big impact), the you can execute the following script using webdriver's executeScript, right after the page load (or before the first interaction attempt with the page).
document.getRootNode().replaceChild(document.getElementsByTagName('html')[0], document.getElementsByTagName('transformiix:result')[0])
This will replace the documents root node transformiix:result when present with the html tag.
Note that if in your current development, you have more stuff included by your helper.xsl, you might need to also take those tags and move then inside the header tag as part of the script above.
Edit: You can also reproduce the XSL issue by executing the following code in a firefox debug window:
//Execute in a firefox inspect console
var p = new XSLTProcessor();
var toTransform = document.implementation.createDocument(null, "CONTEXTO");
var parser = new DOMParser();
var xmlString = `<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1"/>
<xsl:template match="/">
<script></script>
<xsl:apply-templates select="CONTEXTO"/>
</xsl:template>
<xsl:template match="CONTEXTO">
<html>
<body>
Hello
</body>
</html>
</xsl:template>
</xsl:stylesheet>
`;
p.importStylesheet(parser.parseFromString(xmlString, "text/xml"));
var doc = p.transformToDocument(toTransform);
console.log(doc.getRootNode().children[0].outerHTML);

android animator - scale view to the center (Froyo)

I have a View in my android app which I want to scale & fade away to the center of it. So far I have the following
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<scale
android:duration="1500"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:toXScale="0"
android:toYScale="0" />
<alpha
android:duration="1500"
android:fromAlpha="1"
android:toAlpha="0" />
</set>
yet that leads to the unwanted effect the text is "scaled away" to the upper left corner. How can I correct this so it is scaling to the center of the view? I need this for API >=8 .
Thanks for any hint.
Martin
Found the solution myself, pivotX and pivotY are doing the trick
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<scale
android:duration="1500"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="0"
android:toYScale="0" />
<alpha
android:duration="1500"
android:fromAlpha="1"
android:toAlpha="0" />
</set>