Index: sansview/perspectives/fitting/basepage.py
===================================================================
--- sansview/perspectives/fitting/basepage.py	(revision 6f2c9193ff21395eb08572d7152be3a0fb7a1c39)
+++ sansview/perspectives/fitting/basepage.py	(revision f20767bc58d07c9f4d4c8b08bed906d17bd199e7)
@@ -61,4 +61,5 @@
         ##list of dispersion parameters
         self.disp_list=[]
+        self.disp_name=""
         ## list of orientation parameters
         self.orientation_params=[]
@@ -100,5 +101,13 @@
         self.popUpMenu.AppendItem(self._redo)
         self._redo.Enable(False)
-        wx.EVT_MENU(self, id, self.onRedo)
+        wx.EVT_MENU(self, id, self.onRedo)       
+        self.popUpMenu.AppendSeparator()
+                
+        id = wx.NewId()
+        self._keep = wx.MenuItem(self.popUpMenu,id,"Keep"," Keep the panel status to recall it later")
+        self.popUpMenu.AppendItem(self._keep)
+        self._keep.Enable(True)
+        wx.EVT_MENU(self, id, self.onSave)
+        self.popUpMenu.AppendSeparator()
         
         ## Default locations
@@ -281,5 +290,5 @@
         self.polydisp= sans.models.dispersion_models.models
         self.disp_box = wx.ComboBox(self, -1)
-       
+
         for key in self.polydisp.iterkeys():
             name = str(key.__name__)
@@ -287,5 +296,4 @@
                 # Remove the option until the rest of the code is ready for it
                 self.disp_box.Append("Select customized Model",key)
-                
             else:
                 self.disp_box.Append(name,key)
@@ -328,10 +336,10 @@
         self.weights=[]
         # Go through the list of dispersion check boxes to identify which one has changed 
+
         for p in self.disp_cb_dict:
             self.state.disp_cb_dict[p]=  self.disp_cb_dict[p].GetValue()
             # Catch which one of the box was just checked or unchecked.
             if event.GetEventObject() == self.disp_cb_dict[p]:              
-
-                
+               
                 if self.disp_cb_dict[p].GetValue() == True:
                     # The user wants this parameter to be averaged. 
@@ -390,8 +398,7 @@
                     self.state.model._persistency_dict[p] = [self.values, self.weights]
                 else:
-                    # The parameter was un-selected. Go back to Gaussian model (with 0 pts)
                     self._reset_dispersity()
               
-                ## Redraw the model
+                ## Redraw the model ???
                 self._draw_model()
         
@@ -411,14 +418,15 @@
         
         name= self.popUpMenu.GetLabel(event.GetId())
+        self._on_select_model_helper()
+        
         if name in self.saved_states.keys():
             previous_state = self.saved_states[name]
-            self.reset_page(previous_state)
-            
-   
+            ## reset state of checkbox,textcrtl  and  regular parameters value
+            self.reset_page(previous_state)      
+                  
     def onSave(self, event):
         """
             save history of the data and model
         """
-        
         if self.model==None:
             return 
@@ -429,4 +437,5 @@
         
         self.state.model = self.model.clone()
+        self.state.model.name= self.model.name
         #if not hasattr(self.model, "_persistency_dict"):
         #self.model._persistency_dict = {}
@@ -434,4 +443,6 @@
                         
         new_state = self.state.clone()
+        new_state.model.name = self.state.model.name
+        
         new_state.enable2D = copy.deepcopy(self.enable2D)
         ##Add model state on context menu
@@ -482,4 +493,8 @@
                     item[4].Hide()
         self.Layout()
+        # Get a handle to the TextCtrl
+        widget = evt.GetEventObject()
+        # Select the whole control, after this event resolves
+        wx.CallAfter(widget.SetSelection, -1,-1)
         return
     
@@ -501,4 +516,5 @@
         # Make sure the mouse event is available to other listeners
         event.Skip()
+
     
     def read_file(self, path):
@@ -555,10 +571,10 @@
         ## save data    
         self.state.data= copy.deepcopy(self.data)
-       
         try:
             n = self.disp_box.GetCurrentSelection()
             dispersity= self.disp_box.GetClientData(n)
             name= dispersity.__name__
