If you want to save the entity, SubmitCancelColumn is indeed the right place. but you should be overriding the onSubmitted method. As for custom delete link in SubmitCancelColumn, that might be a bit problematic as the panel is package private.
Anyway, I usually don't put the delete link in that column, it doesn't make much sense IMHO. WhatI do is to add CheckBoxColumn and a separate delete link that removes all checked items. -Matej On Tue, Sep 30, 2008 at 3:54 PM, Jim Pinkham <[EMAIL PROTECTED]> wrote: > OK, now a question about using inmethod grid: (I really like this > grid, by the way - awesome work Matej!!) > > On a grid with some editable columns, I override setItemEdit to use > the same grid in non-editable mode, and also to save the edits. > > if (enableEdits) > columns.add(new SubmitCancelColumn("esd", new > Model("Edit"))); > DataGrid grid = new DefaultDataGrid("grid", new > MyDataSource(), columns) { > @Override > public void setItemEdit(IModel rowModel, boolean edit) > { > if (enableEdits) { > super.setItemEdit(rowModel, edit); > if (!edit) > // dao save row goes here > } > } > }; > > I think the IDataSource is very clear, but it is for loading. For > updating, is this appropriate, or am I overlooking a simpler/better > way? > > Then, I would like to add a delete link inside the SubmitCancelColumn > - has anyone already done that? I'm thinking it would only be visible > if editMode is false to share the same screen space with the ok/cancel > icons. > > I suppose a blank line to add a new row at the end would be nice too, > but I think I can figure that out myself... > > Thanks, > -- Jim. > > On Mon, Sep 29, 2008 at 5:57 PM, Jim Pinkham <[EMAIL PROTECTED]> wrote: >> That did the trick, thanks a million! >> >> On Mon, Sep 29, 2008 at 5:20 PM, Matej Knopp <[EMAIL PROTECTED]> wrote: >>> I don't think the grid snapshots in maven are recent enough. You >>> should fetch it from svn and build it yourself if you want to use it. >>> Also keep in mind that grid version for 1.3 is in the 1.3 branch of >>> wicket stuff, not the trunk: >>> >>> http://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicket-1.3.x/inmethod-grid/ >>> >>> -Matej >>> >>> On Mon, Sep 29, 2008 at 10:21 PM, Jim Pinkham <[EMAIL PROTECTED]> wrote: >>>> I'd like to use inmethod grid in my charity auction project. >>>> >>>> I've got a slightly modified version of one of the grid-examples using >>>> DataGrid like so: >>>> >>>> DataGrid grid = new DefaultDataGrid("grid", >>>> >>>> AuctionApplication.get().getDao().getItems(getYear()), // returns >>>> IDataSource >>>> Arrays.asList(new IGridColumn[] { >>>> new PropertyColumn(new ResourceModel("id"), "id"), >>>> new PropertyColumn(new ResourceModel("name"), >>>> "name"), >>>> // I'll try editable columns here once I get >>>> basic display working... >>>> new SubmitCancelColumn("esd", new Model("Edit")), >>>> })); >>>> add(new Form("form").add(grid)); >>>> >>>> I'm getting this error at runtime I don't understand: >>>> >>>> NoSuchMethodError: org.apache.wicket.MetaDataKey: method <init>()V not >>>> found >>>> at com.inmethod.grid.common.AbstractGrid$4.<init>(AbstractGrid.java:908) >>>> at com.inmethod.grid.common.AbstractGrid.<clinit>(AbstractGrid.java:907) >>>> at org.firstuucolumbus.CatalogPage.<init>(CatalogPage.java:43) >>>> >>>> Unfortunately, I'm a total Maven newbie, so I'm guessing something >>>> must be amiss in pom.xml (below) >>>> >>>> or the way I'm using it: mvn clean install eclipse:clean eclipse:eclipse >>>> >>>> (Then I usually run Start from Eclipse) >>>> >>>> Would someone wiser in the ways of inmethod and/or Maven care to give >>>> me a hand here? >>>> >>>> Any help much appreciated. >>>> >>>> Thanks, >>>> -- Jim. >>>> >>>> <project xmlns="http://maven.apache.org/POM/4.0.0" >>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >>>> http://maven.apache.org/maven-v4_0_0.xsd"> >>>> >>>> <modelVersion>4.0.0</modelVersion> >>>> <groupId>org.firstuucolumbus</groupId> >>>> <artifactId>auction</artifactId> >>>> <packaging>war</packaging> >>>> <version>1.0-SNAPSHOT</version> >>>> <!-- TODO project name --> >>>> <name>auction</name> >>>> <description></description> >>>> >>>> <licenses> >>>> <license> >>>> <name>The Apache Software License, Version >>>> 2.0</name> >>>> >>>> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> >>>> <distribution>repo</distribution> >>>> </license> >>>> </licenses> >>>> >>>> <dependencies> >>>> <!-- WICKET DEPENDENCIES --> >>>> <dependency> >>>> <groupId>org.apache.wicket</groupId> >>>> <artifactId>wicket</artifactId> >>>> <version>${wicket.version}</version> >>>> </dependency> >>>> <dependency> >>>> <groupId>org.apache.wicket</groupId> >>>> <artifactId>wicket-extensions</artifactId> >>>> <version>${wicket.version}</version> >>>> </dependency> >>>> >>>> <!-- LOGGING DEPENDENCIES - LOG4J --> >>>> <dependency> >>>> <groupId>org.slf4j</groupId> >>>> <artifactId>slf4j-log4j12</artifactId> >>>> <version>${slf4j.version}</version> >>>> </dependency> >>>> <dependency> >>>> <groupId>log4j</groupId> >>>> <artifactId>log4j</artifactId> >>>> <version>${log4j.version}</version> >>>> </dependency> >>>> >>>> <!-- JUNIT DEPENDENCY FOR TESTING --> >>>> <dependency> >>>> <groupId>junit</groupId> >>>> <artifactId>junit</artifactId> >>>> <version>3.8.2</version> >>>> <scope>test</scope> >>>> </dependency> >>>> >>>> <!-- JETTY DEPENDENCIES FOR TESTING --> >>>> <dependency> >>>> <groupId>org.mortbay.jetty</groupId> >>>> <artifactId>jetty</artifactId> >>>> <version>${jetty.version}</version> >>>> <scope>provided</scope> >>>> </dependency> >>>> <dependency> >>>> <groupId>org.mortbay.jetty</groupId> >>>> <artifactId>jetty-util</artifactId> >>>> <version>${jetty.version}</version> >>>> <scope>provided</scope> >>>> </dependency> >>>> <dependency> >>>> <groupId>org.mortbay.jetty</groupId> >>>> <artifactId>jetty-management</artifactId> >>>> <version>${jetty.version}</version> >>>> <scope>provided</scope> >>>> </dependency> >>>> <dependency> >>>> <groupId>org.mortbay.jetty</groupId> >>>> <artifactId>jetty-plus</artifactId> >>>> <version>${jetty.version}</version> >>>> <scope>provided</scope> >>>> </dependency> >>>> <dependency> >>>> <groupId>org.mortbay.jetty</groupId> >>>> <artifactId>jetty-naming</artifactId> >>>> <version>${jetty.version}</version> >>>> <scope>provided</scope> >>>> </dependency> >>>> <dependency> >>>> <groupId>commons-dbcp</groupId> >>>> <artifactId>commons-dbcp</artifactId> >>>> <version>${commons-dbcp.version}</version> >>>> </dependency> >>>> >>>> <dependency> >>>> <groupId>org.springframework</groupId> >>>> <artifactId>spring</artifactId> >>>> <version>${springframework.version}</version> >>>> </dependency> >>>> <dependency> >>>> <groupId>org.apache.wicket</groupId> >>>> <artifactId>wicket-spring</artifactId> >>>> <version>${wicket.version}</version> >>>> <!-- exclude spring framework that wicket pulls in >>>> <exclusions> >>>> <exclusion> >>>> >>>> <groupId>org.springframework</groupId> >>>> <artifactId>spring</artifactId> >>>> </exclusion> >>>> </exclusions> --> >>>> </dependency> >>>> <!-- merged with wicket-spring asof wicket 1.4 --> >>>> <dependency> >>>> <groupId>org.apache.wicket</groupId> >>>> <artifactId>wicket-spring-annot</artifactId> >>>> <version>${wicket.version}</version> >>>> <!-- exclude spring framework that wicket pulls in >>>> --> >>>> <exclusions> >>>> <exclusion> >>>> >>>> <groupId>org.springframework</groupId> >>>> <artifactId>spring</artifactId> >>>> </exclusion> >>>> </exclusions> >>>> </dependency> >>>> >>>> <dependency> >>>> <groupId>mysql</groupId> >>>> <artifactId>mysql-connector-java</artifactId> >>>> <version>5.1.6</version> >>>> </dependency> >>>> <dependency> >>>> <groupId>com.inmethod</groupId> >>>> <artifactId>grid</artifactId> >>>> <version>${inmethod.grid.version}</version> >>>> </dependency> >>>> >>>> </dependencies> >>>> >>>> <build> >>>> <resources> >>>> <resource> >>>> <filtering>false</filtering> >>>> <directory>src/main/resources</directory> >>>> </resource> >>>> <resource> >>>> <filtering>false</filtering> >>>> <directory>src/main/java</directory> >>>> <includes> >>>> <include>**</include> >>>> </includes> >>>> <excludes> >>>> <exclude>**/*.java</exclude> >>>> </excludes> >>>> </resource> >>>> </resources> >>>> <testResources> >>>> <testResource> >>>> <filtering>false</filtering> >>>> <directory>src/test/java</directory> >>>> <includes> >>>> <include>**</include> >>>> </includes> >>>> <excludes> >>>> <exclude>**/*.java</exclude> >>>> </excludes> >>>> </testResource> >>>> </testResources> >>>> <plugins> >>>> <plugin> >>>> <groupId>org.mortbay.jetty</groupId> >>>> <artifactId>maven-jetty-plugin</artifactId> >>>> </plugin> >>>> <plugin> >>>> <groupId>org.apache.maven.plugins</groupId> >>>> >>>> <artifactId>maven-eclipse-plugin</artifactId> >>>> <configuration> >>>> >>>> <downloadSources>true</downloadSources> >>>> </configuration> >>>> </plugin> >>>> >>>> <plugin> <!-- wicket 1.4 needs jdk 1.5 --> >>>> <groupId>org.apache.maven.plugins</groupId> >>>> >>>> <artifactId>maven-compiler-plugin</artifactId> >>>> <configuration> >>>> <source>1.5</source> >>>> <target>1.5</target> >>>> </configuration> >>>> </plugin> >>>> >>>> </plugins> >>>> </build> >>>> >>>> <properties> >>>> <wicket.version>1.3.4</wicket.version> >>>> <springframework.version>2.5.3</springframework.version> >>>> <slf4j.version>1.4.2</slf4j.version> >>>> <log4j.version>1.2.14</log4j.version> >>>> <commons-dbcp.version>1.2.2</commons-dbcp.version> >>>> <jetty.version>6.1.4</jetty.version> >>>> >>>> <inmethod.grid.version>1.0.0-SNAPSHOT</inmethod.grid.version> >>>> </properties> >>>> >>>> <repositories> >>>> <repository> >>>> <id>WicketStuff</id> >>>> <name>Wicket Stuff Repo</name> >>>> <url>http://wicketstuff.org/maven/repository</url> >>>> <snapshots> >>>> <enabled>true</enabled> >>>> </snapshots> >>>> <releases> >>>> <enabled>true</enabled> >>>> </releases> >>>> </repository> >>>> </repositories> >>>> </project> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>>> For additional commands, e-mail: [EMAIL PROTECTED] >>>> >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]