Parallel Fade State Transition Not Playing - flash-builder

This is an old issue, but it's recently come up again; and this time it refuses to work itself out. The problem: When I click on "Forgot Password" the program instantly changes states, without playing the transition.
Transition Code:
<s:Transition toState="LoginForgotPassword" fromState="*" autoReverse="true">
<s:Parallel targets="{[loginExisting, passwordGroup, loginNew, whyTextLink, loginForgot]}">
<s:Fade duration="500" hideFocusRing="true"/>
</s:Parallel>
</s:Transition>
Effected Targets:
<s:states>
<s:State name="LoginMain"/>
<s:State name="LoginForgotPassword"/>
<s:State name="LoginRegister"/>
</s:states>
<s:Panel id="loginWizard" width="546" height="308" horizontalCenter="0" verticalCenter="0"
title.LoginMain="Log-in or create account" title.LoginForgotPassword="Forgot Password"
title.LoginRegister="New user registration">
<s:VGroup width="100%" height="80%" horizontalAlign="center" verticalAlign="middle">
<s:VGroup width="90%" height="85%">
<s:RadioButton id="loginExisting"
label="I'm already a member and I want to login with my Tarrigato account."
groupName="loginMethod" alpha.LoginForgotPassword="0.0"
visible.LoginRegister="false"/>
<s:HGroup width="100%" height="40" horizontalAlign="center">
<s:HGroup width="80%" height="40">
<s:Label height="40" fontSize="15" width="100" text="Username: " verticalAlign="middle"/>
<s:TextInput id="loginUsername" width="300" height="40" focusIn="loginFocusInHandler(event)"/>
</s:HGroup>
</s:HGroup>
<s:HGroup width="100%" height="40" horizontalAlign="center" id="passwordGroup" alpha.LoginForgotPassword="0.0">
<s:HGroup width="80%" height="40">
<s:Label height="40" fontSize="15" width="100" text="Password:" verticalAlign="middle"/>
<s:TextInput id="loginPassword" displayAsPassword="true" width="300"
focusIn="loginFocusInHandler(event)" height="40"/>
</s:HGroup>
</s:HGroup>
<s:HGroup includeIn="LoginRegister" width="100%" height="40" horizontalAlign="center">
<s:HGroup width="80%" height="40">
<s:Label height="40" fontSize="15" width="100" text="Email:" verticalAlign="middle"/>
<s:TextInput id="loginEmail" width="300" height="40"/>
</s:HGroup>
</s:HGroup>
<s:HGroup includeIn="LoginRegister" width="100%" height="20" horizontalAlign="center">
<s:HGroup width="80%" height="20">
<s:CheckBox id="acceptedRules" label="I accept the Tarrigato Rules & Regulations"/>
</s:HGroup>
</s:HGroup>
<s:Spacer height="15"/>
<s:RadioButton id="loginNew"
label="I'm a new member and I want to create a new Tarrigato account now."
groupName="loginMethod" selected="true" alpha.LoginForgotPassword="0.0"
visible.LoginRegister="false" includeInLayout.LoginRegister="false"/>
<mx:LinkButton id="whyTextLink"
label="Want to know why you need a Kommunicate account?"
click="whyPanel.visible = true;" color="#B8B8B8"
textDecoration="underline" alpha.LoginForgotPassword="0.0"
visible.LoginRegister="false" includeInLayout.LoginRegister="false"/>
</s:VGroup>
</s:VGroup>
<mx:HRule y="218" width="100%"/>
<s:Button id="loginForgot" left="7" bottom="7" label="Forgot Password?"
click="currentState = "LoginForgotPassword";"
alpha.LoginForgotPassword="0.0"
visible.LoginRegister="false"/>
<s:Button id="loginCancel" right="126" bottom="7" label="Cancel"
click="currentState = "LoginMain";"
enabled.LoginMain="false"/>
<s:Button id="loginContinue" right="7" width="115" bottom="7" label="Continue"
click="loginContinue_clickHandler(event)"/>
</s:Panel>

