Skip to main content

help about adding a row in a jmaki table

1 reply [Last post]
aetius
Offline
Joined: 2009-03-17
Points: 0

Hello
I have 1 jsp page and a servlet.

In my jsp page I put this

I'd like to insert in the jsp page a form that takes from the user the data to create a new row in the editable table.

I thought to create a servlet with a method like this

public JSONObject getData(HttpServletRequest request, HttpServletResponse response) throws JSONException{

JSONObject newrow = new JSONObject();

newrow.put("title",request.getParameter("ins_title"));
newrow.put("author",request.getParameter("ins_title"));
newrow.put("isbn",request.getParameter("ins_title"));
newrow.put("description",request.getParameter("ins_title"));

return newrow;

}

Is it possible to pass the JSONObject to a method addRow ( defined in glue.js? ) called in the jsp page?

Help me please I'm a newbie so excuse me!

Thanks!!!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmurray71
Offline
Joined: 2003-07-31
Points: 0

It is possible. Find out more here:

http://wiki.java.net/bin/view/Projects/jMakiTableDataModel

Pretty much you can do it with something like:

jmaki.publish("/dojo/table/addRow", {
value :
{ title : 'Book Title 3',
author : 'Author 3',
isbn: '4415',
description : 'A Some long description'}
});