This is only in theory, haven't actually checked it but I think it could work
If each one of those posts is done by an itemrender, your renderer can have 2 states stateone and statetwo for example.
The reply state (statetwo) being bigger and containing space for the reply post.
Store your replies in the database and have another boolean column ( Tinyint(1) or something) in your MySql db indicating that a particular post has a reply . When you pull your data from the database and put in in an arraycollection check this column for each post and use it to set the state of the itemrenderer.
That way posts with no reply with be state one, and posts with replies will be state 2 and you can populate the reply field with data from the object in your arraycollection.
I suppose it all does depend on how you get your data from MySQL and how you store it in Flex but I think states is a way you could accomplish things like this.
Thanks.. This idea really make me sit on my laptop again.. I have started with your idea, lets see how far i can go... please let me know if you have any useful link for this...
Or if you came across any other idea
I am still struggling to get it done. PLease provide your ideas...
Firstly you can start here
Its all about view states in flex custom itemrenderers, the principals are the same as what you want.
Then its all about how you get your data from MySql and how you store it in flex. Do you store it as an arraycollection (possibly collection of Value Objects)?
Once I know this I can help you further but I'm not going to do your code for you.
Yeah i store my MYSQL output as arraycollection
OK, start by creating a Spark List <s:List>
The dataprovider for this list will be your arraycollection from your database.
Set the properties that you need and then create an item renderer for that list. the itemrenderer will look like the individual posts for your forum.
Have the itemrenderer have two states and the starting state being determined by whether the object in your array collection has the reply boolean/value/whatever set. (ie data.hasReply) then in that second state you have a text area / label where the reply can be shown which is excluded from "excludeFrom='stateone'. You can do the state checking with a dataChange event (you cant use creation complete or init as this wont work). The datachange event will fire everytime the data changes ( ie for every item in the list)
This should get you a bit further
Thanks for your quick reply.. I will start seeing this. Only wanted to inofrm you is I am still with flex3