Hi guys!
I'm looking for help with a rare case. I have a zone, a form (with a
checkbox) and a grid. The form and the grid are enclosed by the zone.
<t:zone t:id="targetsZone" t:update="show">
<t:form t:id="filterTargetsForm" t:zone="targetsZone" zone="targetsZone">
<t:checkbox t:id="flag" t:value="flag" />
<t:submit value="Filter" />
</t:form>
<t:grid source="targets" row="target" model="myModel" inPlace="true" />
</t:zone>
On the java side: I change the grid model, depending on the checkbox value:
@Component
private Zone targetsZone;
@Property
@Persist
private boolean flag;
public BeanModel<CycleTargets> getMyModel() {
BeanModel<CycleTargets> myModel = beanModelSource.createDisplayModel(
CycleTargets.class, messages);
if (flag){
myModel.include(.....);
myModel.exclude(.....);
myModel.reorder(.....);
} else {
myModel.include(.....);
myModel.exclude(.....);
myModel.reorder(.....);
}
}
void onSubmitFromFilterTargetsForm() {
this.ajaxResponseRenderer.addRender("targetsZone", this.targetsZone);
}
Note that the method "onSubmit" only update the zone. So, depending if the
checkbox is clicked or not, i want to change the properties displayed by
the grid.
The problem is that after the form-submit the model seem not to change and
throws an "*Render queue error in
SetupRender[cycles/NewEditCyclePage:targetsgrid]: Bean editor model for
XXXXXXXX does not contain a property with id 'XXXXXX'*"
Do you know if the model of a grid can be changed on this way?
Thanks in advance!
------------------------------------------------------------------
David Germán Canteros