TAILIEUCHUNG - Mastering JavaServer™ Face phần 6

kể từ khi các thuộc tính cột được thiết lập cho bảng điều khiển này, hai thành phần tại một thời điểm sẽ được đặt vào một hàng, sau đó một hàng mới sẽ được tạo ra cho hai, cho đến khi có các thành phần trẻ em không có nhiều hơn nữa. | UI Components 219 public InvoiceBean new SelectItem 0 On Receipt new Selectitem 30 Net 30 Days new Selectitem 60 Net 60 days public List getPaymentTerms return paymentTerms public void setPaymentTerms List paymentTerms paymentTerms public String getPaymentTerm return paymentTerm public void setPaymentTerm String paymentTerm paymentTerm Now we can add tags to see Listing to render a drop-down menu based on the list of Selectitems stored in the paymentTerms property h selectOneMenu id terms value f selectitems value h selectOneMenu The selectOneMenu tag will render a drop-down list that is bound to the bean property referenced by the tag s value attribute in this case the InvoiceBean s paymentTerm field . The options list in the resulting HTML select element will be generated from the list of Selectitems contained in the paymentTerms field identifed by the nested selectitems tag. Similarly we could follow the same set of steps used in the previous example to add a set of radio buttons. First here s the new code we need to add to the InvoiceBean class List of possible order status codes private List statuscodes new ArrayList Current order status private String statuscode public InvoiceBean . new Selectitem 1 Open new Selectitem 2 Past Due 220 Chapter 6 new SelectItem 3 Paid public List getStatusCodes return statuscodes public void setStatusCodes List statuscodes statuscodes public String getStatusCode return statusCode public void setStatusCode String statusCode statusCode . Now we can add the JSP tags h selectOneRadio id status value f selectItems value h selectOneRadio As you can see the only real difference between the drop-down

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.