<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    why not to use Dialog instead of Page for this use case?<br>
    <br>
    <div class="moz-cite-prefix">05.06.2014 21:28, Michael Neufing
      пишет:<br>
    </div>
    <blockquote
      cite="mid:1401982082.68101.YahooMailNeo@web28701.mail.ir2.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
        Lucida Grande, sans-serif;font-size:10pt">
        <div style="" class=""><span style="" class="">Hi </span>Chris,</div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;" class=""><br>
        </div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: HelveticaNeue,Helvetica
          Neue,Helvetica,Arial,Lucida Grande,sans-serif;
          background-color: transparent; font-style: normal;" class="">one
          problem I see with your solution is that the App could take
          long time to launch, when there are a bunch of Pages that have
          to be initialized at launch (depending on the structure of the
          Pages).<br>
        </div>
        <div style="" class=""> <br>
          So I would prefer lazy loading Pages, which will be
          initialized when it is needed.<br>
          <br>
          <br>
          Mit freundlichen Grüßen,<br>
          <br>
        </div>
        <div style="" class="">Michael Neufing<br style="" class="">
        </div>
        <div class="qtdSeparateBR"><br>
          <br>
        </div>
        <div style="display: block;" class="yahoo_quoted">
          <div class="" style="font-family: HelveticaNeue, Helvetica
            Neue, Helvetica, Arial, Lucida Grande, sans-serif;
            font-size: 10pt;">
            <div class="" style="font-family: HelveticaNeue, Helvetica
              Neue, Helvetica, Arial, Lucida Grande, sans-serif;
              font-size: 12pt;">
              <div style="" class="" dir="ltr"> <font style="" class=""
                  size="2" face="Arial"> Christopher Lamb
                  <a class="moz-txt-link-rfc2396E" href="mailto:christopher.lamb@thurweb.ch"><christopher.lamb@thurweb.ch></a> schrieb am 16:40
                  Donnerstag, 5.Juni 2014:<br style="" class="">
                </font> </div>
              <br style="" class="">
              <br style="" class="">
              <div style="" class="">
                <div style="" class="" id="yiv0917048400">
                  <div style="" class=""> Hi Markus<br style="" class=""
                      clear="none">
                    <br style="" class="" clear="none">
                    In my app I chose to instantiate all my Pages in the
                    same place. Each of the pages has a declaration in a
                    separate qml file (e.g. MainPage.qml,
                    AreaSelectionPage.qml).<br style="" class=""
                      clear="none">
                    <br style="" class="" clear="none">
                    With this architecture none of the declarations need
                    to know about the previous or next page. It is not
                    their concern. Instead they emit signals NextPage,
                    BackPageWithInfo, and Cancelled. In the signal
                    handler in the page instantation I do the actual
                    pushing and popping, and because all pages are
                    instantiated in the same scope,  they are all
                    available to be pushed / popped to. (see code
                    example below).<br style="" class="" clear="none">
                    <br style="" class="" clear="none">
                    The downside is that all the pages are created on
                    startup (regardless of if they are ever visited).
                    For lightweight pages this is not a problem, but for
                    some pages this might be a problem. For these I
                    dynamically create the page content when the page is
                    visible.<br style="" class="" clear="none">
                    <br style="" class="" clear="none">
                    Grüsse<br style="" class="" clear="none">
                    <br style="" class="" clear="none">
                    Chris<br style="" class="" clear="none">
                    <br style="" class="" clear="none">
                    <br style="" class="" clear="none">
                  </div>
                  <div style="" class="">
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">ApplicationWindow<span class="" style="color:#c0c0c0;"> </span>{</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">    </span><span class="" style="color:#800000;">id</span>:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#000000;">appWindow</span></pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">    .......</span></pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">    </span><span class="" style="color:#800000;">initialPage</span>:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#000000;">mainPage</span></pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">    </span><span class="" style="color:#800080;">MainPage</span><span class="" style="color:#c0c0c0;"> </span>{</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">id</span>:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#000000;">mainPage</span></pre>
                                ....<br style="" class="" clear="none">
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">onNextPage</span>:<span class="" style="color:#c0c0c0;"> </span>{</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">             </span><span class="" style="color:#808000;">if</span><span class="" style="color:#c0c0c0;"> </span>(<span class="" style="font-style:italic;color:#2985c7;">pageType</span><span class="" style="color:#c0c0c0;"> </span>==<span class="" style="color:#008000;">"SMS"</span>)<span class="" style="color:#c0c0c0;"> </span>{</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">                </span><span class="" style="font-style:italic;color:#0055af;">console</span>.log(<span class="" style="color:#008000;">"smsType</span><span class="" style="color:#c0c0c0;"> </span><span class="" style="color:#008000;">is:</span><span class="" style="color:#c0c0c0;"> </span><span class="" style="color:#008000;">"</span><span class="" style="color:#c0c0c0;"> </span>+<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#2985c7;">smsType</span>)</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">                </span><span class="" style="color:#808000;">if</span><span class="" style="color:#c0c0c0;"> </span>(<span class="" style="font-style:italic;color:#2985c7;">smsType</span><span class="" style="color:#c0c0c0;"> </span>==<span class="" style="color:#008000;">"Default"</span>)<span class="" style="color:#c0c0c0;"> </span>pageStack.push(<span class="" style="font-style:italic;color:#000000;">smsPage</span>,<span class="" style="color:#c0c0c0;"> </span>{lati:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#000000;">mainPage</span>.getLati(),<span class="" style="color:#c0c0c0;"> </span>longi:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#000000;">mainPage</span>.getLongi(),<span class="" style="color:#c0c0c0;">
 </span>alti:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#000000;">mainPage</span>.getAlt
 i(),<span class="" style="color:#c0c0c0;"> </span>area_id:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#2985c7;">area_id</span>,<span class="" style="color:#c0c0c0;"> </span>template_id:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#2985c7;">template_id</span>,<span class="" style="color:#c0c0c0;"> </span>msg_status:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#2985c7;">msg_status</span>,<span class="" style="color:#c0c0c0;"> </span>lastPage:<span class="" style="color:#c0c0c0;"> </span><span class="" style="color:#008000;">"mainPage"</span>})</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">            </span>}</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">            </span><span class="" style="color:#808000;">else</span><span class="" style="color:#c0c0c0;"> </span>{</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">                </span>pageStack.push(<span class="" style="font-style:italic;color:#000000;">areaSelectionPage</span>)</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">            </span>}</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span>}</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">    </span>}</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">    </span><span class="" style="color:#800080;">AreaSelectionPage</span><span class="" style="color:#c0c0c0;"> </span>{</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">id</span>:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#000000;">areaSelectionPage</span></pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">....</span></pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">onBackPageWithInfo</span>:<span class="" style="color:#c0c0c0;"> </span>{</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">            </span><span class="" style="font-style:italic;color:#000000;">mainPage</span>.areaSet<span class="" style="color:#c0c0c0;"> </span>=<span class="" style="color:#c0c0c0;"> </span>true;</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">            </span><span class="" style="font-style:italic;color:#000000;">mainPage</span>.area_id<span class="" style="color:#c0c0c0;"> </span>=<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#2985c7;">area_id</span>;</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">            </span>pageStack.pop(<span class="" style="font-style:italic;color:#000000;">mainPage</span>);</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span>}</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">onCancelled</span>:<span class="" style="color:#c0c0c0;"> </span>pageStack.pop(<span class="" style="font-style:italic;color:#000000;">mainPage</span>);</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">     </span>}</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">    </span><span class="" style="color:#800080;">SMSPage</span><span class="" style="color:#c0c0c0;"> </span>{</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">id</span>:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#000000;">smsPage</span></pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">....</span></pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">onNextPage</span>:<span class="" style="color:#c0c0c0;"> </span>{</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">            </span>pageStack.push(<span class="" style="font-style:italic;color:#000000;">contactSelectionPage</span>,<span class="" style="color:#c0c0c0;"> </span>{area_id:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#2985c7;">area_id</span>,<span class="" style="color:#c0c0c0;"> </span>template_id:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#2985c7;">template_id</span>})</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span>}</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">     </span>}</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">    </span><span class="" style="color:#800080;">ContactSelectionPage</span><span class="" style="color:#c0c0c0;"> </span>{</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">id</span>:<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#000000;">contactSelectionPage</span></pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">....</span></pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">onBackPageWithInfo</span>:<span class="" style="color:#c0c0c0;"> </span>{</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">            </span><span class="" style="font-style:italic;color:#0055af;">console</span>.log(<span class="" style="color:#008000;">"About</span><span class="" style="color:#c0c0c0;"> </span><span class="" style="color:#008000;">to</span><span class="" style="color:#c0c0c0;"> </span><span class="" style="color:#008000;">pop</span><span class="" style="color:#c0c0c0;"> </span><span class="" style="color:#008000;">smsPage;</span><span class="" style="color:#c0c0c0;"> </span><span class="" style="color:#008000;">contactName:</span><span class="" style="color:#c0c0c0;"> </span><span class="" style="color:#008000;">"</span><span class="" style="color:#c0c0c0;"> </span>+<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#2985c7;">contactName</span><span class="" style="color:#c0c0c0;"> </sp
