No sourceSet nodes in the change event??!, help!

I have Acrobat 9 pro and it comes with Lifecycle 8.2 ES
I decided to try the data drop down with an address block for a simple database hello world form.
I have read every web reference to this (on the surface) simple hello world style forms project.
In the process I’ve learned formCalc, accessors, clone(1), Ref, the XML form model, sourceSet,
binding, nodes, items, shortcut formCalc notation, form vars, defining OLEDB and OLEDB ODBC (tried both).
I’ve coded the change event at least 30 different ways using both formCalc and javascript.
I still can’t get this to work. I belive in RTFM but this has finally kicked my a** and I need some help.
I know what the problem is, I don’t believe it. The sourceSet node in the change event has 0 nodes even though I have two data connections and I can access them in the initialize event. Did they remove access to the sourceSet in the change event completly in Acrobat 9 and just didn’t tell anyone?
My database is SQL server with two tables.
A customer table with Name and CustomerID
An Address Table with CustomerId and address information
I set up the data drop down to display the Name and then in the change callback I tried to get the CustomerId
and query for the data in the second table. I’ve bound the address block data to fields in the second table and set the second table to delayed open.
I’ve tried this with every possible way of coding an accessor. When coded directly (using the intellsence thing) I get unknown accessor for the error. When using the index method and searching for it with a while, I get index out of range with an index value of 0.
Here is a formCalc version of the change callback:
========================
$host.messageBox(“In Change”)
var sName = xfa.event.newText
var sCustomerId = $.boundItem(sName)
var oDataConn = Ref($sourceSet.DataConnectionCRM.clone(1))
$host.messageBox(sCustomerId )
oDataConn.#command.query.commandType=”text”
oDataConn.#command.query.select = Concat(“SELECT [Name], Customer.[CustomerId], [AddressLine1], [AddressLine2], City, State, Zip FROM [DSD_JDEPROD].[dbo].[Customer] join [DSD_JDEPROD].[dbo].[Address] on PrimaryAddressId = Address.AddressId where Customer.CustomerId = ‘”, sCustomerId ,”‘;”)
oDataConn.open()
========================
This version of the code has the unknown accessor error at this line:
var oDataConn = Ref($sourceSet.DataConnectionCRM.clone(1))
I’ve coded this line many different ways using xfa notation, $sourceSet notation, resolveNode notation, but in the end it doesn’t matter
because this message box:
$host.messageBox(Concat(“sourceSet=”,xfa.sourceSet.nodes.items.length))
returns a 0 count in the change event.
I’ve check the XML and I have sourceSet in there and as I’ve said, the intellisense thing works and
the initialize callback works. The dropdown is correctly populated.
Note: I do realize I’m going to have to do something different in order to get the customerId as this:
var sCustomerId = $.boundItem(sName)
doesn’t work due to the way the initialize event populates the drop down. I’m sure I can fix that.
I just can’t get past the problem of no sourceSet nodes in the change event.
Thanks for your help!

