Radio button to filter Datagrid, buggy

Hi all.

I have a datagrid in poplated with the form of a mysql database, data is stored in a Collection of table.

Here's my datagrid

< XY = "1" mx:DataGrid = "20" width = "296" dataProvider = "{YourCandidatesArr}" height = "325" itemClick = "itemClickHandler (event)" >
< mx:columns >
< mx:DataGridColumn headerText = "" ID: "width ="35"dataField ="ref"/ >"
< mx:DataGridColumn headerText = "First name" dataField = "FirstName" / >
< mx:DataGridColumn headerText = "Name" dataField = 'secondname' / >
< / mx:columns >
< / mx:DataGrid >

Here's my radio buttons

< s:RadioButton = x "447" y = "180" label = "Live" groupName = "radiogroup1" id = "CB_live" change = "GetYourCandidates_filterFunc (event)" / >
< s:RadioButton = x "447" y = "206" label = "Zéro" groupName = "radiogroup1" id = "CB_Archieved" change = "GetYourCandidates_filterFunc (event)" / >
< s:RadioButton = x "447" y = "232" label = "All" groupName = "radiogroup1" id = "CB_All" change = "GetYourCandidates_filterFunc (event)" / >

And finally my script

protected function GetYourCandidates_filterFunc(item:Object):void
{
If (CB_live.selected)
{
output. Text = "a";
YourCandidatesArr.filterFunction = case_a_filterFunc;
YourCandidatesArr.refresh ();
}
ElseIf (CB_Archieved.selected)
{
output. Text = "b";
YourCandidatesArr.filterFunction = case_b_filterFunc;
YourCandidatesArr.refresh ();
}
ElseIf (CB_All.selected)
{
output. Text = "c";
YourCandidatesArr.filterFunction = case_c_filterFunc;
YourCandidatesArr.refresh ();
}
}

Filters


protected function case_a_filterFunc(item:Object):Boolean
{
If (item.locked == 'no')
{
Returns true
}
on the other
Returns false;
}
protected function case_b_filterFunc(item:Object):Boolean
{
If (item.locked is "Yes")
{
Returns true
}
on the other
Returns false;
}
protected function case_c_filterFunc(item:Object):Boolean
{
If (item.locked is "Yes")
{
Returns true
}
Else if (item.locked == 'no')
{
Returns true
}
on the other
Returns false;
}

Now my problem is, the buttons filter correctly when I click on them first, but if I click through them, in a random order they do not work as they should.

Hello

try to make the code as below, it should fix your problem

David

PS: Sorry for last night went to Canberra really late and crashed for a few hours just sorta

(600km of travel and an aggressive meeting on the same day a affecting).

http://ns.Adobe.com/MXML/2009.

xmlns:s = "library://ns.adobe.com/flex/spark".

xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" minHeight >

Import mx.collections.ArrayCollection;

Import mx.events.ItemClickEvent;

[Bindable] private var isLocked:String = 'All ';

[Bindable] private var myArray:ArrayCollection = new ArrayCollection();

protected function radiogroup1_itemClickHandler(event:ItemClickEvent):void

{

isLocked = event.label;

myArray.filterFunction = lockFilter;

myArray.refresh ();

}

protected function lockFilter(item:Object):Boolean

{

Switch (IsLocked)

{

case 'Live': if (item.locked == 'no') true false return otherwise return;

break;

case 'Archive': if (item.locked == 'Yes') true false return otherwise return;

break;

case 'All': if (item.locked == 'Yes' | item.locked == 'no') true false return otherwise return;

break;

}

}

]]>

Tags: Flex

