In this article I will show you how you can work around the basic actionStatus limitations and show dynamic content in actionStatus depend on what action is being triggered on the page.
Let's say that we want to create a page with following characteristics:
- The page filters Accounts records based on Account Type and view the records to user via pageBlockTable
- One column of the shown table has a link "Action" which when clicked on a controller's method will be called via javascript.
- Meanwhile, the actionStatus will show a message like: Processing {Account.Name} ... (Neat ehh!). The message can be combined with any HTML code (for each row in the table) to enhance the view of the actionStatus
Now let's look a bit further into what we need to put together in the page to accomplish the above:
- I will need an InputField component to be hooked up with Account's picklist "Type".
- Also a commandButton to call a method of the Controller and view the results on the pageBlockTable
- The pageBlockTable will have Account Name, Type and Action columns. Action column will have a facet in which we will do our trick! The facet should do the following:
- It will have a hyperlink which calls a javascript function once clicked on.
- Also it will have a hidden div which will contain the HTML template we need to show in actionStatus once the link is clicked on!
You will see all these in the next page.
No comments:
Post a Comment