You have placed the <s:transition> in <fx:Declarations> - it should be within <s:transitions>.
You have:
<fx:Declarations>
<s:Transition toState="LoginForgotPassword" fromState="*" autoReverse="true">
<s:Parallel targets="{[loginExisting, passwordGroup, loginNew, whyTextLink, loginForgot]}">
<s:Fade duration="500" hideFocusRing="true"/>
</s:Parallel>
</s:Transition>
</fx:Declarations>
This should be implemented as:
<s:transitions>
<s:Transition toState="LoginForgotPassword" fromState="*" autoReverse="true">
<s:Parallel targets="{[loginExisting, passwordGroup, loginNew, whyTextLink, loginForgot]}">
<s:Fade duration="500" hideFocusRing="true"/>
</s:Parallel>
</s:Transition>
</s:transitions>
Use the transitions array outside of declarations.
Beyond that, the only change I made was placing the id of "passwordGroup" in the HGroup that contains the password Label and TextInput. You only had the password TextInput in the targets of the transition and did not include an alpha state for the TextInput.
<?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"
currentState="LoginMain">
<s:states>
<s:State name="LoginForgotPassword" />
<s:State name="LoginMain" />
</s:states>
<s:transitions>
<s:Transition toState="*"
fromState="*"
autoReverse="true">
<s:Parallel targets="{[loginExisting, passwordGroup, loginNew, whyTextLink, loginForgot]}">
<s:Fade duration="500" />
</s:Parallel>
</s:Transition>
</s:transitions>
<s:Panel id="loginWizard"
width="546"
height="308"
horizontalCenter="0"
title="Log-in or create account"
title.LoginForgotPassword="Forgot Password"
verticalCenter="-0">
<s:VGroup width="100%"
height="80%"
horizontalAlign="center"
verticalAlign="middle">
<s:VGroup width="90%"
height="75%">
<s:RadioButton id="loginExisting"
label="I'm already a member and I want to login with my Tarrigato account."
groupName="loginMethod"
alpha.LoginForgotPassword="0.0" />
<s:HGroup width="100%"
height="40"
horizontalAlign="center">
<s:HGroup width="80%"
height="40">
<s:Label height="40"
fontSize="15"
width="100"
text="Username: "
verticalAlign="middle" />
<!-- unknown reference: focusIn="loginFocusInHandler(event)" -->
<s:TextInput id="loginUsername"
width="300"
height="40" />
</s:HGroup>
</s:HGroup>
<s:HGroup id="passwordGroup"
alpha.LoginForgotPassword="0.0"
width="100%"
height="40"
horizontalAlign="center">
<s:HGroup width="80%"
height="40">
<s:Label height="40"
fontSize="15"
width="100"
text="Password:"
verticalAlign="middle" />
<!-- unknown reference: focusIn="loginFocusInHandler(event)" -->
<s:TextInput id="loginPassword"
displayAsPassword="true"
width="300"
height="40"
left="4" />
</s:HGroup>
</s:HGroup>
<s:Spacer height="15" />
<s:RadioButton id="loginNew"
label="I'm a new member and I want to create a new Tarrigato account now."
groupName="loginMethod"
selected="true"
alpha.LoginForgotPassword="0.0" />
<!-- unknown reference: click="whyPanel.visible = true;" -->
<mx:LinkButton id="whyTextLink"
label="Want to know why you need a Kommunicate account?"
color="#B8B8B8"
textDecoration="underline"
alpha.LoginForgotPassword="0.0" />
</s:VGroup>
</s:VGroup>
<mx:HRule y="218"
width="100%" />
<s:Button id="loginForgot"
left="7"
bottom="7"
label="Forgot Password?"
alpha.LoginForgotPassword="0.0"
click="currentState = 'LoginForgotPassword';" />
<s:Button id="loginCancel"
right="127"
bottom="7"
label="Cancel"
click="currentState = 'LoginMain';"
enabled.LoginMain="false" />
<s:Button id="loginContinue"
right="7"
bottom="7"
label="Continue" />
</s:Panel>
</s:Application>

Related

Positioning actionbar items on android

I have this code
<template>
<Page>
<ActionBar title="Action Items">
<StackLayout orientation="horizontal">
<Image src="res://icon" width="40" height="40"
verticalAlignment="center" />
<Label text="NativeScript" fontSize="24"
verticalAlignment="center" />
</StackLayout>
<NavigationButton text="Go Back" android.systemIcon="ic_menu_back"
(tap)="onNavBtnTap()">
</NavigationButton>
<ActionItem (tap)="onShare()" ios.systemIcon="9"
ios.position="left" android.systemIcon="ic_menu_share"
android.position="actionBar">
</ActionItem>
<ActionItem (tap)="onDelete()" ios.systemIcon="16"
ios.position="right" text="delete" android.position="popup">
</ActionItem>
</ActionBar>
<ScrollView>
<StackLayout class="home-panel">
<!--Add your page content here-->
<Label textWrap="true" text="Play with NativeScript!"
class="h2 description-label">
{{first}}
</Label>
<Label textWrap="true"
text=" Write code in the editor or drag and drop components to build a NativeScript mobile application."
class="h2 description-label" />
<Label textWrap="true"
text="Scan the QR code with your mobile device and watch the changes sync live while you play with the code."
class="h2 description-label" />
</StackLayout>
</ScrollView>
</Page>
</template>
<script>
export default {
data() {
return {
first: "Once"
};
}
};
</script>
<style scoped>
.home-panel {
vertical-align: center;
font-size: 20;
margin: 15;
}
.description-label {
margin-bottom: 15;
}
</style>
which produces
My question is how come the back button aligned itself left and the others right without explicitly coding left or right?
<NavigationButton text="Go Back" android.systemIcon="ic_menu_back"
(tap)="onNavBtnTap()">
</NavigationButton>
and the other buttons are aligning to the right
<ActionItem (tap)="onShare()" ios.systemIcon="9"
ios.position="left" android.systemIcon="ic_menu_share"
android.position="actionBar">
</ActionItem>
<ActionItem (tap)="onDelete()" ios.systemIcon="16"
ios.position="right" text="delete" android.position="popup">
</ActionItem>
<NavigationButton/> is by default on the left, as it's just calls into the native setNavigationIcon api:
https://developer.android.com/reference/android/widget/Toolbar#setNavigationIcon(android.graphics.drawable.Drawable)
While the other <ActionItem> elements are added with the Menu api:
https://developer.android.com/reference/android/widget/Toolbar#getMenu()
For your other question, you can do the following:
<Label :text="`${first} Play with NativeScript!`" textWrap="true" class="h2 description-label" />
:text makes it a binding, the then you pass in a regular JavaScript string literal.
An alternative would be:
:text="first + ' Play with NativeScript!'"
Both ways should work fine.

Vue warn: Property or method "item" is not defined on the instance but referenced during render

im getting below error while i'm iterate CartItem.
Property or method "item" is
not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property
why this error is showing and how can i solve this.
[Note : this is a nativescript vue project]
<ListView
v-for="(item, index) in cartItems"
:key="index"
height="1000"
class="listCard"
>
<v-template>
<GridLayout
rows="auto"
columns="auto,*3,auto"
backgroundColor="white"
class="innerList"
>
<StackLayout orientation="horizontal" col="0" row="0">
<Button>
<FormattedString>
<Label
class="fa fas"
:text="'fa-trash' | fonticon"
fontSize="30"
></Label>
</FormattedString>
</Button>
<Image :src="item.imageUrl" height="80" width="auto"></Image>
</StackLayout>
<StackLayout col="1" row="0">
<Label
:text="item.title"
textWrap="true"
class="font-weight-bold"
color="#333333"
></Label>
<Label :text="item.color" color="#999999"></Label>
<Label :text="'USD ' + item.price" color="red"></Label>
</StackLayout>
<StackLayout orientation="horizontal" col="2" row="0">
<Button
text="-"
#tap="onDecriment(index)"
class="operatorButton operatorBox"
marginRight="0"
/>
<Label
class="operatorLabel operatorBox"
:text="item.quantity">
</Label>
<Button
text="+"
#tap="onIncrement(index)"
class="operatorButton operatorBox"
marginLeft="0"
/>
</StackLayout>
</GridLayout>
</v-template>
</ListView>
I don't see any error in your code but can you try using for instead of v-for. I see in this example, Listview is being using with for.
As per docs: If a v-for is used on a <ListView> a warning will be printed to the console, and it will be converted to the **for** property. you can read more about Listview with for here
<ListView
for="(item, index) in cartItems"
:key="index"
height="1000"
class="listCard"
>
....

How to use an external image as pattern in svg-edit?

