Is there any Wicket-like web framework to use with Scala (besides lift)? - scala

I want to start a project using the Scala language. While searching for web frameworks I've found Lift. However, it is not what I was looking for: a web framework that has complete separation of HTML and code. Lift does have some nice features (and a learning curve) but we need to have complete separation of HTML and code. I was hoping to find something like Wicket, Tapestry or Barracuda for the Scala language.
Although it is nice to be able to reuse html templates, it is more important to us to have the HTML templates work as a "static application" mockup. In Tapestry we can just put links in the static templates and use that to have static navigation and a sort of prototype of the application.
So, do you know of any other web framework that is easy to work with the Scala language?
Thanks,
Luis

Here it is I can understand why you might want it pure Scala, but you haven't stated that's necessary, and with the techniques defined within the blog post, and there is another blog which also helps, you should be able to get it close enough to what you desire.

Tapestry 5 has many similarities with Wicket and works very well with Scala. I haven't tried it myself, but Francois Armand has being doing it for some time and he's writing about in in his blog.

Try Context. It is a component based framework written in Java but I have used it with Scala without much difficulties.
Context uses XSL as templating language which forces a sharp separation between logical presentation (DOM-tree) and actual presentation (HTML/CSS/JS).
You can even, with little effort, create prototypes and mocked views by faking the DOM-tree and trying invidual components in different combinations.

Related

How can I use Material UI in Scala JS?

My team works with Scala.js and I wanna use Material-UI. But those two's code types look very different. Most of the examples in Material-UI seem to be based on regular Javascript.
I've tried to search about that, but the information is very limited, so I couldn't get any useful information. Is there anyone using Material-UI with Scala.js?
When using most JS libraries from Scala.js, you need what is called a "facade" -- a strongly-typed Scala wrapper that describes how to use the weakly-typed JavaScript library.
There appear to be several Material UI facades, but most of them look a bit half-baked. I'd guess that the most mature is the one in Chandu's scalajs-react-components project -- in general, Chandu has done more with React in Scala.js than most folks. The general top-level page for the project can be found here.

Playframework twirl (scala templates) guides

Good day all
note: Play! Framework newbie here.
I am trying to familairze myself using scala templates for a project, but cannot quite seem to get it right, nor do the examples found online always work correctly.
Problem:
I have to have searched for small solutions for a problem, and frequently encounter syntactical errors or the like.
I decided to search for some comprehensive guide to building Scala templates used as views, but found only fragments and pieces of code that may help.
Documentation Provided:
Play Scala Documentation
Play provided examples:
Examples in Java and Scala
Variables:
Declaring variables
Declaring Variable 2
Displaying Data:
Displaying data using functions
Display Items in alternating rows table with indicies
Using blocks
Displaying Block Scala variables in html see the use of { and }
Passing Data / Objects:
Passing objects between views and controllers
Further Reading:
Play Google Groups thread
Question:
note: I am asking this only since I have no idea how to proceed
Is there any comprehensive guide for building Scala templates. Documented to such a degree as one would find for Play! Framework?
TL;DR Where did you learn / discover how to create simple to complex Play! Scala templates?
Here you have pack of examples and Play seed projects:
https://playframework.com/download#examples
You should look for a blogposts about play templates:
http://mariussoutier.com/blog/2012/04/27/play-framework-2-0-templates-part-1-parameters/
You should read play documentation. It isn't perfect, but very helpful.
https://www.playframework.com/documentation/2.6.x/ScalaTemplates
I would say the templates are somehow intuitive. You write html and when you want to do some scala you should start the expression with an #.
When I find myself struggling with the syntax I just google "scala play twirl map" if I want to know the syntax for the .map (twirl is the real name of the template engine)
Besides that, the documentation under https://www.playframework.com/documentation/2.6.x/ScalaTemplates should be the best resource

Proper designer-first reall world app example in Scala Lift

Trying to learn lift, and i'm looking for a somehow bigger example than HelloWorld (something like spring pet-clinic).
Especially i'm looking at advanced templating in designer friendly manner (as less code in snippets as possible).
I tried to look at example Lift apps https://github.com/lift/examples
But they heavily mix html in their snippets https://github.com/lift/examples/blob/master/nuggets/skittr/src/main/scala/com/skittr/snippet/UserMgt.scala
So can anyone link me to a source of real world app that uses designer-friendly templating?
Hmmm. My hobbie project partially corresponds to what you ask, I think.) https://github.com/vn971/roboCup
It's not all good, I started it when only learning Scala and I see now that it has poor decision choises in some places. But, for example, you can see code-free templates here:
https://github.com/vn971/roboCup/blob/master/src/main/webapp/swiss.html
Ajax bindings can be seen here:
https://github.com/vn971/roboCup/blob/master/src/main/webapp/admin.html
It unfortunately uses html in the code somewhere, too. It's also very little, uses actors (both lift's and akka), has no database at all (only the state of the tournament matters and it's not persisted).
try lift in action book , there is a build of a big web app almost step by step and the project is also on github so you can download it also from there

GWT - Graphical representation of a tree

I want to represent a Tree in my GWt Project in a another way as the standard graphical
representation.
Drag & Drop should be able.
Like this one:
http://s1.directupload.net/file/d/2603/yzo588bb_jpg.htm
Do you know a good GWT Extension to realize this?
I have already looked at the Google Web Toolkit Gallery.
Do you think something like this would solve the problem?
http://gwtgallery.appspot.com/about_app?app_id=86
I'm using Raphaël Gwt for such graphic stuff.
I've tried Vectomatic once, but it is no fun to write, because it seems like the author had no Idea what a namespace is (Several classes starting with OMSVG) and it doesn't "feel" like writing a java programm.
On the other side, with Raphël-GWT is a binding to a javascript-library, thus you have (llittle) Preformance tradeoff for loading an external Cross-browser javascript library.

Has anybody tried the new MVC HTML5 Toolkit from Codeplex?

I saw a tweet today referring to the MVCHTML5 helpers on Codeplex. I'm wondering if
Anybody has tried this out yet?
Does it add any real significant benefit over the default HTML helpers?
What are the actual HTML5 aspects of this library?
I would definitely recommend checking it (I am a little biased as I wrote it!).
But it's just a simple DLL that you include in your MVC project and it will give you all the benefits of HTML5 input types. If the browser doesn't support it - it will just fall back to a normal textbox.
To answer your questions though, it only adds a benefit if you are looking to add HTML5 functionality to your application or website. It uses the exact same syntax and the normal HTML helpers that ASP.net MVC comes with, but this just makes life easier if you are looking to add HTML5 functionality to your site.
Here is another link regarding HTML5 and the input types: http://diveintohtml5.ep.io/
I've just been trying it out, it doesn't seem to support the Required DataAnnotations for unobtrusive client side validation