-            if name == "GaussianDispersion":
+            self.disp_name = name
+            if name == "GaussianDispersion" :
                if hasattr(self,"cb1"):
                    self.state.cb1= self.cb1.GetValue()
@@ -577,6 +593,8 @@
         if hasattr(self,"disp_box"):
             self.state.disp_box = self.disp_box.GetCurrentSelection()
+
             if len(self.disp_cb_dict)>0:
                 for k , v in self.disp_cb_dict.iteritems():
+         
                     if v ==None :
                         self.state.disp_cb_dict[k]= v
@@ -589,5 +607,8 @@
             if len(self._disp_obj_dict)>0:
                 for k , v in self._disp_obj_dict.iteritems():
+      
                     self.state._disp_obj_dict[k]= v
+                        
+            
             self.state.values = copy.deepcopy(self.values)
             self.state.weights = copy.deepcopy(self.weights)
@@ -600,4 +621,5 @@
         self.state.fittable_param =[]
         self.state.fixed_param =[]
+
         
         ## save checkbutton state and txtcrtl values
@@ -606,4 +628,5 @@
         self._copy_parameters_state(self.orientation_params_disp,
                                      self.state.orientation_params_disp)
+        
         self._copy_parameters_state(self.parameters, self.state.parameters)
         self._copy_parameters_state(self.fittable_param, self.state.fittable_param)
@@ -621,8 +644,15 @@
             self._undo.Enable(False)
             return 
+       
         self.model= state.model
         self.data = state.data
         self.smearer= state.smearer
         self.enable2D= state.enable2D
+        
+        #???
+        self.disp_cb_dict = state.disp_cb_dict
+        self.disp_list =state.disp_list
+
+       
         ## set the state of the radio box
         self.shape_rbutton.SetValue(state.shape_rbutton )
@@ -637,10 +667,12 @@
         self.structurebox.SetSelection(state.structurecombobox )
         self.formfactorbox.SetSelection(state.formfactorcombobox)
+        
+        
         ## enable the view 2d button if this is a modelpage type
         if hasattr(self,"model_view"):
-            if not self.enable2D:
+            if self.enable2D:
+                self.model_view.Disable()
+            else:
                 self.model_view.Enable()
-            else:
-                self.model_view.Disable()
         ## set the select all check box to the a given state
         if hasattr(self, "cb1"):   
@@ -648,4 +680,5 @@
       
         ## reset state of checkbox,textcrtl  and  regular parameters value
+            
         self._reset_parameters_state(self.orientation_params_disp,
                                      state.orientation_params_disp)
@@ -653,42 +686,56 @@
                                      state.orientation_params)
         self._reset_parameters_state(self.parameters,state.parameters)    
-            
-        ## display dispersion info layer
+         ## display dispersion info layer        
         self.enable_disp.SetValue(state.enable_disp)
         self.disable_disp.SetValue(state.disable_disp)
-        
+
         if hasattr(self, "disp_box"):
+            
             self.disp_box.SetSelection(state.disp_box) 
             n= self.disp_box.GetCurrentSelection()
             dispersity= self.disp_box.GetClientData(n)
-            name= dispersity.__name__      
+            name= dispersity.__name__     
+
             self._set_dipers_Param(event=None)
             
             #self.disp_cb_dict = {}
             #for k,v in self.state.disp_cb_dict.iteritems():
-                #self.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 
-                #self.state.disp_cb_dict = copy.deepcopy(state.disp_cb_dict)
+            #    self.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 
+            #    self.state.disp_cb_dict = copy.deepcopy(state.disp_cb_dict)
+
+            if name=="ArrayDispersion":
                 
-            if name=="ArrayDispersion":
                 for item in self.disp_cb_dict.keys():
