ItemRender creates 2 of each object. Problems of variable height TextArea

Ok. I'll start with what I was trying to explain how I found myself here. I tried TextArea with no scroll bar that resized at the height of the text. Googling, it seems to be the solution to do this is to expand the text box and use something like

var numLines:int = this.mx_internal::getTextField().numLines;
for (var i:int = 0; i < numLines; i++)
     totalHeight += this.mx_internal::getTextField().getLineMetrics(i).height;
this.height = totalHeight;

to calculate height. It works, but then I put the component (WrappedText) in a DataGrid control and used an itemRenderer on it and things went wrong.

What I see is that there are TWO WrappedText objects with just a line in the DataGrid control is created. The only difference when I go back is their parent, for example if I this.toString () in the creationComplete

MADE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer13._Renderer_WrappedText1
MADE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer27._Renderer_WrappedText1

The problem this causes is one of these objects a numlinesrequired equal the number of characters in the text. The other has the correct value (1). So what happens is the dataGrid Gets the wrong height.

I've trimmed everything down so there is only one line in the table etc. Here is the trace output. FACT is creationComplete of the WrappedText and RESIZE is when it recalculates its size (when the text is printed) and HEIGHT of the GRID is displayed by the creationComplete of the DataGrid

MADE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer13._Renderer_WrappedText1
RESIZE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer13._Renderer_WrappedText1 HEIGHT= 14 NUM LINES 1
RESIZE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer13._Renderer_WrappedText1 HEIGHT= 196 NUM LINES 14
MADE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer61._Renderer_WrappedText1
RESIZE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer61._Renderer_WrappedText1 HEIGHT= 14 NUM LINES 1
RESIZE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer61._Renderer_WrappedText1 HEIGHT= 196 NUM LINES 14
RESIZE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer61._Renderer_WrappedText1 HEIGHT= 14 NUM LINES 1
GRID HEIGHT= 1402

So my main question is this is a reasonable approach or y at - it another way not what I want? That is to say. a DataGrid that contains blocks of variable height, word wrapped text?

Also, can someone explain what is happening here so I understand what I am doing wrong, for example why 2 objects will be created?

Another interesting data point (?) is that if I put in an ObjectUtil.toString (this.parent) in the creationComplete of WrappedText the two objects get the value correct numlinesrequired example

MADE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer13._Renderer_WrappedText1
RESIZE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer27._Renderer_WrappedText1 HEIGHT= 14 NUM LINES 1
RESIZE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer27._Renderer_WrappedText1 HEIGHT= 196 NUM LINES 14
RESIZE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer27._Renderer_WrappedText1 HEIGHT= 14 NUM LINES 1
MADE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer27._Renderer_WrappedText1
GRID HEIGHT= 142
RESIZE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer13._Renderer_WrappedText1 HEIGHT= 14 NUM LINES 1
RESIZE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer13._Renderer_WrappedText1 HEIGHT= 14 NUM LINES 1
RESIZE:  Main4_0.theContainer.theGrid.ListBaseContentHolder8.Renderer27._Renderer_WrappedText1 HEIGHT= 14 NUM LINES 1

Note that the NUM LINES changed and the RESIZING is done after the creationComplete of the grid.

An explanation of the foregoing would be nice so why dumping simply the object causing completely different behaviors?

I have attached the source of my simple text program. Thank you

Stuart.

The creation of two converters maybe because the DataGrid creates additional converters purely for the measure. I think that this only happens if variableRowHeight is set to true. If you take a look at the source of the DataGrid and search for 'calculateRowHeight()' you will see that it calls the method "getMeasuringRenderer()" on each column to calculate the height of each row.

Your measurement problem can be because the width of the measurement converter is not set with the same value as the width of the rendering on the screen tool. I would put a breakpoint inside the method "setupRendererFromData" of DataGrid to see what the explicitWidth is defined. Looks like that the measurement converter should be set to the width of the column. Maybe set a width explicit on your column, if you do not already.

Tags: Flex

