Creating form element from within a component

Hi all,
I am trying to create a form element within a component
function which is then called from a .cfm page which has the cfform
tags. I keep getting a context validation error for the form
element tag. Here is some sample code:
<cfcomponent name="yourComponent">
<cffunction name="createTag" returntype="string"
access="public">
<cfsavecontent variable="returnContent">
<cfselect name="thisSelect">
<option value="0">Value 1</option>
</cfselect>
</cfsaveconten>
<cfreturn returnContent>
</cffunction>
</cfcomponent>
And in the .cfm page:
<cfform>
<cfinvoke component="yourComponent" method="createTag"
returnVariable="returnContent"/>
<cfoutput>#returnContent#</cfoutput>
</cfform>
The error occurs in the function and it says the cfselect
must be within a cfform. I tried the function without the save
content and just set the output="yes" but the same error occurs.
Any help appreciated in how to get around this. Just putting
the code in the .cfm is not an option for this.
Any help appreciated.
Jim

quote:
Originally posted by:
jim1234
Thanks for the reply. Yes, that works. So it looks like it
has to do with the function call.
After some further investigation, I found out that a regular
<select> works, it's just the <cfselect> that does not.
ColdFusion wants it directly within the <cfform> tag.
Something does not make sense. If the cfsavecontent worked in
the cfm file, there is no reason for it not to work in a cfc.
If you want to persue this, the next troubleshooting step is
to copy the function to your cfm file and see if it works. I
suspect that you are trying something simple as a proof of concept.