-                    print "array dispersion",state.values, state.weights
-                    self.disp_cb_dict[item].SetValue(state.disp_cb_dict[item])
-                    # Create the dispersion objects
-                    from sans.models.dispersion_models import ArrayDispersion
-                    disp_model = ArrayDispersion()
-                    disp_model.set_weights(state.values, state.weights)
-                   
-                    self._disp_obj_dict[item] = disp_model
-                    # Set the new model as the dispersion object for the selected parameter
-                    self.model.set_dispersion(item, disp_model)
-                   
-                    #self.model._persistency_dict = {}
-                    #self.model._persistency_dict[item] = [state.values, state.weights]
+                    
+                    if hasattr(self.disp_cb_dict[item],"SetValue") :
+                        self.disp_cb_dict[item].SetValue(state.disp_cb_dict[item])
+                        # Create the dispersion objects
+                        from sans.models.dispersion_models import ArrayDispersion
+                        disp_model = ArrayDispersion()
+                        if hasattr(state,"values")and self.disp_cb_dict[item].GetValue()==True:
+                            if len(state.values)>0:
+                                self.values=state.values
+                                self.weights=state.weights
+                                disp_model.set_weights(self.values, state.weights)
+                            else:
+                                self._reset_dispersity()
+                        
+                        self._disp_obj_dict[item] = disp_model
+                        # Set the new model as the dispersion object for the selected parameter
+                        self.model.set_dispersion(item, disp_model)
+                    
+                        #self.model._persistency_dict = {}
+                        self.model._persistency_dict[item] = [state.values, state.weights]
                     
             else:
-                self._disp_obj_dict={}
-                for k , v in self.state._disp_obj_dict.iteritems():
-                    self._disp_obj_dict[k]=v
-    
+
+                for k,v in self.state.disp_cb_dict.iteritems():
+                    self.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 
+                    self.state.disp_cb_dict = copy.deepcopy(state.disp_cb_dict)
+                
+                #self._disp_obj_dict={}
+                #for k , v in self.state._disp_obj_dict.iteritems():
+                #    self._disp_obj_dict[k]=v
+                
         ##plotting range restore    
         self._reset_plotting_range(state)
@@ -703,5 +750,5 @@
             self.Refresh()
             #self.compute_chisqr(smearer= self.smearer)  
-            
+        #self._draw_model()   
         ## reset state of checkbox,textcrtl  and dispersity parameters value
         self._reset_parameters_state(self.fittable_param,state.fittable_param)
@@ -714,7 +761,16 @@
         self._reset_context_menu()
         
+        #self._reset_dispersity()
+        #self._set_dipers_Param(event=None) #to bo removed //resets disper para value
+
+        #self.disp_cb_dict = {}
+        #for k,v in self.state.disp_cb_dict.iteritems():
+            #self.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 
+            #self.state.disp_cb_dict = copy.deepcopy(state.disp_cb_dict)
+
+
         ## set the value of the current state to the state given as parameter
         self.state = state.clone() 
-       
+        self._draw_model()
        
         
@@ -886,9 +942,10 @@
             @param statelist: list of state object to store the current state
         """
-        
+        #statelist=[]
         if len(listtocopy)==0:
             return
        
         for item in listtocopy:
+  
             checkbox_state = None
             if item[0]!= None:
@@ -1242,7 +1299,9 @@
         
         ## post state to fit panel
+        self.state.parameters =[]
         self.state.model =self.model
+        
         self.disp_list =self.model.getDispParamList()
-        self.state.disp_list = self.disp_list,
+        self.state.disp_list = self.disp_list
         self.sizer4_4.Layout()
         self.sizer4.Layout()
@@ -1339,4 +1398,5 @@
         """
         self._reset_dispersity()
+
         if self.model ==None:
             self.model_disp.Hide()
@@ -1351,6 +1411,8 @@
             self.disp_box.Show(True)
             ## layout for model containing no dispersity parameters
+            
             self.disp_list= self.model.getDispParamList()
-            if len(self.disp_list)==0:
+             
+            if len(self.disp_list)==0 and len(self.disp_cb_dict)==0:
                 self._layout_sizer_noDipers()  
             else:
@@ -1362,5 +1424,5 @@
             self.disp_box.SetSelection(0) 
             self.sizer4_4.Clear(True)
-        
+            
         ## post state to fit panel 
         self.save_current_state()
@@ -1369,5 +1431,6 @@
             event = PageInfoEvent(page = self)
             wx.PostEvent(self.parent, event)
-       
+        
+        self._draw_model()
         self.sizer4_4.Layout()
         self.sizer4.Layout()
@@ -1376,5 +1439,4 @@
         self.SetScrollbars(20,20,200,100)       
           
-            
         
     def _layout_sizer_noDipers(self):
@@ -1416,6 +1478,6 @@
         self.weights=[]
        
