The commenting system has the following requirements:
Any time the full details of a post are displayed (whether automatically when the application loads, or by user selection) any comments associated with that post should be displayed as well.
If there are no comments associated with the current post, the comment list should be hidden.
Users may not submit blank comments.
Only logged-in users may comment, so the commenting form should be displayed only when there is a user logged in.
When the user submits the comment, the submit button should be disabled until a result is returned.
When a comment is successfully submitted, the comment form should be cleared and the submit button enabled.
Loading comments when a post is displayed is a matter of triggering the comment loading logic whenever a post is set as the current post.
You can hide the comment display by tying the visibility of the view to the number of comments for the selected posts.
You can keep users from submitting blank comments by using the Flex validation classes that you used for registration and the add posts feature.
You can allow only logged-in users to post comments by tying the visibility of a comment to the user's being logged in.
You can disable the submit button and clear the form by binding a setter function to a property that indicates the status of the comment submission.