include a refresh button belonging to the list of customer

and subcontractor communications, in order to update the
selected filter.
This commit is contained in:
Susana Montes Pedreira 2012-03-20 15:43:47 +00:00
parent bcce43a35c
commit 72dabb9cc9
4 changed files with 25 additions and 0 deletions

View file

@ -98,7 +98,10 @@ public class CustomerCommunicationCRUDController extends GenericForwardComposer
public void setCurrentFilterItem(FilterCommunicationEnum selected) {
customerCommunicationModel.setCurrentFilter(selected);
refreshCustomerCommunicationsList();
}
private void refreshCustomerCommunicationsList(){
// update the customer communication list
listing.setModel(new SimpleListModel(getCustomerCommunications()));
listing.invalidate();
@ -198,4 +201,11 @@ public class CustomerCommunicationCRUDController extends GenericForwardComposer
}
}
/**
* Apply filter to customers communications
* @param event
*/
public void onApplyFilter(Event event) {
refreshCustomerCommunicationsList();
}
}

View file

@ -109,7 +109,10 @@ public class SubcontractorCommunicationCRUDController extends GenericForwardComp
public void setCurrentFilterItem(FilterCommunicationEnum selected) {
subcontractorCommunicationModel.setCurrentFilter(selected);
refreshSubcontractorCommunicationsList();
}
private void refreshSubcontractorCommunicationsList() {
// update the subcontractor communication list
listing.setModel(new SimpleListModel(getSubcontractorCommunications()));
listing.invalidate();
@ -233,4 +236,12 @@ public class SubcontractorCommunicationCRUDController extends GenericForwardComp
}
}
/**
* Apply filter to subcontractors communications
*
* @param event
*/
public void onApplyFilter(Event event) {
refreshSubcontractorCommunicationsList();
}
}

View file

@ -39,6 +39,8 @@
selectedItem="@{controller.currentFilterItem}"
itemRenderer="org.libreplan.web.common.EnumsListitemRenderer">
</listbox>
<button label="${i18n:_('Refresh')}" style="margin-top: -4px"
onClick="controller.onApplyFilter(event)"/>
</div>
<separator bar="false" spacing="20px" orient="horizontal"/>
<grid id="listing"

View file

@ -39,6 +39,8 @@
selectedItem="@{controller.currentFilterItem}"
itemRenderer="org.libreplan.web.common.EnumsListitemRenderer">
</listbox>
<button label="${i18n:_('Refresh')}" style="margin-top: -4px"
onClick="controller.onApplyFilter(event)"/>
</div>
<separator bar="false" spacing="20px" orient="horizontal"/>
<grid id="listing"