Note that there are some explanatory texts on larger screens.

plurals
  1. PO"States" in javascript or php?
    primarykey
    data
    text
    <p>I've been working with FLEX for while and I had there some "states" declaration. For those who are not sure what I mean, it's like a couple of different pages between you can translate, setting a current state.<br> Now I want to get started with Facebook development, and I don't know how to pass between pages I created with html. I guess that would be possible using javascript rather than php, but I am not sure how. Can someone please help me? </p> <p>A scheme of what I would like to do is: </p> <pre><code> tigger1 State A--------------------&gt;State B trigger2 State B--------------------&gt;State C </code></pre> <p>The following example shows a login panel with 2 states: <code>default</code>, for showing the login form, and <code>Register</code> for showing the form for registration. The current state change is triggered by an action (in this case, pressing the <code>Linkbutton</code>). Mainly, what states do, is displaying proper content based on what the user should be able to do under each state. So, if for example I want to do a payment form, after the user attempts to make the payment, if the payment was successfully done, I would have a "Thank_you" state, while if the payment failed, I would have a "Try_again" state. How can this be done using php/js?</p> <p>Code sample of <a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf63611-7ffa.html#WS2db454920e96a9e51e63e3d11c0bf69084-7dd4" rel="nofollow">login/register panel</a> (from adobe flex website, also running example and full code can be found in the link):</p> <pre><code>&lt;!-- The Application class states property defines the view states.--&gt; &lt;s:states&gt; &lt;s:State name="default"/&gt; &lt;s:State name="Register"/&gt; &lt;/s:states&gt; &lt;!-- Set title of the Panel container based on the view state.--&gt; &lt;s:Panel id="loginPanel" title="Login" title.Register="Register"&gt; &lt;s:Form id="loginForm"&gt; &lt;s:FormItem label="Username:"&gt; &lt;s:TextInput/&gt; &lt;/s:FormItem&gt; &lt;s:FormItem label="Password:"&gt; &lt;s:TextInput/&gt; &lt;/s:FormItem&gt; &lt;s:FormItem id="confirm" label="Confirm:" includeIn="Register"&gt; &lt;!-- Add a TextInput control to the form ONLY for the Register view state. --&gt; &lt;s:TextInput/&gt; &lt;/s:FormItem&gt; &lt;s:FormItem&gt; &lt;!-- Use the LinkButton to change view state.--&gt; &lt;!-- Set label of the control based on the view state.--&gt; &lt;mx:LinkButton id="registerLink" label="Need to Register?" label.Register="Return to Login" click="currentState="Register" click.Register="currentState="default"/&gt; &lt;s:Button id="loginButton" label="Login" label.Register="Register"/&gt; &lt;/s:FormItem&gt; &lt;/s:Form&gt; &lt;/s:Panel&gt; </code></pre> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload