• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MyFaces Tomahawk t:columns tag - basic example needed

 
Wally Hartshorn
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm so confused! Can someone explain to me how to use the MyFaces Tomahawk <t:columns> tag? The documentation is minimal, to say the least, and I can't seem to find a basic example anywhere. Most of the questions that I've found discussing it are asking about things like sorting and scrolling. All I need to know is how to use the tag at all.

Here's one version of what I've been trying.

Here's the output I wanted:


Here's the output I got:


Part of the JSP file:


Part of the Java code:


Should I be giving <t:dataTable> an array of data grouped as rows (which is what I tried first) or an array of data grouped as columns (which is what I'm trying in the above example)? In other words, should each array inside the ArrayList represent one row or one column?

What should <tutputText value="#{oneDay[rowIndex]}" /> really be? What I'm trying definitely isn't working! It apparently takes what I've specified and repeats it for each column. If I try to specify multiple <tutputText> tags (e.g. hard-coding oneDay[0], oneDay[1], oneDay[2], and oneDay[3]), it puts all of the results in a single cell, then repeats that cell. Not what I had in mind at all.

In some of the example snippets that I've seen, I've seen reference to something like <tutputText value="#{timecardForm.columnValue}">, but I've seen no explanation of where "columnValue is coming from. Presumably there's a call to a "getColumnValue" method, but I'm not sure how that method would know which value is needed next.

I'm obviously wildly missing the mark on this one. Can anyone point me in the right direction?

Thanks in advance!
 
Wally Hartshorn
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After posting my earlier message, I decided that perhaps the secret is writing a getColumnValue method.

The JSP code:


The code to initialize the sample data:


The code to return the proper value for this cell:


That works! Is that really how <t:columns> is supposed to be used? For example, I never use the "oneRow" variable that is created by <t:dataTable value="#{timecardForm.rows}" var="oneRow"> in the JSP. That seems a bit odd. Is that the preferred way of doing it?

Lastly, was there something somewhere that would have EXPLAINED this, saving me a day and a half of confused experimentation?
 
abhishekt tiwari
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need your full java code for this displaying the calendar please
 
Leonardo Uribe
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is an example of t:columns Here If you need a calendar in a table fashion check this example
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic