Alıntı Alex Harui <[email protected]>:
If you have a simple test case of “inclusion in exclusion” then we
should look at that. If the only way to see it is to run your
actual code that’s fine, but I may not have time to look right away.
The code piece I sent, is a standalone single test case which has
excludeFrom in excludeFrom.
If you replace the inner excludeFrom to includeIn you can see the
behavior quickly.
I replaced in the source below, you can check if you like.
I don’t know how many people have existing code with what I’ll call
“unnecessary states” in them, so I don’t know how valuable it will
be to the rest of the Royale folks to have an implementation that is
fault tolerant. It might be quick and simple to create a variant of
the states implementation that is fault tolerant. I don’t know,
because I haven’t looked to see what the root problem is.
I would stay with states, and either create that fault tolerant
version or just clean up the “unnecessary states”. Cleaning up the
unnecessary states will make your code more efficient than building
in fault tolerance.
Do you mean inclusion in exclusion is unnecessary or vice versa ?
Because the real case is not exclusion in exclusion but
inclusion exclusion, the sample is just for test as i mentioned.
If yes, than of course I would like to clean "unnecessary" things in
my project rather than doing unnecessary work.
Also, if you really want a fault tolerant states impl, it might be
“cheaper” to see if one of the other committers has time to create
it for you.
I do not like to waste neither my nor the other guys time for the
things that are not really needed to implement.
Thanks,
Serkan
My 2 cents,
-Alex
From: Serkan Taş <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Monday, October 21, 2019 at 7:02 PM
To: "[email protected]" <[email protected]>
Subject: Re: nested states not handled correctly
Hi Alex,
22.10.2019 00:30 tarihinde Alex Harui yazdı:
There might still be other bugs, but we have not tried to make the
code worth with exclusions within exclusions.
Also bugs in inclusion in exclusion
In keeping with the PAYG philosophy, we don’t want to burden the
States implementation with fault tolerance for such conditions. You
are welcome to create a variation of the States implementation with
that fault tolerance if you want.
My application flow is highly dependent on state implementation, so
I have simply 3 options :
1. redesign flow without state implementation
2. wait for a time to have the bugs fixed
3. try to fix it with my own
I am not sure which one feasible for my case, as I can not go P(AYG
)without one of them, advises ?
In your example, if the Form as excludeFrom loggedOutState, then
there should be no need for the child formItem to also have
excludeFrom loggedOutState.
Seems like i could not express my self clearly; This code piece is
just prepared for those who want to see the bug clearly and simply,
it is not the real case.
Here is the original :
https://drive.google.com/open?id=1AeLJndyE0SnDgCoSdIjgC6hfgubgFnPj<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdrive.google.com%2Fopen%3Fid%3D1AeLJndyE0SnDgCoSdIjgC6hfgubgFnPj&data=02%7C01%7Caharui%40adobe.com%7C5fcd64d4c06640dada0a08d75693efbc%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637073065701362634&sdata=2vgUNtRogCS4TyS1YV%2F86Ec9HEWVcg5QamVSuNGtelo%3D&reserved=0>
Of course, I could be wrong…
-Alex
Thanks,
Serkan
From: Serkan Taş
<[email protected]><mailto:[email protected]>
Reply-To: "[email protected]"<mailto:[email protected]>
<[email protected]><mailto:[email protected]>
Date: Monday, October 21, 2019 at 12:09 PM
To: "[email protected]"<mailto:[email protected]>
<[email protected]><mailto:[email protected]>
Subject: nested states not handled correctly
Hi,
Here is the simple example for test case.
In this example;
When you click on the button, the state is switched between two
states : loggedOutState/loggedInState.
And according to the state definition the form is shows and hides
according to the state.
The button "nevershown" is never shown because it is excluded from
both states loggedOutState/loggedInState.
The one which is strange is the form item "button1". It has the same
state with the button "nevershown" , but behaves like it has no
excludeFrom tag defined. It behaves similar when you use "includeIn"
tag.
I am going to debug the code and try to find-out what is wrong, but
if anybody has any solution and/or idea I highly appreciate.
Thank,
Serkan
Sample test case code
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C5fcd64d4c06640dada0a08d75693efbc%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637073065701372591&sdata=jjW31rXL5c8HG9Fa1ybbMEyeUiPPcswn%2FDjMsC3EtxA%3D&reserved=0>
xmlns:s="library://ns.apache.org/royale/spark"
xmlns:mx="library://ns.apache.org/royale/mx"
paddingBottom="0" paddingTop="0" paddingLeft="0" paddingRight="0"
height="100%" width="100%"
creationComplete="onCreationComplete()"
>
<fx:Metadata>
</fx:Metadata>
<s:states>
<s:State name="loggedOutState"/>
<s:State name="loggedInState"/>
<s:State name="jobDetailState"/>
</s:states>
<fx:Script>
<![CDATA[
import mx.formatters.DateFormatter;
import org.apache.royale.utils.Timer;
[Bindable]
var time:String;
private var ticker:Timer;
[Bindable]
private var counter:Number = 0;
protected function button_clickHandler(event:MouseEvent):void {
if(currentState == "loggedOutState") {
currentState = "loggedInState";
} else if(currentState == "loggedInState") {
currentState = "loggedOutState";
}
}
public function showTime():void {
ticker = new Timer(1,1);
ticker.addEventListener(Timer.TIMER, onTimerComplete);
ticker.start();
COMPILE::JS
{
var d = new Date();
time = d.toLocaleTimeString() + ' ' +
d.toLocaleDateString();
}
}
public function onCreationComplete():void {
showTime();
}
public function onTimerComplete(event:Timer):void {
showTime();
counter ++;
}
]]>
</fx:Script>
<fx:Declarations>
</fx:Declarations>
<s:layout>
<s:VerticalLayout gap="10" paddingRight="10"
paddingLeft="10" paddingTop="10" paddingBottom="20" />
</s:layout>
<s:Button id="button" width="200" label="Show/Hide"
click="button_clickHandler(event)"/>
<mx:Panel title="Form Container Example"
paddingBottom="10" paddingTop="10" paddingLeft="10"
paddingRight="10"
height="100%" width="100%">
<mx:Text width="100%"
text="Moving from one form field to another
triggers the validator."/>
<mx:Form width="100%" height="100%" excludeFrom="loggedOutState" >
<mx:FormHeading label="Enter values into the form."/>
<mx:FormItem label="First name" >
<mx:TextInput id="fname" width="200"/>
</mx:FormItem>
<mx:FormItem label="Date of birth (mm/dd/yyyy)">
<mx:TextInput id="dob" width="200"/>
</mx:FormItem>
<mx:FormItem includeIn="jobDetailState" >
<s:Button id="button1" width="200" label="Time : {time}" />
</mx:FormItem>
</mx:Form>
</mx:Panel>
<s:Button id="nevershown"
excludeFrom="loggedOutState,loggedInState" label="Never Shown
Button" />
</s:Application>
--
Serkan Taş
Mobil : +90 532 250 07 71
Likya Bilgi Teknolojileri
ve İletişim Hiz. Ltd. Şti.
www.likyateknoloji.com
--------------------------------------
Bu elektronik posta ve onunla iletilen bütün dosyalar gizlidir. Sadece
yukarıda isimleri belirtilen kişiler arasında özel haberleşme amacını
taşımaktadır. Size yanlışlıkla ulaşmışsa bu elektonik postanın
içeriğini açıklamanız, kopyalamanız, yönlendirmeniz ve kullanmanız
kesinlikle yasaktır. Lütfen mesajı geri gönderiniz ve sisteminizden
siliniz. Likya Bilgi Teknolojileri ve İletişim Hiz. Ltd. Şti. bu
mesajın içeriği ile ilgili olarak hiç bir hukuksal sorumluluğu kabul
etmez.
This electronic mail and any files transmitted with it are intended
for the private use of the persons named above. If you received this
message in error, forwarding, copying or use of any of the information
is strictly prohibited. Please immediately notify the sender and
delete it from your system. Likya Bilgi Teknolojileri ve İletişim Hiz.
Ltd. Şti. does not accept legal responsibility for the contents of
this message.
--------------------------------------