an>+<span class="" style="color:#c0c0c0;"> </span><span class="" style="color:#008000;">",</span><span class="" style="color:#c0c0c0;"> </span><span class="" style="">contactPhone:</span><span class="" style="color:#c0c0c0;"> </span><span class="" style="color:#008000;">"</span><span class="" style="color:#c0c0c0;"> </span>+<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#2985c7;">contactPhone</span>);</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">            </span><span class="" style="font-style:italic;color:#000000;">smsPage</span>.contactName<span class="" style="color:#c0c0c0;"> </span>=<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#2985c7;">contactName</span>;</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">            </span><span class="" style="font-style:italic;color:#000000;">smsPage</span>.contactPhone<span class="" style="color:#c0c0c0;"> </span>=<span class="" style="color:#c0c0c0;"> </span><span class="" style="font-style:italic;color:#2985c7;">contactPhone</span>;</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">            </span><span class="" style="font-style:italic;color:#000000;">smsPage</span>.lastPage<span class="" style="color:#c0c0c0;"> </span>=<span class="" style="color:#c0c0c0;"> </span><span class="" style="color:#008000;">"contactSelectionPage"</span>;</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">            </span>pageStack.pop(<span class="" style="font-style:italic;color:#000000;">smsPage</span>);</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span>}</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">        </span><span class="" style="color:#800000;">onCancelled</span>:<span class="" style="color:#c0c0c0;"> </span>pageStack.pop(<span class="" style="font-style:italic;color:#000000;">smsPage</span>);</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;"><span class="" style="color:#c0c0c0;">     </span>}</pre>
                    <pre class="" style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;">}</pre>
                    <style style="" class="" type="text/css">
