CFFORM and CFC usage

I have form that is calling itself for submission, and at the
top of the
form, I have:
<cfif structkeyexists(url,"m")>
<cfswitch expression="#m#">
<cfcase value="0">
<cfinvoke component="compoents.post" method="infoMail">
<cfinvokeargument name="fName" value="#form.fName#">
<cfinvokeargument name="lName" value="#form.lName#">
<cfinvokeargument name="Address1"
value="#form.Address1#">
<cfinvokeargument name="Address2"
value="#form.Address2#">
<cfinvokeargument name="City" value="#form.City#">
<cfinvokeargument name="State" value="#form.State#">
<cfinvokeargument name="Zip" value="#form.Zip#">
<cfinvokeargument name="Plus4" value="#form.Plus4#">
<cfinvokeargument name="Email" value="#form.Email#">
<cfinvokeargument name="Info" value="#form.Info#">
<cfinvokeargument name="Events" value="#form.Events#">
<cfinvokeargument name="Class" value="#form.Class#">
<cfinvokeargument name="News" value="#form.News#">
</cfinvoke>
</cfcase>
<cfcase value="1">
</cfcase>
</cfswitch>
</cfif>
The problem is that if a checkbox on the form isn't selected,
then I get:
Element EVENTS is undefined in FORM
How can I get around this?? On the CFC I have it setting a
default
value of 0, and it isn't required.....

Steve G wrote:
>
> The problem is that if a checkbox on the form isn't
selected, then I get:
>
> Element EVENTS is undefined in FORM
>
> How can I get around this?? On the CFC I have it setting
a default
> value of 0, and it isn't required.....
That is a standard problem with the HTTP standard and the
check box and
radio button controls. If they are not selected no key is
sent to the
server. Your default in the CFC is not working because the
code is
failing when trying to use the non-existent 'form.events'
value in the
<cfinvokeargument...> tag. You just have to code your
form handler page
to understand this might be so. The two most common solutions
to this
is to check for the existence of the field OR to default it
to some value.
The struckKeyExists() function works well to test for the
existence of
form fields as the form and url variables are structures.
I.E.
<cfif structKeyExists(form,"Events")>
<cfinvokeargument name="Events" value="#form.Events#">
</cfif>
The <cfparam...> tag is designed to provide a default
value to something
if it does not exists.
I.E.
<!--- at the top of the form action page --->
<cfparam name="form.events" default="0">

