0 Replies Latest reply on Feb 15, 2008 10:59 PM by jieshengz

    initialState and value  for Togglepanel

      Hi, all
      Just share my experience with TogglePanel. TogglePanel has several fields (stateOrder, initialState, value) controlling which facet is displayed first. I have a togglePanel inside an form. The togglePanel is for file input. The end user can either select a file or paste text to textArea. In first loading, I'd like to display file upload box as first facet. Upon redisplay, I'd like to display the text area first if text area value is not empty. The issue is that on the first load, the togglePanel has its value (the value for value attribute) set to initialState. When the form is redisplayed, the value is restored and I can not change the value anymore. To be able to change the value for "value" attribute, I uses a function like this #{my:getstate(name)}. When JSF tries to set value to this function during restore, it can not. JSF just gives a warning. It is good, it deos not through an exception. By this, I can set the first facet dynamically.

      Hope this helpful

      -jason