Binding different events to a form depending if it is used for edit or create new.

Hi,
I succesfully have separated presentation from logic (events, etc...) using the code behind article at adobe site. This is pretty nice but now I have a little problem. Think about I have two forms one for edit and the other to add a new user. Usually this forms are allmost the same only some logic change and just few controls if any.
What I would like to do (don't know if this is best way to do it, for me it does):
1) Create Add form.
2) Create a view state to change this add form to edit when needed (I think just few changes if any will be needed)
3) Now the problem, I need to bind different logic if I'm in edit or add new user form. Is there any way to attach different functionality
to the form component to let it behave the way I need depending on the mode (edit or new)? I have seen include can be used but can it be used conditionally?
Example:
    if( in edit mode)
        include ("src/usermanagement_editlogic.as"))
    else( in add mode)
        include ("src/usermanagement_addlogic.as"))
As I previously said I'm pretty new to flex but I think this is a good way to do things and have everything splitted. If anyone has a better way to do it I would be really happy to hear it  .
Thanks in advance,
Aron.

Using forms for create/edit or login/register are similar scenarios. Usually, you can take care of those by simply changing states.
Doing different includes is complicating things; you can just include all the code, and just use what you need depending on the state you are in.
Before you get into conditionally including things, or creating a bunch of different events, look at this little simple tutorial on using states, which happens to use a login/register form as an example: http://www.adobe.com/devnet/flex/quickstart/creating_states/.
HTH,
Carlos

Similar Messages

  • Is there a way to consolidate two different Apple ID's into one. I have an old Apple ID that I used for Itunes and a new I used to set up my iphone.

    Is there a way to consolidate two different Apple ID's into one. I have an old Apple ID that I used for Itunes and a new one I used to set up on my iphone.

    You cannot merge accounts.
    Why did you start a new account?

  • BTE 1030 - we use for AP documents, create an event that triggers a workflow

    Hello all,
    We use SAP's program RFBIBL00 to post AP documents.  We coded a function module that is called when BTE 1030 is reached.  Our FM creates an event that triggers a workflow.
    We are now doing some testing with an external vendor who is creating AP documents by doing an RFC  using function module BAPI_ACC_DOCUMENT_POST.
    It seems that this BTE, 1030, is not being triggered when the IDOC created by this function module posts the AP document.
    Has anybody else seen this issue and found a way to deal with it?
    Thanks
    Bruce

    AFAIK BAPI_ACC_DOCUMENT_POST and FI posting should trigger BTE 00001030 but BAPI_INCOMINGINVOICE_CREATE and AC interfacewould trigger BTE 00001050. (or is BAPI_ACC_DOCUMENT_POST also using AC interface, I will let you check it)
    Nevertheless call your FM triggered thru BTE 1030 also in a FM triggered thru BTE 1050. Also in the call check for update task
    function z_fi_00001050.
    call function 'TH_IN_UPDATE_TASK'
         importing
           in_update_task = in_update_task.
       if in_update_task eq 0 and i_xvbup eq 'X'.
         call function 'Z_FI_00001030' in update task
           exporting
             i_xvbup = ' '
           tables
             t_bkpf  = t_bkpf
             t_bseg  = t_bseg..
       else.
         call function 'Z_FI_00001030'
           exporting
             i_xvbup = ' '
           tables
             t_bkpf = t_bkpf
             t_bseg = t_bseg...
       endif.
    Regards,
    Raymond

  • How to package different content so that the same license can be used for all content.

    1)      If packaging all the content at the same time, use the same instance of DRMParameters every time you call MediaEncrypter.encryptContent().  All content packaged using the exact same DRMParameters object will be associated with the same license.
    2)      If packaging content at different times, but want to have all the content associated with the same license, you need to use V2KeyParameters.setContentEncryptionKey().  The first time you package a piece of content, you would use ContentEncryptionKey.generate() to generate a new key/license ID.  To use the same key/license for later content, you need to store the info in ContentEncryptionKey, so you can pass in the same values later for the new content.

    To package content at different times using the same license, you need to implement the following:
    Call ContentEncryptionKey.generate to generate a new key and license ID.
    On your V2KeyParameters, call setContentEncryptionKey and pass in the object generated in step 1.
    Call MediaEncrypter.encryptContent and pass in the V2KeyParameters (via DRMParameters), as usual.
    Store the contents of ContentEncryptionKey, so the same values can be used again later.  The key, license ID, and packaging date should all be stored.
    When you want to package additional content using this license, lookup the stored key, license ID, and packaging date and pass these into the ContentEncryptionKey constructor to create a ContentEncryptionKey instance.
    On your V2KeyParameters, call setContentEncryptionKey and pass in the object generated in step 5.
    Call MediaEncrypter.encryptContent and pass in the V2KeyParameters (via DRMParameters), as usual.
    The media packaged in steps 3 and 7 should now be protected using the same license.

  • Help!  Can't figure out how to store the same photo in different events

    I know that this is just a user error problem, but I can't figure out how to store multiple versions of the same photo in different events. For example, I use Aperture as my main photo library, so I have a big folder set-up by year and then by events within those years to organize and maintain my library. I'm currently working on a project where I would like to pull out certain pictures for other uses. I tried creating new events and then moving the pictures to those events (like I would have in iPhoto) expecting for a new version of the picture to be deposited in the new event. That didn't work - it moved the picture out of my "main library" folder and as far as I can see it now only exists in the new event. Next, I tried creating "new versions" of the pictures I wanted to move and then just selecting those and moving them. In one folder I selected three photos, clicked "New Versions", then in the browser display I could see two of each picture (for a total of six), I selected ONE of each photo and moved those three to the new event. At which point all six disappear from the "main library" and end up in my new event. I don't understand why that happens. Currently the only way I've been able to do what I need to do is by using the flag field, but as far as I can tell there is only one of those - it's on or off that is really not serving my purpose. What do I need to do???

    Like Jim said, you most likely want Albums for what you describe. Albums simply consist of "pointers" to a single compilation of image data. Albums can be created and deleted at will, because they are just pointers; an important concept.
    Also learn to use Keywords - and unlearn "folder" organization, which is not the way digital asset management works. The power of Albums and Keywords is huge once we lose the film-think of folders organization.
    HTH
    -Allen Wicks

  • How do I make a photo folder for different event on ipad2?

    How do I make a photo folder for different event on ipad2?

    These links may be helpful.
    How To Create Photo Albums http://tinyurl.com/cxm4eoq
    How to Add New Albums in the Photos App on the iPad & Add Photos to the Album
    http://tinyurl.com/7qep7fs
     Cheers, Tom

  • Cannot create new form in portal

    hello
    i have a problem creating a form in portal!
    i log in portal with the username orcladmin, then i click on builder -> navigator -> providers -> open(any provider) -> create new form (or report or chart)
    i get the error in internet explorer The page cannot be found (link =http://marpolas.marpol.si:7783/pls/portal/PORTAL.wwexp_api_engine.create_action)
    in netscape the error is a little different
    The requested URL /pls/portal/PORTAL.wwv_menu.menu was not found on this server.
    it is imposible for me to create new forms in portal.
    Any ideas?
    thanks in advance
    Marjan
    p.s
    i use portal on windows 2000 server, 1800mhz and 1gb ram

    Sounds like a problem with the privileges.
    Try creating a new user, say user_temp, and grant the user Manage privilege to All Portal DB Providers and Manage to All Schemas.
    Try creating a form after logging in as user_temp.
    The minimum privileges required to create a Portal DB provider component is Create privilege on the Portal DB Providers and Manage on the Portal DB Provider schema.

  • What is the best program for editing pdf documents and filling in forms

    Whats the best program to use for editing pdf documents and filling in pdf forms?

    Acrobat Pro XI  creative suite 6
    or the newer Acrobat Pro creative cloud
    Been using it now for endless years.

  • Can't create new calendar events through Thunderbird

    Hi,
    I have Lightning installed and hooked up to two Google Calendars, one for actual events (both work and personal) and one for things like local holidays and week numbers (this is a read-only calendar Google's put together).
    My issue is that I can't create a new event on my personal calendar through Thunderbird. I can open the "create new event" dialog box no problem, and fill in all the details, but when I hit "Save and Close" nothing happens - the dialog box stays open, and no event is created.
    I can create events in a 'local' calendar (e.g. the blank "Home" calendar that Lightning comes with as a default). I can log into my Google calendar through my browser and create events no problem, but then hitting the "synchronise" button in Thunderbird doesn't make them show up (although syncing the calendar app on my android phone, linked to the same Google Calendar, makes the new events created through the browser show up no problem).
    The only other information I can offer is that on the Calendar tab in Thunderbird, on the left of the screen, there's list of the calendars my Thunderbird/Lightning has installed/synchronised: "Home" (a local calendar, basically empty but functioning), "Luke John's Calendar" (Google Calendar, the one I'm having the problem with), and "Week Numbers" (Read-only Google Calendar, I don't know if it's possible to create new events on because it's read only). Next to both "Luke John's Calendar" and "Week Numbers" are little (error?) symbols: black exclamation marks in yellow triangles, which give the rollover text "The Calendar [name] is momentarily not available."
    Any suggestions for sorting this out? I'd be very grateful!

    Hi Benito,
    What does it mean when a subscribed calendar is corrupted?
    The files iCal uses to store the calendars (.ics files) are text files. (You can look at one by exporting a calendar from iCal and opening the .ics file with a text editor.) When you subscribe to a calendar you are copying the calendar file to your hard drive. If some information is missing in the file, or the data is ordered in the wrong way, this can lead to iCal not functioning properly.
    The error could be on the server or your local copy, from what you write it's hard to tell. You could try subscribing to the problem calendar from another machine to see if it has the same problem.
    The usual recommendation for a local calendar (one you created) with this problem is to export and then import the calendar. This means the calendar is re-created from scratch. You can't use this solution with a calendar you are subscribed.
    I hope this helps.
    John M

  • Form routine name to give fax for Contract (ME31 & ME32)

    Hello All,
    What is the form routine name to be used for faxing the Contract form (ME31 & ME32) in program SAPFM06P?
    Thanks & Best Regards,
    Phani Kumar. S

    Hi,
    Thanks for your replies. But when i give ENTRY_NEU and then try to issue the output for fax, the process is stopped with following error message: Error in OPEN_FORM for document.
    Any idea?
    Thanks & Kind Regards,
    Phani Kumar. S

  • Urgent !!! - Java script help for events in adobe form

    Hi ,
    We have requirement  where we have 5 buttons on interactive form which will retrive data from R/3 system .
    1) How can i distingish the event of each button  ?
    For Ex : We have 5 buttons namely , GetPlantcode , GetStatus, SubmittpSAP etc..
    We hav only 2 events on adobe form - Submit to SAP and SAPCheckFields.
    Please let me know some alternative by which i can sent some variable to webDynpro which distinguishes them.
    2) How to set a value for the context variable on button click event ?
    Ex : I have a context node ( data node ) bind to adobe interactive adobe component on a webDynpro application. If i want to set Selectindicator ( value attribute in data Node ) a value on a button click , Please let me know the java script how i can do this.
    Happy New Year for all
    Nanda

    Hi ,
    We found one work around for this. It seems to solve our issue for now.
    Set a text field on adobe and try to set it with some value in each button click. We can get retrived that value in webdypro application through context bind value node to text field.
    Using the value in the value node we have applied different logic in same event submit to SAP.
    Nanda

  • I currently have 30,000 photos in my i photo library in300 events.  Ientally ad.    I add photos each day to different events over many years.  Currently I download my photos on one of my 6 MacBooks , and eventually I synch the photos to my phone

    i have 30,000 photos in 300 events in I photo.
    i Add photos each day into different events
    i have to manually add the photos into one of my 5 MacBooks , synch to my phone and then synch each device to have all my photos be up to date with each event
    is there now a way to add photos to my 30,000 photo library on just one device anfd have all my devices synched perfectly through the cloud into events exactly as it appears on my first device ...like our contacts or other synched items on the cloud?
    it is critical that the events are maintained and the photos go exactly into place?
    photo stream is not the answer
    thanks
    Knickfan 1970

    Hi Terence:
    so that sounds like better news...I should be OK when this happens?
    Essentially my events become albums...I still have the separation ..correct?
    Why would this be a problem?
    This was a response from an earlier post from Vanoord that concerned me: quote..see next-
    Events has been removed from Photos - it's replaced by 'Moments'.
    'Moments' are like 'Events', but split up by the software and you have no control over what goes where, or what they're called. If you've got 300 Events now, you can look forward to about 3,000 'Moments'.
    This response implies that all my 300 events will become separated into thousands of moments.  What does this mean?  Is this true?
    Won't my Events just become albums as you suggested?
    I have years of events that have accumulated and collated photos.  They must stay separated.
    ****the other thing I was unclear about was the synching part..
    Example:
    I have 300 albums with 30K photos distributed in various numbers in each album ( used to be events according to your response)
    I add some photos in each album each day
    I set all my devices to the cloud etc...
    the cloud synchs from my designated "source" Macbook...
    the cloud sees this and uploads
    then the confusing part...the other devices ( MacBooks, I pad, i phone) all will see the synch and can then be designated to download to each device in the original form as we view it on a Macbook or i phone?  What does "full resolution" or optimized previews mean as Leonie replied above?
    I need my JPEG images for my education keynote presentations and e mailing images as required from each event as needed ( soon to be albums)
    Thanks again...just want to understand what is going to happen

  • How can I combine post to two different tables with one form?

    I am trying to create a "phantom" record in a table to be used later in a report. How can I create a form and properly $_POST to two different tables? Thanks for any suggestions!

    In POST processing, just do the insert to one table, followed by the insert to the second table. I don't understand where you are getting stuck.
    Sometimes when we do an insert, we need the auto-generated ID from the newly created record as a "foreign key" for the record created in the second insert. MySQL has a nifty solution for that. The specific code depends on whether you are using the mysql, mysqli or PDO database connection.

  • How to create a event to display records depend on selection ofdropdownlist

    BSP
    how to create a event to display records depend on selection of dropdownlist box,
    Using BHTML,
    thank you,
    regards,
    jagrut bharatkumar shukla

    1) Copy this script to the code
    <script type="text/javascript">
    function displayVacationDates() {   
        for (var i=0; i < document.forms[0].Status.length; i++) {
            if (document.forms[0].Status[i].checked && document.forms[0].Status[i].value=='Vacation'){
              document.getElementById('startDateRow').style.visibility='visible';
              document.getElementById('endDateRow').style.visibility='visible';
             if (document.forms[0].Status[i].checked && !(document.forms[0].Status[i].value=='Vacation')){
             document.getElementById('startDateRow').style.visibility='hidden';
              document.getElementById('endDateRow').style.visibility='hidden';
    </script>
    2) Set initial style to 'hidden'
    <tr id="startDateRow" style="visibility:hidden">
    <td align="left"><blockquote>
      <p><span class="style16 style8"><strong>Start date:
      </strong></span></p>
    </blockquote>                 </td>
    <td align="left"><script>DateInput('VacStart', true, 'DD-MON-YYYY')</script></td>
    </tr>
    <tr id="endDateRow" style="visibility:hidden">
    <td align="left"><blockquote>
      <p><span class="style16 style8"><strong>End date:
      </strong></span></p>
    </blockquote>                      </td>
    <td align="left"><script>DateInput('VacEnd', true, 'DD-MON-YYYY')</script></td>
    </tr>
    3) Call the display script
    <input name="Status" type="radio" value="In the Field" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="Vacation" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="Sick day" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="Admin Day" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="DSR Ride Along" onclick="displayVacationDates()">
    <input name="Status" type="radio" value="ServiceCall" onclick="displayVacationDates()">

  • Manually dispatching a keyboard tab event on a form does not work

    Hi,
    I am trying to solve the following issue:
    I have a form that is sitting on a TitleWindow. This is a popup window. I have a TextInput field. After clicking on the TextInput field when I try to paste something on it, nothing happens the first time and it works i.e. I am able to paste when I do a cntrl V the second time (I am trying to solve this weired behavior). When I use the keyboard to tab to the TextInput field I am able to paste using cntrl V  the first time itself.
    Therefore, I am trying to manually dispatch a tab keyboard event on a form using the following code and this does not work. I have 2 TextInput component on the form and I want the cursor to be on the second TextInput component.
    I have a have a key down handler and I can see that the event that comes in is a tab event, but on the UI the cursor does not position itself correctly.
    myForm.setFocus();
    myForm.dispatchEvent(
    new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, Keyboard.TAB,Keyboard.TAB ))
    Am I missing something?
    Appreciate your help.
    Thanks
    Lilly

    No I am not trying to change the text programmatically. I have added a click event handler and a paste event handler on the textinput. I checked the differences in the properties of event and did not see anything that is different.
    I have a hunch that it has something to do with the fact that this form is sitting on a popup window.

Maybe you are looking for

  • Can you get your data off of a broken iPhone 3gs?

    I dropped my iPhone 3gs and it broke apart. Took it to someone to fix it and it broke even worse. I was going to sell it to a company that would repair it and sell it. Before I do that I want to get all of my data off it...is there a way I can do thi

  • Can't get past the "Connect to iTunes screen."

    So, earlier today I found my old iPhone 4. (Currently an iPhone 5 user) I connected it to my computer and attempted to update it to 1.6.3 (iTunes prompted to me to do so) - anyways, the ISPW downloaded and began installing. About half way through I g

  • Help! Where do I start

    I want to make changes to a TV viewer swf file by changing the color scheme in the corresponding CSS file. I was told to compile the file when the changes are made in the CSS file. Question: Do I compile the SWF file itself. Can someone give me some

  • APs not joining controller

    I upgraded a controller yesterday 5508 it went from a low code version 6.x to 6.0.196.0 then to 7.0.116.0. However although all the access points joined code 6.0.196.0 they refused to join 7.0.116.0. The aps are all 1242s. The country codes etc were

  • HT201209 Hi, i bought an i Tune card in Tokyo but i can't redeem it in nigeria

    I bought an iTunes card in Tokyo but couldn't use it in Nigeria, was asked to use it on Japanese platform, what should i do