« Return to Thread: How to display different input type in one column

How to display different input type in one column

by rtow :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View in Thread

I have a column that needs to display either dropDownChoice or text.

dataViewPanel.html
          <tr wicket:id="datatable">
            <td>
                       
            </td>
            <td>
                        <input type="text" wicket:id="value" />
             </td>
          </tr>
        </table>

dataView.java
        protected void populateItem(Item item)
        {
                Config gc = (Config) item.getModelObject();
                item.setModel(new CompoundPropertyModel(gc));
               
                item.add(new Label("name"));
                item.add(new TextField("value"));
        }

My question is: depends on value of "name", I like to render the "value" column as either dropDownChoice or text.

thanks,
richard

 « Return to Thread: How to display different input type in one column