Similar Questions

  • How to dynamically set the filter IR APEX of the value of a radio button column?

    Hello

    I built a simple APEX 4.2 IR report that includes column, namely "Source_Data" and a separate user to input radio button namly "P33_SOURCE_DATA" with two possible values in 'X' or 'Y '.

    I would like the report filter source_data = 'X' or source_data = "Y" is applied, after each time the user clicks on the radio button P33_SOURCE_DATA. "

    So my question is, how to set the value of the IR filter using the value of P33_SOURCE_DATA to the dynamic action and javascript?

    Thanks in advance.

    Concerning

    Susanna

    In this case, you can pull an onchange dynamic action on the radio, or at the click of a button.

    This dynamic action update your IR region

    And your IR region would have an appropriate where clause, with "Page to go" set on your radio.

  • jdev11 - how the code filter additional liaison with radio buttons?

    Using JDev 11.1.1.0.2, ADF BC for model, ADF Faces JSF to view, deploy to WebLogic 10.3 appserver, database Oracle 11

    I asked for help (a do my work ask), that I'm the only developer JDev in our shop, and I looked at this problem too long and now have obscured the problem. I don't really want the answer (rather the skills needed to solve this problem), but it will ;-)

    Installation program:
    ExecwithParam base where the logic is stored in the AppModule. At this point, there is only a single binding TechID variable, which is passed to four of your different and updates the where clause and calls on each VO of the AppModule executeQuery. Works great so far!

    Need:
    Add additional time based filter: Group of buttons on the Radio for the last 30 days, 60 days, 90 days, choose a date. If choosing a date is sΘlectionnΘe, then the user selects a date with a date picker, and all records by this date are used.

    Support:
    There is a date variable in each query, and a common type of DATE filterDate may be added to each to filter with somedatefield > =: filterDate in each VO

    Thoughts:
    I like to break things in simple parts, so how about starting just the radio button.
    My thinking goes like this:
    Add another variable of filterDate liaison to each of your. Add this to the App Module.

    So, how can I set up a radio button so that I can get the value of the selected and then button that convert a SYSDATE - value and which use th e App Module logic? I continue to think of the big picture end of case and forget everthing. I know that's not difficult, but just ask me for some advice.

    At one point, I was thinking to add a clove of support to the option button, then wasn't sure if it was the best way and don't know how I would get the value in the AppModule. Part of the problem is that I came across a mental block. If I add the components that aren't linked data, as a selector of dates, or checkboxes, radio buttons, etc.. How can I get the values in the AppModule? I've seen many examples of data to related components, but do not know how to mix and match the binding with just a rich component controls base such as an input control. (This may better ask in a different thread).

    Finally, what of the big picture, the part about the addition of the datePicker - of ideas?

    Like cable TV, characters hosted - the kind that are related in my case the code! (Reference of American humor, must be familiar with USA cable TV channel (I'm addicted to the show House))

    Thank you, Ken

    Ken,

    A small correction to your last sentence - you don't want to refer to the support of the AM bean - you want to refer to the AM of the bean to support.

    If you want a very simple way: find the service for your AM method in the data control palette, drag-and - drop it on your page as a button JSPX. JDeveloper will automatically add a binding for the action in the pagedef. Then, double-click the button that results and create a new method of bean of support for her (in front of JDev, don't remember what we call the dialog box) - given the option, say JDev to put the code to link to you - then the resulting method should have the code that calls the method via the definition of the page. Simply add a bit of extra code to determine and set the date.

    John

  • Cannot be selected 2 radio buttons in different columns in a DataGrid.

    Hello

    I have 2 columns of radio buttons successfully using itemrenderer. But I am unable 2 radiobuttons select simultaneously since the two columns.

    Here, I enclose the screenshot of the application. Since the screen shot I will explain to you wht exactly my problem is...

    radio_image.JPG

    If I select the box option helps in the first row, and then I want to select Start button in the second row while the first line help button is still selected; but I am unable to do that is to say, the focus moves

    In short, help Option radio buttons and option buttons in startup should be in two separate groups.

    Thanxs

    Gerard

    Comment your code in init() & flag 1 the erroneous values value & flag 2 in your XML.

  • Print multiple lines of page based on radio button choice group

    Hello... I have a PDF file that is a form of group request, consisting of 6 distinct forms. On the first page, I have 6 groups of option buttons "Yes / No".

    If the radio button for one or more of these groups is selected as 'Yes', then when button click Print (on the page) then the appropriate page range prints.

    It is desirable but not essential for them to be printed in a print job.

    The Code I've been adjust to try to get the result is less but I have myself linked in knots now and any help would be greatly appreciated:

    Thank you very much

    
    
    //<AcroForm>
    //<ACRO_source>PrntForms:Annot1:MouseUp:Action1</ACRO_source>
    //<ACRO_script>
    /*********** belongs to: AcroForm:PrntForms:Annot1:MouseUp:Action1 ***********/
    var nButton = app.alert({
    cMsg: "Your selected forms will be sent to your default printer.\n\nIf you require to print to an alternative printer, press cancel and select 'Print' from the 'File' menu.",
    cTitle: "Submit Forms for Printing?",
    nIcon: 1, nType: 1
    });
    // array for button responses
    //var aResponse = new Array("OK", "Cancel");
    
    if(nButton == 1) 
    {    this.print({ bUI: false, bSilent: true, bShrinkToFit: true, nStart: 1, nEnd: 1 });
    } else
    if(nButton == 0) 
    {    this.Exit
    }
    
    var a_app;
    if(this.getField("AppForm1”).value=="Yes"){
        a_app = "1, 1";
    } else a_app = "0, 0"
    
    var b_app;
    if(this.getField(“AppForm2”).value=="Yes"){
        b_app = "2, 2";
    } else b_app = "0, 0"
    
        var pp = this.getPrintParams();
              pp.interactive = pp.constants.interactionLevel.full;
              pp.printRange=[[a_app], [b_app]];
              this.print(pp);
    //</ACRO_script>
    //</AcroForm>
    
    

    In fact, the last part should be something like this (I tried to change the code, but it is buggy):

    If {(printRanges.length>0)}

    pp var = this.getPrintParams ();

    pp.interactive = pp.constants.interactionLevel.full;

    pp.printRange = printRanges;

    This.Print (pp);

    } else app.alert ("no page ranges are selected.");

  • Upper right corner radio buttons disappear

    Whenever I update Firefox since version 32, radio buttons right up to "minimize, resize the window and close", disappear. They will appear momentarily, and then they are gone. If I downgrade to the version 32, I get back them, so I kept version 32 just for this reason. I wonder why they are endangered in version 33!

    Thank you

    You use a theme installed, or the default value?

    Start Firefox in Safe Mode {web link}
    While you are in safe mode;

    Type of topic: preferences< enter > in the address bar

    Select Advanced > General.
    Find and stop using hardware acceleration.

    Search web sites secure. Are there problems?

    Then restart.

  • 33 Firefox works only with Amazon Wish List radio buttons

    On Amazon.com, if I click on the option button "Add to wish list", my wish lists list doesn't go down for display and selection. Instead, the item is added to my wish list default (I have several wish lists). Within any given wish list, radio buttons 'Move' (to another list of wishes) and 'Delete' does not work for any item in the list. This does not work on my system (Win 7; 33 Firefox) if I use (God forbid!) Internet Explorer.

    This happens in Firefox Safe mode? If this isn't the case, it can be a complement on. Questions to troubleshoot Firefox in Safe Mode

  • Radio buttons of style entry does not not in firefox linux

    Under linux, we cannot use radio buttons pass Foundation zurb. Look at this question: https://github.com/zurb/foundation/issues/1615#issuecomment-14593962.

    The buttons work if I add a - moz-appearance: no rules

    div.switch input {
     position: absolute;
     z-index: 3;
     opacity: 0;
     width: 100%;
     height: 100%;
     -moz-appearance: none
    }
  • Firefox crashes in typing or by clicking check box or the radio button, even with all the plugins / extensions removed. Check with many types of malware scanners.

    Firefox crashes in typing or by clicking check box or the radio button, even with all the plugins / extensions disabled, then deleted. Sometimes it hangs for five minutes. I checked the PC with several types of scanners of evil-ware, but none to be found. All hidden and deleted cookies, all DELETED & extension plugins. Remove all instances of Firefox PC and registry, then restored to bookmarks. The only thing that I did not is to remove and reinstall not my favorites.
    Windows Vista (yes I know) and FF 13.0.1

    Try disabling hardware acceleration in Firefox.

  • Why 200 radio buttons in a form cause 8 second period of rendering

    We have an on-line questionnaire containing 36 questions, each with 6 radio buttons (216 total) in a single form. Although the page to render quickly, there is then a delay in Firefox up to 8 seconds before it will record an option by clicking button. This problem does not occur in Chrome or Safari, and there are slight delay (second) in Internet Explorer. The period shall be reduced pro rata by reducing the number of option buttons. The period may also be reduced to about 4 or 5 seconds by removing all elements of the page outside the boxes option and the form.

    Unfortunately, you will need to get with Norton to try to determine why.

    We could try to open a bug report in Bugzilla... Use the Plugins with Norton AV product component-> https://bugzilla.mozilla.org/enter_bug.cgi?product=Plugins

  • How to programmatically set the option button selected on a group of radio buttons

    Hello, I have another question for you.

    How can I set an option specifically button selected programmatically on a group of Radio buttons? I think it's very simple, but I can't find a solution.

    Thank you in advance.

    You can use the SetActiveCtrl function

  • resize the radio button

    Hello

    How to resize the radio button face before image.i am using labview 8.6

    "" To create a resizable option button, right click on the option button control and selectreplace"classic"Boolean Classic'Round/Square option button. "" You can also place a Radio button Classic Round/Square directly on the front panel or in the box of radio buttons by right-clicking on the front panel to display the controls palette and selecting classic "Boolean Classic'Round/Square option button. This new radio button is now resizable.

  • IdeaPad z460 - how to turn off the physical wireless radio button?

    Hello...

    It is possible to disable the wireless radio button? It's very annoying when I disable the wireless without notice and wasting time trying to figure what happened.

    TKS,

    Hi neokenchi,

    Then... Thanks again for the reply, but I'm a little disappointed that I can't set (enabled) button.

    The only way is to avoid touching this unawareness button...

  • Resize the system checkbox and radio buttons system

    Is it possible to resize the system checkbox and radio buttons system. If we right click on one of them and go to properties, size controls are disabled. I wonder if it's feasible.

    Also I noticed that I could add the new radio buttons to do a right-click and choosing Add new button. Is it possible to achieve this programattically.

    Kind regards

    Austin

    AustinCann wrote:

    Is it possible to resize the system checkbox and radio buttons system. If we right click on one of them and go to properties, size controls are disabled. I wonder if it's feasible.

    As mentioned, system controls cannot be customized, because they depend on the windows theme. However, here are some Boolean values, so all you need to do is use an ordinary Boolean value and import the graphics that you want in the case of true and false. They can easily be made to look like an oversized check box. More details, especially about radio buttons can be found here.

    AustinCann wrote:

    Also I noticed that I could add the new radio buttons to do a right-click and choosing Add new button. Is it possible to achieve this programattically.

    You could probably do it in edit mode programmatically by using scripts. You can't do it at run time.

    To fill a RadioButton with new Boolean values, you can simply drag the new values Boolean inside or even shift-do drag an item to create a copy of it. Don't forget to change the labels to something intuitive.

  • Help with custom radio buttons.

    Before you go all Rube Goldburg thought that I post for a quick reality check.

    Basically, I have a test with several different configurations of coupon and I try to give users an advanced interface to select one they use. Using radio buttons seems the way to go and I inserted my custom images but I have only be able to select by clicking on the buttons. I want the user to be able to click on the image. Unless I'm missing something, I have this feeling that I have to create the four complete custom Boolean buttons with States of 4-6 and then write the code to do that alone is never on at the same time?

    Joint-

    You can change the appearance and the size of the used option button and overlay them on your chart, and then set the transparent parameter. So it looks like they're clicking on custom image but they are clicking on the invisible button on the top of the image.

    But it might be easier to use a ring of photo,

    Photo ring can be changed at runtime to add selections. Where the radio button enum cannot.

Maybe you are looking for