mencoba komponen beaneditform tapestry5

Untuk halaman .tml adalah sebagai berikut😀

 <t:beaneditform object="barang"/>

 

Sedangkan untuk halaman .java :🙂

 package com.example.tutorial.pages;

import org.apache.tapestry5.annotations.SetupRender;

import com.example.tutorial.entities.Barang;

public class Tbeaneditform {

private Barang barang;

@SetupRender
 void setupRender(){
 if (barang == null)
 barang = new Barang();
 }

void onSelectedFromSubmit(){

}

public Barang getBarang() {
 return barang;
 }

public void setBarang(Barang barang) {
 this.barang = barang;
 }
 }

Sedangkan untuk bean Barang :

 public class Barang {
 private String id_barang;

private String nama_barang;

private String harga_barang;

public Barang() {
 // TODO Auto-generated constructor stub
 }

public Barang(String id_barang, String nama_barang, String harga_barang) {
 this.id_barang = id_barang;
 this.nama_barang = nama_barang;
 this.harga_barang = harga_barang;
 }

public String getId_barang() {
 return id_barang;
 }

public void setId_barang(String id_barang) {
 this.id_barang = id_barang;
 }

public String getNama_barang() {
 return nama_barang;
 }

public void setNama_barang(String nama_barang) {
 this.nama_barang = nama_barang;
 }

public String getHarga_barang() {
 return harga_barang;
 }

public void setHarga_barang(String harga_barang) {
 this.harga_barang = harga_barang;
 }
 }

Published by

saifiahmada

Begin a big Process with a bit trying

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s