-        
-        from sans.models.dispersion_models import GaussianDispersion
+      
+        from sans.models.dispersion_models import GaussianDispersion, ArrayDispersion
         if len(self.disp_cb_dict)==0:
             self.sizer4_4.Clear(True)
@@ -1426,17 +1488,17 @@
             self.SetScrollbars(20,20,200,100)   
             return 
-        
-        
-        for p in self.disp_cb_dict:
-            # The parameter was un-selected. Go back to Gaussian model (with 0 pts)
-            disp_model = GaussianDispersion()
-            # Store the object to make it persist outside the scope of this method
-            #TODO: refactor model to clean this up?
-            self._disp_obj_dict[p] = disp_model
-            # Set the new model as the dispersion object for the selected parameter
-            self.model.set_dispersion(p, disp_model)
-            # Redraw the model
-           
-            self._draw_model()
+        if (len(self.disp_cb_dict)>0) :
+            for p in self.disp_cb_dict:
+                # The parameter was un-selected. Go back to Gaussian model (with 0 pts)                    
+                disp_model = GaussianDispersion()
+               
+            	self._disp_obj_dict[p] = disp_model
+            	# Set the new model as the dispersion object for the selected parameter
+                try:
+            	   self.model.set_dispersion(p, disp_model)
+                except:
+                    pass
+				# Redraw the model
+                self._draw_model()
         ## save state into
         self.save_current_state()
@@ -1454,11 +1516,11 @@
              self.disp_list should change type later .now only gaussian
         """
-        
+
         n = self.disp_box.GetCurrentSelection()
         dispersity= self.disp_box.GetClientData(n)
         name= dispersity.__name__
+        self.disp_name = name
         if name == "GaussianDispersion":
             self._set_sizer_gaussian()
-            
         if name == "ArrayDispersion":
             self._set_sizer_arraydispersion()
@@ -1477,11 +1539,9 @@
         self.Refresh()
         
-       
-       
-        
     def _set_sizer_arraydispersion(self):
         """
             draw sizer with array dispersity  parameters
         """
+        
         if len(self.param_toFit)>0:
             for item in self.fittable_param:
@@ -1491,9 +1551,11 @@
                 if item in self.param_toFit:
                     self.param_toFit.remove(item)
-                    
+                  
+
         self.fittable_param=[]
         self.fixed_param=[]
         self.orientation_params_disp=[]
         self.sizer4_4.Clear(True) 
+        self._reset_dispersity()
         ix=0
         iy=1     
@@ -1504,12 +1566,27 @@
         # Add a check box for each parameter.
         self.disp_cb_dict = {}
+        
         for p in self.model.dispersion.keys():
-            ix+=1 
-            self.disp_cb_dict[p] = wx.CheckBox(self, -1, p, (10, 10))
-            self.state.disp_cb_dict[p]=  self.disp_cb_dict[p].GetValue()
-            #print "went here======>",self.disp_cb_dict
-            wx.EVT_CHECKBOX(self, self.disp_cb_dict[p].GetId(), self.select_disp_angle)
-            self.sizer4_4.Add(self.disp_cb_dict[p], (iy, ix), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        
+            if not p in self.model.orientation_params:
+                ix+=1 
+                self.disp_cb_dict[p] = wx.CheckBox(self, -1, p, (10, 10))
+                self.state.disp_cb_dict[p]=  self.disp_cb_dict[p].GetValue()
+
+                wx.EVT_CHECKBOX(self, self.disp_cb_dict[p].GetId(), self.select_disp_angle)
+                self.sizer4_4.Add(self.disp_cb_dict[p], (iy, ix), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        for p in self.model.dispersion.keys():
+            if p in self.model.orientation_params:
+                ix+=1 
+                self.disp_cb_dict[p] = wx.CheckBox(self, -1, p, (10, 10))
+                self.state.disp_cb_dict[p]=  self.disp_cb_dict[p].GetValue()
+                if not self.enable2D:
+                    self.disp_cb_dict[p].Disable()
+                else:
+                    self.disp_cb_dict[p].Enable()
+
+                wx.EVT_CHECKBOX(self, self.disp_cb_dict[p].GetId(), self.select_disp_angle)
+                self.sizer4_4.Add(self.disp_cb_dict[p], (iy, ix), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+
+
         ix =0
         iy +=1 
@@ -1519,8 +1596,23 @@
         self.SetScrollbars(20,20,200,100)
         ## save state into
+
+        self.state.orientation_params =[]
+        self.state.orientation_params_disp =[]
+        self.state.parameters =[]
+        self.state.fittable_param =[]
+        self.state.fixed_param =[]
+        
+        ## save checkbutton state and txtcrtl values
+        
+        self._copy_parameters_state(self.orientation_params,
+                                     self.state.orientation_params)
+
         self._copy_parameters_state(self.orientation_params_disp,
                                      self.state.orientation_params_disp)
+        
+        self._copy_parameters_state(self.parameters, self.state.parameters)
         self._copy_parameters_state(self.fittable_param, self.state.fittable_param)
         self._copy_parameters_state(self.fixed_param, self.state.fixed_param)
+        
         
         ## post state to fit panel
@@ -1528,9 +1620,11 @@
         wx.PostEvent(self.parent, event)
         
+                
+        
+       
 
     def _set_range_sizer(self, title, object1=None,object=None):
         """
