• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

MyFaces Tomahawk t:columns tag - basic example needed

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 <t:outputText 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 <t:outputText> 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 <t:outputText 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need your full java code for this displaying the calendar please
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Everyone is a villain in someone else's story. Especially this devious tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic