Questions tagged [jsf-2]

JavaServer Faces (JSF) is a model-view-presenter framework typically used to create web applications. Version 2.x is a major step ahead compared to JSF 1.x, significantly expanding the standard set of components and component libraries.

JavaServer Faces 2.x is a major step ahead as compared to JSF 1.x, significantly expanding the standard set of components and component libraries. Facelets (which was designed specifically for JavaServer Faces) was adopted as the official view technology for JSF 2.x. This eliminates the life-cycle conflicts that existed with JSP, forcing workarounds by Java developers. Lot of things which are hardly possible in JSF 1.x can be done more elegantly in JSF 2.x.

For the real wiki, please jump over to the wiki: https://stackoverflow.com/tags/jsf/info.

15731 questions
41
votes
8 answers

How to set width of a p:column in a p:dataTable in PrimeFaces 3.0?

I'm using PrimeFaces 3.0-M3 and I have a with two columns in it. I want the first column to be fixed at a width of 20px. The other column can use whatever space is left over. Here are screenshots of what I'm currently getting: The…
Jim Tough
  • 14,843
  • 23
  • 75
  • 96
41
votes
2 answers

How to reference JSF image resource as CSS background image url

I often, change the images of my buttons using the image attribute, but someone told me that it is a good practice to do it using .css I tried but i cant, what i am doing wrong? This is what i did: 1-The resources of my project are stored like…
javing
  • 12,307
  • 35
  • 138
  • 211
41
votes
1 answer

Difference between h:link and h:outputLink

I have looked at the API's for both components but am not too sure why you would use one over the…
Thomas Buckley
  • 5,836
  • 19
  • 62
  • 110
41
votes
1 answer

Redirect to external URL in JSF

I've been dealing with a problem with JSF, when it comes to redirect to pages inside my app it works just fine, but I haven't been able to redirect to external URL can some one guide me on this?
Necronet
  • 6,704
  • 9
  • 49
  • 89
41
votes
4 answers

Are @ManagedBeans obsolete in JavaEE6 because of @Named in CDI/Weld?

Because of CDI (and its implementation Weld), every POJO in JEE6 can be annotated with @Named, which makes the POJO accessible to the view. Does that mean that ManagedBeans are completely obsolete now? Or did I miss something where @ManagedBean…
Wolkenarchitekt
  • 20,170
  • 29
  • 111
  • 174
40
votes
2 answers

Facelets repeat Tag Index

Does anyone know a way to get the index of the element in a ui:repeat facelets tag?
c12
  • 9,557
  • 48
  • 157
  • 253
40
votes
6 answers

PrimeFaces commandButton doesn't navigate or update

I'am using Primefaces to make my app a little bit more beautiful. I noticed that p:commandButton and h:commandButton don't work the same way. The p:commandButton calls the method and nothing else hapens. The h:commandButton calls the method and…
Sven
  • 6,288
  • 24
  • 74
  • 116
39
votes
3 answers

Concatenating strings within EL expression defined in an attribute of a facelets tag

I need to write an EL expression for an attribute which goes something like this: #{cc.attrs.appreciatedByCurrentUser ? (cc.attrs.count +'
'+ (cc.attrs.count-1)) : ((cc.attrs.count+1) +'
'+ cc.attrs.count)} Now the problem is that this…
Rajat Gupta
  • 25,853
  • 63
  • 179
  • 294
39
votes
2 answers

JSF doesn't support cross-field validation, is there a workaround?

JSF 2.0 only allows you to validate the input on one field, like check to see if it's a certain length. It doesn't allow you to have a form that says, "enter city and state, or enter just a zip code." How have you gotten around this? I'm only…
Jonathan S. Fisher
  • 8,189
  • 6
  • 46
  • 84
39
votes
6 answers

How do you pass view parameters when navigating from an action in JSF2?

From an action in my bean, I'm trying to redirect to another page expecting a view parameter. What is the recommended way to do this in JSF2? E.g., say my source page is: http://localhost/page1.xhtml it has a commandButton that calls an…
dule
  • 17,798
  • 4
  • 39
  • 38
38
votes
2 answers

Execution order of events when pressing PrimeFaces p:commandButton

I am trying to execute a JSF2 bean method and show a dialog box after completion of the method on click of PrimeFaces .
Abhay
  • 687
  • 4
  • 13
  • 22
38
votes
4 answers

How do I process GET query string URL parameters in backing bean on page load?

I've read how to send parameters using JSF but what if the user types their companyId in the URL when accessing their login page? For example, http://my.company.url/productName/login.faces?companyId=acme. The way we do it now, there is a bit of…
Big Al
  • 481
  • 1
  • 7
  • 14
37
votes
4 answers

How to let validation depend on the pressed button?

I have created form and I want to show previous existing items on a table while a new one is creating. I'd like to show matching items as form is filling up. But when I try to filter the list without having the form completed, the validation…
Roteke
  • 663
  • 2
  • 9
  • 12
37
votes
2 answers

com.sun.faces.numberOfViewsInSession vs com.sun.faces.numberOfLogicalViews

Mojarra Implementation of JSF 2 has the following context params: com.sun.faces.numberOfViewsInSession (default is 15) com.sun.faces.numberOfLogicalViews (default is 15) What is the difference between them? The documentation doesn't speak much…
Miguel Ping
  • 18,082
  • 23
  • 88
  • 136