-            TODO: object1 and object are NOT proper parameter names.
-            Please clean up your code.
+            Fill the 
         """
         self.sizer5.Clear(True)
@@ -1541,8 +1635,14 @@
         self.qmin.SetValue(str(self.qmin_x))
         self.qmin.SetToolTipString("Minimun value of Q in linear scale.")
+        #self.qmin.Bind(wx.EVT_SET_FOCUS, self.onSetFocus)
+        #self.qmin.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter)
+        #self.qmin.Bind(wx.EVT_TEXT_ENTER, self._onparamEnter)
      
         self.qmax    = BasicPage.ModelTextCtrl(self, -1,size=(_BOX_WIDTH,20))
         self.qmax.SetValue(str(self.qmax_x))
         self.qmax.SetToolTipString("Maximum value of Q in linear scale.")
+        #self.qmax.Bind(wx.EVT_SET_FOCUS, self.onSetFocus)
+        #self.qmax.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter)
+        #self.qmax.Bind(wx.EVT_TEXT_ENTER, self._onparamEnter)
      
         sizer_horizontal=wx.BoxSizer(wx.HORIZONTAL)
Index: sansview/perspectives/fitting/fitpage.py
===================================================================
--- sansview/perspectives/fitting/fitpage.py	(revision 6f2c9193ff21395eb08572d7152be3a0fb7a1c39)
+++ sansview/perspectives/fitting/fitpage.py	(revision f20767bc58d07c9f4d4c8b08bed906d17bd199e7)
@@ -623,5 +623,5 @@
            
         self.reset_page_helper(state)
-        evt = ModelEventbox(model=self.model)
+        evt = ModelEventbox(model=state.model)
         wx.PostEvent(self.event_owner, evt)   
             
@@ -1121,96 +1121,102 @@
         iy+=1
         sizer.Add((10,10),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        for item in self.model.orientation_params:
-            if not item in self.disp_list :
-                iy += 1
-                ix = 0
-                ## add parameters name with checkbox for selecting to fit
-                cb = wx.CheckBox(self, -1, item )
-                cb.SetValue(False)
-                wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param)
-                if self.data.__class__.__name__ =="Data2D":
-                    cb.Enable()
-                else:
-                    cb.Disable()
-                sizer.Add( cb,( iy, ix),(1,1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 5)
-
-                ## add parameter value
-                ix += 1
-                value= self.model.getParam(item)
-                ctl1 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH,20),
-                                    style=wx.TE_PROCESS_ENTER)
-                
-                ctl1.SetValue(format_number(value))
-                if self.data.__class__.__name__ =="Data2D":
-                    ctl1.Enable()
-                else:
-                    ctl1.Disable()
-                sizer.Add(ctl1, (iy,ix),(1,1), wx.EXPAND)
-                ## text to show error sign
-                ix += 1
-                text2=wx.StaticText(self, -1, '+/-')
-                sizer.Add(text2,(iy, ix),(1,1),\
-                                wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
-                text2.Hide() 
-                ## txtcrtl to add error from fit
-                ix += 1
-                ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
-                sizer.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-                ctl2.Hide()
-                if self.data.__class__.__name__ =="Data2D":
-                    ctl1.Enable()
-                else:
-                    ctl1.Disable()
-                param_min, param_max= self.model.details[item][1:]
-                ix += 1
-                ctl3 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER,
-                                               kill_focus_callback = self._onparamRangeEnter,
-                                               set_focus_callback  = self._onparamRangeEnter)
-                if param_min ==None:
-                    ctl3.SetValue("")
-                else:
-                    ctl3.SetValue(str(param_min))
-                sizer.Add(ctl3, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-                ctl3.Hide()
-                if self.data.__class__.__name__ =="Data2D":
-                    ctl3.Enable()
-                else:
-                    ctl3.Disable()
-                ix += 1
-                ctl4 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER,
-                                               kill_focus_callback = self._onparamRangeEnter,
-                                               set_focus_callback  = self._onparamRangeEnter)
-                sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-                if param_max ==None:
-                    ctl4.SetValue("")
-                else:
-                    ctl4.SetValue(str(param_max))
-                ctl4.Hide()
-                if self.data.__class__.__name__ =="Data2D":
-                    ctl4.Enable()
-                else:
-                    ctl4.Disable()
-                if self.engine_type=="park":
-                    ctl3.Show(True)
-                    ctl4.Show(True)
-                ix +=1
-                # Units
-                try:
-                    units = wx.StaticText(self, -1, self.model.details[item][0], style=wx.ALIGN_LEFT)
-                except:
-                    units = wx.StaticText(self, -1, "", style=wx.ALIGN_LEFT)
-                if self.data.__class__.__name__ =="Data2D":
-                    units.Enable()
-                else:
-                    units.Disable()
-                sizer.Add(units, (iy,ix),(1,1),  wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        
+        # type can be either Guassian or Array
+        type= self.model.dispersion.values()[1]["type"]
+       
+        #For Gaussian only
+        if type.lower() != "array":
+            for item in self.model.orientation_params:
+                if not item in self.disp_list:
+                    iy += 1
+                    ix = 0
+                    ## add parameters name with checkbox for selecting to fit
+                    cb = wx.CheckBox(self, -1, item )
+                    cb.SetValue(False)
+                    wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param)
+                    if self.data.__class__.__name__ =="Data2D":
+                        cb.Enable()
+                    else:
+                        cb.Disable()
+                    sizer.Add( cb,( iy, ix),(1,1),
+                                 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 5)
+    
+                    ## add parameter value
+                    ix += 1
+                    value= self.model.getParam(item)
+                    ctl1 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH,20),
+                                        style=wx.TE_PROCESS_ENTER)
                     
-                
-                ##[cb state, name, value, "+/-", error of fit, min, max , units]
-                self.parameters.append([cb,item, ctl1,
-                                        text2,ctl2, ctl3, ctl4,units])
-                self.orientation_params.append([cb,item, ctl1,
-                                        text2,ctl2, ctl3, ctl4,units])
+                    ctl1.SetValue(format_number(value))
+                    if self.data.__class__.__name__ =="Data2D":
+                        ctl1.Enable()
+                    else:
+                        ctl1.Disable()
+                    sizer.Add(ctl1, (iy,ix),(1,1), wx.EXPAND)
+                    ## text to show error sign
+                    ix += 1
+                    text2=wx.StaticText(self, -1, '+/-')
+                    sizer.Add(text2,(iy, ix),(1,1),\
+                                    wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                    text2.Hide() 
+                    ## txtcrtl to add error from fit
+                    ix += 1
+                    ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+                    sizer.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+                    ctl2.Hide()
+                    if self.data.__class__.__name__ =="Data2D":
+                        ctl1.Enable()
+                    else:
+                        ctl1.Disable()
+                    param_min, param_max= self.model.details[item][1:]
+                    ix += 1
+                    ctl3 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER,
+                                                   kill_focus_callback = self._onparamRangeEnter,
+                                                   set_focus_callback  = self._onparamRangeEnter)
+                    if param_min ==None:
+                        ctl3.SetValue("")
+                    else:
+                        ctl3.SetValue(str(param_min))
+                    sizer.Add(ctl3, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+                    ctl3.Hide()
+                    if self.data.__class__.__name__ =="Data2D":
+                        ctl3.Enable()
+                    else:
+                        ctl3.Disable()
+                    ix += 1
+                    ctl4 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER,
+                                                   kill_focus_callback = self._onparamRangeEnter,
+                                                   set_focus_callback  = self._onparamRangeEnter)
+                    sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+                    if param_max ==None:
+                        ctl4.SetValue("")
+                    else:
+                        ctl4.SetValue(str(param_max))
+                    ctl4.Hide()
+                    if self.data.__class__.__name__ =="Data2D":
+                        ctl4.Enable()
+                    else:
+                        ctl4.Disable()
+                    if self.engine_type=="park":
+                        ctl3.Show(True)
+                        ctl4.Show(True)
+                    ix +=1
+                    # Units
+                    try:
+                        units = wx.StaticText(self, -1, self.model.details[item][0], style=wx.ALIGN_LEFT)
+                    except:
+                        units = wx.StaticText(self, -1, "", style=wx.ALIGN_LEFT)
+                    if self.data.__class__.__name__ =="Data2D":
+                        units.Enable()
+                    else:
+                        units.Disable()
+                    sizer.Add(units, (iy,ix),(1,1),  wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+                        
+                    
+                    ##[cb state, name, value, "+/-", error of fit, min, max , units]
+                    self.parameters.append([cb,item, ctl1,
+                                            text2,ctl2, ctl3, ctl4,units])
+                    self.orientation_params.append([cb,item, ctl1,
+                                            text2,ctl2, ctl3, ctl4,units])
               
         iy+=1
Index: sansview/perspectives/fitting/fitpanel.py
===================================================================
--- sansview/perspectives/fitting/fitpanel.py	(revision 6f2c9193ff21395eb08572d7152be3a0fb7a1c39)
+++ sansview/perspectives/fitting/fitpanel.py	(revision f20767bc58d07c9f4d4c8b08bed906d17bd199e7)
@@ -145,5 +145,5 @@
         
         pageClosedEvent = wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE
-        self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.onClosePage)      
+        self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.onClosePage)
        
         #dictionary of miodel {model class name, model class}
@@ -389,6 +389,4 @@
             self.fit_page_name[page.window_name].appendItem(page.createMemento()) 
             
-            #print " current added state: ",len(self.fit_page_name[page.window_name])
-            
     def _onUndo(self, event ):
         """
