Why is sortCompareFunction called when clicking checkbox on non-sortable column?

Hello,
I have a datagrid that contains three static DataGridColumn columns.  The first column uses a checkbox item renderer whose sortable property is set to false:
<mx:DataGridColumn
width="100"
sortable="false"
itemRenderer="com.mycomponent.CheckBoxItemRenderer" />
On creation complete, a fourth column is added dynamically to the datagrid, through ActionScript, and several of its properties are set, like so:
var dgc : DataGridColumn = new DataGridColumn();
dgc.headerText = someAttribute.name;
dgc.itemRenderer = new ClassFactory(ProductResultItemRenderer);
dgc.sortCompareFunction = attributeCompareFunction;
Everything is rendered just fine.  If I sort the datagrid items by clicking the column header of the second or third columns (these are the static columns that use Flex's default sort function) and then click on any of the items' checkboxes, there are no issues.  However, if I sort the items by clicking on the header of the dynamically-added fourth column and then click on any of the items' checkboxes, the results are partially re-sorted.  Setting a breakpoint in my attributeCompareFunction method, any time I click a checkbox in this use case, this compare function is called.
Can someone shed some light on why this function is invoked in this last use case, especially when performing a non-sortable event (clicking on a checkbox)?
Thanks,
-Jose

Hi Alex,
I set a breakpoint in the sortCompareFunction, but I'm unable to determine what is calling it.  Here is the call stack:
Main Thread (Suspended)
Function/<anonymous>
mx.collections::SortField/http://www.adobe.com/2006/flex/mx/internal::internalCompare
mx.collections::Sort/internalCompare
mx.collections::Sort/findItem
mx.collections::ListCollectionView/http://www.adobe.com/2006/flex/mx/internal::findItem
mx.collections::ListCollectionView/addItemsToView
mx.collections::ListCollectionView/moveItemInView
mx.collections::ListCollectionView/handlePropertyChangeEvents
mx.collections::ListCollectionView/listChangeHandler
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
mx.collections::ArrayList/internalDispatchEvent
mx.collections::ArrayList/itemUpdateHandler
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
com.my.package.models::ProductVO/dispatchEvent [no source]
com.my.package.models::ProductVO/set compare [no source]
com.my.package.components::CheckBoxItemRenderer/onChange
com.my.package.components::CheckBoxItemRenderer/___CheckBoxItemRenderer_CheckBox1_change
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
mx.core::UIComponent/dispatchEvent
spark.components.supportClasses::ToggleButtonBase/buttonReleased
spark.components.supportClasses::ButtonBase/mouseEventHandler
The event dispatched by "ProductVO/dispatchEvent" is of type "mx.events.PropertyChangeEvent", which is OK since the "compare" property was updated.  However, later in the call stack, the "ArrayList" object fires an "internalDispatchEvent" of type "mx.events.CollectionEvent", which is an "update" event.  Looking at the rest of the call stack, this is the event that leads to the re-sort.
Is there any way to prevent this CollectionEvent event from firing and, if so, how?
Thanks,
-Jose

Similar Messages

  • Which script is called when click "edit page" option from SharePoint gear icon?

    HI All,
    Which script is called when click "edit page" option from SharePoint gear icon?

    Hi,
    By inspecting the “Edit” button in the ribbon using IE Developer(F12), we can see that there is a function “CoreInvoke” in the click event of this button.
    By default, the “CoreInvoke” is defined in
    Init.js file which locates in 15 hive.
    Best regards
    Patrick Liang
    TechNet Community Support

  • Why is Firefox freezing when clicking items in an online grocery flyer...the screen changes to gray with image in back ground and then freezes

    When clicking on an item on a grocery flyer online..the item does not pop up and the browser freezes with a gray overtone.
    In the iamge I clicked on the normal window on Delissio pizza and a small window shopuld have popped up with deatils on the sale of the product...instead the screed turns gray(normal)...but no popup and the browser freezes

    HI kidronatics,
    The pop up sounds like there is an issue with a script loading in Firefox. However in order to troubleshoot the freezing try:
    *[[Firefox hangs or is not responding - How to fix]]

  • Why disable few parameters when fast_start_mttr_target set to non zero.

    When fast_start_mttr_target set to non zero value why do we need to disable log_checkpoint_interval, log_checkpoint_timeout and fast_start_io_target?

    These parameters were replaced in 9i only by the fast_start_mttr_target parameter. And the recommendation to not to use them now is because, if set , these parameters would override the FSMTT parameter and also would disable the auto-tuning of the incremental checkpointing which is there because of FSMTT.
    HTH
    Aman....

  • Method Call when click a link

    Hi All
    I have jspx page which have several links to go to different pages. How do i call a java method when I click a link
    Thank You
    Padma Kumara

    You are using JSF navigation/ ADF navigation or any other ? Means what type of application you are developing ??
    For JSF and ADF both you can use managed beans :
    JSF
    If Bean Name testBean which refers to com.test.TestBean class.
    you want to refer testMethod()
    you are using h:commandLink,
    then use <h:commandLink action="testBean.testmethod"/>
    In ADF also you can use similar way,
    <af:commandLink action="testBean.testmethod"/>
    Additional You can use action Listener or
    ADF taskflow's method call activity.
    Edited by: Moinak on Feb 11, 2011 3:12 AM
    Edited by: Moinak on Feb 11, 2011 3:16 AM

  • Issue when clicking checkbox inside JTable

    The following exception in displayed when populating a table that is created extending the JTable, and clicking on the checkbox that is present in one of the cells. Any idea !!!!!!!!!!!!!
    java.lang.NullPointerException
    at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.setValueIsAdjusting(BasicTableUI.java:480)
    at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.mouseReleased(BasicTableUI.java:534)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:232)
    at java.awt.Component.processMouseEvent(Component.java:5100)

    Post a small demo code that is generally compilable, runnable and could reproduce your problem. See: http://homepage1.nifty.com/algafield/sscce.html and http://www.yoda.arachsys.com/java/newsgroups.html

  • Why is screen blank when click "new tab", where is the window to type in url address

    I cannot see the URL address of page I am on if I want to cut/paste and keep it, also I have to keep opening another mozilla firefox over and over as the newtab feature shows a blank page each time. Where is the area to type in URL address? How come I cannot have a series of pages open typing a new address on each page like I used to?

    I found my own answer. If this happens, go to "view", "toolbars," and put a check next to "navigation toolbar."

  • Why does my form data gets cleared out when clicking on the back button.

    Can someone explain why does my form selections get cleared out when clicking on the back button.
    I have a JSP page that displays a form with some selections and text boxes. I populate the page and submit the request. The action on the submit call another jsp page, which processes the data and displays the results via a <jsp:include> statement which calls the results page. When clicking on the back button from the results page, it returns me to the form page, but the selections are cleared out.
    1. Is there something in my calling of the pages that causes this behavior and can I prevent it?
    I notice that the behavior is different when using the IE 6.0 version Netscape 7.1. IE clears the page Netscape 7.1 retains the settings.
    If I cannot prevent this behavior does that mean I will have to save the state of the form data. And if I have to save the form data, what would be the easiest method of doing this. I'm a beginner to JSP and Java, but have some ASP experience. I don't understand why the back button in a JSP request clears the form data but a regular HTML page does not can someone explain?
    THANKS.

    the browser doesn't have to remember what you submitted and fill that back in.
    you can't prevent it unless you can ensure a new request to the server in which you can fill the default values in there.

  • Why is it that when i am receiving a call the phone does not respond to my finger touch?

    Why is it that when i am receiving a call the phone does not respond to my finger touch?

    If the photos that you have on your iPad came from a different computer that may be why you are getting that message. If you have photos from a previous sync with iTunes you must make sure that you have those photos selected to sync again.
    In the photo below, I have a checkmark next to sync photos. The folder from which the photos are syncing is iPhoto on my Mac. You can also see that I have clicked - selected albums, events, and faces automatically. These events, albums, etc will sync every time the way I have this set up.
    I can also add new events or albums when I sync if I choose to do so. You have to select the other albums, events, etc. that you want to sync by putting a checkmark in the box next to the event and then click on Apply in the lower right corner of iTunes and they will transfer to your iPad.

  • Why is it that when I go to the search screen to find a particular message in a conversation it comes up with the message but when I click on it it takes me to the conversation where the most recent message was sent and not the message I wanted

    Why is it that when I go to the search screen and type in a particular message I want to view, my iPhone finds it but when I click on it it only takes me to the conversation at the most recently thing texted and not the particular message I clicked on?

    Never occurred to me you can search messages that way, thanks.
    Another way to do it is to scroll from the most recent message to the top of the screen and tap load more messages, repeatedly till you reach the one you want.
      I like your method better, but with both methods it refreshes to the most recent message.

  • How can I call a custom javascript function when clicking on cfgrid cell.

    I would like to call a custom javascript function when
    clicking on a cell in an cfgrid (of html format). The closest thing
    I can find is to use the HREF="" attribute, but it doesn't seem to
    work with javascript inside it.
    Simple example:
    <cfgridcolumn name="Foo" header="Foo"
    href="javascript:customFunction(#ID#);">
    Do I need to tap into the underlying Ext JS funtionality? If
    so, where can I start?
    Thanks!

    Hi,
    According to your post, my understanding is that you want to hide/show list columns based on specify the permission for Users, SharePoint Groups or Active Directory Groups.
    Here is a solution from CodePlex for your reference:
    SharePoint 2013 Column & View Permission
    https://sp2013columnpermission.codeplex.com/
    Best Regards
    Dennis Guo
    TechNet Community Support

  • I have just clicked on my iTunes desktop icon and got the following message "The file iTunes Library.itl" cannot be read because it was created by a newer version of iTunes. Why has this occurred when it working fine?

    I have just clicked on my iTunes desktop icon and got the following message "The file iTunes Library.itl" cannot be read because it was created by a newer version of iTunes. Why has this occurred when it working fine? Is it best to update iTunes to 10.2 to attempt to resolve? Initially I got the prompt Quicktime was out of date so I updated that successfully in all programs. I do not want to lose my iTunes library.

    Sorted problem updated and reinsatlled and restarted computer.

  • Why do I not get the checkout option for a pdf type document when clicking on the document link in the SharePoint workflow task?

    We are trying to use workflows to review and edit pdf files in sharepoint 2010. We are having a couple of issues and am hoping someone has the answer.....
    1)  When myself and coworkers click on the pdf document in the library, we get the check out option as expected.  However when we click on the document
    link in a workflow task (on the sharepoint site), the pdf opens as a temporary file and we do not get the check out option.  Why does this happen????? 
    2)  The same thing happens when we click on the document link in the workflow task email;   HOWEVER,  one of our co-workers does get the
    check out option when clicking on the link in the email task.  Why would she get the checkout option using the email and not when clicking on the link in the task list on the sharepoint site ????  We have compared our internet settings and adobe
    settings to ours and found no differences.
    We are using Sharepoint 2010, Windows 7, IE8, Adobe Reader X or XI.  Some of us have Adobe Pro X and have the same issues.

    Hi,
    According to your post, my understanding is that you could not get the checkout option for a pdf type document when clicking on the document link in the SharePoint workflow task.
    I try to reproduce the issue, however, no matter when I click the pdf type document in the library or click on the pdf document link in the workflow task email, it download the pdf doucment and then I can open it.
    It will be better if you can descript how you
    get the check out option as expected when you click on the pdf document in the library.
    Then I upload a
    word type document to the library, no matter when I click the word type document in the library or click on the word document link in the workflow task email, I can open the word document directly and get the check out option as expected.
    I recommend to use the other type docuemts to check whether the check out option works.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Why do certain webpages via google searches (YouTube, google images etc) not load when clicked but load upon page refresh?

    I had problems with my Firefox browser being too slow so recently reset the browser (preserved my bookmarks but lost all my plugins). Now I find that when I am searching for something in google when clicking on certain links the window goes blank/white and shows a long url across the top (showing the link was pressed from a google search) and only if I refresh the page will the link load up.
    Not sure why this is the case and could use some advice.
    Thank you in advance.

    Make your Firefox faster
    *https://support.mozilla.org/en-US/kb/firefox-slow-how-make-it-faster?

  • Why do I not get the checkout option when clicking on the document link in the SharePoint workflow task?

    We are trying to use workflows to review and edit pdf files in sharepoint 2010. We are having a couple of issues and am hoping someone has the answer.....
    1)  When myself and coworkers click on the pdf document in the library, we get the check out option as expected.  However when we click on the document link in a workflow task (on the sharepoint site), the pdf opens as a temporary file and we do not get the check out option.  Why does this happen????? 
    2)  The same thing happens when we click on the document link in the workflow task email;   HOWEVER,  one of our co-workers does get the check out option when clicking on the link in the email task.  Why would she get the checkout option using the email and not when clicking on the link in the task list on the sharepoint site ????  We have compared our internet settings and adobe settings to ours and found no differences.
    We are using Sharepoint 2010, Windows 7, IE8, Adobe Reader X or XI.  Some of us have Adobe Pro X and have the same issues.

    No the person who can check out using the link in the email has the same permissions as me.  We have looked at all kinds of settings, profile etc and nothing evident can be determined to explain the reason.  However, one difference we did notice is that this person does not have a default web browser set and thus when clicking on items to open, it always pops up a dialog box asking which program to use to open it with.  This person chooses Adobe Reader and it opens on the Sharepoint server as it should and she gets the checkout option in a dialog box just like clicking on the document in the library.  My theory is that this step of choosing the program to open with is interrupting the typical way a pdf file is handled when clicking on URL links to the document, which is…. it is opened as temporary internet file rather than on the Sharepoint server.   Hopefully someone can figure this out ☺

Maybe you are looking for

  • Error while Activating update rule in BW

    Hi, I am getting an ABAP dump while activating an update rule. The rule is from DSO to cube. "MESSAGE_TYPE_X" " "     "%_T020N1" or "%_T020N1" "INSTANTIATE"            I have added some new fields in a DSO. The rule is from DSO to cube. While activat

  • Install.app Creative Suite CS5 will not start up on Mac OS X 10.9.4

    After a clean unistall I already reinstalled CS4, now i am trying to install the upgrade for disk or downloaded version from the Adobe site for Creative Suite Design Standard CS 5. When I try to start up the install.app I get the message that Install

  • How do I replace one adaptor from my Apple World Traveler Adaptor Kit?

    How do I replace one adaptor from my Apple World Traveler Adaptor Kit?

  • Pdf file not exporting data as xml

    Hi I have created a pdf form in adode livecycle version 8, I have saved it as a adobe acrobat 7 dynamic xml form. when a user has completed the form I need to export the data as an xml file however there is no data from the form in the xml file. does

  • Using iframe in jspDynPage

    hi all: i wrote an iframe control with html tag in my jspDynPage. then i went to get the property of the iframe on client side using javascript, i got a script error that prompted it is refused to visit. i know this will certain happened when the "if