You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Josh Kamau <jo...@gmail.com> on 2010/11/08 10:00:54 UTC

Adding virtual column to a grid

Hi

Am trying to add a virtual column to a grid  (an action link for deleting a
record) but its not appearing on the grid. Whats wrong with this code:

<html t:type="layout" t:title="Show all contacts"
      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
      xmlns:p="tapestry:parameter">


      <div class="span-6">
          <div t:type="menu"/>
      </div>

      <div class="span-16">
              <t:grid t:source="contacts" row="contact">
                  <p:deletecell>
                       <t:actionlink t:id="delete">delete</t:actionlink>
                  </p:deletecell>
              </t:grid>
      </div>

</html>

package com.josh.addressbook.pages;

import java.util.List;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.josh.addressbook.entities.Contact;
import com.josh.addressbook.services.Dao;

public class ShowAll {

    @Inject
    private Dao dao ;

    @Property
    private Contact contact ;

    public List<Contact> getContacts(){
        return dao.getAll();
    }

}

king regards.
Josh

Re: Adding virtual column to a grid

Posted by Stephan Windmüller <st...@tu-dortmund.de>.
On 08.11.2010 10:00, Josh Kamau wrote:

> Am trying to add a virtual column to a grid  (an action link for deleting a
> record) but its not appearing on the grid. Whats wrong with this code:
> [...]
>               <t:grid t:source="contacts" row="contact">

You need to use the "add" parameter of the Grid:

http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html

http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/tables/addandremovecolumns1

HTH
 Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Adding virtual column to a grid

Posted by Josh Kamau <jo...@gmail.com>.
Got it.

It worked.

I had actualy read the documentation but i missed the "add" part.

thanks all.

On Mon, Nov 8, 2010 at 4:08 AM, Sven Homburg <ho...@googlemail.com>wrote:

> Josh, i advise you: read the documents ..... and read carefully !!!
>
> <t:grid source="users" row="user" add="delete">
>
>
> with regards
> Sven Homburg
> Founder of the Chenille Kit Project
> http://chenillekit.codehaus.org
>
>
>
>
> 2010/11/8 Josh Kamau <jo...@gmail.com>
>
> > Hi
> >
> > Am trying to add a virtual column to a grid  (an action link for deleting
> a
> > record) but its not appearing on the grid. Whats wrong with this code:
> >
> > <html t:type="layout" t:title="Show all contacts"
> >      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
> >      xmlns:p="tapestry:parameter">
> >
> >
> >      <div class="span-6">
> >          <div t:type="menu"/>
> >      </div>
> >
> >      <div class="span-16">
> >              <t:grid t:source="contacts" row="contact">
> >                  <p:deletecell>
> >                       <t:actionlink t:id="delete">delete</t:actionlink>
> >                  </p:deletecell>
> >              </t:grid>
> >      </div>
> >
> > </html>
> >
> > package com.josh.addressbook.pages;
> >
> > import java.util.List;
> >
> > import org.apache.tapestry5.annotations.Property;
> > import org.apache.tapestry5.ioc.annotations.Inject;
> >
> > import com.josh.addressbook.entities.Contact;
> > import com.josh.addressbook.services.Dao;
> >
> > public class ShowAll {
> >
> >    @Inject
> >    private Dao dao ;
> >
> >    @Property
> >    private Contact contact ;
> >
> >    public List<Contact> getContacts(){
> >        return dao.getAll();
> >    }
> >
> > }
> >
> > king regards.
> > Josh
> >
>

Re: Adding virtual column to a grid

Posted by Sven Homburg <ho...@googlemail.com>.
Josh, i advise you: read the documents ..... and read carefully !!!

<t:grid source="users" row="user" add="delete">


with regards
Sven Homburg
Founder of the Chenille Kit Project
http://chenillekit.codehaus.org




2010/11/8 Josh Kamau <jo...@gmail.com>

> Hi
>
> Am trying to add a virtual column to a grid  (an action link for deleting a
> record) but its not appearing on the grid. Whats wrong with this code:
>
> <html t:type="layout" t:title="Show all contacts"
>      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
>      xmlns:p="tapestry:parameter">
>
>
>      <div class="span-6">
>          <div t:type="menu"/>
>      </div>
>
>      <div class="span-16">
>              <t:grid t:source="contacts" row="contact">
>                  <p:deletecell>
>                       <t:actionlink t:id="delete">delete</t:actionlink>
>                  </p:deletecell>
>              </t:grid>
>      </div>
>
> </html>
>
> package com.josh.addressbook.pages;
>
> import java.util.List;
>
> import org.apache.tapestry5.annotations.Property;
> import org.apache.tapestry5.ioc.annotations.Inject;
>
> import com.josh.addressbook.entities.Contact;
> import com.josh.addressbook.services.Dao;
>
> public class ShowAll {
>
>    @Inject
>    private Dao dao ;
>
>    @Property
>    private Contact contact ;
>
>    public List<Contact> getContacts(){
>        return dao.getAll();
>    }
>
> }
>
> king regards.
> Josh
>