ItemRenderer custom - decide if selectable based on the dataProvider

Hello

I want to have a list with unselectable items, except some that have a property like {selectable: true} in the item object.

Thank you.

This message may be useful: http://flexponential.com/2009/12/20/disable-selection-on-some-items-in-a-spark-list/

Be sure to check the implementation of Tink in the comments.

Tags: Flex

Similar Questions

  • How ItemRenderer change for DataGrid column based on the value of this column?

    Hello! I am trying to create a DataGrid that has a component Button to register when the value of this column is 'Open', then a label saying full when the value of this column is "Full". But Im having a hell of a time he find.

    Here's my MXML with 2 different inline installation of components for different rendering engines point 2:

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" >

    < mx:Component id = "RegFull" >
    < mx:VBox horizontalAlign = "center" verticalAlign = "middle" >
    < mx:Label id = 'Full text' text = "Full" / >
    < / mx:VBox >
    < / mx:Component >

    < mx:Component id = "RegButton" >
    < mx:VBox horizontalAlign = "center" verticalAlign = "middle" >
    < mx:Button label = "Save" / >
    < / mx:VBox >
    < / mx:Component >

    < mx:DataGrid id = "scGrid" width = "100%" height = "100%" number of lines = "4" >

    < mx:dataProvider >
    < mx:Object label = "Status" data = 'Open' / >
    < mx:Object label = "Status" data = "Full" / >
    < mx:Object label = "Status" data = 'Open' / >
    < mx:Object label = "Status" data = "Full" / >
    < mx:Object label = "Status" data = 'Open' / >
    < mx:Object label = "Status" data = "Full" / >
    < / mx:dataProvider >

    < mx:columns >
    < mx:DataGridColumn id = "RegCol" headerText = "Reg" dataField = "data" / >
    < / mx:columns >

    < / mx:DataGrid >
    < / mx:Application >

    How can I dynamically use the right of itemrenderer based on the value of the field? THANKS FOR ANY HELP PROVIDED!

    The best
    Stephen

    You can have more than 1 column renderer engine. There are two ways to do this. One way would be to use States. A State for each possible value in the data. Since you either want a button (data == 'open') or a label (data == 'Full') by using the States wouldn't be a bad choice.

    Alternatively, you can use a canvas instead of a VBox. Make a label and a button with horizontalCenter = "0" "0" = red to make them each other. Make it visible according to the data value:






    where dataField is the value of the property dataField on this converter DataGridColumn.

  • Automatic filling of multiple selection based on the selection list

    Hello

    I have a problem in filling multiple selection data in the selection list.
    I would like to take an example and explain.
    I have 3 tables: employee, Department and a link table for employee and department.
    The selection list contains employee and the Department is a multiple selection. Employee selection, all departments must be posted and belongs to the Ministry of which employee (which comes from the binding table) must be selected (high-lighted). How can I do this?

    HI 841762 :),.

    Do not use the 'style' to highlight that you would have found out by now that would make the blue text background while the font color remains black and this will make the text unreadable. Plus if there is a button on the page when you submit it to us, I doubt that it will store the State of the selected items in a multiple of P1_DEPT in session state. then try this...

    In the application process, replace, the status of 'style' that you used to highlight as you...

    ....
    If (rec.R=cnt)then
    htp.prn('');
    ELSE
      htp.prn('');
    end if;
    ...
    

    Then in the JS, use

    appendToSelect(list, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue,l_Opt_Xml.getAttribute('selected'));
    

    and change the function "appendToSelect".

    function appendToSelect(pSelect, pValue, pContent,pIsSelected) {
    
     var l_Opt = document.createElement("option");
     l_Opt.value = pValue;
    
    if(pIsSelected)
    l_Opt.setAttribute('selected','selected');
    
    if(document.all){
      pSelect.options.add(l_Opt);
      l_Opt.innerText = pContent;
     } else {
      l_Opt.appendChild(document.createTextNode(pContent));
      pSelect.appendChild(l_Opt);
     }
    }
    
  • Can I set selection based on the 'selectedItem.label' instead of 'selectedIndex '?

    I searched the forums for this one but no luck. It's also a little difficult without being able to download a file, but this is:

    In a simplified version of my question, I have a ComboBox control named "cb". I can put its selectedIndex 1 (corresponding to 'Red' selectedItem.label) easily with:

    cb.selectedIndex = 1

    However, given that the 'Reds' are not necessarily at a selected index of 1, if it is asked another entry in the list, I'd rather base my code on selectedItem.label, because it will always be 'red '.

    How can I do this? I can at least draw corresponding to the label with the code as selection index:

    var frameSelect:Number = cb.selectedIndex;
    trace (frameSelect)

    Do I need some sort of loop function? Or y at - there a simpler way? I can define a variable at the beginning of my code to figure out what the corresponding selection of 'Red' date index here? I need essentially

    var frameSelect:Number is cb. [Index of everything goes with the label of 'Red']

    If it is useful for you, what I'm doing (on a scale of simplified) uses a drop-down list box to change the color of a clip. The user can click on 'Blue' or 'Yellow' or 'Red' in the box of comb and clip changes color. However, I also need a simple button that has only a single result ('Red') where the user clicks the button and thus sets the index selected in the combobox control directly to the 'red'. As I said, I can do it quite easily using the setting selectedIndex, but this means I have to manually update my button code whenever a new color option has been added. Not ideal remotely, because the actual implementation has hundreds of colors in tables and there will be many buttons create different arrangements of comboboxes.

    (For example a combobox is colors, one of the forms, and one is size. The final objective is to let the user experience as much as they want through drop-down menus, OR click on a 'Small green circle' button to go directly to a particular result.)

    Any help would be greatly appreciated!

    You need just a little loop on the elements in the dataProvider and check the labels against 'red '.

    Something like so should work for you:

    function getIndex(s:String) {}

    var ind:int = - 1;

    var dp:DataProvider = cb.dataProvider;
    for (var i: int = 0; i< dp.length;="">
    If (dp.getItemAt (i) .label == s) {}
    IND = i;
    break;
    }
    }

    return ind.

    }

    cb.selectedIndex = getIndex ("red");

  • execution of actions on a selection based on the object type

    Hello.

    I am trying to write an AppleScript that considers the current selection, then redefines the scaling of all lines of that selection to 100%, and then sets the absolute horizontal scale of the remaining elements of the selection to 100%.

    My attempts so far are:

    say application «Adobe InDesign CS3»

    put Original_Selection to selection

    put to each graphic line of Original_Selection Lines_Selection -this part is not working

    put transform reference point of window layout 1 to anchor Center

    Choose Lines_Selection

    redefine the scaling to the selection {1.0 , 1.0}

    Choose Original_Selection - but it must be ' Original_Selection less Lines_Selection ' somehow

    put horizontal scale absolute at 100

    end say

    None of this really works as I expect, but I can't find out the required syntaxes. Anyone know where I am going wrong?

    Thank you.

    Try this:

    say application «Adobe InDesign CS3»

    the value transform reference point of window layout 1 of anchorage Center

    redefine the scaling of (each point of selection which class is the line graph) to {1.0, 1.0}

    the horizontal scale absolute value of (each element of selection whose class is not graphic line) to 100

    end say

    --

    Shane Stanley [email protected]>

    AppleScript Pro, April 2010, Florida http://www.applescriptpro.com>

  • checkbox selection based on the name within a field

    I have a PDF form

    the form has 2 selections of checkboxes.  M or F (male or female)

    I can get a field to fill with M or F or man or woman, but how do I get a checkbox to select M or F based on

    What comes in a field?

    You can use the custom validation script of the--of the text field to change the check box, for example:

    If (event.value == "Male") this.getField("CheckBoxMale").checkThisBox (0, true);

    Else if (event.value == "Female") this.getField("CheckBoxFemale").checkThisBox (0, true);

  • Would it not be possible to make a selection based on the percentage instead of pixels? For example: 90% left, 5% of the upper part.

    Im having a little trouble getting a Photoshop Action to work the way I need to.

    Product photos are taken in different batches, and the only thing that is guaranteed, it must be transparent in the upper right. This means I need an action that makes a selection with the 'magic wand' tool and is independent to define an absolute selection through pixels (see images below).

    selection.PNG

    Photo: how it behaves

    selection2.png

    Photo: How I need to behave

    Anyone know how I can solve this problem without resizing the canvas to an exact size?

    Thank you in advance,

    Edvard

    Hi edvardkrupke

    Please try and change the rules per cent in Photoshop preferences.

    Check the screenshot below.once you change restart Photoshop to check

    Let us know if that helps.

    Kind regards

    ~ Mohit

  • Update of custom table and column based on the number of lines inserted in it.

    Hello

    I have a XX_TDP_DT custom table that has a column ID_processus.
    User will be be download data in the XX_TDP_DT table, but they insert any value into ID_processus.
    Say if the entered data are 1000 lines.
    I need to process these 1000 rows in batches, so I want to have 1 for 1 to 200 rownum = ID_processus, ID_processus = 2 for rownum 201 to 400 and so on.
    How can I achieve this, any suggestions?

    Database: 10g

    Thank you.

    You can also use NTILE to do this, see:
    Re: Divide also extracted almost lines and assign a group
    http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:47910227585839

  • XML E4X nodes select based on the attribute of the child node.

    Hey,.

    I'm making a selection on the following XML code.

    I want to retrieve the list of the variable node when its child nodes metadata attribute 'name' is not equal to "transitional". I have read the documentation, but have not been able to solve this problem, and it should be pretty simple. So far, I tried with something like.

    variable var: XMLList = classInfo.variable. (the metadata. (@name! = "transitoire")) ;

    variable var: XMLList = classInfo.variable. (metadata.@name! = "transitional");

    But he returns all the nodes variable.

    "< name =" type com.sca.dataModel::PresentationDataEntity"base =" com.sca.dataModel::BaseEntity "isDynamic ="false"isFinal ="false"isStatic ="false">
    < extendsClass type="com.sca.dataModel::BaseEntity"/ >
    < extendsClass type = 'Object' / >
    < variable name = "subtitle" type = "string" >
    < name of metadata = "__go_to_definition_help" >
    < arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/ >
    < arg key = "pos" value = "128" / >
    < / metadata >
    < / variable >
    < variable name = "id" type = "Number" >
    < name of metadata = "__go_to_definition_help" >
    < arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/ >
    < arg key = "pos" value = "153" / >
    < / metadata >
    < / variable >
    < variable name = "tableName" type = "String" >
    < name of metadata = "transitional" / >
    < name of metadata = "__go_to_definition_help" >
    < arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/ >
    < arg key = 'pos' value = '118' / >
    < / metadata >
    < / variable >
    < variable name = "db_SortAsc" type = "Boolean" >
    < name of metadata = "transitional" / >
    < name of metadata = "__go_to_definition_help" >
    < arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/ >
    < arg key = "pos" value = "281" / >
    < / metadata >
    < / variable >
    < variable name = "title" type = "String" >
    < name of metadata = "__go_to_definition_help" >
    < arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/ >
    < arg key = "pos" value = "100" / >
    < / metadata >
    < / variable >
    < method name = "setData" declaredBy = "com.sca.dataModel::BaseEntity" returnType ="*" > "
    < parameter index = '1' type = 'Object' optional = "false" / >
    < name of metadata = "__go_to_definition_help" >
    < arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/ >
    < arg key = "pos" value = "330" / >
    < / metadata >
    < / method >
    < name of metadata = "__go_to_ctor_definition_help" >
    < arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/ >
    < arg key = "pos" value = "167" / >
    < / metadata >
    < name of metadata = "__go_to_definition_help" >
    < arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/ >
    < arg key = "pos" value = "42" / >
    < / metadata >
    < / type >

    Try classInfo.variable. ([email protected] (.indexOf("transient')) is

    (- 1).

  • Selection based on the date of no recovery no lines

    Hello

    Why this doesn't work (returns 0 records)

    < cfquery = name 'interrogate' Datasource = "#Application.Datasource #" >
    SELECT *.
    THE VOTING
    WHERE the arguments start_date > = #DateFormat (now (), "dd-mm-yyyy") # and end_date < = #DateFormat (now (), "dd-mm-yyyy") #.
    < / cfquery >

    There are two rows on the table. One with start_date 12/01/2006 and the date of 12/19/2006, the other with 12/20/2006 start_date and end_date of 31/12/2006. Any of these get selected, once the current DAT files are 31/12/2006.

    Thank you

    My lack of formal training is showing through... I jump into the deep end.

    I changed the statement for...

    WHERE the #DateFormat (now (), "dd-mm-yyyy") # BETWEEN start_date and end_date

    I read this as "where is today > = past date and today.<= future="" date".="" i="" want="" a="" date="" between="" the="" start="" and="" end.="" but="" that="" doesn't="" return="" any="">

    What shocks you on the date format? JMA is the Australian date format.

    I will start this topic.

    Thank you
    Tanya

  • cord cable fiber type selection based on different types of SFP connectors?

    need help with fiber patch cable cord type selection based on the different types of SFP connectors, y at - it links online or any documents that will be useful...

    The type of connector, usually (but not always) follows the form factor of the transceiver. For example, most SFP and SFP + transceiverss use dual LC.

    However, always check the Datasheet on the link I provided above to confirm if there is any doubt.

    Please indicate your question as answered if it was.

  • Command tab selected, based on navigation

    Hello

    I have a jsf (jspx) page with a navigation pane, which has three navigation elements. Now by clicking one of the navigation feature a different jsf page will appear in a new window. This page has three tabs. Now, I want to show a tab is selected, based on the navigation point clicked. I have a managed bean where I put the disclosed ownership of the retail show based on the clicked point navigation. But it is throwing null pointer exception.

    public void firstitemClicked() {}

    this.getTab1 () .setDisclosed (false); This line is an error

    this.getTab2 () .setDisclosed (true);

    this.getTab3 () .setDisclosed (false);

    }

    And this method is called the navigation item that is located on the first page.

    Mallaury,

    Make the Boolean type as "static".

    In your DemoBackingBean, do the "static" variable that we were missing before.


    Private static boolean first = false;

    Tip: I prefer to use "af:setActionListener" instead of writing code for such requirement

    Thank you

    SAIF

  • Make ItemRenderer custom bindable?

    If I use my custom ItemRenderer then my TileList tiles change when the dataProvider changes, however when I use my custom ItemRenderer that they do not change when the dataProvider changes.

    I don't know how to fix this?

    Here is the code for my ItemRenderer component.


    Thank you!!

    'john isaack' wrote in message
    News:gigrvl$a6h$1@forums. Macromedia.com...
    > If I don't use my custom ItemRenderer then the tiles in my TileList
    > change
    > when the dataProvider changes, however when I use my custom ItemRenderer
    > they
    > do not change when the dataProvider changes.
    >
    > I don't know how to fix this?
    >
    > Here is the code for my ItemRenderer component.

    http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.PDF
    Q2

    Maybe you should read it all this time, since you were sent for her
    before on another number :-)

    You could also find here useful example element Converter:
    http://flexdiary.blogspot.com/2008/09/GroupingCollection-example-featuring.html

  • How to calculate the sum of two digital form fields based on the selection of the checkbox.

    I have a form in Acrobat Pro who needs a custom calculation. How to calculate the sum of two digital form fields based on a selection of the checkbox. I have three number fields. Field-A and B are simple one or two digits. Field-C is the sum, or the total field. I want to field-C have a control box which, when turned on and off, just gives a. gives the sum of A + B

    _ Field - 2

    _ Field - A 4

    [check] _ _ field - 6 C

    [disabled] _ _ field - 2 C

    Thank you

    The custom field C calculation script could be:

    (function () {
    
        // Get the values of the text fields, as numbers
        var v1 = +getField("A").value;
        var v2 = +getField("B").value;
    
        // Set this field's value based on the state of the check box named "CB"
        if (getField("CB").value !== "Off") {
            event.value = v1 + v2;
        } else {
            event.value = v1;
        }
    
    })();
    

    Replace 'A', 'B', and 'CB' with the real names of the fields.

  • Automate snapshots based on the custom field

    I am a newbie to scripting and can't creating a Powershell script that will automatically create snapsht based on a custom attribute that is specified on the virtual computer. I got so far:

    Get - VM | Select the custom name fields - ExpandProperty | Where {$_.value - eq "takesnapshot"} | Select name

    This gives me a list of virtual machine names that have the specified "takesnapshot" custom field, however, I don't know how to use the output with the Get - VM | New snapshot command to create a new snapshot. Any help would be appreciated.

    OK, the key is "Ministry" and the value is "instant".

    With the attached line, you should get in the market.

    Your test had a few typos: it should be $_ and you should leave out the test to white before the brackets.

    ____________

    Blog: LucD notes

    Twitter: lucd22

Maybe you are looking for

  • Data output DASYLab stop after 10 points

    Let me Preface everything by saying: I'm a novice at this. Now that's the road... I'm having a problem getting more than 10 data points to save in an output file. I'm sure it's a conflict of implementation, but I have no chance to understand. I have

  • HP Laserjet P1102W: Poor print job

    I bought a HP Laserjet P1102W, and after printing of less than 500 pages, he started leaving large voids in the pint. I replaced the cartridge but it is printing a gray, not black. It tells me that this is not a problem with the cartridge, but with t

  • Windows 7 - Live Photo Gallery Screen Saver - filename option, the peak, freezing and will not sleep

    I just upgraded from Windows XP. There are a few features that I miss and I don't know if there is anyway to get.1. under XP, you might have the name of the file appears in the corner of the image when the screen saver is running. Really useful to fi

  • Seeds of MS Paint, Windows 7 Ultimate

    Seems either there is a glitch in the program or a bug or something, but I have three problems with the paint.  Wanted to know if there is advice or anything. (1) when I click on the arrow on font size, it freezes momentarily, saying that he does not

  • I have no drivers usb 802.11n wlan for windows 7

    I need find los este para poder instalarlo device drivers!