Skip to main content

jmaki dojo table columns from java bean

3 replies [Last post]
Joined: 2010-03-26

Hi all.My problem is pretty simple.I have been able to load data onto the table from a bean in my jsp page as follows:
//top of page i have these

<%@ taglib prefix="a" uri="http://jmaki/v1.0/jsp" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.sql.*" %>

//for the dojo table i have this:

//please note that the rows come fine but columns come as integers 0 to 9 their positons.Here is my code in java class that loads the column names.Here is the place that i need help with.
public JSONArray getFssRegCols() throws Exception
JSONArray books = new JSONArray();
JSONArray book = new JSONArray();
String [][] dataz = new String [10][2];
dataz[0][0]="label : ''MOBILE''";
dataz[1][0]="label : ''NAME''";
dataz[2][0]="label : ''ID_CARD_NO''";
dataz[3][0]="label : ''DEALER_NO.''";
dataz[4][0]="label : ''DATE_OF_BIRTH''";
dataz[5][0]="label : ''REG_DATE_TIME''";
dataz[6][0]="label : ''GENDER''";
dataz[7][0]="label : ''DEALER_SHOP''";
dataz[8][0]="label : ''TOWN''";
dataz[9][0]="label : ''ACTION''";
dataz[0][1]="id : ''mobile''";
dataz[1][1]="id : ''name''";
dataz[2][1]="id : ''idno''";
dataz[3][1]="id : ''dealer''";
dataz[4][1]="id : ''dob''";
dataz[5][1]="id : ''redate''";
dataz[6][1]="id : ''gender''";
dataz[7][1]="id : ''shop''";
dataz[8][1]="id : ''tao''";
dataz[9][1]="id : ''act''";
for(int m=0;m

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2010-03-26

My main question is why the column names don't show and instead numbers 0 to 9 pressumably the array indexes are returned instead?
Thank you all and know that your help is well appreciated.

Message was edited by: dangari

Joined: 2003-07-31

Any chance you can show me the rendered page?

It would be good to see what the data gets rendered as.


Joined: 2010-03-26

Let me explain further what I'm faced with here.
Now by hard coding the columns as follows on the jsp page ,but using the bean for the rows, everything is fine:

I only want to do this dynamically from the java class instead of on the jsp page.

Message was edited by: dangari