You can use panels. Have a panel with a label and a panel with a textfield, and add the right panel based on your flag. I believe there is an example of this in one of the wicket-stuff projects (beanedit?)
-Igor > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:wicket-user- > [EMAIL PROTECTED] On Behalf Of Jim McBeath > Sent: Friday, September 09, 2005 4:26 PM > To: [email protected] > Subject: [Wicket-user] form table with variable editable fields > > I have a component that displays an html table with a variable number > of rows and columns, similar to the TableGeneratorComponent in the > displaytag example but with a model that goes along with it so that > I can change the data and redisplay it. This works fine as long as > I only want to display the data. > > Now I want to modify this component so that it has some form input fields > in the table. I modified my model to have a method "isColumnEditable" > that I call from the component to see if a column should be rendered as > an input field or as simple text. That method call works fine, but I > don't know how to set up my html file to select between an input field > and a plain string. The html file currently has a <span> element which > I attach to a Label for each cell of the table, but Wicket complains when > I try to attach it to a TextField instead. I understand this, and I know > I could hard-wire the html so that specific columns are editable, but I > want a component that automatically configures which columns are editable > based on the current state of the model. > > I was unable to find anything in the wiki or examples that showed how > to select between two different types of fields based on program data. > Can anyone point me to an example or let me know how I would do this? > > -- > Jim McBeath > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Wicket-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/wicket-user > ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
