Posts

Showing posts with the label JSF

Digital Marketing

How to solve: Form submit does not trigger action method on JSF commandlink or commandbutton

First, make sure those commandlink or commandbutton is inside the <h:form> and </h:form> If still not woking, check whether you have "rendered" or "disabled" attribute for that component and your bean is request scope. You should change it from request scope to view scope. This is because if your bean is request scope, your "rendered" or "disabled" attributes are evaluated in different condition during processing the form submit from during displaying the form. JSF won't invoke the command if "rendered" or "disabled" attribute evaluates as "false".

Primefaces vs AngularJS

Primefaces – really easy to use AngularJS – fast + a great prospect http://cse.google.ca/cse?cx=partner-pub-4718006397759079:6694309064&ie=UTF-8&q=angularjs,jquery,JSF

Server-Side-State-Saving vs Client-Side-State-Saving in JSF

Client side state saving needs the state to be serialized, encrypted and base64 encoded. Saving state on the client uses  more bandwidth as well as more client resources , while saving it on the server uses more server resources . You may also want to save state on the client if you expect your users to  disable cookies . By default, the state is saved on the server. If state is saved on the client, the state of the entire view is rendered to a hidden field on the page. In server side state saving by default in MyFaces, the state is serialized but not encrypted or base64 encoded. It is possible to disable serialization in MyFaces and make it faster.

JSF page redirection Example

To enable the page redirection, append faces-redirect=true at the end of the view name: return FacesContext.getCurrentInstance().getViewRoot().getViewId() + "?faces-redirect=true" ; <h:commandButton action= "page1?faces-redirect=true" value= "Page1" />

JavaServer Faces (JSF) Standard Request-Response Lifecycle

Image
JSF manages MVC 100% on the server side, using the browser as a rendering platform only. The initial idea was to decouple the rendering platform from the server-side UI component model, in order to allow to replace HTML with alternative markup languages by swapping the Render Response phase. This was in the early 2000’s when HTML could be soon replaced by XML-based alternatives (that never came to be), and then HTML5 came along. Also browsers where much more quirkier than what they are today, and the idea of cross-browser JavaScript libraries was not widespread.