I'm a new to svg-edit, and I have a problem with using external link as pattern image.
Svg-edit delete the part
xlink:href="http://www.micromark.com/RS/SR/Product/85373_T.jpg"
when I apply modifications in the source :
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:undefined="http:/www.w3.org/1999/xlink">
<defs>
<pattern x="0" y="0" width="100" patternUnits="userSpaceOnUse" id="testGilles" height="100" xmlns:xlink="http:/www.w3.org/1999/xlink">
<image id="svg_3" width="100" height="100" xlink:href="http://www.micromark.com/RS/SR/Product/85373_T.jpg"/>
</pattern>
</defs>
<g>
<title>Layer 1</title>
<rect id="svg_1" height="225" width="238" y="87" x="82" stroke-width="5" stroke="#000000" fill="url(#testGilles)"/>
</g>
</svg>
Does anyone knows why ?
I hope this is clear, it's not easy for me to explain it in English :)

ColumnModel Set Header error with mono 3.3.0

This is my asp.net GridPanel code with columnmodel id ColumnModel3
<South Split="true" Collapsible="true" CollapseMode="Mini">
<ext:Panel runat="server" ID="pnlMsgLst" Frame="true" Height="145" Title="消息列表" AutoScroll="true"
Collapsed="true">
<Content>
<ext:GridPanel ID="vehGridPnl" runat="server" StoreID="msgStore" StripeRows="true"
Frame="true" AutoHeight="true" AutoExpandColumn="Id" AutoScroll="true" EnableHdMenu="false">
<ColumnModel ID="ColumnModel3" runat="server">
<Columns>
<ext:Column ColumnID="Id" Header="ID" Width="80" DataIndex="Id" Hidden="false" />
<ext:Column Header="消息内容" Width="180" DataIndex="Content">
<Renderer Fn="change" />
</ext:Column>
<ext:Column Header="车牌号码" Width="90" DataIndex="CarPlateNo">
<Renderer Fn="change" />
</ext:Column>
<ext:Column Header="设备ID" Width="90" DataIndex="DevID">
<Renderer Fn="change" />
</ext:Column>
<ext:Column Header="经度" Width="80" DataIndex="Longitude">
<Renderer Fn="change" />
</ext:Column>
<ext:Column Header="纬度" Width="80" DataIndex="Latitude">
<Renderer Fn="change" />
</ext:Column>
<ext:Column Header="速度" Width="70" DataIndex="Speed">
<Renderer Fn="change" />
</ext:Column>
<ext:Column Header="方向" Width="70" DataIndex="Angle">
<Renderer Fn="change" />
</ext:Column>
<ext:Column Header="定位" Width="80" DataIndex="Location">
<Renderer Fn="change" />
</ext:Column>
<ext:Column Header="时间" Width="150" DataIndex="Date">
<Renderer Fn="change" />
</ext:Column>
<ext:Column Header="车辆状态" Width="300" DataIndex="Status">
<Renderer Fn="change" />
</ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel3" SingleSelect="true" runat="server">
</ext:RowSelectionModel>
</SelectionModel>
</ext:GridPanel>
</Content>
</ext:Panel>
</South>
this is a Javascript, when page loaded, will automatically run this function
function ChangeTitle() {
vehListPanel.setTitle(VehList_Title + " :" + nVehCount.toString());
btnVehDetails.setText(vVehDetails);
pnlMsgLst.setTitle(pMsgList);
ColumnModel3.setColumnHeader(1, pContent);
ColumnModel3.setColumnHeader(2, vVehNum);
ColumnModel3.setColumnHeader(3, vDevID);
ColumnModel3.setColumnHeader(4, pLongitude);
ColumnModel3.setColumnHeader(5, pLatitude);
ColumnModel3.setColumnHeader(6, pSpeed);
ColumnModel3.setColumnHeader(7, pAngle);
ColumnModel3.setColumnHeader(8, pLocate);
ColumnModel3.setColumnHeader(9, pTime);
ColumnModel3.setColumnHeader(10, pAlarmStatus);
}
This Function will change the columnmodel3 header.
Unfortunately, this only work on IIS, when i m trying on my real server, it will return an Error
ReferenceError: ColumnModel3 is not defined
ColumnModel3.setColumnHeader(1, pContent);
is this a bug? or what? any other way to change the column header ?
Server are using mono3.3.0,xsp4 and ext.net version is 1.3.0
P/S : other components like button,label are working proper with SetText and SetTitle. just ColumnModel having the problem.
Since, the way can't work, i m trying on firebug to change the header, and finally i get the way to change the header from firebug with javascript like this
vehColModel = parent.frames["StatisticFrm0_IFrame"].vehGrid.colModel
vehColModel.setColumnHeader(3, vVehNum);
vehColModel.setColumnHeader(4, vDevID);

