Search code examples
user-interfacelistviewwicketwicket-6presentation-layer

Different input type based on data type of column in listview in wicket


I am having a list of InputColumnsVO which will have column name and column datatype attributes..I am thinking to iterate this list of input columns object using Listview and display input boxes based on the column data type.For example:

if datatype is date,
        display DateTextField,
if datatype is numeric,
        display dropdown,
if datatype is string, 
       display a textfield.

Is this achievable in wicket?or is there an alternative way to the design?


Solution

  • Depending on the type add a Panel that contains the respective form component. If the HTML markup is really simple and you don't want to have a special Panel for it then use a Fragment instead.