You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jamie Orchard-Hays <ja...@dang.com> on 2003/08/08 21:11:20 UTC
property not getting set
I've got a multi-select object that selects values for a filter. This filter then is used in a methed to return results from the
database. My form has a listener where I process the filter values. I can see that the filter is set, but when I call the method
that retrieves the filtered data, the filter is empty! (I output the values of the filter's properties in both the listener method
and the data accessor method.) I can't seem to figure out what I'm missing here.
/* listener for submit*/
public void formSubmit(IRequestCycle cycle){
System.out.println("------------------------");
System.out.println("in submit listener");
if(getSelectedJobTypes() != null && !getSelectedJobTypes().isEmpty()){
System.out.println("------------------------");
System.out.println("in submit listener if statement");
Iterator iterator = getSelectedJobTypes().iterator();
Integer [] jobTypeIds = new Integer[getSelectedJobTypes().size()];
int i = 0;
while(iterator.hasNext()){
JobOpportunityTypesData jobType = (JobOpportunityTypesData)iterator.next();
jobTypeIds[i++] = jobType.getJobOpportunityTypeId();
System.out.println("jobType.getJobOpportunityTypeId(): " + jobType.getJobOpportunityTypeId());
}
jobOppsSearchFilter.setJobOpportunityTypeIds(jobTypeIds);
setJobOppsSearchFilter(jobOppsSearchFilter);
System.out.println("jobOppsSearchFilter: " + jobOppsSearchFilter);
}
}
/* data accessor method */
public JobOpportunitiesListViewData [] getJobOpportunities() throws Exception{
JobOpportunitiesListViewData [] results;
studentJobOppMethods = getStudentJobOppMethods();
System.out.println("***jobOppsSearchFilter: " + getJobOppsSearchFilter());
results = studentJobOppMethods.searchJobsByCriteria(getJobOppsSearchFilter());
return results;
}
Re: property not getting set
Posted by Jamie Orchard-Hays <ja...@dang.com>.
Silly me. I was creating a new filter in every pageBeginRender(). Oops.
Jamie
----- Original Message -----
From: "Jamie Orchard-Hays" <ja...@dang.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, August 08, 2003 3:11 PM
Subject: property not getting set
> I've got a multi-select object that selects values for a filter. This filter then is used in a methed to return results from the
> database. My form has a listener where I process the filter values. I can see that the filter is set, but when I call the method
> that retrieves the filtered data, the filter is empty! (I output the values of the filter's properties in both the listener method
> and the data accessor method.) I can't seem to figure out what I'm missing here.
>
> /* listener for submit*/
> public void formSubmit(IRequestCycle cycle){
> System.out.println("------------------------");
> System.out.println("in submit listener");
> if(getSelectedJobTypes() != null && !getSelectedJobTypes().isEmpty()){
> System.out.println("------------------------");
> System.out.println("in submit listener if statement");
>
> Iterator iterator = getSelectedJobTypes().iterator();
> Integer [] jobTypeIds = new Integer[getSelectedJobTypes().size()];
> int i = 0;
> while(iterator.hasNext()){
> JobOpportunityTypesData jobType = (JobOpportunityTypesData)iterator.next();
> jobTypeIds[i++] = jobType.getJobOpportunityTypeId();
> System.out.println("jobType.getJobOpportunityTypeId(): " + jobType.getJobOpportunityTypeId());
> }
> jobOppsSearchFilter.setJobOpportunityTypeIds(jobTypeIds);
> setJobOppsSearchFilter(jobOppsSearchFilter);
> System.out.println("jobOppsSearchFilter: " + jobOppsSearchFilter);
> }
> }
>
> /* data accessor method */
> public JobOpportunitiesListViewData [] getJobOpportunities() throws Exception{
> JobOpportunitiesListViewData [] results;
> studentJobOppMethods = getStudentJobOppMethods();
> System.out.println("***jobOppsSearchFilter: " + getJobOppsSearchFilter());
> results = studentJobOppMethods.searchJobsByCriteria(getJobOppsSearchFilter());
>
> return results;
> }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>