Displaying dynamic Table based on checkbox selected

Use Case – 

User wanted to have a table where its rows should be displayed based on selectManyCheckbox.

Solution – 

Step 1, Create binding for the table in bean.

Step 2, Create one variable selectedList of java.util.List type.

Step 3, Create valueChangeListener on selectManyCheckbox and assign selectedList = (List)ValueChangeEvent.getNewValue();

Step 4,

        a. on click on commandButton, repopulate the list which is displaying data in table. selectedList will have all selected checkbox indexes. 

        b. add partialTarget on table binding.

Step 5. make sure bean is in pageFlowScope.

Step 6, Done. Enjoy!!!

Advertisements

One comment

  1. Hi

    I have a requirement where we have around 10 checkboxes. Based on the checkboxes selected, we need to display the text of those checkboxes in the format of a table. So, can you please help.

    Thanks
    Srikala

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s