Matt
05/01/2023, 9:09 PMcfvonner
05/01/2023, 9:12 PMMatt
05/02/2023, 12:03 AMcfvonner
05/02/2023, 12:52 AMpublic void function item (rc) {
if rc.keyExists('keyId') {
view( 'item' );
}
if rc.keyExists( 'keyIds' ) {
view( 'multipleitems' );
}
...
}
cfvonner
05/02/2023, 12:53 AMcfsimplicity
05/02/2023, 8:36 AMsetView()
rather than view()
. Plus you'll need a reference to the framework in the controller. And the first condition isn't needed because "item" is the default view for that action.
// make the FW/1 API available to this controller
public function init( fw ) {
variables.framework = fw;
return this;
}
public function item( rc ){
if( rc.KeyExists( "keyIds" )
variables.framework.setView( "multipleItems" );
}
Matt
05/02/2023, 11:27 AM// make the FW/1 API available to this controller
public function init( fw ) {
variables.framework = fw;
return this;
}
public function ShowOneItem( rc ){
// user input checked and calls to DBs with rc.keyID
}
public function ShowMultiple( rc ){
// user input checked and with rc.keyIDs
// I was hoping to call the ShowOneItem from LOOP within ShowMultiple view where the ShowOneItem
}
I have tried to place HTML output into savecontent variable, I was even thinking of CFHTTP but that seems like a bridge too far. I am not sure if that helps to clarify. But at this point, I am thinking this might not be possible.cfsimplicity
05/02/2023, 1:16 PMview()
method may be what you need after all. You can pass parameters to it as a struct in the second argument and it will return the output as a variable to your controller. https://framework-one.github.io/documentation/4.3/reference-manual/#public-string-function-view-string-path-struct-args----any-missingview----Matt
05/02/2023, 2:32 PMcfvonner
05/02/2023, 3:22 PMview( arguments )
for each item. Then, rather than looping in your controller, pull all of the data in one call to the database, pass it all to the main view, and loop over it inside of the view.cfvonner
05/02/2023, 3:24 PMview()
vs. setView()
. Toward the end of the time I was using FW/1, I was using view()
with arguments almost exclusively, so I forgot about setView()
.cfvonner
05/02/2023, 3:27 PMMatt Jones
05/02/2023, 3:28 PMMatt
05/02/2023, 4:47 PM