Similar Messages

  • CFFORM and HIGH CPU USAGE

    Dear Friends
    I write my new forms using CFFORM and format=flash it have a
    DATAGRIDE bind to a 3 tab form (add, edit and delete) and its
    working very nice but when even a single user run the page the CPU
    usage on the server suddenly jump to over 90% and I'm really scared
    to launch it live, does any body has any suggestion?
    Its a MX7 (7.0.1) Enterprise version running on a 4 CPU
    Windows 2000 Server (SP3) with IIS 5, I already installed all
    latest updates and hot fixes.

    "Does the instance with the high counts receive more traffic than the other instances? Is it possible that the load balancer not
    working the way it should be?"
    How can I get that information? I can't see metrics for a specific instance
    "Does it always happen to the first instance?"
    I will check it better, but in the order given by the Processes panel it's the second instance which has the issue. The scaling is at 2 instances for the most part of the time (it's the minimum).
    Maybe one time it was the 3th instance but I'm not sure, I'll give it more attention.
    " How long do these moment last?"
    The time can be 10 to 30 minutes, but I fix it as soon as I see the problem. It's not the down-scaling to resolve it because in these situations the CPU as well is high so the scaling holds or increases the number of instances.
    "- How often do these moments occurs?"
    It occurs quite often, 2/4 times a week.

  • Get CPU and memory usage

    Hi!
    I would like to know if there is any way of getting system CPU and memory usage using Java code.

    I want to get the system CPU and memory usage using the performance monitor dll, the perfctrs.dll, but access this data using Java language.Then you should create wrapper dll between your java code and perfctrs.dll and convert data from format of dll to format of your java code.
    So, that is next question - how to create wrapper dll, how to deal with or how perfctrs.dll works?

  • Scratch disks and RAM usage

    i would like to understand the relationship between scratch disks and RAM usage in Photoshop.
    While i was working on a fairly big psb file (2gb), photoshop kept prompting that I was out of memory, but in fact the utilization was only 75% (i had 16gbs total, photoshop was only using 7gb, and i allowed PS to use up to 14gb in total). when it says out of memory, it was actually my scratch disk at fault ( i only set 1 scratch disk, which was my 120gb SSD running out of space).
    any idea how I can optimize PS to use up all my RAM first before even touching my scratch disk? (short of using a RAMdisk, please).
    thanks!

    I am curious about this also. I just reinstalled W-7--have 11 G of physical memory--a ton of hard drive empty space also, and I have been wondering why PS_CC is so slow--since basically I have only put my Security and Browser in addition to Adobe back on the Dell XPS computer..... At least now it does show the downloading percentage (like .psd file) , but that must be what is happening.  I do think that some of these "frozen" screens I have been experiencing, was because the program was using scratch disk, instead of the Ram... I came up from CS-5, and can't describe it in detail, but just realize how slow PS-CC is in most everything.  Going back and see if reallocating will help...

  • How can we find the most usage and lowest usage of table in Sql Server by T-SQL

    how can we find the most usage and lowest usage of table in Sql Server by T-SQL
    The table has time stamp column
    StartedOn datetime
    EndedOn datetime

    The Below query has been used , but the textdata column doesnot include the name of the table ServiceLog.
    SELECT
    FROM
    databasename,
    duration
    fn_trace_gettable('F:\Program
    Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\log_148.trc',
    default)
    WHERE
    DATABASENAME='ZTCFUTURE'
    AND TEXTDATA
    IS
    NOT
    NULL
    --AND TEXTDATA LIKE 'SERVICE%'
    order
    by cpu
    desc; 

  • Question regarding roaming and data usage

    I am currently out of my main country of service, and as such I have a question regarding roaming and data usage.
    I am told that the airplane mode is sufficient from keeping the phone off from roaming, but does this apply to any background data usage for applications and such?
    If the phone is in airplane mode, are all use of the phone including wifi and application use through the wifi outside of all extra charges from roaming?

    Ann154 wrote:
    If you are getting charged to use the wifi, then it is possible.  Otherwise no
    Just to elaborate here, Ann154 is referring to access charges for wifi, which is nothing to do with Verizon, so if you are using it in a plane, hotel, an internet cafe etc that charges for Wifi rather than being free .   Verizon does not charge you (or indeed know about!) wifi usage, or any other usage that is not on their cellular network (such as using a foreign SIM for example in global phones)  So these charges, if any, will not show up on the verizon bill app.  Having it in airplane mode prevents all cellular data traffic so you should be fine

  • Problem with memory usage and CPU usage

    Hello,
    i have a problem with the memory usage and cpu usage in my project!
    My application must run for more than 24 hrs. The problem is that the longer it runs the bigger is the memory and cpu usage!
    It starts with ~15% CPU usage and ~70 MBytes memory usage. After ~ 24hrs the CPU usage is ~60% and the memory usage is ~170 MBytes!
    After  3 days the CPU usage is almost about 70% and the memory usage is about 360 MBytes!
    What can I do to reduce this huge recource usage?
    Thank you!

    Hi Pahe,
       I think the issue is memory usage, since CPU usage can increase due to greater memory requirements.
       Anyway, it's difficult to debug without seeing your code, can you post it (possibly for LV 7.1 compatibility)?  Or just post a JPEG of the piece of code that can give problems...
       I guess you're appending data to an array instead of replace data elements, but I can't be sure...
       Have a nice day!
    graziano

  • Where to see CPU and RAM usage in IPAD 1

    Hi:-)
    While i have Apps running , I would like to be able to see CPU and RAM in use..and ideas how/where?
    Thanks

    There are several apps in the app store that can show you cpu and ram usage of your device, e.g. "system info"

  • NI DAQmx 8.3 and CPU usage

    I have similar problem as described on page http://forums.ni.com/ni/board/message?board.id=250&message.id=23831
    but have solution and some reflections.
    first of all, about system
    system use 2x PCI-6143 and take data from 16 channels with maximum rate (250 kS/s)
    program
    was created about year ago (with LV 7.1.1, DAQmx 7.4) and on PC with
    PIV (3.2 GHz) processor and 1 Gb of RAM work properly (CPU usage less
    30%).
    Now I've recompile program with LV8.2 and update drivers to DAQmx 8.3. now program can't work properly because CPU usage 100%
    I create test VI for research this problem.
    First version (daq_test1) - simple code - configure daqtask and get data.
    I found:
    if
    sample rate less or equal 90 kS/s (on PCI-6143) CPU usage less 5%, but
    when rate more 95 kS/s CPU usage jump to 60% (for one or more channels
    on one or two devises).
    Then I create simulated devise PCI-6143 in MAX and the same vi (daq_test1) require not more than 5-10% of CPU.
    also
    I have examine devise 16E-4 and find the same problem: if samle rate
    more than "boundary" rate, CPU usage is too much (50-70%).
    Then I add configure parameters (daq_test2) - add manualy DMA "on". There are no effects (CPU usage jump to 60% on "fast" rates)
    Then I  "play" with WaitMode (daq_test3). There are no effects (even if WaitMode=Sleep and SleepTime>1s CPU usage about 60%)
    Finally
    I create vi (daq_test4), where "manually" check
    AvailableSamplesPerChannel and call DAQmx Read only when bufer has more
    samples, that I need.
    So I'd wound solution, but think driver
    MUST check available samples carefully (also, why DAQmx 7.4 can fast
    scan, but  DAQmx 8.3 can't do it at least the same way as previous version).
    Attachments:
    daq_test.zip ‏78 KB

    Artem,
    Thank you for contacting National Instruments support.  This is expected behavior. When the wait mode is set to Sleep, DAQmx will only sleep if and only if there is no data available to process. So, for example,  at 200 kS/s, data is filling up the buffer fairly quickly and should always be available to read, which means that the process will not sleep at all. When data is always available, the CPU is going to handle it as quickly as possible and thus the CPU will appear to be running at near 100%.
    Specifying a wait mode of Sleep is really only beneficial when the acquisition is running slowly enough that a lot of time is spent in DAQmx Read waiting for the data to arrive. In the past, the CPu was maxed out even at extremely slow sampling rates.  Sleep mode alleviates this problem by putting the process to sleep when no data is ready for processing; however, if data is available, it will be handled immediately and no sleeping will occur. If data is constantly available for processing, the CPU is expected to deal with it right away and the usage will appear to be high.
    Regards,
    Kenn North
    Senior Product Manager - Search, Product Data
    http://ni.com/search

  • Batch tracking and material usage analysis

    how do we track the batches and material usage analysis in case of any customer complaint?

    You can use the reports BMBC, MB56, MCRE, MCRX.
    If you want to track by batch wise then batch traceability report MB56.
    Hope this helps you.

  • VI to read CPU and Memory usage on XP machines

    Need a VI to read CPU and Memory usage on an XP machine.

    it works perfectly on my LV8.0 and W2K... it should work on XP too... happy coding...
    Message Edited by JQ on 01-12-2007 11:14 AM
    Best Regards,
    JQ
    LV 8.0 user...
    Attachments:
    cpu_usage.vi ‏18 KB

  • Is there any Vi for getting the CPU and Memory usage of the Local as well as Remote System

    Is there any Vi for getting the CPU and Memory usage of the Local as well as Remote System

    Find the attachment(LV8.5) for local machines. 
    You can use shared variables to monitor the remote machine's usage.
    Attachments:
    Task Monitor 85.vi ‏25 KB

  • How to find out CPU and memory usage for an instance?

    Hi DBA Gurus,
    How to find out CPU usage and memory usage for an instance?
    Any information is appreciated!
    Thank you!
    Robert

    you can calculate cpu usage by adding fallowing three factors which you can get from v$sysstat
    1. Parse CPU time : This represents the percentage of CPU time spent parsing SQL statements. Parse time CPU can be a strong indication that an application has not been well tuned. High parse time CPU usually indicates that the application may be spending too much time opening and closing cursors or is not using bind variables.
    2. Recursive CPU time : Sometimes, to execute a SQL statement issued by a user, the Oracle Server must issue additional statements. Such statements are called recursive calls or recursive SQL statements. For example, if you insert a row into a table that does not have enough space to hold that row, the Oracle Server makes recursive calls to allocate the space dynamically if dictionary managed tablespaces are being used.
    Recursive calls are also generated due to the inavailability of dictionary info in the dictionary cache, firing of database triggers, execution of DDL, execution of SQL within PL/SQL blocks, functions or stored procedures and enforcement of referential integrity constraints
    3. Other CPU time : This represents the percentage of time spent looking for buffers, fetching rows or index keys, etc. Generally, \"Other\" CPU should represent the highest percentage of CPU time out of the total CPU time used.
    total memory used you can calculate adding
    total_agrigate_area+sga
    memory usage on os level you can know by fallowing commands
    vmstat 5 20 depending upon os

  • Firefox keeps freezing and using 50% cpu and memory usage shoots up most of the time it's when there's an auto update of anything addon, plugin or ff!

    Firefox keeps freezing and using 50% cpu and memory usage shoots up real fast and carries on going till it uses up all there is left. Most of the time it's when there's an auto update of anything addon, plugin or ff but not just neccessarily then! I find out it's happened when there's been an update after i restart and an extra webpage comes up with the particular addon/plugin/ff update. I have to restart most of time because nothing sorts it out. I'm using windows xp with the latest update of ff 13.0.1 it's not this version because it's been happening for a while. And it never started when i added a particular addon or plugin or when i added a new app to my pc either. Any idea as to what this may be or how i'd sort it out?
    Cheers

    Maybe disable hardware acceleration? This article should help: https://support.mozilla.org/en-US/kb/firefox-uses-too-much-memory-ram

  • Can you explain about Higher-level item category and item usage?

    Hi all
    Can you explain about Higher-level item category and item usage?
    thanks all

    Higher level item category and Item usage are used in the item category determination.
    Let me take an example of Item Category TANN (Free of charge Item)
    Item category Determination: Sales Document type + Item Category Group + Usage + Higher Level Item Category
    TA + NORM + FREE + TAN = TANN
    Higher Level Item category: The category on which this item category is dependent. meaning for TAN , TANN is a free item. Therefor TAN is the higher level item category.
    Item Category Usage: It controls system response during document processing. The line item has an specific usage according to that usage it has to respond. Free for free items, text for text items etc.
    Regards
    AK
    Reward points if helpful

Maybe you are looking for