Custom Page
Create and use a Custom Page.
The example is based on DemoResultClient
from scala-adapters.
The Custom Page displays the incoming images at random positions and in random sizes.
Constraints
- You have created the project with scala-adapters-g8.
- You have your Job Results ready (job-results).
- A basic understanding of Type Classes in Scala (see scala-type-classes).
Shared Data
We can reuse /shared/src/main/scala/shared/GetStartedResult
Create HtmlElement
First we create the HTMLElement with for the image /client/src/main/scala/client/GetStartedClient.scala
randomImgStyle
creates the random position and in random size of the image.
Extend the UIStore
We extend the UIStore with UIGetStartedStore
The idea of a UIStore is, that changing the UIState is done just in one place.
Create the Client
This is more or less a composition of HTMLElements, done with Binding.scala.
Here is a small intro to Binding.scala binding-google-maps.
Update Client Application
We have to update our client slightly /client/src/main/scala/client/GetStartedClient.scala
As we have now our implementation for our CUSTOM_PAGE
.
Check Result
Running the Project and running the Job, should give you this: