My project is based on jsf & primefaces.
Recently there was a requirement from the customer to add 3D capabilities so I was thinking about WebGL.
My question is how can I use the data from the bean (server side)?
While via jsf API it's very simple I don’t know how to pass the values to the JS function.
Is it possible or perhaps there is some other why ?
Please advise since I am new to WebGL.
Thanks
Two solutions may be possible for you:
Embed JavaScript in JSF to bring the data from the bean to WebGL.
Create a web service that returns the data you need and call it from any ajax lib in JavaScript.
Related
I was looking for a webframework to use in an application for a call center. 3 important requirements would probably be
an ability for a quick, localized refresh of the screen
a need to collect information from 3-4 disparate systems
the roadmap/longevity of the framework itself
Was looking at JSF & AngularJS (I have worked on neither). Am I right in considering them as alternatives or are they meant for very different things. How do these measure against the 3 considerations above.
No, angular is clearly not an alternative to JSF. JSF is a server side java application framework (with some ajax features). Angular is a client side javascript framework. It's a bit like comparing JQuery and JSPs.
I am looking at the HDIV framework to implement it in my Grails application. Looks like the framework is more user friendly to Struts/java based applications. They do say it can be configured on other frameworks. This is what it exactly says:
It is possible to use HDIV in applications that don’t use Struts 1.x, Struts 2.x, Spring MVC or JSTL, but in this case it is necessary to modify the application (JSP pages).
I see that we need to modify the editable and non editable data being sent to the server (one of the strategies is to cypher code the hidden field and add a state parameter to link urls.)
And in the response we get back this data and use a validate() function to do integrity checks.
The sample grails-HDIV project on GITHUB is really basic with no details.
Has anyone implemented it on grails?
Thanks
Priyank
I've just written a plugin for this very thing. I'll see if my company will let me release it and if so I'll inform you.
I have a html mockup with lots of css images refs etc. and need to convert it to a jsf 2.0 app.
I know of the facelets attributes jsfc, but as i see it this does not work for jsf tags that need an attribute itself. Say you have a simple login form that needs to be converted. within there is a submit button. does not work, my action will not be called.
jsfc="h:button" action="#{auth.authenticate}"
I am having a hard time to believe that the interaction between developers and designers still is an unsolved problem, after all those iterations in Java EE. Designers do their stuff in html, css, maybe js but no jsf tags or el code. So there must be an efficient way how we can annotate html where the only difference between rendered from the filesysem and rendered from a jsf container is that the later has dynamic functionality.
anyone?
As to the concrete problem as stated in your question, you're confusing <h:button> with <h:commandButton>. The <h:button> sends a GET request and supports a navigation case outcome only and the <h:commandButton> sends a POST request and can invoke a bean action method.
So fix it accordingly as
jsfc="h:commandButton" action="#{auth.authenticate}"
or
jsfc="h:button" outcome="nextPage"
I'll ignore the remnant of your question as that's subjective. Try http://programmers.stackexchange.com instead (only try to make it a bit more constructive, or it'll get closed as non-constructive).
See also:
JSF View Declaration Language Documentation - the ultimate JSF tag documentation
I'm working with my team to create an enterprise level web application with Grails, but I don't see any "out of the box" solution to dealing with browser history when using grails with AJAX. Can someone point me to some documentation so that I can nail this?
Thanks a ton.
Grails is predominantly a server-side framework. All it provides in terms of client-side functionality are some tags to make it easy to call the server via AJAX. I'm not aware of any functionality in the core framework to support using the back/forward buttons when AJAX calls are made.
You might find something in a plugin, but I doubt it. Your best bet is to look for this functionality in whichever JS library you're using (YUI, JQuery, Dojo, etc.)
Typically this is done by changing the location.hash property on the page. This corresponds to a string you can add after the current url with a #. Adding or modifying this part of the URL will keep you on the same page, but add an additional history entry.
The jQuery BBQ plugin is a very useful framework to manage the hash. It contains a number of useful methods to manage the hash property as key/value pairs, the same way the regular URL query string works.
How suitable is ASP.NET MVC for developing anything like
http://www.google.com/ig?
I haven't seen or failed to find any examples yet. Does the MVC approach imply that the user interface is not supposed to look like that?
Check out http://aspspider.info/lakkakula/local.aspx, it is Web 2.0 Portal developed using Asp.Net MVC 1.0, Microsoft Ajax Client Templates and jQuery with drag and drop widget personalization much like google.com/ig.
MVC is quite suitable for such a UI. Your main controller can render with a list of the widgets the user has defined, or an ajax call to a method returning a JsonResult can be used... this can generate the wrappers client-side calling for each partial vie for the corresponding controls. I would think that MVC would simplify things quite a bit.
MVC + jQueryUI would be about all you'd need...
I guess a little bit more clarification, what exactly do you mean by "suitable"?
One method might be for each available "widgit" to be a controller, and then you can use jQuery (or whatever you want) to call the specified method and render. The page would then have a series of "lists" (which you can store in the DB) against the user and you can simply order those lists to display the relevant widgits in the correct order.
Obviously, that's a VERY large simplification....
See the tutorial Developing Web 2.0 Portal using ASP.NET MVC, Microsoft Ajax Client Templates and jQuery with drag and drop widget personalization.