r5836 - in branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client: screen/patient widget

0 views
Skip to first unread message

subve...@svn.freemedsoftware.org

unread,
Sep 2, 2010, 2:50:47 AM9/2/10
to freemed-d...@googlegroups.com
Author: hamid
Date: 2010-09-02 02:50:47 -0400 (Thu, 02 Sep 2010)
New Revision: 5836

Modified:
branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/IntakeInitialContactEntry.java
branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/widget/IntakeInitialContactEntryWidget.java
Log:
Fixed Autosave problem

Modified: branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/IntakeInitialContactEntry.java
===================================================================
--- branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/IntakeInitialContactEntry.java 2010-09-01 18:36:17 UTC (rev 5835)
+++ branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/screen/patient/IntakeInitialContactEntry.java 2010-09-02 06:50:47 UTC (rev 5836)
@@ -50,6 +50,7 @@
import com.google.gwt.http.client.Response;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.TabPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
@@ -182,9 +183,9 @@

@Override
public void onSelection(SelectionEvent<Integer> arg0) {
- if(tabPanelMain.getWidgetIndex(intakeInitialContactEntryWidget) == arg0.getSelectedItem())
+ if(tabPanelMain.getWidgetIndex(intakeInitialContactEntryWidget) == arg0.getSelectedItem()){
intakeInitialContactEntryWidget.startAutoUpdate();
- else
+ }else
intakeInitialContactEntryWidget.CancelAutoSave();

}

Modified: branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/widget/IntakeInitialContactEntryWidget.java
===================================================================
--- branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/widget/IntakeInitialContactEntryWidget.java 2010-09-01 18:36:17 UTC (rev 5835)
+++ branches/bmas-staging/ui/gwt/src/org/freemedsoftware/gwt/client/widget/IntakeInitialContactEntryWidget.java 2010-09-02 06:50:47 UTC (rev 5836)
@@ -41,6 +41,8 @@
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.logical.shared.SelectionEvent;
+import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
@@ -292,7 +294,8 @@
}
protected void saveAllForms(){
if ((CURRENT_INTAKE_TYPE == INTAKE_TYPE_CALLIN && validateCallinForm()) || CURRENT_INTAKE_TYPE == INTAKE_TYPE_PATIENT){
- wSubmit.setEnabled(false);
+ if(!isAutoSaveRequest)
+ wSubmit.setEnabled(false);
HashMap<String, HashMap<String, String>> data = new HashMap<String, HashMap<String, String>>();
data.put("saintake", getSubstanceAbuseMap());
data.put("mhdx", getMentalHealthMap());
@@ -345,11 +348,14 @@
if(data instanceof Integer)
r = (Integer)data;
if(isAutoSaveRequest){
- if(r!=null)
- treatmentInitialIntakeId = r;
- if (parentResponderInterface != null)
- parentResponderInterface
- .handleResponse(patientId);
+ if(r!=null){
+ HashMap<String,String> idsMap = (HashMap<String,String>)data;
+ treatmentInitialIntakeId = Integer.parseInt(idsMap.get("id"));
+ substanceAbuseIntakeId = Integer.parseInt(idsMap.get("saintakeId"));
+ mentalHealthDiagnosesId = Integer.parseInt(idsMap.get("mhdxid"));
+ patientSubstanceId = Integer.parseInt(idsMap.get("patientsubstanceid"));
+
+ }
wSubmit.setText("Modify");
populateDefaultData();
isAutoSaveRequest = false;
@@ -375,7 +381,7 @@
}else Util.showErrorMsg(moduleName, "Initial Intake Form failed.");
}

- }, isModify?"Boolean":"Integer");
+ }, isModify?"Boolean":(isAutoSaveRequest?"HashMap<String,String>":"Integer"));
}
}

@@ -538,10 +544,10 @@
}
};
// Run initial polling ...
- autoSaveTimer.run();
+ autoSaveTimer.schedule(CurrentState.getFormAutoSaveInterval());
} else {
CancelAutoSave();
- autoSaveTimer.run();
+ autoSaveTimer.schedule(CurrentState.getFormAutoSaveInterval());
}
}

Reply all
Reply to author
Forward
0 new messages