0 Replies Latest reply on Sep 23, 2008 5:30 PM by Duncan Stockdill

    Compact Form Fields Implementation

    Duncan Stockdill Newbie

      Has anyone been able to implement compact form fields using Seam/JSF?  By this I mean that the field label is shown in the input field until the user tabs into the field.  The field label is re-added if the user tabs off without adding a value. There is a standard technique described here: a list apart article


      My UI uses ajax commands to add form fields to the page. For this reason I haven't tried to set the initial css classes in the onload event.  Instead I have derived the css class by checking if the form field is null. The onblur/onfocus events are used to update the css class based on user input.  This works initially but if the form fails validation then the subsequent re-render fails to recognise the field is set because JSF hasn't bound the input values to the model.  Is there a workaround for this - i.e. some way to get the form value rather than the model value?


      I have also tried an entirely different approach which uses a converter to populate the field with the label text when the underlying value is null.  This doesn't work either as JSF doesn't call the converter for null values.
      http://seamframework.org/Community/JSFConverterAndNull. Anyone knows a workaround for this?