Similar Questions

  • For each object, create a new layer and rename it

    Hello!

    I want to export an Illustrator file to DWG, and I have many things I want to keep the name. But to keep this info in AutoCAD, I need to transfer them as layer names (DWG/DXF export does not record the name of the object, but the name of the first level layer) and put all these layers as layers of level first (DWG/DXF export maintains just first layers of level).

    So I would like to make or find a capable script something like this:

    in my file,.

    for each object,.

    see if there is a layer with the name of the object

    If there is any layer with the same name

    then

    Create a layer,

    give the name of the object to the layer

    endif

    Place the object in this layer

    Is there someone who can help me?

    Thank you!

    You can select your layer, then use "Release to layers", which will create a sublayer for each object that you have, and then a script can rename these layers based on the named object it contains... so you can drag them all out of their layer sublayers parent so that they become the main layers... everything that is explained here, including the script

    Selected lap HAVE sublayers in top-level layers?

  • Duplication of object problem

    Hello

    I have the following problem:
    I have an object (an instance of the class that is included) which will contain a maximum of 4 objects with arrays inside of them. After the second object inside the class instance is created, a reference object is created instead of a new object. Even if I think it's a reference, because when I use classInstance.setTxt (), and then getTxt() with item0, item1, values are returned, instead of different values, because I want to just change the text to item0, item1 and not both...

    I even used the loop for copying the object as you can see, but it makes no difference. Please help me.

    Thanks in advance,
    Rick.

    Hi again,

    already solved the problem. I had to add another loop for, because I wasn't not copy values, but the array objects to the new object. This way references are always created, so I had to loop through arrays too and copy each value in the table created within the new object...

  • Not able to create a tracker singleinstance object

    Hello..

    Recently, when I login or reboot my system, I get a popup that says:

    Could not create a Tracker SingleInstance object:

    Failed to instantiate a new object of Tracker SingleInstance. For more information, see InnerExceptions.

    Does that mean and what should I do. Please help me.

    Thank you.

    Hi VinodhRRQ,

    Thanks for posting in the Microsoft Community.

    In order to quickly provide a solution, please answer these questions:

    1 did you do changes on the computer before the show?

    2. what version of Microsoft Visual C++ is installed on the computer?

    Follow the suggestions below for a possible solution:

    Method 1: I suggest you perform the clean boot and check if the problem persists.

    Place the computer in a clean boot state, then check if it helps. You can start Windows by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

     

    Note: After troubleshooting, be sure to configure the computer to start as usual as mentioned in step 3 of the article mentioned above.

    Method 2: If the previous step fails, then I suggest that you manually download and install Microsoft Visual C++ 2010 redistributable and check if you can install the software.

    In programs and features, you do not show that you have installed Microsoft Visual C++ 2008 Redistributable and Microsoft Visual C++ 2010 redistributable? If this is not the case, download the links here. You must install all versions of Visual C++ executables for the type of system you have (x 86) 32 - bit or 64-bit (x 64).

    Package redistributable Microsoft Visual C++ 2010 (x 86)

    http://www.Microsoft.com/en-US/Download/details.aspx?ID=5555

     

    Package redistributable Microsoft Visual C++ 2010 SP1 (x 86)

    http://www.Microsoft.com/en-US/Download/details.aspx?ID=8328

     

    Package redistributable Microsoft Visual C++ 2010 (x 64)

    http://www.Microsoft.com/en-US/Download/details.aspx?ID=14632

    Package redistributable Microsoft Visual C++ 2010 (x 64) SP1

    http://www.Microsoft.com/en-US/Download/details.aspx?ID=13523

    It will be useful. For any other corresponding Windows help, do not hesitate to contact us and we will be happy to help you.

  • Programmatic entity with LOV object problem

    Hi all

    I created a programmatic entity object (name: 'Document', attributes: 'ID', 'DocumentLanguageID') with a solution of Jobinesh = > binary: construction by program managed business - part 2 components

    There is also a normal entity object that depends on the database (name: "DocumentLanguage", attributes: 'ID', 'DocumentLanguageName')

    I created the association and the relationship between two entity object and added a LOV to 'DocumentLanguageID' of 'Document '. Now I can use the ADF form which gives me a list of choices for the LOV attribute. And it can save the object correctly. It is perfect.

    The problem arises when I want to display a table of 'Document' and want to see the 'DocumentLanguageName' and 'DocumentLanguageID '.

    I added DocumentLanguage entity to the view of the Document (DocumentView) object. Then you click on the button 'Add a feature attribute' and the added attribute "DocumentLanguageName" to "DocumentView".

    When I run the app module, I see "DocumentLanguageID" is correct, but the 'DocumentLanguageName' is empty and that an exception is thrown called ' (oracle.jbo.KeyNotPopulatedException) Houston-25078: ID attribute of the key to DocumentLanguage not filled.

    What is the problem?

    Looking for your help. Thank you.

    I must just AutoSubmit set to true for the DocumentLanguageID of the same entity/view object attribute.

  • get list from a SQL database and create links to each lines in AS3

    I'm doing an AIR application with these conditions:

    I have a SQL database. In my table, there is a column 'categories' (with different categories (computer, books... etc.)).

    enter image description here

    In my AS3, I managed to recover "theDescription" when the user select a category. With the URLMethod and a php file.

       // create SQL $sql = "SELECT * FROM annonces where categorie = '$categorie'";

    $sql_result = mysql_query($sql, $connection) or die ("Couldn't execute query.");

    $num = mysql_numrows($sql_result); $phptheDescription = "";

    $counter = 0;

    while ($row = mysql_fetch_array($sql_result)) {

    $theDescription = $row["theDescription"];

    $phptheDescription = $theDescription;

    }

    echo  "phptheDescription=" . $theDescription;

    So my AS3 code retrieves the $phptheDescription since php and displays in a output_txt .

    Problem: in my output_txt , a 'theDescription"appears. But I have TWO Articles in the category 'Computers' (and I have 100 points in the same categories).

    How do I show all the "theDescription' that are in the same categories?

    Ex: If I choose "Computer", it should display "a Surface Pro 3" and "An IMAC". But it only shows the last element "IMAC".

    And, after that, it is possible to create "links" for each item posted?

    Here are 2 videos of short films (20 sec) explaining my problems:

    https://vid.me/DS2r

    http://sendvid.com/6iesrygk

    THX

    Hi-I've never used PHP so I could be wrong here - but it seems to me you're a loop in the records, each time as reset $theDescription to all that is in the current (rather than accumulate output) record. If you are effctively echo only the last record in the query.

    I think you should be either running the command echo inside your loop, or alternatively the concatenation of a string inside the loop and then echoing the end of the loop?

    I would be likely to generate XML data in PHP (just by concatenating strings) and then use it in my AS3 code.

  • ORA-04089: cannot create triggers on the objects belonged to SYS

    I did a google on this error and it say that I should never get to anything to do with the system and also to make another account when executing my script, I did this, but I still get the error code and the error is less than

    REM **********************************************************************

    CREATE TABLE gam_attribute_bin (/ * gam_ab * /)

    attribute_owner_type char (1) NOT NULL, / * player Att, Att User Instance Att Att class.

    Class criteria, client static/Gulp * /.

    ATTRIBUTE_NAME VARCHAR2 (20) NOT NULL,

    owner_id NUMBER (10) NOT NULL, / * specific check-in attribute_owner * /.

    LONG RAW NULL binary_value

    ) TABLESPACE gam_lgtab STORAGE (INITIAL 256 K NEXT 256 K MAXEXTENTS PCTINCREASE 0 unlimited)

    /

    ALTER TABLE gam_attribute_bin ADD)

    CONSTRAINT gam_attribute_bin_pk

    UNIQUE (attribute_owner_type, owner_id, attribute_name)

    USING INDEX

    TABLESPACE gam_ind

    STORAGE (INITIAL 256 K NEXT 256 K MAXEXTENTS PCTINCREASE 0 unlimited)

    )

    /

    Suppression of REM binary attribute when necessary

    CREATE TRIGGER gam_att_delete

    AFTER YOU REMOVE gam_attribute

    FOR EACH LINE

    BEGIN

    IF (: old.attribute_data_type = 'B')

    THEN

    DELETE FROM gam_attribute_bin

    WHERE attribute_owner_type =: old.attribute_owner_type

    AND attribute_name =: old.attribute_name

    AND owner_id =: old.owner_id;

    END IF;

    END;

    /

    ERROR on line 1:

    ORA-04089: cannot create triggers on the objects belonged to SYS

    hope someone can help me clear this up thanks

    Hello

    You code works very well for me.  I had to change to run on my system tablespaces, but otherwise, what you posted worked for me when I tried (in a different schema than SYS, of course).

  • CREATE TYPE subscription_type AS OBJECT - ERROR

    I'm not able to create objects of type also tried with different versions of oracle.
    I am currently using Oracle 11 g enterprise edition (2.9 GB).
    The problem is when I create an object TYPE and when I finish the command with a semicolon ';', oracle sql does not stop only (the query does not run) the loop goes on and on.
    I did like this and found that the SYNTAX is also perfect.

    SQL > CREATE TYPE subscription_type AS OBJECT
    2 (street varchar2 (30),)
    3 city varchar2 (30),
    4 PIN number code (10));
    5
    6
    7
    8...
    It turns on and it never ends. Command runs.
    Help, please!

    You must end with a slash: /

    create type address_type as object
           (street varchar2 (30), city varchar2 (30), pincode number (10));
    /
    
  • (2) is there a place that I see all the logics without seeking the properties of each object?

    LookoutDirect 4.5

    (2) is there a place that I see all the logics without seeking the properties of each object?

    It seems that the lookout 4.5 is not browser connection. We have added this tool to view the connections at the belvedere 5.x.

  • Using DC of the ADF and 'Create' on a display object in a pop-up window.

    Using the ADF DC, when I invoke "Create" on a view object, all entries in the form, became available for edit. If these entries are on a popup, they remain disabled. Why?

    I m using JDev 11.1.1.7.

    Thank you

    Sergio Filho Samaan

    If it helps,

    You could do CreateInsert and then the listener to cancel popup, if the transaction is dirty you Rollback to the folder will not appear in the table. Even if it's more than just a workaround solution. Because you should be able to create it in order to implement this type of requirement.

  • Display linked smart object problem?

    I was really kissing linked smart objects recently. However I found on a few occasions, there are cases where a linked smart object seems to strangely, and I see pixels rounded curiously - almost as if she started scaling the picture a bit.

    Screen Shot 2015-12-16 at 08.03.04.png

    The smart object linked above is correct, but the one below (linked the same file) is rendered differently. Two smart objects have been placed with identical dimensions, any scaling that occur here. Whenever I for now, place this file in the PSD I have this display problem. Around him, my only way is by duplicating that rendered correctly.

    Has anyone else encountered this problem?

    I worked on it.

    Essentially, when you insert the linked smart object even if I was seized to display 100% width & height (by default, that it has been globally as the source PSD has a smaller width/height), I had to then move the smart object after setting width & height 100% in order to then render correctly.

  • Creating tables of Business Objects

    Hi, I'm starting a new project using ADF and I created a company schema object connection to an existing database, but without any table created inside.
    After defining certain entities that I have configured a module of application to work with this feature, after that when I run this app module it does not create any model within my database.
    Y at - it a configuration to do inside the AppModule to this tables for creating component inside the database?

    Thank you for your attention.

    Right-click in your diagram and choose to generate tables in the schema.

  • Cannot create a new illustration. Problems occurred during the recording of the print file.

    I can't open a new Illustrator file. He sends me this error: failed to create a new illustration. Problems occurred during the recording of the print file. ID:-1

    I opened a previous document created in CC, but it does not allow me to copy and paste items from one doc to another.

    I rebooted with nothing doesn't.

    System:

    Adobe Creative Cloud CC

    Mac Book Pro 2012

    2.6 GHz Intel Core i7

    8 GB 1600 MHz DDR3

    On a mac, but it seems that it has resolved itself. In my view, that it may have been a corrupted file that threw everything off. Thank you.

  • Each object is a segment of each

    Is that each object (say table) will be given by the single segment by oracle, otherwise when oracle will assign a segment more to an object (table)

    No, it depends.

    For example, each table column that has a CLOB/BLOB will have 2 distinct segments of the LOB.
    If the table is partitioned each partition table is a separate segment.

  • How to scale objects in one layer with each object in the same position

    I have a card with symbols on it, placed exactly where they should be. Is it possible to scale all the objects in a layer or group to be bigger, but not treat them as a layer that is stretched to scale proportionally? Basically, how could I do each larger symbol as if each is to be climbed from their centres?

    I tried to select a layer so that each object is selected, and then transforming them (specifying a percentage of the scale). As a result, the objects are enlarged, but it produces the same results as a normal click and drag the corner alignment point. Any ideas?

    Object--> transform each. Each object / group object must be properly structured and selected individually.

    Mylenium

Maybe you are looking for