@@ -18,6 +18,7 @@ import DialogContent from '@material-ui/core/DialogContent';
1818import DialogContentText from '@material-ui/core/DialogContentText' ;
1919import DialogTitle from '@material-ui/core/DialogTitle' ;
2020
21+ import PythonMethodControlledSelectFieldConnection from '../../../redux/reduxconnect/PythonMethodControlledSelectFieldConnection'
2122var PythonControlledCapability = require ( 'geppetto-client/js/communication/geppettoJupyter/PythonControlledCapability' ) ;
2223var PythonControlledTextField = PythonControlledCapability . createPythonControlledControl ( TextField ) ;
2324var PythonMethodControlledSelectField = PythonControlledCapability . createPythonControlledControlWithPythonDataFetch ( Select ) ;
@@ -36,24 +37,6 @@ export default class NetPyNEConnectivityRule extends React.Component {
3637 } ;
3738 }
3839
39- componentDidMount ( ) {
40- GEPPETTO . on ( 'populations_change' , ( ) => {
41- this . forceUpdate ( ) ;
42- } )
43- GEPPETTO . on ( 'cellType_change' , ( ) => {
44- this . forceUpdate ( ) ;
45- } )
46- GEPPETTO . on ( 'cellModel_change' , ( ) => {
47- this . forceUpdate ( ) ;
48- } )
49- }
50-
51- componentWillUnmount ( ) {
52- GEPPETTO . off ( 'populations_change' )
53- GEPPETTO . off ( 'cellType_change' )
54- GEPPETTO . off ( 'cellModel_change' )
55- }
56-
5740 handleRenameChange = event => {
5841 var storedValue = this . props . name ;
5942 var newValue = Utils . nameValidation ( event . target . value ) ;
@@ -156,7 +139,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
156139 </ NetPyNEField >
157140
158141 < NetPyNEField id = { "netParams.connParams.synMech" } >
159- < PythonMethodControlledSelectField
142+ < PythonMethodControlledSelectFieldConnection
160143 model = { "netParams.connParams['" + this . props . name + "']['synMech']" }
161144 method = { "netpyne_geppetto.getAvailableSynMech" }
162145 postProcessItems = { ( pythonData , selected ) => pythonData . map ( name => (
@@ -218,23 +201,23 @@ export default class NetPyNEConnectivityRule extends React.Component {
218201 } else if ( this . state . sectionId == "Pre Conditions" ) {
219202 var content = < div >
220203 < NetPyNEField id = { "netParams.connParams.preConds.pop" } >
221- < PythonMethodControlledSelectField
204+ < PythonMethodControlledSelectFieldConnection
222205 model = { "netParams.connParams['" + this . props . name + "']['preConds']['pop']" }
223206 method = { "netpyne_geppetto.getAvailablePops" }
224207 postProcessItems = { this . postProcessMenuItems }
225208 multiple
226209 />
227210 </ NetPyNEField >
228211 < NetPyNEField id = { "netParams.connParams.preConds.cellModel" } >
229- < PythonMethodControlledSelectField
212+ < PythonMethodControlledSelectFieldConnection
230213 model = { "netParams.connParams['" + this . props . name + "']['preConds']['cellModel']" }
231214 method = { "netpyne_geppetto.getAvailableCellModels" }
232215 postProcessItems = { this . postProcessMenuItems }
233216 multiple
234217 />
235218 </ NetPyNEField >
236219 < NetPyNEField id = { "netParams.connParams.preConds.cellType" } >
237- < PythonMethodControlledSelectField
220+ < PythonMethodControlledSelectFieldConnection
238221 model = { "netParams.connParams['" + this . props . name + "']['preConds']['cellType']" }
239222 method = { "netpyne_geppetto.getAvailableCellTypes" }
240223 postProcessItems = { this . postProcessMenuItems }
@@ -279,23 +262,23 @@ export default class NetPyNEConnectivityRule extends React.Component {
279262 } else if ( this . state . sectionId == "Post Conditions" ) {
280263 var content = < div >
281264 < NetPyNEField id = { "netParams.connParams.postConds.pop" } >
282- < PythonMethodControlledSelectField
265+ < PythonMethodControlledSelectFieldConnection
283266 model = { "netParams.connParams['" + this . props . name + "']['postConds']['pop']" }
284267 method = { "netpyne_geppetto.getAvailablePops" }
285268 postProcessItems = { this . postProcessMenuItems }
286269 multiple
287270 />
288271 </ NetPyNEField >
289272 < NetPyNEField id = { "netParams.connParams.postConds.cellModel" } >
290- < PythonMethodControlledSelectField
273+ < PythonMethodControlledSelectFieldConnection
291274 model = { "netParams.connParams['" + this . props . name + "']['postConds']['cellModel']" }
292275 method = { "netpyne_geppetto.getAvailableCellModels" }
293276 postProcessItems = { this . postProcessMenuItems }
294277 multiple
295278 />
296279 </ NetPyNEField >
297280 < NetPyNEField id = { "netParams.connParams.postConds.cellType" } >
298- < PythonMethodControlledSelectField
281+ < PythonMethodControlledSelectFieldConnection
299282 model = { "netParams.connParams['" + this . props . name + "']['postConds']['cellType']" }
300283 method = { "netpyne_geppetto.getAvailableCellTypes" }
301284 postProcessItems = { this . postProcessMenuItems }
0 commit comments