menjajal komponen loop tapestry5

File .tml

<html xmlns:t="">

 <thead bgcolor="#cccccc">
 <th>Id Barang</th>
 <th>Nama Barang</th>
 <th>Harga Barang</th>
 <tr t:type="Loop" t:source="barangs" t:value="barang" bgcolor="#ffcc00">


File .java

package com.example.tutorial.pages;

import java.util.ArrayList;
 import java.util.List;

import org.apache.tapestry5.annotations.Property;
 import org.apache.tapestry5.annotations.SetupRender;
 import com.example.tutorial.entities.Barang;

public class Tloop {

private List<Barang> barangs;

 private Barang barang;

 void setupRender(){
 barang = new Barang();

public List<Barang> getBarangs(){
 barangs = new ArrayList<Barang>();
 barangs.add(new Barang("01", "Barang A", "5000"));
 barangs.add(new Barang("02", "Barang B", "4000"));
 barangs.add(new Barang("03", "Barang C", "6000"));
 return barangs;


Published by


Begin a big Process with a bit trying

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s