Index: sansview/perspectives/fitting/modelpage.py
===================================================================
--- sansview/perspectives/fitting/modelpage.py	(revision 6f2c9193ff21395eb08572d7152be3a0fb7a1c39)
+++ sansview/perspectives/fitting/modelpage.py	(revision f20767bc58d07c9f4d4c8b08bed906d17bd199e7)
@@ -35,4 +35,5 @@
         description=""
         if self.model!=None:
+            
             description = self.model.description
             
@@ -279,7 +280,8 @@
         # If the 2D display is not currently enabled, plot the model in 2D 
         # and set the enable2D flag.
+
         if self.fitrange:
             self.enable2D = True
-            
+ 
         if self.enable2D:
             self._draw_model()
@@ -290,8 +292,11 @@
                     if item[2]!=None:
                         item[2].Enable()
-            if len(self.orientation_params_disp)>0:
-                 for item in self.orientation_params_disp:
-                    if item[2]!=None:
-                        item[2].Enable()
+            if  self.disp_name == "ArrayDispersion":                
+                self._set_sizer_arraydispersion()  
+            else:
+                if len(self.orientation_params_disp)>0:
+                     for item in self.orientation_params_disp:
+                        if item[2]!=None:
+                            item[2].Enable()
         self.state.enable2D =  copy.deepcopy(self.enable2D)
         ## post state to fit panel
@@ -329,5 +334,4 @@
         self.state.structurecombobox = self.structurebox.GetCurrentSelection()
         self.state.formfactorcombobox = self.formfactorbox.GetCurrentSelection()
-        #print "_on_select_model",self.state.structurecombobox,self.state.formfactorcombobox 
        
         ## post state to fit panel
@@ -504,5 +508,5 @@
         sizer.Add((10,10),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         for item  in self.model.orientation_params:
-            if not item in self.disp_list :
+            if not item in self.disp_list and item in keys:
                 iy += 1
                 ix = 0
@@ -536,5 +540,5 @@
                 self.orientation_params.append([None,item, ctl1,
                                         None,None, None, None,None])
-                
+                    
         iy+=1
         sizer.Add((10,10),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
