How to detect value change of item?

Hi all,
We want to list all goods that customer chooses, so TileList is used to display all goods information and a custom component MyItem is used as ItemRenderer. Meanwhile a Label is used to display the sum of all the goods. The hierarchy is simply like this:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  layout="absolute" >
<mx:TileList id="tl" dataProvider="{acGoods}" ItemRenderer="MyItem"/>
<mx:Label id="labelSum"/>
</mx:Application>
Here, acGoods is an ArrayCollection which I believe is bindable.
User may change price inside MyItem directly, so the text of the Label need to update as well. I find that acGoods contains latest price. Now the problem is Label text stays the same. I have tried to call calculating function in set acGoods() but it doesn't work.
Please don't sugguest dispatch event because this is only a simplified scenario. If anybody tell me how to implement this by binding mechaism, that'll be very helpful.
Best wishes,

protected function get totalLabelText():string {
    // for each var i:* in acGoods and so on
    return 'Calculated label here';
<mx:Label id="labelSum" text="{totalLabelText}"/>
Inside MyItem:
once you changed something invoke:
Application.application.executeBindings(true);
Hope this will work for you

Similar Messages

  • How to get value from list item

    Hi all,
    How to get value from list item?
    I have a problem with the List Item object
    in the Oracle forms.
    How can I retrieve the selected item from
    a list ?
    I didn't find any function like 'list.GET_
    SELECTED_ITEM()'...
    thanks
    Bala

    Hello,
    You get the value as for any other Forms item:
    :value := :block.list_tem ;Francois

  • How to get Value of a item of first record when current record is second

    How to get Value of a item of first record when current record is second in Form6i ?
    get_item_instance_property dose not allow to get value.

    Gerd,
    You're right, there are several other triggers that must be coded, but I was responding to Steve's statement about Inserting or deleting records from the multi-record block. For the record, I use the following to manage a Record Group:
    * When-New-Block-Instance - Initialize the RG
    * block Post-Query - populate the RG
    * When-Create-Record - add new record to RG
    * When-Remove-Record - remove record from RG
    * block When-New-Item-Instance - capture previous value of the item or row
    * When-Validate-Item - Item specific Insert, Update, Delete of values in the RG
    There are a few other places as well, but these are the minimum. It might seem like a lot of code, but then again, I don't use this solution for every multi-line block. Like all tools, you use the right tool for the job. :-)
    Craig...

  • How to retain value in LoV item in Tabular Form, after Page Refresh

    Hi,
    I have a tabular form, which contains 2 items(columns), of type "Select List - named LoV".
    Now, 2nd item(column) in tabular form, that LoV should get populated based on user's selection value in first item LoV.
    1. So how do I refer to the value, that user selected in first item's LoV? I will have to use this value as reference in LoV query of my 2nd item ( on this tabular form)
    2. Everytime I select value in first item LoV, page gets refreshed, as my requirement is to calculate 2nd item's LoV based on selected value in first item. So after this page refresh, first item LoV loses its value that was selected before the page refresh happened. So how do i retain this value in first item LoV? I have an unconditional process, that on every submit(refresh) of page, I set all my items with their corresponding values. But problem is what do i mention there to refer to this first item ( of type LoV) of tabular form?
    I looked in view source of my page, this item is referred as f03.
    So i used "apex_application.g_f03", to set this item to its value, in my uncoditional submit process. But it did not work. I tried to refer this item as "f03" in this unconditional submit process. But still it did not help, the selected item loses its value after page refresh(submit).
    Please help.
    Thanks and Regards,
    Ravi.

    Hi Rave,
    You will have to use Javascript and Ajax to change the values as ApEx submissions will lose your results unless they are saved into the database.
    Remember, that as you are using a tabular form there will be lots of items called f01, fo2, fo3 etc on the page (one per row).
    Regards
    Michael
    Edited by: MKii on Jun 4, 2009 10:13 AM

  • Event structure to detect value change of a control within a cluster in an array

    I have 1D array that contains a cluster. The cluster contains a numeric and a boolean control.
    If the user starts to edit the numeric control value i would like to call one subVI, and if the boolean control value is changed, call a different subVI.
    The array control on the front panel allows the user to edit a number of the array elements. 
    I would like to use an event structure to detect a value change in the cluster. When editing the Events, in the Event Sources panel i get the option to select only the array, not the cluster within the array or the controls within the cluster. Can the Event structure be opened up to show controls within clusters and arrays?
    The solution i am using is to detect a mouse up event on the array and then use property nodes to  determine if the key focus is on the numeric, and  a case structure to determine which subVI to call. This works, but is there a better (simpler) way?
    Thanks, Blue.

    Thanks for the responses guys.
    The tricky bit was that i wanted the numeric control values to flag they were going to be edited, so i could call a subVI, before their values were changed by the user. This is done by using the key focus property node, - i need to detect changes on the fly rather than post the event.  Probably didn't make this clear enough in my original post. 
    The array is of variable size depending on if the user decides to insert or delete elements. The user also has the option to click and edit the array without having to do to much scrolling through the array index, as the FP shows several elements at a time. The Event Structure does a good job of automatically determining which element in the array is being edited, and returning those values to the property nodes. Turned out simpler than i thought it might be at one point!
    Cheers, Blue. 
    Message Edited by BlueTwo on 01-15-2009 06:52 AM
    Attachments:
    evstrct1.jpg ‏63 KB

  • How to keep values in text items.

    Hi,
    I have created a tabular form with report.out of this form Two items are converted to LOV'S(TEAM_LOV,TYPE_LOV) i.e TEAM_LOV for P4_TEAM item and TYPE_LOV for P4_TYPE item.
    TEAM_LOV := select team d, team_id r from teams;
    TYPE_LOV := select type d , type_id r from types where team_id=:P4_TEAM;
    1. For P4_TEAM item is select list with redirect .
    2. For P4_TYPE item is select list.
    Problem:=
    When i create a new record and enter new values in the text items above the P4_TEAM item and then selects the list of values from P4_TEAM then the values from the above text items gets clears . How to prevent the clearing the item values.
    If i use select list with submit. then i have validation on two items so i gives validation errors.
    Help !
    Thanks,
    Ramesh

    Hi Ramesh,
    I had the same problems and solved it with AJAX. then only the second list is updated and no submit or redirect is needed.
    Otherwise you could set a condition for your validation, i.e. only if item is not null.
    chrissy

  • Detect value change in a wire

    Hi, this seems pretty trivial, but I cannot find a clean way to do it, and i couldn't find anything in the forums. I want to detect a change in the value in a wire coming out of a "Get timestring VI", from iteration to iteration, and I dont think event structures quite help, because they detect changes only in front panel controls. I prefer not to use shift registers because they bring in unnecessary clutter. Is there a cleaner way to do this?
    Thanks!

    A feedback node is a little less clutter because it is more localized.
    Here's the code to detect a change in a numeric, but it works with any datatype. Modify as needed.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Changed.png ‏3 KB

  • How to detect dataprovider change in spark List ?

    The problem is : when the dataprovider changes, the List unselects its items. I want the selected item of the List to stay selected, even if the dataprovider has a new item, for example.
    So I try to detect a change in the dataprovider, to be able to re-select the item that was selected before the change.
    I tried to listen several events but it didn't work :
    - change is dispatched by user, not by code.
    - updatecompleted is dispatched when the dataprovider changes but it is triggered also when the list is resized, and I don't want that.
    - collectionChange is not dispatched
    I don't understand why valueCommit is not dispatched when the dataprovider changes.
    Can you help me ???

    There is a dataProviderChange event fired whenever dataProvider is set,
    but it may not be listed in the metadata so you may not be able to access
    from MXML.
    Flex harUI,
    Why isn't this event exposed publicly through the metadata of the class?
    The easy fix I can come up with is to extend the List, by simply exposing the event, like:
              [Event(name="dataProviderChange", type="flash.events.Event")]
              public class ExtendedList extends List
    But I don't know if it's good practice...

  • How to set value of application item using Java script.

    I have created a textbox on page 0, on chnage of textbox i want to set the value of application item.
    How to write the code to set & get value of application item.
    Thanks,
    -Amit

    Hello Amit
    This would be a great place to start...
    JavaScript
    Alternatively, APEX 4.0 will make this sort of task declarative.
    Kind regards
    Simon Gadd

  • LV7: how to catch 'Value change' event for cursor position in XY graph?

    I try to catch an event when the cursor position of a graph's cursor
    changes. I created a reference for the cursor array and registered a dynamic
    event 'Value change' for it. The event does not fire when the cursor changes
    (either by dragging it with the mouse or by direct entry of a new value in
    the cursor's X or Y fields. In contrast, when I register e.g. the 'Mouse Up'
    event for the cursor array, the event IS detected.
    -Franz

    So this is the same behaviour as that of a regular control which also does
    not fire a 'Value changed' event when it gets updated by e.g. writing to a
    local.
    At least the cursor's behavior is consistent then...
    But unfortunately also the direct user interaction with the cursor's numeric
    field does not fire the event, which is NOT consistent.
    I was trying to catch cursor changes in my event loop and had used a 'Mouse
    Up' event of the graph indicator to look for cursor changes (whose last
    position I had kept in a local or shift reg). In order not to miss a direct
    user interaction in the numeric field I added the dynamic event 'Value
    change' to the same event case, but with no success, it missed the direct
    entry ...
    according to what you say this seems to b
    e a bug then...
    -Franz
    "Greg McKaskle" schrieb im Newsbeitrag
    news:[email protected]..
    > > I try to catch an event when the cursor position of a graph's cursor
    > > changes. I created a reference for the cursor array and registered a
    dynamic
    > > event 'Value change' for it. The event does not fire when the cursor
    changes
    > > (either by dragging it with the mouse or by direct entry of a new value
    in
    > > the cursor's X or Y fields. In contrast, when I register e.g. the 'Mouse
    Up'
    > > event for the cursor array, the event IS detected.
    > >
    >
    > The reason is that value change events fire when user action directly on
    > the control changes its value. They do not fire when other programmatic
    > value changes occur. If you are looking at a value change on the cursor
    > palette, user interaction with the numeric should fire it, but updates
    > due to cursor movement are more like programmatic updates.
    >
    > Additional events will likely be added in future
    releases, and these may
    > make it easier to catch cursor movement events on a graph.
    >
    > Greg McKaskle
    >

  • How to trigger value change in event structure

    Hii everyone, as the title, how should I trigger the value change event to pop up a message.. below is my connection..
    I want to trigger the event structure to pop up the sub-vi, when the flame and led are TRUE state... I using property node but still the event structure not able to execute.. How should I connect? Thank you very much...
    Solved!
    Go to Solution.

    There are several ways you can do it. First you have to configure your sub-vi so that it does whatever you want when it runs  (in the vi properties, top most window for example) and to make sure that it closes completely when finished (when clicking the "OK" button for example).
    You than need to make an asynchronous call to the sub-vi. There are several ways to do it. My favorite one is shown below. You go in the "Application control" sub-palette and select Static VI reference. I like this approach because it keeps track of the sub-vi path for you, as long as the sub-vi is in the same project. You then drag the sub-vi onto the empty square that will changes to your sub-vi icon. You then connect to an invoke node from the same sub-palette and select run VI. Set "Wait Until Done" to false and the main VI will keep running after starting the Sub vi. Set "Auto Dispose Ref" is the easiest way to go. Otherwise you have to keep track of the sub-vi reference and close it yourself when you're done.
    Marc Dubois
    HaroTek LLC
    www.harotek.com

  • How to Set Value of page item?

    String dimLayoutNew[][] = new String[3][];
    dimLayoutNew[0] = new String[1];
    dimLayoutNew[1] = new String[1];
    dimLayoutNew[2] = new String[2];
    dimLayoutNew[0][0] = measureString;
    dimLayoutNew[1][0] = strDimension1;
    dimLayoutNew[2][0] = strDimension2;
    dimLayoutNew[2][1] = strDimension3;
    Boolean applyNewLayoutFlag = tableQuery.layout(dimLayoutNew);
    In this Layout,How to set the value of strDimension2 page item to one member of strDimension2?
    thanks!

    what about this - look up the javadoc to get more >info ....You would have to admit, while BI Beans are great, the documentation is a little light.
    int targetHPos[] = targetDataAccess.getEdgeCurrentHPos (2);
    now apply the order to the targethpos as you like...now, once you make your changes to the targetHPos, how does one actually make the change to the Query object (i.e. what method does one need to call to pass the new targetHPos in??) I looked through the JavaDoc and didn't see a SetCurrentHPos or equivalent function in the DataAccess Class. Is there one?
    Also, what role, if any, should the SetCurrentPage method of the query object play if I'm not using it correctly?

  • How to supply values for searchCriteria items in af:query programmatically

    Hi,
    Is it possible to supply the default values for search criteria items in af:query programmatically? I didn't find any of the method to set the values for the search criteria items inside the oracle.adf.view.rich.model.Criterion and oracle.adf.view.rich.model.AttributeCriterion classes.
    Please let me know how can I supply DATE values by default for the search criteria items inside the view criteria.
    Thanks

    Jdev I am using is 1.5.
    I've search page where I've a date field (like TransactionDate). The transactionDate is a transient variable in my VO. Created a view criteria using this transient date filed and kept the operator as 'Between'. When I load the page, I want to keep the values for Between operator as 'CurrentDate' and 'CurrentDate - 365 days' (LastYearDate as of today).
    I can't use bind variables to set the currentDate and lastYearDate to the values of the 'Between' operator. If I use so, I will get an error 'Attempt to set a parameter that doesn't occur in the sql.....'.
    So I thought of overriding the QueryEvent inside the bean. But I didn't find a way to set the values for the TransactionDate programmatically.
    I tried below code in the queryEvent method, but in this case the response time is very hign ( I didn't see the result till 30mn).
    DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    ViewCriteria vc =
    JUSearchBindingCustomizer.getViewCriteria((DCBindingContainer)bc.findExecutableBinding("SupplierSearchCriteriaQuery"),"__ImplicitViewCriteria__");
    Date curretYearDate = null, lastYearDate = null;
    Calendar calendar = Calendar.getInstance();
    curretYearDate = calendar.getTime();
    calendar.add(Calendar.DAY_OF_YEAR, -365);
    lastYearDate =calendar.getTime();
    Object o = new Date();
    ViewCriteriaRow vcr = (ViewCriteriaRow)vc.get(0);
    for(int i=0;i<vcr.getAttributeNames().length;i++) {
    if(vcr.getAttributeNames() == "LastTransactionDate") {
    System.out.println("====================== opeartor ================== " + vcr.getOperator("LastTransactionDate"));
    if( ("%".equals(vcr.getAttributeValues()[i]) || vcr.getAttributeValues()[i]==null)) {
    List nameList = new ArrayList();
    nameList.add("LastTransactionDate");
    List valueList = new ArrayList();
    valueList.add(lastYearDate);
    valueList.add(curretYearDate);
    vcr.setAttributeValues(nameList, valueList);
    vc.addRow(vcr);
    JUSearchBindingCustomizer.applyAndExecuteViewCriteria(bc, vc);
    Thanks,
    Lakshman

  • How to detect any changes of a StepType-field by the sequence ?

    Hi all,
    suppose I've got this: a simple StepType 'TEST' with one added custom field 'Source' of the type String.
    When using this StepType in a Sequence and editing the 'Source' value (from the Variables panel),
    the Sequence name is immediately marked with an '*'. Which is wat we want :-)
    But, if I change the 'Source' value from code (C#), I see that my 'Source' value is changed (in the Variables panel), but not that the Sequence has detected this.
    Maybe it's StepType-flag that I have to set or from code, executing a trigger or so ?
    Thanks in advance ?
    Franky
    Solved!
    Go to Solution.

    I'm talking to myself, but FYI:
    because I'm updating my sequence from code (C#), I've the current Step as an object and
    therefore I knows if any fields are changed.
    Using this snippet will mark my sequencefile as 'changed' : 
    step.Sequence.SequenceFile.AsPropertyObjectFile().IncChangeCount();

  • How to populate values in Apex item

    Hi,
    I am using apex collection item to capture data my requirement is to calculate data using the apex item
    This requirement is like this. I am using a SQL query like this
    select
    wwv_flow_item.TEXT(1,NULL,20,10) "A",
    wwv_flow_item.TEXT(2,NULL,20,10) "B",
    wwv_flow_item.TEXT(4,NULL,20,10) "C"
    from dual
    There 3 text boxes are generated in the window when i enter 3 in A and 2 in B it must give me a sum value in C as 5
    this has to be done dynamicall as end user key in values this can be done using java script or any other method please suggest
    Thanks
    Sudhir.

    Hello Sudhir,
    >> If there are multiple text box …
    If there are multiple text boxes, you need to allocate each a unique ID. The easiest is to use the substitution string #ROWNUM#. The code should look similar to the following:
    select empno,
    apex_item.TEXT(1,null,20,10,'onchange="addItems(this);"','A'||'#ROWNUM#') "A",
    apex_item.TEXT(2,null,20,10,'onchange="addItems(this);"','B'||'#ROWNUM#') "B",
    apex_item.TEXT(3,null,20,10,'onchange="addItems(this);"','C'||'#ROWNUM#') "C"
    from empBecause we are in a multi-row environment, we need to pass the line number we are on, into the JavaScript function, hence the use of ‘this’.
    In the JavaScript function, we first need to determine the line number we are on, and then use it to perform the calculation. The code can look similar to the following:
    <script type="text/javascript">
    function addItems(pThis) {
      /* extract rownum */
      var line_no = pThis.id.substr(1);
      $x('C'+line_no).value = parseInt($v('A'+line_no)) + parseInt($v('B'+line_no));
    </script>Regards,
    Arie.
    Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.

Maybe you are looking for

  • Firefox keeps crashing, giving me an error report.

    Firefox used to never really crash on me, aside from the time when it would totally freeze my computer. This is the error I've been getting ; AdapterDeviceID: 0x1244 AdapterVendorID: 0x10de Add-ons: %7B972ce4c6-7e08-4474-a285-3208198ce6fd%7D:25.0,%7B

  • Desk top froze up but mouse works how do I unfreeze desk top

    TRying to in freeze the desk top the mouse will move but can't click on anything and no response from key board

  • External midi

    how can you stop getting signal constantly coming through an external midi track? (ie. rewired reason instrument) I don't want to mute the track cause I still want to hear playback of what I've laid down but I don't want the external midi signal cont

  • Platform Support for WLS 5.1 SP9 and / or WLS 6.x

    When will BEA support WLPS with either WLS 5.1 SP9 or WLS 6.x?

  • Oracle.adf.faces.STATE compressed?

    Dear all, i have a question about how adf faces saving its view sate. in jsf (1.1_02), i can specify a context-parameter com.sun.faces.COMPRESS_STATE=false to avoid compressing the state information. adf faces seem store the view info in a hidden for