How do I align appbarcommands to left?

I have several command on my appbar. I want to align two of them to the left. How would I do it?
I am using Html5/JS
Basically How do you do this in HTML5/JS?
<Page.BottomAppBar>
<AppBar x:Name="bottomAppBar" Padding="10,0,10,0">
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Button Style="{StaticResource EditAppBarButtonStyle}" Click="Button_Click"/>
<Button Style="{StaticResource RemoveAppBarButtonStyle}" Click="Button_Click"/>
<Button Style="{StaticResource AddAppBarButtonStyle}" Click="Button_Click"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource RefreshAppBarButtonStyle}" Click="Button_Click"/>
<Button Style="{StaticResource HelpAppBarButtonStyle}" Click="Button_Click"/>
</StackPanel>
</Grid>
</AppBar>
</Page.BottomAppBar>
See the example's below, section:'global' will align the element to right and section:'selection' will align the element to the left.
To align button to the right
<button id="mybutton2"
data-win-control=
"WinJS.UI.AppBarCommand"
data-win-options="{label:'Delete',
icon:'delete',
section:'global',
tooltip:'Delete item'}">
</button>
To align button's to the left
<button id="mybutton3"
data-win-control=
"WinJS.UI.AppBarCommand"
data-win-options="{id:'cmdCamera',
label:'Camera',
icon:'camera',
section:'selection',
tooltip:'Take a picture'}">
</button>
Sincel global is deprecated, I could not figure out how to align command buttons from left to right. The only solution I found is, add extra buttons and remove their label and icon.
I know this is ugly but had to find a work around and this is the one I had to choose.
<div class="toolbar" data-win-control="WinJS.UI.ToolBar">
<!-- Primary commands -->
<button data-win-control="WinJS.UI.Command" data-win-options="{
id:'cmdMentions',
label:'Mentions',
type:'button',
icon: 'accounts'
}"></button>
<button data-win-control="WinJS.UI.Command" data-win-options="{
id:'cmdBlocked',
label:'Blocked Accounts',
type:'button',
icon: 'blockcontact'
}"></button>
<button data-win-control="WinJS.UI.Command" data-win-options="{
id:'cmdConfig',
label:'Configuration',
icon: 'edit'
}"></button>
<button data-win-control="WinJS.UI.Command" data-win-options="{
id:'cmdConfig1'
}"></button>
<button data-win-control="WinJS.UI.Command" data-win-options="{
id:'cmdConfig2'
}"></button>
<button data-win-control="WinJS.UI.Command" data-win-options="{
id:'cmdConfig3'
}"></button>
<button data-win-control="WinJS.UI.Command" data-win-options="{
id:'cmdConfig4'
}"></button>
</div>
Just setting it via CSS works fine.
HTML:
<button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'cmdEdit',label:'Edit',icon:'edit'}"></button>
CSS:
#cmdEdit{
position:absolute;
left:50px;
}
Here is a great sample from CodeShow. This works perfectly.
<button
data-win-control="WinJS.UI.AppBarCommand"
data-win-options="{id:'cmdAdd',label:'Add',icon:'add', section:'global',tooltip:'Add item'}"></button>
<button
data-win-control="WinJS.UI.AppBarCommand"
data-win-options="{id:'cmdRemove',label:'Remove',icon:'remove', section:'global',tooltip:'Remove item'}"
onclick="appbar2.remove()"></button>
<hr />
data-win-control="WinJS.UI.AppBarCommand"
data-win-options="{type:'separator',section:'global'}" />
<button
data-win-control="WinJS.UI.AppBarCommand"
data-win-options="{id:'cmdDelete',label:'Delete',icon:'delete', section:'global',tooltip:'Delete item'}"></button>
<button
data-win-control="WinJS.UI.AppBarCommand"
data-win-options="{id:'cmdCamera',label:'Camera',icon:'camera', section:'selection',tooltip:'Take a picture'}"></button>