PrioritySelection(GadgletQuery viewPersonalNotesQry,GadgletRequest viewPersonalNotesRequest){
localViewPersonalNotesQry = viewPersonalNotesQry;
localViewPersonalNotesRequest = viewPersonalNotesRequest;
RadioButton allPriority = new RadioButton("priority",prefsUtils.getMsg("gadgetLabelAll"));
RadioButton highPriority = new RadioButton("priority",prefsUtils.getMsg("gadgetLabelHigh"));
RadioButton midPriority = new RadioButton("priority",prefsUtils.getMsg("gadgetLabelMedium"));
RadioButton lowPriority = new RadioButton("priority",prefsUtils.getMsg("gadgetLabelLow"));
prioritySelectionPanel.add(allPriority);
prioritySelectionPanel.add(highPriority);
prioritySelectionPanel.add(midPriority);
prioritySelectionPanel.add(lowPriority);
allPriority.setValue(true);
allPriority.addClickHandler(new ClickHandler(){@Override
public void onClick(ClickEvent c){
getRequestQuery().removeFilterBy("priority",Params.PRIORITY.getParamName());
getPlatformRequest().makeRequest();
}});
highPriority.addClickHandler(new ClickHandler(){@Override
public void onClick(ClickEvent c){
if(getRequestQuery().filterByExists("priority",Params.PRIORITY.getParamName()))
getRequestQuery().changeParamValue(Params.PRIORITY.getParamName(), "1");
else
getRequestQuery().addFilterBy(FilterByBoolOpTypes.AND, "priority", FilterByRelOpTypes.EQUAL, Params.PRIORITY.getParamName(), "1", FilterByParamTypes.INT);
getPlatformRequest().makeRequest();
}});
midPriority.addClickHandler(new ClickHandler(){@Override
public void onClick(ClickEvent c){
if(getRequestQuery().filterByExists("priority",Params.PRIORITY.getParamName()))
getRequestQuery().changeParamValue(Params.PRIORITY.getParamName(), "2");
else
getRequestQuery().addFilterBy(FilterByBoolOpTypes.AND, "priority", FilterByRelOpTypes.EQUAL, Params.PRIORITY.getParamName(), "2", FilterByParamTypes.INT);
getPlatformRequest().makeRequest();
}});
lowPriority.addClickHandler(new ClickHandler(){@Override
public void onClick(ClickEvent c){
if(getRequestQuery().filterByExists("priority",Params.PRIORITY.getParamName()))
getRequestQuery().changeParamValue(Params.PRIORITY.getParamName(), "3");
else
getRequestQuery().addFilterBy(FilterByBoolOpTypes.AND, "priority", FilterByRelOpTypes.EQUAL, Params.PRIORITY.getParamName(), "3", FilterByParamTypes.INT);