Dynamic columns in Primefaces datatable - jsf-2

I want to create a dynamic datatable using Primefaces that reflects user's choice. The user can choose one of the two radio buttons and then the datatable will be shown to the user.
The only difference between two radio buttons is that choosing the second one the datatable will contain an additional column.
Is it possible to create such datatable, using Primefaces and JSF?

Easiest solution would be to set rendered attribute of column depending on radio button selected.
...
<h:column rendered="#{myBean.radioValue}">
...
radio button 1 -> myBean.radioValue=false
radio button 2 -> myBean.radioValue=true

Related

How do I filter a table using check list boxes and a button? (in Delphi 2010)

This is the form I am working with:
It shows a basic Delphi form with a DB Grid on top with a panel underneath. The panel below contains two CheckListBox's and one radiogroup. Each CheckListBox contains three check boxes and the radiogroup consists of two radio buttons. There is also a button on the right of the panel with the text "Filter" on it.
Question: How can I select the check boxes and one of the radio buttons and then click the button to make the table filter according to the selection?

How to auto-select a selectOneRadio on the basis of selection of another selectOneRadio in primefaces

I have two SelectOneRadio menus in an xhtml form.
How can I automatically select a radiobutton, in the second menu, on the basis of the selection of a radiobutton in the first menu?

Pass table row values to struts action class which uses display: column tag

I have a struts table which displays data using <display:column> tag.It has many rows and checkbox for each row. But for only one column I need to show as text fields which I did using <display:column><input type ="text"..../></display:column>. Now the problem is I need to submit only the value of the text fields for the rows which have been selected by checking the check box. The submit button is outside the display tag. Can anybody please suggest how to achieve this.

How to populate dropdown & radio using Backbone View

I am playing with Jquery Mobile along with Backbone. Have some scenario to populate the dropdown(select) when one of the radio (option) is selected.
View and markup can be viewed from here [partial code][1]. I am able to populate the dropdown on radio button selection changed event.
Now I like to know how to set these values on page load for the radio and select. Any guidance would be appreciated.

How to create Combobox with multiselect capability?

How to create a Combobox having Multiselect Capability using Jquery?
Does JQuery Combobox has this functionality or Property?
if it helps, take a look http://ivaynberg.github.io/select2/ for multi select values
Edited : I found one more link it's really great http://tameraydin.github.io/jquery-easyselect/
Combobox displays the selected value when its list of options is collapsed. You may want to use multiple selection list.
to use multiple select in combobox you will have to create your own user control using checked listbox, textbox and a button.
and on click of button just make checked list box visible and let the user select items from that checkedListBox and as user select items on it you take those values and concatenate it in textbox with comma seperated. and then again on click on button hide that list box.
as it is on : http://9perhour.co.uk/
which is asking for select technology
some good samples
for jquery:
http://abeautifulsite.net/blog/2008/04/jquery-multiselect/
http://quasipartikel.at/multiselect/
http://www.codeproject.com/KB/ajax/jqueryajax.aspx
for asp.net:
http://www.codeproject.com/KB/user-controls/MultipleSelectionDropDown.aspx
http://www.codeproject.com/KB/webforms/DataGridDropDownList.aspx
http://www.codeproject.com/KB/asp/multiselectdropdown.aspx

Resources