The list with the variable row height

Hi, please look at the example below

What I do is:

-J' I create an item in list with variableRowHeight set to true.

-The dataProvider contains 2 numbers: 2 and 3

-In the itemRenderer, this causes in progress of creation, respectively 2 and 3 buttons

-As you can see, the height of the list is badly calculated, a scroll bar appears.

-When you switch 2 and 3 (so that the table becomes 3 and 2), the list is too large.

-I could make a custom list class and override the method of measurement, but I can't understand what to measure. I should be able to walk through the itemRenderers and measure their height.

Any ideas?

THX,

Dany

<? XML version = "1.0" encoding = "utf-8"? >
" < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="vertical"creationComplete =" init () "> "

< mx:Script >
<! [CDATA]
Import mx.collections.ArrayCollection;

[Bindable]
private var dp:ArrayCollection;

private function init (): void
{
var a: Array = [2, 3];
DP = new ArrayCollection (a);
}

[]] >
< / mx:Script >
< mx:List width = "100%" dataProvider = variableRowHeight "{dp}" = "true" rowCount = "{dp.length}" >
< mx:itemRenderer >
< mx:Component >
< mx:VBox >
< mx:Script >
<! [CDATA]
Import mx.controls.Button;
override public function set data(value:Object):void
{
Super.Data = value;

If (this.numChildren == 0)
{
for (var i: int = 0; i < value; i ++)
{
var b:Button = new Button();
b.label = "Row" + value;
this.addChild (b);
}
}
}
[]] >
< / mx:Script >
< / mx:VBox >
< / mx:Component >
< / mx:itemRenderer >
< / mx:List >
< / mx:Application >

Sorry, it's a method on a list called measureHeightOfItems.  The results,

Add viewMetrics.top and down and you should have the exact size of the

List.

Tags: Flex

