Search code examples
javaicefacesjspx

How to set a blank default value in iceface's selectinputdate?


I use Icefaces' selectInputDate. The code in .jspx file is the following:

<ice:selectInputDate id="Dt" 
        value="#{actionsBean.MDate}"
        renderAsPopup="true" required="true"
        partialSubmit = "true"
        popupDateFormat="#{msgs.date_format}" 
        valueChangeListener = "#{actionsBean.mDateChangeListener}">
                          <f:converter converterId="MDateConverter" />      </ice:selectInputDate>

The problem actually is: I want that value in the input to be an empty string by default. I set to MDate null value, then panel opens and after user(me in this case) worked and closed panel I set null value to MDate again. But then I open the panel one more time the last value I selected via calendar was saved and automatically filled in. How can I resolve this?


Solution

  • When you close the panel, your selectInputDate component doesn't redraw on the page, and then returns the old value. It can be, for example, if you use 'rendered=true/false' property for showing/hiding of the parent panel.

    For fix, use 'visibled' property instead of 'rendered' or use binding for clear value in your selectInputDate component directly