2

How to create html like table in Oracle ADF? The following

<af:table> 

adds also headers, which is not desired in my case. I need just a simple table like layout, with no margins between rows and cells. Something like this (note: instead of text may be anything, layouts, imags, etc.):

enter image description here

I can create something similar with panelGridLayout, but when adding borders, the margins between rows still remain.

<af:panelGridLayout id="pgl3">
        <af:gridRow height="auto" id="gr4">
          <af:gridCell id="gc9"
                       inlineStyle="padding-top:5px; padding-bottom:5px; padding-right:20px; padding-left:20px; border-right:solid thin; border-left:solid thin; border-top:solid thin; border-bottom:solid thin; border-color:Silver;">
            <af:outputText value="Text1"/>
          </af:gridCell>
          <af:gridCell id="gc8"
                       inlineStyle="padding-top:5px; padding-bottom:5px; padding-right:20px; padding-left:20px; border-right:solid thin; border-top:solid thin; border-bottom:solid thin; border-color:Silver;">
            <af:outputText value="Text2"/>
          </af:gridCell>
        </af:gridRow>
        <af:gridRow height="auto" id="gr6">
          <af:gridCell id="gc10"
                       inlineStyle="padding-top:5px; padding-bottom:5px; padding-right:20px; padding-left:20px; border-right:solid thin; border-left:solid thin; border-top:solid thin; border-bottom:solid thin; border-color:Silver;">
            <af:outputText value="Text3"/>
          </af:gridCell>
          <af:gridCell inlineStyle="padding-top:5px; padding-bottom:5px; padding-right:20px; padding-left:20px; border-right:solid thin; border-top:solid thin; border-bottom:solid thin; border-color:Silver;"
                       id="gc6">
            <af:outputText value="Text4"/>
          </af:gridCell>
        </af:gridRow>
      </af:panelGridLayout>

Which will look like:

enter image description here

Also,I noticed this solution ( https://community.oracle.com/thread/1104448), but I would prefer to avoid ADF table, since I only need layout.

Thanks

whiteErru
  • 275
  • 1
  • 5
  • 13

4 Answers4

1

Use JSF <h:panelGrid>, It will give the look and feel of an html table:

<h:panelGrid columns="2" id="pg1" width="100%" frame="box" rules="all">
    <af:outputText value="Text1" id="ot1"/>
    <af:outputText value="Text2" id="ot2"/>
    <af:outputText value="Text3" id="ot3"/>
    <af:outputText value="Text4" id="ot4"/>
</h:panelGrid>
amishra
  • 951
  • 9
  • 12
0

I'm not sure it will work or not, but trying it does not hurt, put your html tags inside the value attribute of <af:outputFormatted> for example:

<af:outputFormatted styleUsage="yourStyle"
                value="<b>any output</b>"/>
void
  • 7,760
  • 3
  • 25
  • 43
0

Trinidad table will give you exact html-table layout.

However you should avoid using html things in your adf application if possible.
If your requirements is only to have table without header, you can style
af:table and turn off headers layer in your skin like this:

.noHeader af|column::column-header-cell{
   display: none;
}

af:panelGroupLayout in layout=horizontal mode will render html table around its content too, however you will have only one row and almost no control of it behavior.

af:panelGridLayout will render grid that may be used as table layout too.

Nagh
  • 1,757
  • 1
  • 14
  • 19
0

How about using the listView component - http://jdevadf.oracle.com/adf-richclient-demo/faces/components/listView/listViewTabular.jspx

Shay Shmeltzer
  • 3,693
  • 1
  • 13
  • 9