Skip to main content

Blog Archive for mriem during October 2012

Note this blog is obsolete, see https://www.manorrock.com/blog/ for the current blog The definition of a PartialStateHolder according to the PartialStateHolder interface:   void clearInitialState()   boolean initialStateMarked()   void markInitialState()   Note that the methods above do not mention that a PartialStateHolder extends from StateHolder. Be aware that if...
Note this blog is obsolete, see https://www.manorrock.com/blog/ for the current blog The definition of a StateHolder according to the StateHolder interface:   boolean isTransient()  void restoreState(FacesContext context, Object state)  Object saveState(FacesContext context)  void setTransient(boolean newTransient) Each of the methods mentioned above have a particular...
Note this blog is obsolete, see https://www.manorrock.com/blog/ for the current blog Since state saving happens as part of the JSF lifecycle a component, validator, converter, etcetera that wants to participate in state saving can do so by implementing or using one or all of the below mentioned APIs. StateHolder PartialStateHolder StateHelper StateHolder This is the original API that a...
Note this blog is obsolete, see https://www.manorrock.com/blog/ for the current blog During the JSF lifecycle state will be restored at the beginning of a request (if any state is available) and state will be saved at the end of a request (if any state is available). Why is it important to know what happens during request processing? Well, if you know how JSF state saving works you can...
Note this blog is obsolete, see https://www.manorrock.com/blog/ for the current blog The following blog articles are part of the JSF Converter series Introduction to JSF Converters The JSF Converter API The NumberConverter The DateTimeConverter Writing your own Converter Packaging your JSF Converter
Note this blog is obsolete, see https://www.manorrock.com/blog/ for the current blog In the previous blog entry you learned how to write your own converter. Say you want to distribute this converter to others. How can you make sure the JSF runtime knows about the converter without needing to add it to the faces-config.xml of the web application. As described in the previous blog entry you need...
Note this blog is obsolete, see https://www.manorrock.com/blog/ for the current blog Writing you own converter is a pretty straight forward process. It really comes down to implementing the Converter API. Say you want to write a converter that will convert colors. Lets assume we support, "Red", "Green" and "Blue".   package color;  public class ColorConverter implements Converter {...
Note this blog is obsolete, see https://www.manorrock.com/blog/ for the current blog How would you use the JSF DateTimeConverter? If you are working with dates you probably have had a need to display them in the correct format, or even had to parse them? Well, lets start off with using dateStyle. The example below will use the "long" date style as defined by the server Locale. Valid values are...
Note this blog is obsolete, see https://www.manorrock.com/blog/ for the current blog How do you use the JSF NumberConverter? If you are outputting a value, how would you show a currency code along with it? <html xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">  <h:outputText value="#{user.income}"> ...