You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Jeffrey Porter <PO...@WMGMAIL.wmg.warwick.ac.uk> on 2005/10/25 17:04:17 UTC

Help still needed with valueChangeListener

 

 

I have the code that calls my ValueChangeListener implementation.

That part works, the bit I'm having trouble with is setting the new a
value on page.

 

JSP...

<h:inputText 

id="partNumber" 

value="#{nonConformingMaterial.partNumber}" 

required="true"  

      immediate="true"

      onchange="submit()"

>    

<f:valueChangeListener
type="org.me.jsf.actions.NonConformingMaterialAL"/>

</h:inputText>

 

 

The code I have is...

 

CODE...

public class NonConformingMaterialAL implements ValueChangeListener {

 

public void processValueChange(ValueChangeEvent vce) throws
AbortProcessingException  {

 

       String partNo = ((String)vce.getNewValue());

       System.out.println("A value has changed!" + partNo);

 

                  // This doesn't save & show the new value.?!??!

       FacesContext ctxt =  FacesContext.getCurrentInstance();

       if (null != vce.getNewValue()) {

           ctxt.getExternalContext().getSessionMap().put("SHOWTHIS",
"partNumber");

                  }

 

      ctxt.renderResponse();

            }

}

 

This doesn't set the value "SHOWTHIS" in the field though.

 

Can someone please help?

 

Thanks

Jeff.