worksheet

58 views
Skip to first unread message

Joaquin Valdez

unread,
Aug 10, 2011, 12:04:41 AM8/10/11
to JMesa
Hello!

I am using Stripes and trying to get the worksheet feature working.  Here is the error I am getting:

TypeError: 'undefined' is not a function (evaluating 'jQuery.parseJSON(data)')

I am lost...any help would be appreciated.

Thanks!

Joaquin Valdez



Jeff Johnston

unread,
Aug 10, 2011, 8:46:15 AM8/10/11
to jm...@googlegroups.com
What version of JMesa are you on?

Did you try debugging it with Firebug? If so does that tell you anything else.

I think I recognize your name, but just to make sure....do you have JMesa working with a regular table? Just making sure you have the basics working before moving on to the more advanced functionality.

-Jeff Johnston



--
You received this message because you are subscribed to the Google Groups "JMesa" group.
To post to this group, send email to jm...@googlegroups.com.
To unsubscribe from this group, send email to jmesa+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jmesa?hl=en.

Joaquin Valdez

unread,
Aug 10, 2011, 9:31:15 AM8/10/11
to jm...@googlegroups.com
I believe I am using 3.  I haven't used firebug yet...mainly because I don't know what I am looking for.  :-)

Yes I do have a table working using the API. Spectacular I might add.

Thanks!
Joaquin



Joaquin Valdez



Joaquin Valdez

unread,
Aug 10, 2011, 9:51:28 AM8/10/11
to jm...@googlegroups.com
On Aug 10, 2011, at 5:46 AM, Jeff Johnston wrote:


Joaquin Valdez



Joaquin Valdez

unread,
Aug 10, 2011, 1:49:20 PM8/10/11
to jm...@googlegroups.com
Ok I have fixed the original issue now I am encountering this problem when changing a value in the table:

java.lang.NullPointerException
org.jmesa.worksheet.WorksheetUpdater.getWorksheetColumn(WorksheetUpdater.java:112)
org.jmesa.worksheet.WorksheetUpdater.update(WorksheetUpdater.java:55)
org.jmesa.worksheet.servlet.WorksheetServlet.doGet(WorksheetServlet.java:43)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:199)

Thank you!
Joaquin



On Aug 10, 2011, at 5:46 AM, Jeff Johnston wrote:


Joaquin Valdez



Jeff Johnston

unread,
Aug 10, 2011, 4:15:40 PM8/10/11
to jm...@googlegroups.com
Do you have the uniqueProperty defined on the row? The uniqueProperty should be something unique to the row and available in the item (bean).

It might also help if you post your table code.

Then once we figure this out I will for sure put in better handling for the null pointer condition that you are getting!

-Jeff

Joaquin Valdez

unread,
Aug 10, 2011, 4:25:52 PM8/10/11
to jm...@googlegroups.com
Thank you!  here is my table code:

private Table getHtmlTable() {
        HtmlTable htmlTable = new HtmlTable().width("700px");
        
        SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yy-HH:mm:ss");
        htmlTable.caption("Harvest Batches <br/> As of: " + sdf.format(new java.util.Date())).setStyle("font-family:Arial;font-size: 12pt;font-style: normal;");
        sdf = null;
        
        HtmlRow htmlRow = new HtmlRow();
        
        htmlRow.setUniqueProperty("id");
        
        htmlTable.setRow(htmlRow);

        HtmlColumn id = new HtmlColumn("id").title("Id");
        id.setStyle("text-align:left");
        id.editable(Boolean.FALSE);     
        htmlRow.addColumn(id);
        
        
        HtmlColumn lvlt = new HtmlColumn("date").title("Date");
        lvlt.setStyle("text-align:left");
        lvlt.setCellEditor(new DateCellEditor("MM-dd-yy"));
        htmlRow.addColumn(lvlt);

        HtmlColumn accountnbr = new HtmlColumn("batch").title("Batch");
        //accountnbr.setStyle("text-align:left");
        //accountnbr.setCellRenderer(new AccountNbrRenderer());
        accountnbr.filterEditor(new DroplistFilterEditor());
        htmlRow.addColumn(accountnbr);
        
        HtmlColumn firstName = new HtmlColumn("colorGrade").title("Grade").filterEditor(new HtmlFilterEditor());
        firstName.setStyle("text-align:left");
        htmlRow.addColumn(firstName);

        HtmlColumn lastName = new HtmlColumn("item").title("Item");
        lastName.setStyle("text-align:left");
        lastName.filterEditor(new DroplistFilterEditor());
        htmlRow.addColumn(lastName);

        HtmlColumn titlecd = new HtmlColumn("loadnumber").title("Load Number");
        titlecd.setStyle("text-align:right");
        titlecd.filterEditor(new DroplistFilterEditor());
        htmlRow.addColumn(titlecd);
        
        HtmlColumn phone = new HtmlColumn("toteLotBox").title("Tot");
        phone.setStyle("text-align:right");
        htmlRow.addColumn(phone);
       

        HtmlColumn prv = new HtmlColumn("microcystin").title("Microcystin");
        prv.setStyle("text-align:right");
        //prv.setCellEditor(new NumberCellEditor("0.00"));
        //prv.getCellRenderer().setCellEditor();
        htmlRow.addColumn(prv);

        HtmlColumn aspv = new HtmlColumn("gallons").title("Gallons");
        aspv.setStyle("text-align:right");
        //aspv.setCellEditor(new NumberCellEditor("0.00"));
        htmlRow.addColumn(aspv);

        HtmlColumn pbv = new HtmlColumn("qcHold").title("QC");
        pbv.cellRenderer(new QCRenderer());
        //pbv.setStyle("text-align:right");
        //pbv.setCellEditor(new NumberCellEditor("0.00"));
        htmlRow.addColumn(pbv);
        
        HtmlColumn com = new HtmlColumn().title("Comments");
        com.cellRenderer(new ComRenderer());
        //pbv.setStyle("text-align:right");
        //pbv.setCellEditor(new NumberCellEditor("0.00"));
        htmlRow.addColumn(com);
        
        
        HtmlColumn action = new HtmlColumn().title("Action");
        action.cellRenderer(new ActionRenderer());
        htmlRow.addColumn(action);
        
        return htmlTable;
    }

Jeff Johnston

unread,
Aug 10, 2011, 5:47:15 PM8/10/11
to jm...@googlegroups.com
I think you need to remove the first column that has id as the property. I believe that there is an issue ticket on this too. The problem is that you have a column property that is the same as the uniqueProperty on the row. I want to at least be able to check for this and message accordingly, although ideally it would work fine.

So try removing this:


        HtmlColumn id = new HtmlColumn("id").title("Id");
        id.setStyle("text-align:left");
        id.editable(Boolean.FALSE);     
        htmlRow.addColumn(id);

If you still need to have a column that exposes that column you could use a dummy property name and a custom cell editor or define another attribute on your item (bean) that returns the id value.

Hope that fixes it! If not post back and we will figure it out.

-Jeff

Joaquin Valdez

unread,
Aug 10, 2011, 5:55:00 PM8/10/11
to jm...@googlegroups.com
Will do! Thanks.

Joaquin Valdez

unread,
Aug 10, 2011, 9:24:44 PM8/10/11
to jm...@googlegroups.com
Ok I have resolved that issue.  Thanks.

I am now trying to add the "Add Record" functionality and I have a question about that.  I have a few column in my table that use a custom renderer.  They basically show an image if the data is present.  When I click the + image to add a row it throws an error in my custom renderer.

I tried to make the column non editable, but no luck there.

Thanks for helping me out.  I appreciate it.  Do you do a donation thing?

Joaquin


On Aug 10, 2011, at 1:15 PM, Jeff Johnston wrote:


Joaquin Valdez



Jeff Johnston

unread,
Aug 10, 2011, 9:41:34 PM8/10/11
to jm...@googlegroups.com
No problem! What is the error?


Do you do a donation thing?

No. I am just a big fan of open source software and this is my way of giving back something. Plus I figure that if people are willing to use my stuff I try to support it as best as possible.

Sorry that you are having issues with the worksheet! In general I use the worksheet a lot at work in an admin tool that we have. It works really well but I have had very little feedback on it so I sometimes wonder how well it works for others. Hopefully we can get you over these hurdles (and I can go back and put in some better checks).

-Jeff

Jeff Johnston

unread,
Aug 10, 2011, 9:43:24 PM8/10/11
to jm...@googlegroups.com
Does it work without the custom renderer? Can you post what your render looks like too? If it is something that you do not want to post the feel free to send it to me at jeff.joh...@gmail.com.
Reply all
Reply to author
Forward
0 new messages