#yiv0917048400 p, #yiv0917048400 li {white-space:pre-wrap;}
</style><br style="" class="" clear="none">
                    <br style="" class="" clear="none">
                    <br style="" class="" clear="none">
                    <br style="" class="" clear="none">
                    <br style="" class="" clear="none">
                    <br style="" class="" clear="none">
                    <div style="" class="" id="yiv0917048400yqt87829">
                      <div style="" class="">On 05.06.14 14:43, <a
                          moz-do-not-send="true" style="" rel="nofollow"
                          shape="rect" class=""
                          ymailto="mailto:info@flyingfischer.ch"
                          target="_blank"
                          href="mailto:info@flyingfischer.ch">info@flyingfischer.ch</a>
                        wrote:<br style="" class="" clear="none">
                      </div>
                      <blockquote style="" class="" type="cite">Thanks
                        for your inputs! <br style="" class=""
                          clear="none">
                        <br style="" class="" clear="none">
                        Calling <br style="" class="" clear="none">
                        <br style="" class="" clear="none">
                        PreviousPage.topic = "MyTopic"; <br style=""
                          class="" clear="none">
                        pageStack.pop(); <br style="" class=""
                          clear="none">
                        <br style="" class="" clear="none">
                        gives me a ReferenceError: PreviousPage is not
                        defined. <br style="" class="" clear="none">
                        <br style="" class="" clear="none">
                        PreviousPage.qml and property string topic do
                        exist. <br style="" class="" clear="none">
                        <br style="" class="" clear="none">
                        Thanks for your patience! <br style="" class=""
                          clear="none">
                        <br style="" class="" clear="none">
                        Markus <br style="" class="" clear="none">
                        <br style="" class="" clear="none">
                        _______________________________________________
                        <br style="" class="" clear="none">
                        SailfishOS.org Devel mailing list <br style=""
                          class="" clear="none">
                        To unsubscribe, please send a mail to <a
                          moz-do-not-send="true" style="" rel="nofollow"
                          shape="rect" class=""
                          ymailto="mailto:devel-unsubscribe@lists.sailfishos.org"
                          target="_blank"
                          href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a>
                        <br style="" class="" clear="none">
                      </blockquote>
                    </div>
                    <br style="" class="" clear="none">
                  </div>
                </div>
                <br style="" class="">
                <div style="" class="" id="yqt41930">_______________________________________________<br
                    style="" class="" clear="none">
                  SailfishOS.org Devel mailing list<br style="" class=""
                    clear="none">
                  To unsubscribe, please send a mail to <a
                    moz-do-not-send="true" style="" class=""
                    shape="rect"
                    ymailto="mailto:devel-unsubscribe@lists.sailfishos.org"
                    href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></div>
                <br style="" class="">
                <br style="" class="">
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to <a class="moz-txt-link-abbreviated" href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></pre>
    </blockquote>
    <br>
  </body>
</html>