0

I would like to know if, or how to, combine Rikulo UXL templates -- That is, provided it is possible.

Just to keep things simple I took the ScrollViewDemo and LoginDemo from the UXL Overview web page as an experiment. My aim would is to see something like this (which you cannot do, of course) in Dart.

index.dart

   <body>
     <style> ... </style>

     <script src="ScrollViewDemo.dart"  type="application/dart" ></script>
     <script src="SignInDemo.dart"      type="application/dart" ></script>

     <script src="packages/browser/dart.js"></script>
     </body>
   </html>

In Dart you are only permitted one dart script per document.

So what I'm looking for is a way to do as shown above with Rikulo mark-up.

Can we do that?

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
will
  • 4,799
  • 8
  • 54
  • 90

1 Answers1

0

There are a few options for adding a tree of views into the document. Please refer to addToDocument for details.

For example, you can have two different DIV in the HTML pages:

<body>
  <div id="scrollView" class="scrollView"></div>
  <div id="signinView" class="signinView"></div>

Then, you can invoke addToDocument with the target element you prefer:

scrollView.addToDocument(node: document.query("#scrollView"));

Then, the other program can add the sign-in view to #signinView.

You can have multiple dart programs running at the same page as long as they cooperate, such as residing separated DIV blocks as illustrated. The only catch is that each dart program will be compiled a separated JS file and the resulted size will be larger than putting them all in the same program.

Tom Yeh
  • 1,987
  • 2
  • 15
  • 23
  • Thanks for those tips. I want to be clear though that the question is how to combine 'views' statically in a "*What; Not-how*" approach. – will Mar 30 '14 at 11:38
  • One different point. Am I correct in understanding that each of the
    , structures shown above are separate Dart threads, "*You can have multiple dart programs running at the same page*..."; one per view?
    – will Mar 30 '14 at 12:12
  • There is no limitation. It is about how you structure and modulize your application. Splitting into multiple Dart programs or putting in the same program (with optional separated libraries) are up to you. – Tom Yeh Apr 02 '14 at 08:14
  • That's good news. The question was/remains: "HOW TO combine Rikulo UXL templates/views"? This response does not describe such a method. – will Apr 02 '14 at 22:43