Skip to main content

jMaki Dojo Table JSF Example

4 replies [Last post]
jersingh
Offline
Joined: 2006-02-09
Points: 0

Hello,

A couple of questions:

1. Is the jMaki table implemented yet to access JSF beans? If so, can someone point to some documentation or even a .war file?

2. I've been using dojo ModalFloatingPane widgets. Does jMaki support these, and if not is it possible to have the jMaki framework in an app and still create dojo widgets using dojo in a standard manner?

Thanks,
Joe

P.S. jMaki is really shaping up. Great work!

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

We are working on this from a few different angels.

First you can do what you would like today:

The suggested usage with inline data in jMaki version .8.2 is:

args="{columns: { 'title' : 'Title', 'author':'Author', 'isbn': 'ISBN #', 'description':'Description'}}"
value="{rows:[
['JavaScript 101', 'Lu Sckrepter','4412', 'Some long description'],
['Ajax with Java', 'Jean Bean','4413', 'Some long description']
]}" />

Note that we have moved the column descriptions into the args as to separate the structure from the data. We still support values that contain the columns like:

value="{columns: { 'title' : 'Title', 'author':'Author', 'isbn': 'ISBN #', 'description':'Description'},
rows:[['JavaScript 101', 'Lu Sckrepter','4412', 'Some long description'], ['Ajax with Java', 'Jean Bean','4413', 'Some long description']]}" />

You can simple set the value attribute to a managed bean.

args="{columns: { 'title' : 'Title', 'author':'Author', 'isbn': 'ISBN #', 'description':'Description'}}"
value="#{MyBean.tableData}" />

In this case the method MyBean.getTableData will return the following String:

{rows:[
['JavaScript 101', 'Lu Sckrepter','4412', 'Some long description'],
['Ajax with Java', 'Jean Bean','4413', 'Some long description']
]}

You can of course generate the column data in you managed bean as well if you are using a pre .8.2 version of jMaki or if you want dynamic column data.

There is a blog entry by Jennifer on how you can generate JSON from a managed bean at:

http://blogs.sun.com/jenniferb/entry/more_fun_with_jmaki_getting

One thing we found with the Java to JSON APIs was that the order of the JSON Object properties is not guaranteed which is a problem as the column names need to be in the correct order. If you use the JSON API to generate the table data I suggest you create the column names without the JSON API to maintain the correct order. The row information can be generated correctly.

jersingh
Offline
Joined: 2006-02-09
Points: 0

Thanks for the quick reply.

My table will have fixed header names so I won't need that from the bean.

And I can follow Jennifer's blog to get my data.

Only one thing left I have to have is a way to imbed html in the table data. Specifically, make hyperlinks out of the text in a column. Is this possible?

Thanks,
Joe

gmurray71
Offline
Joined: 2003-07-31
Points: 0

Yes you can embed them in the table.

-Greg

jersingh
Offline
Joined: 2006-02-09
Points: 0

Can you point me to documentation or an example app?

Thanks,
Joe