Hi There,

I have built custom component in FarCry b230. Using some tutorials and
documents I have developed the component and also deploy it. In FarCry
Admin panel, I got Custom Component "Member" Tab same like Content tab
and left side menu contains "Member Companies". When I click on that,
on right side container it shows me page same as when you click on
News or Fact. But when I am trying to click on add button, I am
getting error:

 "15:11:49.049 - Expression Exception - in C:\farcry_cawa\fourq
\fourq.cfc : line 74

                Variable CALLER.stobj.typename is undefined."

I am not able to solve the problem. Here I am sending you all files
and the way I created this component so that you can have some idea.I
want to display all member companies with their detail and logo on one
page. For that I want to build new component like "news" called
"Member". I have created CSMemComp.cfc file in <application_name>/
packages/types folder.

CSMemComp.cfc contains:

<cfcomponent extends="farcry.farcry_core.packages.types.types"
displayname="Custom Member Company object" hint="A List for showing
associated Member Companies" bCustomType=1>
    <!--------type properties-------->
    <cfproperty name="Name" type="string" hint="Member Company Name"
required="Yes" default="">
    <cfproperty name="Logo" type="string" hint="Logo to identify
Company" required="no" default="">
    <cfproperty name="Address" type="string" hint="Address of Company"
required="no" default="" >
    <cfproperty name="Website" type="string" hint="Company Website"
required="no" default="" >
    <cfproperty name="Phone" type="string" hint="Phone number of
Company" required="no" default="" >
    <cfproperty name="Fax" type="string" hint="Fax number of Company"
required="no" default="" >
    <cfproperty name="AfterHours" type="string" hint="Contact number
for after hours" required="no" default="" >
    <cfproperty name="Email" type="string" hint="Email address of
Company" required="no" default="" >
    <cfproperty name="status" type="string" hint="Satus of Company
(draft/pending/approved)" required="Yes" default="draft">

    <cffunction name="edit" access="public">

        <cfargument name="objectid" required="yes" type="UUID">

        <!--- getData for object edit --->
        <cfset stObj = this.getData(arguments.objectid)>

        <!--- hack to make arguments available to included file --->
        <cfset stArgs = arguments>

        <cfinclude template="CSMemComp/edit.cfm">

    </cffunction>

</cfcomponent>

Then I had created new folder CSMemComp in <app_name>/packages/types/
I had pasted all files from <farcry_core>/packages/types/_dmNews to
this folder. I had done some changes in edit.cfm file.

edit.cfm contains:

<cfsetting enablecfoutputonly="Yes">
<cfimport taglib="/farcry/farcry_core/tags/farcry" prefix="farcry">
<cfparam name="url.killplp" default="0">

<cfoutput>
<farcry:plp
 
owner="#session.dmSec.authentication.userlogin#_#stObj.objectID#"
            stepDir="/farcry/#application.applicationname#/packages/
types/CSMemComp/plpEdit"
            cancelLocation="#application.url.farcry#/admin/
customadmin.cfm?module=CSMemComp/list.cfm"
            iTimeout="15"
            stInput="#stObj#"
            bDebug="0"
            bForceNewInstance="#url.killplp#"
            r_stOutput="stOutput"
            storage="file"
            storagedir="#application.path.plpstorage#"
            redirection="server"
            r_bPLPIsComplete="bComplete">

            <farcry:plpstep name="start" template="start.cfm">
            <farcry:plpstep name="files" template="files.cfm">
            <farcry:plpstep name="images" template="images.cfm">
            <farcry:plpstep name="categories" template="metadata.cfm">
            <farcry:plpstep name="complete" template="complete.cfm"
bFinishPLP="true">
</farcry:plp>
<cfparam name="request.stPLP.currentStep" default="">
<cfif request.stPLP.currentStep IS 'body'>
<script>

parent.frames['treeFrame'].location.href='#application.url.farcry#/
navajo/overview_frame.cfm?
rootobjectid=#application.navid.fileroot#&insertonly=1';

em = parent.document.getElementById('subTabArea');

for (var i = 0;i < em.childNodes.length;i++)
{
   parent.document.getElementById(em.childNodes[i].id).style.display =
'none';
}
parent.document.getElementById('DynamicFileTab').style.display
='inline';
parent.document.getElementById('DynamicSiteTab').style.display
='inline';
parent.document.getElementById('DynamicImageTab').style.display
='inline';

</script>
<cfelse>
            <script>
parent.frames['treeFrame'].location.href='#application.url.farcry#/
dynamic/dynamicMenuFrame.cfm?type=general';
            em = parent.document.getElementById('subTabArea');
            for (var i = 0;i < em.childNodes.length;i++)
            {
 
parent.document.getElementById(em.childNodes[i].id).style.display =
'inline';
            }
 
parent.document.getElementById('DynamicFileTab').style.display
='none';
 
parent.document.getElementById('DynamicSiteTab').style.display
='none';
 
parent.document.getElementById('DynamicImageTab').style.display
='none';
            </script>
</cfif>
</cfoutput>
<cfif isDefined("bComplete") and bComplete>
            <!--- unlock object and save object --->
            <cfset stoutput.label=stoutput.title>
            <cfinvoke
component="#application.packagepath#.farcry.locking" method="unlock"
returnvariable="unlockRet">
            <cfinvokeargument name="stObj" value="#stOutput#"/>
            <cfinvokeargument name="objectid"
value="#stOutput.objectid#"/>
            <cfinvokeargument name="typename"
value="#stOutput.typename#"/>
            </cfinvoke>
            <!--- all done in one window so relocate back to main page
--->

            <cflocation url="#application.url.farcry#/navajo/
GenericAdmin.cfm?typename=#stOutput.typename#" addtoken="no">

</cfif>
<cfsetting enablecfoutputonly="No">

Then in plpEdit folder, I had changed start.cfm file. I added my new
filed and deleted old ones.
Then I have created new folder CSMemComp under <app_name>/customadmin
and in that new folder I created list.cfm file.

list.cfm Contains:

<cfsetting enablecfoutputonly="yes">
<cfimport taglib="/farcry/farcry_core/tags/admin/" prefix="admin">
<cfimport taglib="/farcry/farcry_core/tags/farcry/" prefix="farcry">

<!--- set up page header --->
<admin:header>

<!--- call generic admin with extrapolation of URL type --->
<farcry:genericAdmin
permissionType="News"
admintype="CSMemComp"
metadata="True"
header="false"
typename="CSMemComp">

<!--- setup footer --->
<admin:footer>
<cfsetting enablecfoutputonly="no">

and finally I changed customadmin.xml file.

customadmin.xml contains:

<?xml version="1.0" encoding="utf-8"?>

<customtabs>
            <parenttab permission="MainNavAdminTab">Member
                        <subtabs permission="MainNavAdminTab" >Objects
                                     <menuitem>
                                                 <label>Member
Companies</label>
                                                 <link>customadmin.cfm?
module=CSMemComp/list.cfm</link>
                                     </menuitem>
                        </subtabs>
            </parenttab>
</customtabs>

I really appreciate for any suggestion ASAP.

Regards,

Sweta Vyas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to