0

PrimeFaces is a Java library which provides common frontend web components (e.g., dialogs, tables, select menus). The advantage of using PrimeFaces is that when you use a PrimeFaces component, you only need to tell it which data to use and which property you want to update server-side. The PrimeFaces library takes it from there, creating the component on the screen, displaying the data, and handling the Ajax interactions with the server-side code.

Is there any equivalent to this in the Ruby or Python web programming worlds? It seems to me like the alternative is coding your components up from scratch each time, manually handling the Ajax, etc., which sounds crazy.

How do non-Java web developers handle this?

Kiwi
  • 1,083
  • 11
  • 26
  • I'd like to comment out that PrimeFaces is a JSF component suite and JSF is a *component-based* framework. On the other hand, django and rails are MVC frameworks. So There is no such thing as PrimeFaces for django or rails because they are use a different paradigm for web development (they are more similar to struts or spring mvc). So to find something similar to Primefaces you'd need to move away from django or rails and find a component based framework for python or ruby. – Serafeim Jan 24 '14 at 14:46
  • I'm actually pretty agnostic about the backend framework - I just wonder how non-JSF developers avoid needless code duplication on the frontend. PrimeFaces provides components to handle common needs if you're using JSF, but what is available for everyone else? Or does everyone truly code all of these things from scratch every time? – Kiwi Jan 24 '14 at 14:49
  • 1
    Well this is a question that applies to Spring MVC or Struts developers :) And yes, most of the times you handle ajax and components however there are other advantages... Take a look here http://stackoverflow.com/questions/4801891/difference-between-request-mvc-and-component-mvc and generally search for "Component based vs mvc frameworks" – Serafeim Jan 24 '14 at 14:51

1 Answers1

0

Well, it may sound crazy, but I used RailsAdmin for this. It generates views, based on model fields and relationships. By 'generates views', I mean that it does it in a runtime (you're not going to have a copy of views in your application and etc.) Basically, this gem provides you basic functionality to manage your data from the beginning (without spending time on creating views and controllers). And ofc, it can't be used as a straight equivalent to PrimeFaces. But for prototyping stage, I think, it will do nicely.

marvelousNinja
  • 1,510
  • 9
  • 15
  • Thanks for your answer! This seems more similar to [Spring Roo](http://projects.spring.io/spring-roo/) in creating screens for CRUD operations. I was thinking more of individual frontend components, for example, an input box which triggers a server method and partial page refresh when the users types in it. – Kiwi Jan 24 '14 at 15:15
  • 1
    I don't think there's a simple solution for that in Rails 'cause of strict separation of concerns. However, you can play with LOTS of JavaScript frameworks in mix with Rails. For example, AngularBootstrap is an AngularJS + Bootstrap combo, with lots of components. This way, you will use Rails strictly as a backend, and this framework as a frontend component. You still going to need write some bindings (between frontend and backend) though. – marvelousNinja Jan 24 '14 at 15:30