how can i use Setview method ?

374 views
Skip to first unread message

Mohammed Suleman khan

unread,
Nov 8, 2013, 2:18:59 PM11/8/13
to framew...@googlegroups.com
I am trying to use setView method in my app to call specific view for a page, I would like to know what I have to configure in Application.cfc in order to use setView methods in the controllers ?

this is my Application.cfc.

component extends = "org.corfield.framework" {


        //Get the directory this application is running in
        this.root = getDirectoryFromPath(getCurrentTemplatePath());
        //Create mappings for ObjectFactory beans
        this.mappings["/myappManager"] = getDirectoryFromPath(getCurrentTemplatePath());
        //We add a hash of the current directory to ensure that each Application has unique name
        this.name = "myapp" & hash(this.root);
       
       
        //We don't be working with the Client scope ..
        this.clientstorage = false;
        //but we may eventually want to add login capabilities
        this.sessionmanagement = true;
        this.sessiontimeout = createTimeSpan(0,2,0,0);
       
       
       //By defining an application-wide datasource, we no longer need
       //datasource="" attributes for our queries.
       this.datasource = "dbname";
       //ORM settings
       this.ORMEnabled = false;
      
      
       // FW/1 - configuration:
        variables.framework = {
        base = getDirectoryFromPath(CGI.SCRIPT_NAME),
        // the name of the URL variable:
        action = 'action',
        // whether or not to use subsystems:
        usingSubsystems = true,
        // default subsystem name (if usingSubsystems == true):
        defaultSubsystem = 'public',
        // default section name:
        defaultSection = 'main',
        // default item name:
        defaultItem = 'default',
        // the URL variable to reload the controller/service cache:
        reload = 'reload',
        // the value of the reload variable that authorizes the reload:
        password = 'true',
        // debugging flag to force reload of cache on each request:
        reloadApplicationOnEveryRequest = true,
        // whether to force generation of SES URLs:
        generateSES = false,
        // whether to omit /index.cfm in SES URLs:
        SESOmitIndex = false,
        // either CGI.SCRIPT_NAME or a specified base URL path:
        baseURL = 'useRequestURI',
        // location used to find controllers / services:
        //cfcbase = essentially base with / replaced by .
        //cfcbase = 'com.services',
        // whether FW/1 implicit service call should be suppressed:
        suppressImplicitService = false,
        // list of file extensions that FW/1 should not handle:
        unhandledExtensions = 'cfc',
        // list of (partial) paths that FW/1 should not handle:
        unhandledPaths = '/flex2gateway',
        // flash scope magic key and how many concurrent requests are supported:
        preserveKeyURLKey = 'fw1pk',
        maxNumContextsPreserved = 10,
        // set this to true to cache the results of fileExists for performance:
        cacheFileExists = false,
        // change this if you need multiple FW/1 applications in a single CFML application:
        applicationKey = 'org.corfield.framework',
        // debug info on the bottom
        debugInfo = false
    };
   
    if ( framework.usingSubSystems ) {
        framework.subsystemDelimiter = ':';
        framework.siteWideLayoutSubsystem = 'common';
        framework.home = framework.defaultSubsystem & framework.subsystemDelimiter & framework.defaultSection & '.' & framework.defaultItem;
        //framework.error = framework.defaultSubsystem & framework.subsystemDelimiter & framework.defaultSection & '.error';
    } else {
        framework.home = framework.defaultSection & '.' & framework.defaultItem;
        //framework.error = framework.defaultSection & '.error';
    };
   
    function setupApplication(){
        setBeanFactory(createObject("component", "org.ObjectFactory").init(expandPath("./assets/config/beans.xml.cfm")));   
    }
   
       
}

this is what I have tried.

<cfset variables.fw.setView('directory.pagename')>

Thanks.

Matt Quackenbush

unread,
Nov 8, 2013, 2:30:59 PM11/8/13
to framew...@googlegroups.com
Configuration of the framework in App.cfc has nothing to do with using setView(). Have you configured your controller(s) per the documentation?

https://github.com/framework-one/fw1/wiki/Developing-Applications-Manual#controllers-and-the-fw1-api

If you have done that and are still having difficulty, please show us the relevant code and the stack trace for any errors you're running into.

HTH




--
--
FW/1 on RIAForge: http://fw1.riaforge.org/
 
FW/1 on github: http://github.com/framework-one/fw1
 
FW/1 on Google Groups: http://groups.google.com/group/framework-one
---
You received this message because you are subscribed to the Google Groups "framework-one" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-on...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Mohammed Suleman khan

unread,
Nov 8, 2013, 3:03:24 PM11/8/13
to framew...@googlegroups.com

Mohammed Suleman khan

unread,
Nov 8, 2013, 3:03:47 PM11/8/13
to framew...@googlegroups.com
I am using railo and I have configure my controllers according to the said doc.

<cffunction name="init" returntype="void" access="public">
                   <cfargument name="fw" type="component" required="true">
                   <cfset Variables.fw = fw>
  </cffunction>

<cffunction name="text_view" access="public" output="false" returntype="any">
                   <cfargument name="rc" type="struct" required="true">
                   <cfset textbox = getSurveyService().getText(arguments.rc.id)>
                   <cfset rc.data = textbox>
                   <cfset variables.fw.view("admin:survey.text_view")>
</cffunction>

Sean Corfield

unread,
Nov 8, 2013, 4:13:49 PM11/8/13
to framew...@googlegroups.com
On Fri, Nov 8, 2013 at 12:03 PM, Mohammed Suleman khan
<salmank...@gmail.com> wrote:
> <cfset variables.fw.view("admin:survey.text_view")>

Did you mean setView() here?
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

Mohammed Suleman khan

unread,
Nov 8, 2013, 4:53:47 PM11/8/13
to framew...@googlegroups.com
yeah I mean setView(), it was a typo sorry for that.
Reply all
Reply to author
Forward
0 new messages