hi
I am reading this book
Packtpub.Apache.MyFaces.1.2.Web.Application.Development
trying to apply PPR on two tr:selectOneChoice
Number one for car company when changed
Second one load car model that belongs to that company.
using valueChangeListener
this is form in jsp file
<tr:form >
<t:saveState value="#{daata}"/>
<c:if test="#{empty autoSubmit}">
<c:set var="autoSubmit" value="false" />
</c:if>
<tr:selectOneChoice id="car"
autoSubmit="true" value="#{daata.car}" valueChangeListener="#{daata.updatemodel}">
<f:selectItems value="#{daata.car}" />
</tr:selectOneChoice>
<tr:selectOneChoice value="#{daata.model}" partialTriggers="car" >
<f:selectItems value="#{daata.model}" />
</tr:selectOneChoice>
</tr:form>
this is updatemodel model function
public void updatemodel(ValueChangeEvent event) {
CoreSelectOneChoice s = (CoreSelectOneChoice) event.getSource();
if(s.getValue().equals("Peugeot")){
Map mods= new HashMap<String, String>();
models.put("405","405");
models.put("406","406");
setModel(models);
}
models is HashMap has it setModels and getModels
and reload fine in page start
but after choosing company in first tr:selectOneChoice it gives me this error
javax.faces.application.ViewExpiredException: /ajax.jspNo saved view state could be found for the view identifier: /ajax.jsp
ajax.jsp(51,4) '#{daata.model}' Error reading 'model' on type daata
kindely help
thanks
I am reading this book
Packtpub.Apache.MyFaces.1.2.Web.Application.Development
trying to apply PPR on two tr:selectOneChoice
Number one for car company when changed
Second one load car model that belongs to that company.
using valueChangeListener
this is form in jsp file
<tr:form >
<t:saveState value="#{daata}"/>
<c:if test="#{empty autoSubmit}">
<c:set var="autoSubmit" value="false" />
</c:if>
<tr:selectOneChoice id="car"
autoSubmit="true" value="#{daata.car}" valueChangeListener="#{daata.updatemodel}">
<f:selectItems value="#{daata.car}" />
</tr:selectOneChoice>
<tr:selectOneChoice value="#{daata.model}" partialTriggers="car" >
<f:selectItems value="#{daata.model}" />
</tr:selectOneChoice>
</tr:form>
this is updatemodel model function
public void updatemodel(ValueChangeEvent event) {
CoreSelectOneChoice s = (CoreSelectOneChoice) event.getSource();
if(s.getValue().equals("Peugeot")){
Map mods= new HashMap<String, String>();
models.put("405","405");
models.put("406","406");
setModel(models);
}
models is HashMap has it setModels and getModels
and reload fine in page start
but after choosing company in first tr:selectOneChoice it gives me this error
javax.faces.application.ViewExpiredException: /ajax.jspNo saved view state could be found for the view identifier: /ajax.jsp
ajax.jsp(51,4) '#{daata.model}' Error reading 'model' on type daata
kindely help
thanks