Similar Messages

  • I have a problem creating a pdf from within Firefox using the print to function.

    I have a problem creating a PDF from within Firefox. I get an error message stating that Adobe PDF creation cannot continue because Acrobat is not activated. Acrobat Pro then opens. If it try to create the PDF again, the same problem. I have FF ver 3.6.10 and Acrobat Pro 8 (from Acrobat CS3).

    This is an Apple user forum, no-one from Apple is here.

  • Creating DVD Chapters from within DVD studio Pro

    Hey,
    Is this possible? Can we create DVD chapters from within DVD Studio Pro?
    Chris

    Yes, you can add chapter markers in the DVDSP timeline, although they are not frame accurate as they are in FCP. You'll typically get them within about half a second as they can only sit on a 'GOP' boundary, and these occur roughly every 15 frames equivalent.
    To add a marker you move the playhead to where you want it and type the 'm' key, pretty much as in FCP.
    The chapter marker then defines the start of a chapter for playback. You can manipulate the navigation such that only one chapter plays before you go back to the menu, or you can start at a marker and continue onwards. You can even create lists of markers that are not in track order and have playback jump about between them, although it's not always wise to do so!

  • Creating Purchase Requisitions from within PS (ie from network)

    When creating purchase requisitions from within Projects Systems (ie activating them from a network) is there a "standard" way to put a cost center on the Purchase Requisition?  Currently no cost center is put on the account assignment.  We are looking at doing a custom field on the network header to hold the cost center and then a user exit to take this cost center and put it on the purchase requisition (and reservations) but before we go to all this trouble thought maybe I should check to see if I am missing something obvious?  Is there a more straight-forward way to accomplish this?  We know that we cannot edit the account assignment in ME52N becuase the PR originates from the network and therefore can only be changed from the network.
    Any input welcome.  Thanks.

    Dear Laura,
    When you will create Purchase Requistion through Network, system automatically takes account assignment category as "N" i.e Network. This you can not change in ME52N transaction.
    So this is a standard practise for generating Purchase Requistion through Network in PS Module.
    As you said putting Cost Center in Network Header as a Account Assignment Category which will go up to PO creation by using some User Exit which will not be possible in PS Module as per my knowledge is concern.
    But you want to keep Cost Center as as a Account Assignement Category you need to create manual Purchase Requisition through ME51N transaction.
    Hoping this will be useful to you.
    Regards,
    Sandeep

  • How to create Default Schema from within the application

    Hi friends
    I am creating users using the following within my application using this syntax
    BEGIN
    APEX_UTIL.CREATE_USER
    (:P124_USER_ID, :P124_USER_NAME,:P124_USER_FIRST_NAME,:P124_USER_LAST_NAME,' ',:P124_USER_EMAIL_ID,'xxxx');
    END;
    The default workspace for the user is set as blanks. I would like to set it to be the default workspace as per the current logged in user.
    Can you help me with the syntax for this
    thank you in advance
    Laxmi

    Laxmi,
    The subject of the post is "How to create Default Schema from within the application".
    But your question asks how to set the "default workspace" for a newly created user.
    Those are different questions and not the ones I think you need answered.
    Let me answer this question "How can you set the default schema for an account when creating the account and set it to the same value used for the default schema attribute of the administrator account used to authenticate to the currently running application?".
    In the apex_util.create_user call use named parameter notation and fetch the information about the currently logged-in user first, e.g.,declare
      l_workspace               varchar2(256);
      l_user_name               varchar2(256);
      l_first_name              varchar2(256);
      l_last_name               varchar2(256);
      l_web_password            varchar2(256);
      l_email_address           varchar2(256);
      l_start_date              varchar2(256);
      l_end_date                varchar2(256);
      l_employee_id             varchar2(256);
      l_allow_access_to_schemas varchar2(256);
      l_person_type             varchar2(256);
      l_default_schema          varchar2(256);
      l_groups                  varchar2(256);
      l_developer_role          varchar2(256);
      l_description             varchar2(256);
    begin
    apex_util.fetch_user (
      p_user_id                  => apex_util.get_current_user_id,
      p_workspace                => l_workspace,
      p_user_name                => l_user_name,
      p_first_name               => l_first_name,
      p_last_name                => l_last_name,
      p_web_password             => l_web_password,
      p_email_address            => l_email_address,
      p_start_date               => l_start_date,
      p_end_date                 => l_end_date,
      p_employee_id              => l_employee_id,
      p_allow_access_to_schemas  => l_allow_access_to_schemas,
      p_person_type              => l_person_type,
      p_default_schema           => l_default_schema,
      p_groups                   => l_groups,
      p_developer_role           => l_developer_role,
      p_description              => l_description);
    apex_util.create_user(
      p_user_id        => :P124_USER_ID,
      p_user_name      => :P124_USER_NAME,
      p_first_name     => :P124_USER_FIRST_NAME,
      p_last_name      => :P124_USER_LAST_NAME,
      p_email_address  => :P124_USER_EMAIL_ID,
      p_web_password   => 'xxxx',
      p_default_schema => l_default_schema);
    end;Scott

  • Create Form Beans from JSP/HTML forms

    In the Builder certification objectives, there is one called "Create Form Beans from JSP/HTML forms". How can I do that? How can I create a form beam starting from the JSP form or HTML form?

    Guys, no one from forum can answer this question?

  • Create fixed assets from within the transaction for creating the purchase order

    Hello All,
    I have gone through the notes on help.sap.com related to automatic creation of asset master record at the time of creating purchase order.  I am not sure how do we achieve this?
    Link to the notes on help.sap.com
    SAP Library - Asset Accounting (FI-AA)
    Any suggesstions from the expert group is appreciated.
    Thank you,
    Vinay

    Hi Vinay
    I know there is a feature whereby you assign asset classes per material group and then you create assets from within the PO. I never used it though
    Let me tell you one thing or rather ask you. Will you as a finance consultant be willing to let a MM guy create the assets??
    Or will a MM guy be willing to create it?? If you allow them, you should be ready for surprises.
    Honestly, this is a feature not worth exploring unless a FI guy is willing to create the PO. I would suggest the creation of asset masters should be with FI only
    Br. Ajay M

  • Changing states from within a component

    Let's say that I have a TileList that is rendering data in a
    VBox. Eventually the TileList fills up and starts scrolling. I want
    to change states when clicking on item in the TileList.
    I don't want to place the click-attribute in the TileList,
    because it will change states when I am scrolling the list without
    actually selecting anything.
    I want to say click="currentState='state2'" inside the VBox,
    but that does not work because state2 is at the root level, and I
    don't know how to get to the root-level (in lack of a better word)
    from withing the component.
    This is not the proper syntax, so misunderstand me the right
    way here... Is there an equivallence to
    click="currentState='_root.state2'" in mxml?
    Thanks for any suggestions or best practices. I want the easy
    way out.
    This is the general structure...
    <mx:Application>
    <mx:states>
    <mx:State id="state1"/>
    <mx:State id="state2"/>
    <mx:State id="state3"/>
    </mx:states>
    <mx:TileList dataprovider="{...}">
    <mx:itemRenderer>
    <mx:component>
    <mx:VBox id="ClickThisBoxToChangeStates">
    <mx:Image/>
    <mx:Label/>
    </mx:Vbox>
    </mx:component>
    </mx:itemRenderer>
    </mx:TileList>
    </mx:Application>

    Your assumption is right.
    It doesn't work because there is no state2-state defined
    within the mx:component.
    In the documentation about changing states it says that I can
    go from application level and change states within a component;
    like this: click="currentState='mycomponent.anotherstate'" but not
    how I can change a state at application level from within a state.
    When I try, it says (at runtime) that the state is not defined.
    So I don't know why <mx:VBox
    click="currentState='state2'"/> doesn't work.
    I apprechiate your expertese a lot.

  • Create form elements directly in InDesign and publish them directly to PDF forms.

    It would be great to add form elements directly in InDesign (e.g. on a specific layer) and when publishing the document to PDF automatically exporting them.
    Now the work flow for adding one new field in am existing PDF form is quite complicated:
    Edit the InDesign document (layout and text) in InDesing -> publish the PDF out of InDesign -> add the existing form fields (copy from existing form into new) -> move the fields to the right place (acrobat does not support paste in place!) -> add the new field (name it, place it, etc.) -> save the PDF.
    For our company handling many different forms, with a lot of changes, this process is very error-prone.
    Enabling this process in one application would help a lot. We are currently using CS3. The feature overview of CS4 does not seem to implement this.
    Anyone else suffering here?
    Best regards,
    Michael

    Just incase you don't Adobe make a Windows only app Lifecycle which is a full blown form design app. Real layout tools, real calculation tools, vastly better than Acrobat which is too tedious for forms. If you company does lots of forms I'ld give it a look.
    They have no intention to bring to Mac I gather, as Mac is a designers only domain according to one Adobe Evangelist I spoke to.

  • Creating rules - possible from within an email?  what do diff options mean?

    In previous email programs I've used (Eudora, Outlook), it is possible to create a rule while you're in a specific email, to direct it to a mailbox you've already set up. Is this possible in Mail, or are rules only created from within the Preferences dialog (a lousy choice)?
    Also, can someone direct me to a list of definitions for each of the various options in the Rules dialog? My rules aren't working right, and I'm sure it's because I'm misunderstanding the subtle differences between the From/To/Any Recipient/Account/etc options.
    Thanks!

    To create a rule you have to go through Preferences/Rules. But as you set up a rule any appropriate values from the currently seelected email will be prefilled. So if you receive an email from me, and as you look at it you decide you don't want to see any more from me, you pull up the Rules dialog, click on Add Rule, and you will see that the From option has my email address filled in for you. If you change the filter option from From to Subject, the subject of my email will be filled in.
    I don't know of any document that outlines the different options - have you looked at help? (This is not a smart answer, my mail help isn't working and I'm afraid I haven't bothered to fix it.) For the specific cases you mention:
    From: the email address that shows in the From column in the mail list
    To: is not necessarily you. It might for example be the name of a mail list, or it might be that the sender has included you as a CC or BCC, and so your name does not appear in the To:
    Any Recipient: recipients (people this mail is delivered to) may be listed in the To: section, the CC: section, or the BCC: section. If you get a lot of mail that you want to filter, and a common feature is that Tom Jones always appears in one of these, but not the same one, then use Any rather than the specific recipient choices
    Account: I have 5 or 6 different email accounts. I might want to treat differently mail from Tom Jones to me at one of those accounts from mail to me at another of those accounts.
    If you want to post some problematic rules, with what is happening and what you had expected would happen, maybe someone can help.
    Incoming mail is tested agains the rules in sequence, and triggering a rule does not necessarily stop the mail being tested against subsequent rules. It is often a good idea to consider whether the last action on a rule should be "stop evaluating rules".
    AK

  • Determining Edit/Display Mode from Within Freestyle Component

    I am new to FPM.  We are running ESS.
    I have enhanced a new Web Dynpro Component onto an Edit page of an OVP (as a Freestyle Component).
    I want the new WDC to behave differently based on the mode I am in.
    How, from within the new WDC, can I tell if I have entered the Edit page in Edit (pencil) or Display mode?
    Thanks...
    ...Mike

    Hello Mike,
    Firstly, welcome to the wonderful world of FPM
    Well, usually with FPM, you have an Edit (or Read-only) button in the top, underneath the title (Identification Region, IDR). This, being standard, has some standard FPM events behind it.
    In your freestyle WD component, you implemented IF_FPM_BUILDING_BLOCK interface, and with it you have some additional methods in your COMPONENT CONTROLLER, such as FLUSH, PROCESS_EVENT, and so on...
    In your PROCESS_EVENT method, you can basically catch all FPM events at application level. Usually you have a big CASE, something like:
    case io_event->mv_event_id.
         when ...
         when 'FPM_EDIT'. "you can find some constants behind CL_FPM_EVENT=>GC... Right now I'm not sure how it's called exactly. But it's advised to use this constants!
              You can write your code here in order to change the behavior, basically, you can do whatever.
              also, it's the same with 'FPM_READ_ONLY'
         when others.
              return.
    endcase.
    I strongly recommend you download the latest version of FPM Cookbook, or the one that is suited with your SAP NW version.
    FPM Developer's Handbook SAP NetWeaver 7.03/7.31 SP4
    Hope I made things a little more clear!
    Tudor

  • Cross-component: Call method of using component from within used component?

    Hi,
    I began diving into cross-component programming.
    Meanwhile after having digged into some scenarios some questions came up to my mind that I am not able to answer myself. I would appreciate your help here!
    Say we have to components.  Comp A uses Comp B (hence, B is a component usage in A)
    1) How to make them communicate not on a data level (via context binding) but on a process level, thus...
    a) can I call A's method from within B? How is the approach on a general level? - as B can be used from totally different components (like A, A1, A2 ...)
    b) perhaps the only way to do this is by firing events? If so, how can I react in A when an event in B (marked as interface event) gets fired? As it seems they do not get registered within A directly...
    I guess the question seems to be a bit tricky. Nevertheless, I think there will be plenty of you out there who used to asked them the same questions before and came up with an approach. Would be nice to hear from you.
    Best wishes,
    Marc @sap1

    Hi,
    thanks for your reply!
    Indeed, I think the nature of WDA would be just to somehow map the context from the used component to the other back and forth.
    Nevertheless, what if I would like to invoke a method of the using component from inside the used component.
    One sample for this requirement could be e.g.:
    Component B offers a tree item and a send/verify button.
    Component A uses B and has some restraints regarding what the selection should look like.
    The user taps the button in B (at runtime in the view container of A), the context gets updated in A and B and in Component A the verifyWithOwnConstraints() method gets called (through B).
    Thanks again,
    Marc

  • Error referencing a Struts-Form element from a JavaScript function.

    As shown below, when referencing the form element named 'custRegion', from the JavaScript function, I get an error msg - document.forms[0].custRegion has no properties.
    It appears that this form-element, which also is present in the logic tag is not visible - is it because I'm referencing it incorrectly...
    <SCRIPT> function setRegion() { var theRegion= 'Western'
    document.forms[0].custRegion.value=theRegion; } </SCRIPT>
    <logic:iterate id="customer" name="customerForm" property="customers" >
    <html:text name="customer" property="custRegion"/>
    <html:select name="customer" property="custState" size="1" onchange="setRegion()">
    <html:option value="1"> California </html:option>
    <html:option value="2"> Arizona </html:option>
    </html:select>
    </logic:iterate>

    Here's a quick example of what may help you. It simply disables the select box and slides in a new text box. Nevertheless, it shows you that you accessed a struts property by name.
    struts code:
    <html:select property="customerRegion">
            <html:option value="-1">Unknown</html:option>
            <html:option value="0">Western</html:option>
    </html:select>
    //quick & dirty textbox for testing.  you'll probably want <html:text ... here instead.
    <input type="checkbox"
           onclick="disableSelectAddTxt(document.YOUR_FORM['customerRegion'], this.checked)" />
    Check box to replace select pull-down  
          <div id="setTBox"></div>javascript:
    function disableSelectAddTxt(selectBoxName, disableIt)
        var setTBoxName = selectBoxName;
        //alert('You passed me ' +setTBoxName+ ' and' +disableIt);
        selectBoxName.disabled = disableIt;
        var setTBox = document.getElementById("setTBox");
        if (disableSelect == true) {
            setTBox.innerHTML = "<input type=\"text\" name="+setTBoxName+ "size=\"10\">";
        if (disableSelect == false) {
            setTBox.innerHTML = "";
      hope this helps.

  • Self Modifying Application (Creating ad-ons from within an application)

    Ok, it's hard to ask this right...
    In the past, I used VB and the VBScript ActiveX to allow the user to write code that my UI could use within itself, for example, to change the way a file would load or to extend the file open save mechanism...
    Is there a way to do this maybe using the jscript engine?
    Or, even better, is there a way I could compile a real java object from within my UI and create it/connect to it in my application when compiling is done?
    The user would be presented a code window where he'd type in the code. In the window, he could use all the java classes to write his code and classes.
    The UI would save and compile the code and start using it right away.
    If someone could point me the right way.
    Thanks.

    In the past, I used VB and the VBScript ActiveX to
    allow the user to write code that my UI could use
    within itself, for example, to change the way a file
    would load or to extend the file open save
    mechanism...Sounds dangerous. But I think I understand what you want to do.
    Is there a way to do this maybe using the jscript
    engine?Not sure what you mean by jscript engine.
    Or, even better, is there a way I could compile a
    real java object from within my UI and create
    it/connect to it in my application when compiling is
    done?No.
    The user would be presented a code window where he'd
    type in the code. In the window, he could use all the
    java classes to write his code and classes.
    The UI would save and compile the code and start
    using it right away.Sounds like you want an IDE inside your program?

  • How can I include a javaScript files from within jsf component

    Is there any way using which I can include javascript files from my jsf component. Because otherwise I have to write all the javascript commands using writer.write which is very tedious rather than this I just want to include the javascript file which contains all the functions required. Also I want that this file should be included only once irrespective of the number of components included.
    Thanx in advance

    This doesn't depend on JSF. You need to include a script tag, like:
    <script src="/path/script.js"
    language="JavaScript" type="text/javascript"></script>
    If you want to include this only once, make a file included into every page, into which you can put other resources to be included along with this script.
    HTH,
    rs.

Maybe you are looking for