menjajal komponen beaneditform tapestry5

File .tml

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">

<t:beaneditform object="mahasiswa"/>

</html>

File .java

 package com.example.tutorial.pages;

import org.apache.tapestry5.annotations.SetupRender;

import com.example.tutorial.entities.Mahasiswa;

public class MasterMahasiswa {

private Mahasiswa mahasiswa;

@SetupRender
 void setupRender(){
 if (mahasiswa == null)
 mahasiswa = new Mahasiswa();
 }

public Mahasiswa getMahasiswa(){
 return mahasiswa;
 }

}

File Mahasiswa.java :

 package com.example.tutorial.entities;

import java.io.Serializable;

public class Mahasiswa implements Serializable {

private String id_mhs;

private String nama_mhs;

private String alamat;

private String no_hp;

private JenisKelamin jns_kelamin;

public String getId_mhs() {
 return id_mhs;
 }

public void setId_mhs(String id_mhs) {
 this.id_mhs = id_mhs;
 }

public String getNama_mhs() {
 return nama_mhs;
 }

public void setNama_mhs(String nama_mhs) {
 this.nama_mhs = nama_mhs;
 }

public String getAlamat() {
 return alamat;
 }

public void setAlamat(String alamat) {
 this.alamat = alamat;
 }

public String getNo_hp() {
 return no_hp;
 }

public void setNo_hp(String no_hp) {
 this.no_hp = no_hp;
 }

public JenisKelamin getJns_kelamin() {
 return jns_kelamin;
 }

public void setJns_kelamin(JenisKelamin jns_kelamin) {
 this.jns_kelamin = jns_kelamin;
 }

@Override
 public String toString() {
 //TODO
 return super.toString();
 }

}

enum JenisKelamin{
 LAKI,PEREMPUAN
 }

 

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