I have done the samething and here is the code that I used .....are you by chance using Reader to run this form?
Paul
//get the input from the DDlist
var inName = xfa.event.newText;
if (inName == ""){
app.alert("You must enter a valid name - try again!")
var nIndex = 0;
while(xfa.sourceSet.nodes.item(nIndex).name != "DataConnection2")
nIndex++;
var oDB = xfa.sourceSet.nodes.item(nIndex).clone(1); // the node pertaining to the data connection specified
//app.alert(oDB.saveXML("pretty"));
//set up sql call to DB to get specifics about employee
oDB.nodes.item(1).query.setAttribute("text", "commandType");
oDB.nodes.item(1).query.select.nodes.item(0).value = "Select * from table1 where AcctNumber = '" + inName + "'";
//app.alert(oDB.nodes.item(1).saveXML("pretty"));
//now connect to DB and get a record
oDB.open()
//close the connection when finshed
oDB.close();

Similar Messages

  • A glitch in my use of the change event

    I have a script in the change event of a drop down list field that works when a certain choice is made then another field becomes visible. I am trying to get that field to become visible when when a record from a database populates the field the correct value. Right now all that happens is the drop down field shows the correct value but the field in question isn't visible.
    Here is the code I am using for the change event.
    var contractLangs = xfa.event.newText;
    if (contractLangs == "Creative Works Unlimited")
    xfa.form.form1.MainPageSF.ContractSF.ContractLanguageSF.presence = "visible";
    else
    xfa.form.form1.MainPageSF.ContractSF.ContractLanguageSF.presence = "hidden";
    I can't figure out how to get the field to become visible when right value goes into the drop down field.

    I don't think I have been explaining this very well so here is another try.
    I have a Drop-down List called "ContractTypeList" that has three items in the list;
    Limited Permission
    Creative Works Unlimited
    Commission for Creative Works
    If Creative Works Unlimited is chosen a hidden Drop-down List called "ContractLanguageList" becomes visible otherwise if either of the other two are chosen then it is hidden.
    I would like the "ContractLanguageList" to be hidden or shown depending on which item shows in the Drop-down List when I cycle through records in a database. Right now it only works with user interaction.
    I'm not sure what to do. I have been using the line, xfa.even.newText. If anyone can help me out it would most appreciated.

  • Getting the rawValue of a Drop-Down list on the "change" event

    I am having problems getting the rawValue of a Drop-Down list on the "change" event. It seems that you have to select the same item twice in a row to get the rawValue to be the value of the selected item.
    ::dropdownlist onChange event::
    xfa.host.messageBox(this.rawValue);
    On the first time a value is selected you get 'null'. The second time the same value is selected, you get the selected value.
    Does anyone have any thoughts on why this is happening? Also, I CANNOT use xfa.event.newText, I need to use the rawValue of the dropdownlist.
    Thanks

    The change event occurs before the rawValue is changed. If you NEED to use the rawValue you'll need to use a later event. Perhaps you could use exit so that it gets triggered when the field loses focus?
    Chris
    Adobe Enterprise Developer Support

  • Xfa.resolvenode returns null on one field whereas returns a node on the event of the specific field

    Hi Experts,
    I have a requirement wherein I need to populate values in my Table row depending upon the value of another text field.
    The problem is when I use this line of code var rsize = xfa.resolvenode("MyForm.SubForm1.Table1.Row1[*].UOM") in the change event of say Field1, it returns 0 on accessing rsize.length whereas the same line returns 5 which is the desired value on initialize event of Table1.Row1.UOM.
    How to get this thing working? I need to use similar lines of code in 5 fields i.e. need to access and assign values to table rows dependimg upon change events in 5 different fields.
    I am new to Adobe forms and stuck up with this since a long time. Let me know what is the ideal way to get this thing working. And where do I put my javascript code if the dependency to fill the row values is on some other field.
    Thanks a lot in advance.

    Hi Niall,
    Thanks for your reply. And sorry for my typo.
    I have used resolveNodes() in my code to get the length. But as I said the length is 0  when the code is written in change event of say Field1 and the same returns 5 which is the desired value when the code is writtenon any event of the UOM field.
    What exactly I want to achieve is to set the rawValue of MyForm.SubForm1.Table1.Row1[*].UOM whenever we enter value in Field1 the hierarchy for which is MyForm.SubForm2.Field1.
    Thanks,
    Archana

  • Change the default event duration from 1 hour to 1/2 hour

    In iCal, the default event is supposed to last for 1 hour. I want to change the default to 30 minutes. I know I can make the change event by event (which is cumbersome). I cannot find any configuration page to set the default event duration. Is there one?
    (This seeming reality has been bothering me for years; but I'm considering migrating from Entourage to iCal/Address Book/Mail and some of what I feel are inefficiencies in iCal are blocking me from doing so.)

    Typically any such defaults are configured outside of Logic via a utility that came with your Audio Interface.
    Example: if you have a Motu Audio interface you use the Motu Audio Setup Utility to set the default Stereo inputs and outputs... which are then used by Logic via Coreaudio.
    Not knowing what Audio Interface you are using (or mixer..) I would suggest you read the documentation that came with it.. and see how to configure it to what you need.
    Note: Some cheap and/or badly supported interfaces/mixers simply don't provide a utility to enable/change default settings... in which case you are stuck with what they set as the defaults themselves.

  • 'CHANGE' event not triggering for BTE 2214 on park/change from FBV1/FBV2

    I have designed a workflow template for FI parking. If the parked document is rejected, i need to trigger FIPP 'CHANGE' event for sending workitem to approver when someone changes the parked document. In SWEL event trace, the 'CHANGE' event is not getting raised.
    So i implemented a BTE 000002214 and now i am able to raise 'CHANGE' event and capture it in workflow. But this is only working when i park a document using FV50 transaction and later change it.
    But when i park a document using FBV1 and then make changes from FBV2, the 'CHANGE' event is not being triggered in SWEL. Should i implement some other BTE like 2218 etc? Can you please help?

    Hi Gokul,
    You can try handling the SAVE event instead of the CHANGED event.
    T-code FBV2 will not allow you to save the document unless you make some changes.
    Try implementing BTE 2218 and revert.
    Thanks,
    Sreekanth

  • Workflow Change Event Issue

    Hello Experts,
    We have a workflow wherein 2 levels of approvals are needed. One level of approval is handled thru workflow mails/BSP.
    After first level approval, using some logic I will find a value like 6 or 5. Which will be updated as trip status.
    After that there is a Z program which will be used by admin to select the trips which has status 6 or 5. And then does the final approval.
    In short
    1.     Manager approval. If approved step 2. Else exit.
    2.     Set trip status as 6 or 5 (decide using a logic and then set the status)
    3.     Wait for Admin app/rejection
    4.     Final approval in z program..
    5.             Control comes back to workflow(thru wait events), does some  logic and sends a mail and stop
    The problem I am facing here is step 2 triggers a change event (after status set) and ends the workflow .. (as the workflow is designed to end as soon as change event is triggered)
    Very few times it works fine and waits in 3rd step ..
    Please let me know how to handle this.
    Thanks
    Meenakshi

    Hi,
    Are you using wait for event step in your workflow that waits for the changed event. I guess this is happening because as soon as the first approver is done the trip status changes and change event is triggered. Try to use some logic over there and avoid triggering of this event if only the trip status is changed.
    Hope it helps.
    Regards,
    Raj

  • Shopping Cart Workflow - "Wait for change event" not firing?

    Hi there,
    I have a scenario where if I create a shopping cart above my spending limit it will go into the approver's inbox, that is fine.
    Now if I change the total value of the shopping cart to be within my spending limit the original workflow should be "logically deleted" and a "no step approval workflow" should be triggered.
    I see when the SC workflow triggers it also branches with a "wait for events", so that if it changes etc it will get caught here.
    When I change the SC it does not do anything, the value of the cart changes but it still sits in the approvers inbox and the "no step approval workflow" does not trigger.
    We are busy upgrading to SRM 5.0, it worked perfectly in the SRM 3.0 system we had.
    Any ideas what would cause the "change event" not to fire?
    Thanks for the help
    Lynton

    Hey Masa,
    You are the man!! That solved it.....I have implemented the BBP_WFL_SECUR_BADI and for whatever reason I set the security level to 4 when it should have been 2.
    4     "High" (workflow is never restarted when changes are made)
    3     "Medium" (WF restarted conditionally when changes are made)
    2     "Low" (workflow is always restarted when changes are made)
    1     "None" (changes to the object are not allowed)
    0     "Not defined"
    Thanks for the help
    Lynton

  • Dynamic Change event getting error with cascading LOV's

    Hi all,
    In my application (v4.0.0), I have two sets of cascading drop-down select lists, these each make up a date (year, month, day) plus a time value (not cascading).
    I also have a dynamic action that gets the hours difference between the two dates set above. This fires on the change event.
    When I change, say the month drop-down, the day list is refreshed. But before it is refreshed, it looks to be emptied and the change event fires. I then get an error from the dynamic action because the day value passed to the query is empty (confirmed when looking at POST data).
    Can anyone think of a workaround idea for this? e.g. a way to set the dynamic action to conditional?
    Thanks!

    Hi Peter
    Thanks for the tip, I have tried this and it has helped, although not solved the problem. I was originally getting two errors appear ("AJAX call returned server error ORA-01843: not a valid month for Set Value.") and this has removed one of them...
    When looking in Firebug, it seems to me that although the dynamic actions (cascading update + set value) are running one before the other, the values aren't updated in order. e.g. the cascading update is not applied before the set value action is run.
    Could this be a bug with dynamic actions?

  • Drag & Drop kills Tree Change event

    I have a tree that I am dragging from to a HorizontalList.
    Anyway, I have the actual drag and drop working fine. However, my
    tree has a handler for it's change event so that when the selected
    item changes, a web service lookup is initiated. After the drag and
    drop the tree appears to have a different item selected, however
    the change event does not fire. Also if I manually click on the
    same row that already appears selected, the event fires and my
    lookup is kicked off.
    It's like after the drag drop the tree's selected item
    appears selected VISUALLY but the tree does not know it is the
    selected item.
    HELP PLEASE.
    P.S. - I am using Flex 2.01 by the way.

    The trick is not to use the tree drag* properties of the
    control and instead use the DragManager to do custom drag and drop.
    This allows to listen to mouse down events and evaluate
    whether to useDragManager.doDrag() to initiate a drag.

  • Difference between Click and Change event

    Not sure what would be causing this, so any input would be very helpful
    I am using the following JAVA script to set focus on a text box after the user clicks on in a check box.
    Using the “Click” event
    xfa.host.setFocus(form1.requester_info.m_approve.Table9.Row1.m_name);
    When I click on the check box, nothing happens. Focus does not move
    Using the “Change” event I use the same code;
    xfa.host.setFocus(form1.requester_info.m_approve.Table9.Row1.m_name); It works.
    I have 4 check boxes on the form that will use this code(changing the focus of course) and I get the same results for each check box.
    Anyone have any ideas what I could be doing to bugger this up
    Chomp

    Hello pguerett
    I am sorry for leaving this until today but……weekend… I thought I would like to be form free for a couple of days.
    I have uploaded the form to https://acrobat.com/#d=fNcy51Gm0hBYRTEwS4SMww
    For you to review. I have set the form up as people would see it if when they first open the form. The user will need to click on text boxes to open up different parts of the form. I am a believer in the phrase, “if you don’t need to read it, you don’t need to see it”. Please keep in mind I have not added all the help notes nor have I completed the accessibility text.
    You will see that I have used the “change” and not the “click” as I was still unable to get the “click to work.
    Thanks Again

  • Change Event problem

    Is there anything wrong with this code?
    if(this.rawValue == 1 &&form1.Data.options.feesG.fees == 1)
    form1.Page1Subform.Space.presence = "hidden";
    else
    form1.Page1Subform.Space.presence = "visible";
    When I put it in the change event of a checkbox, I receive a Runtime error and LC shuts down.
    Any help would be appreciated.
    thanks.

    The only thing is the second condition should have a rawvalue on it ....also ....I would wrap the different conditions in their own brackets like this:
    If ((this.rawValue == 1) && (for,m1.Data.options.feesG.fees.rawValue == 1))
    Neither of those should cause a crash ...if it continues post the form and I will have a look.
    paul

  • Change Event dispatched 2 times in List Component

    Hi,
        Thanks for taking the time to read about my problem. I have a List component which has a simlpe array of strings as a dataprovider. I'm using the change event to call a method and I don't know why this method gets called 2 times.
    ¿Someone knows why this keeps happening?
    Thanks for your help.
    Sebastián Toro

    If an s:List, you put a IndexChangeEvent listener the event, and in that event, cast a filterFunction to the dataProvider of that List ...
    You will have to validate inside that function through property IndexChangeEvent newIndex of greater than or equal to ZERO.
    Because interestingly, the dataProvider of the List filter is invoked IndexChangeEvent again, but now the newIndex, give a value of "-1", leading with it the entire event, from null and associated with this throw this:
    Error # 1009: Can not access a property or method of a null object reference.
    When referring to the event ... :/

  • Dynamic Action, validation check, on an Item, could not use Change event

    I am learning how to use Dynamic Actions in a 3.2.x app that was upgraded to 4.0.x. I wanted to share what I learned adding client side validation with these actions. Perhaps an Apex guru could suggest an easier method to use this feature.
    I have an existing function where a user selects multiple rows in a report page, and then assigns a single status and enters justification text for the selected rows in another page, then saves changes (via submit).
    One item, justification, is required. I replaced my JavaScript validation of an empty value, e.g., P10_JUSTIFICATION.value, with a dynamic action. The Change event was a candidate for this item, with the "is not null" Condition. However, it is possible to initiate this screen to review the status, overlook the justification text and immediately select a button to save changes. No Change event has fired. The Before Page Submit event was applicable here. This Event selection in the wizard does not provide the Item for definition and then the Condition wasn't the right context though available for selection. I selected JavaScript expression for the Condition, actually entered my original JS test expression, and created one True Action. The True action displays an Alert to tell the user that required text is missing.
    Test of this DA was not completely successful. The alert appeared but the page went on to submit anyway. I found I had to add another True Action, Cancel Event, to stop the submit. The DA was then successful.
    The Apex site examples, [http://st-curriculum.oracle.com/obe/db/apex/r40/apexdynactions/apexdynactions_ll.htm] , do a great job showing use of Change and Set Value events for Items but a user may not always navigate through items. These features were promoted for developers with no to little knowledge of JavaScript to use Apex for application development. This DA required using/understanding JS anyways.
    My next step is to implement actions on a tabular form that that has required values. It is disconcerting that I have read in the forum that the column value references such as f0x and its row number are required to get it all working (as a DOM or JQuery selector). I have already found that tabular form columns can be re-ordered from v3.2.1 to 4.0.x. I was hoping I could declare dynamic actions or simpler Javascript methods that would not rely on f0x array references.
    Thanks,
    Kelly

    It is disconcerting that I have read in the forum that the column value references such as f0x and its row number are required to get it all working (as a DOM or JQuery selector).Not necessarily. One possibility is to use descendent jQuery selectors to attach the dynamic action event handler by column heading:
    td[headers="HIREDATE"] input

  • On change event of Dropdown (Loop)

    I am very very new to Adobe and the use of Java. I am attempting to create a form to add or remove users from one of our systems. I have a dropdown box where the end user selects how many users they want to add or remove. In the 'change' event of the dropdown, I have the following:
    if (event.newText == "1")
    aVendorCont1.presence
    = "visible";aVendorEmail1.presence
    = "visible";aVendorCont2.presence
    = "invisible";aVendorEmail2.presence
    = "invisible";aVendorCont3.presence
    = "invisible";aVendorEmail3.presence
    = "invisible";aVendorCont4.presence
    = "invisible";aVendorEmail4.presence
    = "invisible";aVendorCont5.presence
    = "invisible";aVendorEmail5.presence
    = "invisible";aVendorCont6.presence
    = "invisible";aVendorEmail6.presence
    = "invisible";aVendorCont7.presence
    = "invisible";aVendorEmail7.presence
    = "invisible";aVendorCont8.presence
    = "invisible";aVendorEmail8.presence
    = "invisible";aVendorCont9.presence
    = "invisible";aVendorEmail9.presence
    = "invisible";
    else
    aVendorCont1.presence
    = "invisible";aVendorEmail1.presence
    = "invisible";aVendorCont2.presence
    = "invisible";aVendorEmail2.presence
    = "invisible";aVendorCont3.presence
    = "invisible";aVendorEmail3.presence
    = "invisible";aVendorCont4.presence
    = "invisible";aVendorEmail4.presence
    = "invisible";aVendorCont5.presence
    = "invisible";aVendorEmail5.presence
    = "invisible";aVendorCont6.presence
    = "invisible";aVendorEmail6.presence
    = "invisible";aVendorCont7.presence
    = "invisible";aVendorEmail7.presence
    = "invisible";aVendorCont8.presence
    = "invisible";aVendorEmail8.presence
    = "invisible";aVendorCont9.presence
    = "invisible";aVendorEmail9.presence
    = "invisible";
    end
    if
    The user has the choice to add or remove up to 9 users. I havebasically duplicated the above changing the value in the event.newtext and then changing the corresponding presence value to match. How do I get it to loop through the selections? Please keep in mind I am a novice.

    Hello Tim,
    And in GET_V of the attribute serving as dropdown you defined an event?
    * Set the type of the field:  dropdown menu
       CASE iv_property.
        WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist.
        WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
          rv_value = 'select'.
      ENDCASE.
    Best Regards,
    Yevgen

Maybe you are looking for

  • Weird behavior in Classic or not?

    It has been a long time since I've needed to use Classic (on 10.4.something)  Today I needed to do something that could only be done in classic.  I thought I saw some weird behavior so I tried a couple of other classic apps.    All started Classic ju

  • Problems with files with no types or creator infos

    I installed Ffmegx which converts videos in differents formats. In order to work, that software needs extra files (mencoder, mplayer, mpeg2enc). After I downloaded them, the two first ones were seen as Unix Executable files by Mac OSX, the third is s

  • Why can't I find a way to express my discos at your forcing out of your CEO?

    It looks like you have done all you can to avoid letting the public express of there opinion!!! Why don't you try to get Obama impeached he had the same opinion in 2008???

  • Rimregistry wont run

    Newbie-ish question, I cant get rmiregistry to run for some reason. What exactly do I have to do to run it? and rmic wont work either when i use it to compile.

  • Preview (Save As) in Lion

    In Preview before Lion I was able to, for example, open a tiff file and save it as a jpg. This facility has apparently been removed in the new version of Preview under Lion. Does anyone know of a workaround?