You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ayub Khan <ay...@gmail.com> on 2009/01/19 10:52:57 UTC

JSF datable empty rows, position of components in UI

Hi,

Could any give some tips in resolving the below issues ?

1) Display empty rows of data table in JSF, if the list which is bounded to
datable is empty then I need to view atleast one empty row.

2) UI has one datable and a form below it, I need to show the empty table if
there are no records and there should be little space (gap) between Table
and the form below. Currently there is no space between table and form and
their position is also not fixed. Like as I add rows to the table the form
below it is getting pushed below. How to fix the position of these two and
also have a space between them.

Thanks
Ayub

-- 
-- "Two roads diverged in a wood
And I took the one less traveled by
And that has made all the difference.

Robert Frost....."

Re: JSF datable empty rows, position of components in UI

Posted by Ayub Khan <ay...@gmail.com>.
Thanx Simon, I did not think about rendered attribute :)

On 1/21/09, Simon Kitching <sk...@apache.org> wrote:
>
> Ayub Khan schrieb:
> > Hi,
> >
> > Could any give some tips in resolving the below issues ?
> >
> > 1) Display empty rows of data table in JSF, if the list which is bounded
> > to datable is empty then I need to view atleast one empty row.
> >
> > 2) UI has one datable and a form below it, I need to show the empty
> > table if there are no records and there should be little space (gap)
> > between Table and the form below. Currently there is no space between
> > table and form and their position is also not fixed. Like as I add rows
> > to the table the form below it is getting pushed below. How to fix the
> > position of these two and also have a space between them.
>
> <h:panelGroup rendered="#{mybean.numRecords == 0}">
> here goes the stuff you want to render when there are no records
> </h:panelGroup>
>
> <h:dataTable rendered="#{mybean.numRecords > 0}">
> here goes the normal table
> </h:dataTable>
>
>
> Regards, Simon
> --
> -- Emails in "mixed" posting style will be ignored
> -- (http://en.wikipedia.org/wiki/Posting_style)
>



-- 
-- "Two roads diverged in a wood
And I took the one less traveled by
And that has made all the difference.

Robert Frost....."

Re: JSF datable empty rows, position of components in UI

Posted by Simon Kitching <sk...@apache.org>.
Ayub Khan schrieb:
> Hi,
>  
> Could any give some tips in resolving the below issues ?
>  
> 1) Display empty rows of data table in JSF, if the list which is bounded
> to datable is empty then I need to view atleast one empty row.
>  
> 2) UI has one datable and a form below it, I need to show the empty
> table if there are no records and there should be little space (gap)
> between Table and the form below. Currently there is no space between
> table and form and their position is also not fixed. Like as I add rows
> to the table the form below it is getting pushed below. How to fix the
> position of these two and also have a space between them.

<h:panelGroup rendered="#{mybean.numRecords == 0}">
  here goes the stuff you want to render when there are no records
</h:panelGroup>

<h:dataTable rendered="#{mybean.numRecords > 0}">
  here goes the normal table
</h:dataTable>


Regards, Simon
-- 
-- Emails in "mixed" posting style will be ignored
-- (http://en.wikipedia.org/wiki/Posting_style)