Similar Questions

  • The list by using a converter of element with the variable row height

    Hi all

    I am trying to create what amounts to a list of comments. A comment is a comment string and a name, and all comments will be placed in a list in order to scroll vertically to display all comments.

    Here is an example of the sample:

    Application code:

    <? XML version = "1.0"? >
    "< mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml" > "
    < mx:List dataProvider = "{list}" itemRenderer = "ListRenderer" width = "200" variableRowHeight = "true" wordWrap = "true" >
    < / mx:List >

    < mx:Script >
    <! [CDATA]

    [Bindable]
    Table: private list var = new Array)
    {Comment: 'Test', name: 'Joe'},
    {Comment: 'This is a long comment that must wrap onto multiple lines,' name: 'Joe'},
    {Comment: 'Test', name: 'Joe'},
    {Comment: 'Test', name: 'Joe'},
    {Comment: 'This is a long comment that must wrap onto multiple lines,' name: 'Joe'},
    {Comment: 'Test', name: 'Joe'},
    {Comment: 'Test', name: 'Joe'},
    {Comment: 'This is a long comment that must wrap onto multiple lines,' name: 'Joe'},
    {Comment: 'Test', name: 'Joe'}

    );


    []] >
    < / mx:Script >
    < / mx:Application >


    Code rendering engine article:

    <? XML version = "1.0" encoding = "utf-8"? >
    "< mx:VBox xmlns:mx = ' http://www.adobe.com/2006/mxml" > "
    < mx:Text text = "{data.comment}" width="100%"/ > "
    < mx:HBox width = "100%" horizontalAlign = "right" >
    < mx:Text text = "-{data.name}" / >
    < / mx:HBox >
    < / mx:VBox >


    When I run this list it is created with each object being rendered properly, but keep an eye on the height of comments when you scroll from top down (it may take a few scrolls to see), when a comment moves out of the visible range and then comes back in the field of the visible, the height of comments seems back to zero itself , you will see the name disappear (and sometimes reappear again). Can one, someone explain what is happening? Two, this is the best approach, I have also considered using a vbox and Repeater, but so far the current implementation is the closest, just to create the desired result. Thanks in advance.

    OK I found how to fix this problem:

    new code of itemRenderer:


    http://www.Adobe.com/2006/mxml">




    Override the set method of the property data.
    override public function set data(value:Object):void {}
    Super.Data = value;

    If (value! = null)
    {
    commentText.text = value.comment;
    commentText.validateNow ();
    }
    }
    ]]>

    The important thing here is to substitute the data value method, set the comment string and then call validateNow(); This will ensure that the textHeight is updated and the right height is used

  • Tree with itemRenderer can have variable line heights (not string data)?

    Is it possible to create a tree that use itemRenderer for the variable row height?

    In my itemRenderer, I create a HBox for each line.

    For some lines, I want to show VBox with several objects like ComboBoxes as his children.

    The VBox overlaps the next line.

    You need to change the Measure [] method to accurately measure your component.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Table row with loop for each group to set the variable.

    HI: There is probably a simple answer for this, but I don't the have not found...

    I have a single row table to move through a group to set a variable containing a sum running. I'm not display the amount in the table but when I saw the report, I see that the table is expanding (add lines) for each loop.

    The only line table has 3 columns.

    1st column
    <? for-each: AC_GROUP? >

    2nd column
    <? xdoxslt:set_variable ($_XDOCTX, 'xAmtVar', xdoxslt:get_variable($_XDOCTX,'xAmtVar') + CURRENT_AMOUNT)? >

    3rd column
    <? end foreach? >

    Can I use <? for each group? > or something else. My requirement is to set the value of the variable with the total running, but because the loop is adding lines for each value he travels (though not displayed), it's also affecting other areas of the presentation of the page.

    Hope it makes sense. Thanks in advance.

    You can do it many ways.

    No need to loop
    You can create a variable and specify the amount of the sum directly to that.

    
    

    or

    loop through, then add as you do.

    
    

    give any space or enter characters in a word between them, just put it in a single form field will be

    But as I said, I'd definitely go with the first option.

  • The encapsulation of text in a classic report, bleeding in the next row with the report header template fixed.

    Hi all

    APEX 4.2.5

    XE 11.2

    Report Header fixed

    (25 and 26 theme)

    I have a classic report, and I use the fixed header template.

    If I set the width of a column unless the width of the text in the column, then the data encapsulates as it should, but instead to increase the height of the cell in the row to greet him, he bleeds into the rank and writes on the following lines.

    If I change the report to the standard model, it wraps correctly and increases the size of the cell to accommodate the text.  Not sure if it is a bug, or Im definition something wrong.

    If anyone can help to give advice on how to solve this Id be grateful.

    Ive set the maximum width of the CSS report report. and set the width of the column in the column report.

    I have reproduced it on APEX...

    workspace: VRS

    user: test/test

    Application: 291

    Page: 1

    Thank you very much

    Richard

    Richard Legge wrote:

    Hi all

    APEX 4.2.5

    XE 11.2

    Report Header fixed

    (25 and 26 theme)

    I have a classic report, and I use the fixed header template.

    If I set the width of a column unless the width of the text in the column, then the data encapsulates as it should, but instead to increase the height of the cell in the row to greet him, he bleeds into the rank and writes on the following lines.

    If I change the report to the standard model, it wraps correctly and increases the size of the cell to accommodate the text.  Not sure if it is a bug, or Im definition something wrong.

    This is because of rules CSS theme on cells and rows in the report fixed header table:

    {table.uReportFixedHeaders > tbody > tr}

    display: block;

    height: 28px;

    }

    {table.uReportFixedHeaders > tbody > tr > td}

    padding: 4px 8px;

    border-top: 1px solid #DDD;

    border-bottom: none;

    line-height: 20px;

    }

    I wouldn't really classify it as a bug, more as a hypothesis that the model would be used with data that will not be returned on multiple lines in a cell.

    It is easily fixed by substituting equal to line of table and the row height of the cells in the Inline CSS page, as indicated at page 586:

    {table.uReportFixedHeaders > tbody > tr}

    height: auto! important;

    }

    {table.uReportFixedHeaders > tbody > tr > td}

    line-height: inherit! important;

    }

  • Bidi text JTextPane and JTextArea changes the row height

    You can use the following example to demonstrate the problem. When you run, copy and paste an Arab character of http://www.alanwood.net/unicode/arabic.html in the display area. This creates a condition of bidi in the document. The circumflex replaces one with a flag at the top to indicate ownership LTR or RTL of the character. The height of the display line, going at a lower height. I am able to detect the State of bidi. I can't get any action to indicate what was the change of line height. I've exhausted all measuring height of possible line that I could find. The size reported by all methods does not State non-bidi bidi State, even if the row height is significantly reduced. Anyone else encounter this? Any proven way to measure the difference?

    to import javax.swing.JFrame;
    Import javax.swing.JTextPane;

    public class HelloSwing {}

    Public Shared Sub main (String [] args) {}
    JFrame frame = new JFrame ("HelloWorldSwing");
    OSname string = new String();
    OSname = System.getProperty ("os.name");
    JTextPane tp = new JTextPane();
    frame.getContentPane () .add (tp);
    tp.setText (OSname);
    frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
    Frame.Pack ();
    frame.setSize (400, 200);
    frame.setLocationByPlatform (true);
    frame.setVisible (true);
    }
    }

    I think that Eclipse does not use JEditorPane but own component. GUI editors has monospaced fonts of equal width/height for each tank and fixed a height for all rows. It is much easier to manage several sizes of fonts on the same line.

  • How to replace the variable with the help OF the operator?

    Hello

    I'm creating a form where the user selects the check box which products he wants to see. After the choice, I should show all sales of this product, but the selection does not recognize the variable after the IN operator, for example:

    SELECT the product, price, quantity
    FROM the sale
    Product WHERE IN (vcProducts);

    Can someone help me?

    Cree

    I guess that vcProduct is a varchar2 variable where you have a chain of your prodids, as ' 4711,4712 concatinated, 4713'. May be you have each place value '. Is not the question, which is not part of the sql syntax set. You either have a list of enumeration or a subselect.

    Where do you need it? In the block or Pl/Sql where clause.
    In the latter case, you can configure the list in a variable (with enclosing "") and set the block where property.

    In the first of may by INSTR is useful, INSTR (vcProduct, vcDelim | table.prod_id | vcDelim) > 0. Make sure you have your list attached and separated by the vcDelim. If you prodct table with the number of lines (million), it can be slow because no index will be used.

    Dynamic sql or.
    Or write a subquery und temp-table.

  • Replacement of an HTML element with jQuery, why the variable here specified as .html?

    I'm trying to understand this tutorial. I got it except for one thing. As I understand it the following code below to be:

    jQuery function is set on loan.

    A variable is created called "newItem".

    "newItem" is equal to get a paragraph with an alternative text tag

    jQuery then gets the class selector "#para2".

    It imports html using the .html with the variable function content "newItem".

    OK, so why is "newItem.html" instead of just "newItem". I understand the code returned need to be html, but is not "var newItem = $("< p > Ceci est le nouveau paragraphe en remplaçant la ligne < /p >)"); indicate it is html since the paragraph tags?

    In addition, this .html does not indicate what is in parentheses will be back #para2 html?

    $ ("#para2").html(newItem.html ());

    I understand, it "must" be done this way, because I tried with just $ ("#para2") .html (newItem ()); but I do not understand why.

    * also, I'm sure that there is another way to make this code, but I am trying to learn this particular example.

    < head >
    < script type = "text/javascript" >

    $("document").ready (function () {}

    var newItem is $("< p > Ceci est le nouveau paragraphe en remplaçant la ligne < /p >");.

    $ ("#para2") .html (newItem.html());

    });

    < /script >


    < / head >

    < body >

    < ul id = "list1" >

    heading 1 < /li > < li > list of the
    < id = "para2" li > list point 2 < /li >
    3 < /li > < li > element
    4 < /li > < li > element

    < /ul >

    < / body >
    < / html >

    danbenner wrote:

    Thank you. I'm not what you mean "first element in a set of matched elements.

    In jQuery, $("une expression") matches one or more items in the object model of the document (DOM) page. For example, $('p') finds all the records, as well as paragraphs are considered to be a set of matching elements. In this case, the first paragraph would be the first item of all the matching elements. $('p').html () would get the HTML content of the first paragraph.

    In your case, newItem creates a paragraph from literal HTML in $ (). To get the HTML stored in newItem, you must use newItem.html ().

  • IN construction in the clause WHERE of VO with bind variable

    Hello
    With the help of JDev 11.1.1.3.0.
    I have a SQL according to VO following where clause ' WHERE some_nbr IN: inSomeNbrStr'
    -l' some_nbr attribute is of type oracle.jbo.domain.Number.
    -variable binding inSomeNbrStr is of type String.
    I'm assuming that this variable linking parameter to for example. "101, 102' or '(101, 102) ' before the execution of the query might work.
    "However, I get ' ORA-01722: invalid number." Other than the substitution of executeQueryForCollection() and manipulate by program the
    query is - anyone know a more declarative way to achieve this?
    Thank you
    Kenneth

    Hello

    You "MOUNT" the binding variable to get the values separated by commas.

    See this article (Search Using Comma-Separated bind string for the Variable in the list) on how to achieve this.

    It has been developed over 10g. But I think it will hold good for 11g as well.

    Arun-

  • Problems with led variable removed from the database

    Hello

    I have problems with the following code, it draws on a database to add to a list later, player names, however outside of the statement where the name of the player are assigned they are not recognized i.e. the bits where I wrote [CODE] trace ("1these is the name of the player 1 is + player1Name"); [/ Code] etc. There are also 4 variables to do with a number of keys and as far as I can see that I am dealing with the same, declaring them upstairs, assigning them values and when I print them out later that they are beautiful, the only difference I see is the type of variable are about these things.

    I initialized the variables at the top, I tried to make it global, making [CODE] var player1Name: String; [/ Code], it seems a simple problem, but I can't understand it...

    Here's the relevant part of the code:

    [CODE]
    var stage3player1keyCount = 0;
    var stage3player2keyCount = 0;
    var stage3player3keyCount = 0;
    var stage3player4keyCount = 0;

    var player1Name ="";
    var player2Name ="";
    var player3Name ="";
    var player4Name ="";

    It reads in the current state keys players
    myDataP = new LoadVars();
    myDataP.load (" http://www.elementalive.net/keyDown.php");
    myDataP.onLoad = function() {}
    stage3player1keyCount = myDataP.info;
    trace (stage3player1keyCount + "is the number of player one keys");
    }

    myDataQ = new LoadVars();
    myDataQ.load (" http://www.elementalive.net/keyDown1.php");
    myDataQ.onLoad = function() {}
    stage3player2keyCount = myDataQ.info;

    trace (stage3player2keyCount + 'is the number of keys of Player 2');
    }
    myDataR = new LoadVars();
    myDataR.load (" http://www.elementalive.net/keyDown2.php");
    myDataR.onLoad = function() {}
    stage3player3keyCount = myDataR.info;
    trace (stage3player3keyCount + 'is the number of keys of player 3');
    }
    myDataS = new LoadVars();
    myDataS.load (" http://www.elementalive.net/keyDown3.php");
    myDataS.onLoad = function() {}
    stage3player4keyCount = myDataS.info;
    trace (stage3player4keyCount + 'is the number of keys of player 4');
    }
    This.stage3transferKeyList.SetStyle ("fontSize", "20");

    myDataT = new LoadVars();
    myDataT.load (" http://www.elementalive.net/wait1a.php");
    myDataT.onLoad = function() {}
    player1Name = myDataT.info;
    trace ("is the name of the player 1 s" + player1Name);
    printName (player1Name1, 1);
    }
    myDataU = new LoadVars();
    myDataU.load (" http://www.elementalive.net/wait1b.php");
    myDataU.onLoad = function() {}
    player2Name = myDataU.info;
    trace ("is the name of the Player 2 s" + player2Name);
    printName (player2Name, 2);
    }
    myDataV = new LoadVars();
    myDataV.load (" http://www.elementalive.net/wait1c.php");
    myDataV.onLoad = function() {}
    player3Name = myDataV.info;
    trace ("this is the name of the player 3 s" + player3Name);
    printName (player3Name, 3);
    }
    myDataW = new LoadVars();
    myDataW.load (" http://www.elementalive.net/wait1d.php");
    myDataW.onLoad = function() {}
    player4Name = myDataW.info;
    printName (player4Name, 4);
    trace ("is the name of the player 4 s" + player4Name);
    }

    trace ("1these is the name of the player 1 is + player1Name");
    trace ("1these is the name of Player 2's + player2Name");
    trace ("1these is the name of the player 3 is + player3Name");
    trace ("1these is the name of the player 4 is + player4Name");
    [/ CODE]

    Thanks for any help in advance, it is much needed and appreciated.

    Louise.

    I got it working! Thank you very much! You saved his life. It will take that I remember this problem... because I think he could source a few other hiccups throughout our game. You made my day!

    Thank you
    Louise

  • How to trace the greatness of the variables compared to the timestamp with evenly spaced samples in time?

    Hello world. I need to trace the variable amplitudes compared to the timestamp (date and time), but the time intervals between samples are not equidistant. In my area, this is called trend plot. I'm surprised that Labview does not a vi to do this. The only solution that I found so far is to save the data in an Excel file and open this chart in Excel because it has the ability to trace what that this is against what whatsoever is not limited to something as even spaced samples. How to achieve this is Labview? A graph of waveform vi would be perfect if it was not by the fact that it works with even spaced samples.

    Thank you.

    Paulo Siqueira

    Your requirement is directly possible with LabVIEW.

    You can spend time to understand the difference between 'Chart', 'Graph' and "Graph XY".

    VI attached is drawing samples of unequal time.

    Hint:-right click on the 'XY' graph-> properties-> display-> 'Axis of X' = absolute time Format

    Kind regards

    Yogesh Redemptor

  • Adjust the data in the database with the variables

    Hello

    For my internship, I have an assignment to read and set a database with the variables. This SQL server 2005 database contains variables of a controller. These are read and write variables. The assignment is to display the read variables and the user can adjust the variables of Scripture. The first part was "easy" because the forum contained a lot of examples of this. The second part is more difficult because the forum contains absolutely no example of this. Can I use LabVIEW 2010 and 2011, and also I downloaded the 30 day trial of the database connection tool. If it's useful, I can recommend my company to buy this package. Playback vi makes use of a UDL (Microsoft data link) connection.

    So you guys my question is: is it possible to adjust the specific variables in a database using LabVIEW? And maybe you can give me a little advice on this topic...

    Thanks in advance!

    Roy

    In SQL, the specific data are always selected with the keyword WHERE. In VI to update there is a link for options, you can for example add a constant 'WHERE id = 1457 and measure > 0.54 ".

    You can ofc. also build this chain through controls, settings and other means.

    If you prefer, you can use the Execute Query (under Advanced tab I think) to which you can send the complete query example "TestTable Update set name ="Zeus"where id > 14 and id.<>

    /Y

  • To compare the name of the control with a variable

    Hi all

    I want to compare the name of a control with a variable in a loop. Is there any function for it in Labview? Please let me know if it is.

    Thanks in advance


  • How to change the row height in tableLayoutManager?

    HIII all,.

    I used TableLayoutManager in my application but don't know how to increase the row height.

    I use this reference for the TableLayoutManager link.

    How - to create a presentation of the rich UI at TableLayoutManager
    Article number: DB-00783

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800508/...

    and I want to make the size of the entire line 68 px...

    any body can help me how to change the RowHeight in tableFieldManager?

    @peter

    Thank you Peter for your answer.

    I solved the problem as you indicate in the Tablelayoutmanager.java change before 5 months.

    I asked you our post reply you as soon as possible...

    I don't care

    Thank you.

    regaurds,

    Albert_anks

  • How can I select the files in a folder with the help of a list with the files you want and after that rename only the files using another list with desired new names?

    How can I select the files in a folder with the help of a list with the files you want and after that rename only the files using another list with desired new names?

    I have only:
    D: / images (where are necessary + not need files)
    -a list with only the necessary files
    -a list with new names for the files needed
    Thank you.

    Hi Pustiu,

    Thanks for posting in the Microsoft Community.

    You want to know how to select the files in a folder using a list with the files you want and after that rename only the files using another list with desired new names.

    I would have you post your query in the TechNet forums because it caters to an audience of it professionals.

    Your query will be better addressed there.

    Check out the link-

    http://social.technet.Microsoft.com/forums/en-us/w7itprogeneral/threads

    We know if you need help. We will be happy to help you. We, at tender Microsoft to excellence.

    Thank you.

Maybe you are looking for

  • 8600 CN579A more: more than 8600 does not work with Windows 10

    HP has plans to support the more than 8600 on Windows 10, or they will offer a discount on a replacement printer?

  • Webbased NAS200 No. login screen...

    Hello My NAS200 works great!  Any user can access all the files. Perfect... But... I wanted to announce a new user and typed in the ip address. 192.168.2.3 and got no login screen. (administration/status_fs.htm) Firefox, Chrome and IE cannot connect

  • Xperia Arc and Media Go 2.0

    Hello So I've recently updated to Media Go 2.0 and now there seems to be problems when I connect my bow to my PC.  The status of my phone in the menu principal just seems to hang.  Sometimes, it will update the files in my machine and other times (li

  • PRO 8600

    8600 pro, I have it working wireless, it's OK but I was told wired works best. I can't find how to change it in Wired. I need to know what can cable to connect my router to the printer. and what else I need to do.   Thank you, Bill

  • Guest to WLAN access.

    I have 8 Cisco 1230AP providing access to my local network for users of portable computers. Encryption is WPA. I now need to configure not encrypted Internet for customers/visitors - keep away from my local network and internal network. How can I do