← Back to team overview

dhis-mobile-devs team mailing list archive

[Branch ~dhis-mobile-devs/dhis-mobile/lwuit-tracking] Rev 218: clickable pending tracked enity list and navigate for offline tracked entity dashboard

 

------------------------------------------------------------
revno: 218
committer: Long <long.hispvietnam@xxxxxxxxx>
branch nick: lwuit-tracking
timestamp: Thu 2014-05-15 14:46:07 +0700
message:
  clickable pending tracked enity list and navigate for offline tracked entity dashboard
modified:
  src/org/hisp/dhis/mobile/view/OfflineView.java


--
lp:~dhis-mobile-devs/dhis-mobile/lwuit-tracking
https://code.launchpad.net/~dhis-mobile-devs/dhis-mobile/lwuit-tracking

Your team DHIS mobile developers is subscribed to branch lp:~dhis-mobile-devs/dhis-mobile/lwuit-tracking.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis-mobile-devs/dhis-mobile/lwuit-tracking/+edit-subscription
=== modified file 'src/org/hisp/dhis/mobile/view/OfflineView.java'
--- src/org/hisp/dhis/mobile/view/OfflineView.java	2014-05-12 06:46:39 +0000
+++ src/org/hisp/dhis/mobile/view/OfflineView.java	2014-05-15 07:46:07 +0000
@@ -6,6 +6,7 @@
 import org.hisp.dhis.mobile.log.LogMan;
 import org.hisp.dhis.mobile.midlet.DHISMIDlet;
 import org.hisp.dhis.mobile.midlet.NameBasedMIDlet;
+import org.hisp.dhis.mobile.model.LinkButton;
 import org.hisp.dhis.mobile.model.Patient;
 import org.hisp.dhis.mobile.model.PatientAttribute;
 import org.hisp.dhis.mobile.recordstore.OfflinePatientRecordStore;
@@ -26,7 +27,7 @@
     implements ActionListener
 {
     private static final String CLASS_TAG = "OfflineView";
-    
+
     private Vector offlinePatientVector;
 
     private Form offlineForm;
@@ -53,7 +54,7 @@
             for ( int i = 0; i < offlinePatientVector.size(); i++ )
             {
                 String displayText = "";
-                Patient patient = (Patient) offlinePatientVector.elementAt( i );
+                final Patient patient = (Patient) offlinePatientVector.elementAt( i );
 
                 if ( !patient.getTrackedEntityName().equals( trackedEntityName ) )
                 {
@@ -69,7 +70,7 @@
                     offlineForm.addComponent( trackedEntitylbl );
 
                 }
-                
+
                 for ( int j = 0; j < patient.getPatientAttValues().size(); j++ )
                 {
                     PatientAttribute patientAttribute = (PatientAttribute) patient.getPatientAttValues().elementAt( j );
@@ -78,15 +79,20 @@
                         displayText += patientAttribute.getValue() + " ";
                     }
                 }
-                
-                Style labelStyle = new Style();
-                labelStyle.setBgColor( 0xffffff );
-                
+
                 displayText = displayText.trim();
-                this.patientLabel = new Label( displayText );
-                this.patientLabel.setUnselectedStyle( labelStyle );
-                this.patientLabel.setSelectedStyle( labelStyle );
-                offlineForm.addComponent( patientLabel );
+
+                LinkButton personLink = new LinkButton( displayText );
+                personLink.addActionListener( new ActionListener()
+                {
+
+                    public void actionPerformed( ActionEvent arg0 )
+                    {
+                        nameBasedMIDlet.getPersonDashboardView().setPatient( patient );
+                        nameBasedMIDlet.getPersonDashboardView().showView();
+                    }
+                } );
+                offlineForm.addComponent( personLink );
 
             }
         }
@@ -130,7 +136,7 @@
                     }
                     // nameBasedMIDlet.getWaitingView().showView();
                     offlineForm.removeAll();
-                    RecordStoreUtil.clearRecordStore(OfflinePatientRecordStore.OFFLINEPATIENT_DB);
+                    RecordStoreUtil.clearRecordStore( OfflinePatientRecordStore.OFFLINEPATIENT_DB );
                     nameBasedMIDlet.getAlertBoxView( "All patient uploaded", "Success" ).showView();
                 }
             }