Skip to main content

loading DOJO(table) with data

4 replies [Last post]
annrshaw2007
Offline
Joined: 2007-05-22
Points: 0

I am trying to load dojo(table) refering to Loading Your Own Data Into a jMaki Widget.

Getting errorin jsp The value for the useBean class attribute Books IS N OT VALID

public class Book implements Serializable{

private int bookId;
private String title;
private String firstName;
private String surname;

/** Creates a new instance of Book */
public Book(int bookId,
String title,
String firstName,
String surname) {
this.setBookId(bookId);
this.setTitle(title);
this.setFirstName(firstName);
this.setSurname(surname);
}

public int getBookId() {
return bookId;
}

public void setBookId(int bookId) {
this.bookId = bookId;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getFirstName() {
return firstName;
}

public void setFirstName(String firstName) {
this.firstName = firstName;
}

public String getSurname() {
return surname;
}

public void setSurname(String surname) {
this.surname = surname;
}

public List createBooks() throws Exception {
ArrayList books = new ArrayList();
Book book =
new Book(201,
"My Early Years: Growing up on *7",
"Duke", "");
books.add(book);
book =
new Book(202,
"Web Servers for Fun and Proft",
"Jeeves", "");
books.add(book);
book =
new Book(203,
"Web Components for Web Developers",
"Webster", "Masterson");
books.add(book);
return books;
}

public JSONArray getBookData() throws Exception {
JSONArray books = new JSONArray();
JSONArray book = new JSONArray();
ArrayList bookList = (ArrayList)createBooks();
Iterator i = bookList.iterator();
while(i.hasNext()){
Book bookData = (Book)i.next();
book.put(bookData.getBookId());
book.put(bookData.getTitle());
book.put(bookData.getFirstName());
book.put(bookData.getSurname());
books.put(book);
book = new JSONArray();
}
return books;
}

jsp has
<%@ taglib prefix="a" uri="http://jmaki/v1.0/jsp" %>

Can any body help ???????Whats is wrong?????????????

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
carlavmott
Offline
Joined: 2005-02-10
Points: 0

The value agrument is used to provide data inline. You want the data to come from the bean or external source so you need to use the service attribute and do something like:

service="{appBean.getBookData}"
/>

carlavmott
Offline
Joined: 2005-02-10
Points: 0

Hit the post button too soon. You do need to use the service argument but the column headers
need to be set statically since you don't have those in your bean

so, you should use something like:

service="{appBean.bookData}"
/>

reddycm
Offline
Joined: 2008-05-07
Points: 0

Hi ,
I'm still having the problem we b page shows some java script error.

service="{appBean.bookData}"
/>

Can some one kindly help me to load the Dojo table with the bean data.

Thanks,
Mahesh

annrshaw2007
Offline
Joined: 2007-05-22
Points: 0

I am still waiting for reply . Can someone please answer. I see this forum is not active as YUI OR GWT... Please please help

Thanks in advance.