You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Claudio Tasso <ta...@libero.it> on 2006/01/15 17:56:57 UTC

Resources for org.apache.myfaces.component.html.ext.* classes

Hi,
I'm trying to develop a new feature for  t:dataTable (Tomahawk HtmlDataTable), in order to add a "detail" for a row.
My goal is explained in the message below, which is a discussion posted in the users list between me and Martin Marinschek.
During the development of this new feature, I'm facing the following problem.
The HtmlDataTable class (or the HtmlTableRenderer) does not belong to the "org.apache.myfaces.custom" package, so MyFacesResourceHandler can't be used for loading images or other resources.
But loading images  used by  the HtmlDataTable is what I want to obtain.
How do you think I should solve this problem?
Should I implement another ResourceHandler?
Or the current MyFacesResourceHandler should be modified?

Thanks a lot for your help.

---------------------------------------------------------------------
Sounds interesting.

I've had this problem before, and did solve it in a non-perfect way.

Essentially, I had to get rid of all columns - rendered out one
column, and made sure the columns of different rows would align by
using CSS and did the rest by hand.

I like the idea, though! Maybe you should add a feature request or go
even further and send us a patch?

regards,

Martin

On 12/26/05, Claudio Tasso <ta...@libero.it> wrote:

>> Hi,
>> I'm starting using Tomahawk components and I find them very useful. My
>> previuous experience dealt with Oracle ADF components, but they are full
>> of bugs and not flexible.
>> But there's one feature of ADF table which is very nice.
>> Inside a datatable it is possible specifying a facet called
>> "detailStamp". This is an example:
>>
>> <af:table value="#{myManagedBean.allEmployees}"
>>    var="emp">
>>        <f:facet name="detailStamp">
>>                <h:outputText value="#{emp.address}"/>
>>        </f:facet>
>>        <h:column>
>>                <f:facet name="header">
>>                        <h:outputText value="Name"/>
>>                </f:facet>
>>                <h:outputText value="#{emp.address}"/>
>>        </h:column>
>> </af:table>
>>
>>
>> The result is this: there's a column called "details" which contains a
>> button, this button shows/hide the detail. Suppose that there are two
>> rows. The initial state of the rendered table is this:
>>
>> <table>
>>    <tr>
>>       <th>details</th>
>>       <th>Name</th>
>>    </tr>
>>    <tr>
>>          <td><a href="SHOW_DETAIL"><img src="show.gif"/></a></td>
>>          <td>John Smith</td>
>>    </tr>
>>    <tr>
>>          <td><a href="SHOW_DETAIL"><img src="show.gif"/></a></td>
>>          <td>Ed Ross</td>
>>    </tr>
>> </table>
>>
>> When the user clicks  on the detail of the first row, a new row is
>> displayed below the current row, so this is the result:
>>
>> <table>
>>    <tr>
>>       <th>details</th>
>>       <th>Name</th>
>>    </tr>
>>    <tr>
>>          <td><a href="HIDE_DETAIL"><img src="hide.gif"/></a></td>
>>          <td>John Smith</td>
>>    </tr>
>>    <tr>
>>          <td colspan="2">Washington Avenue, Springfield, USA</td>
>>    </tr>
>>    <tr>
>>          <td><a href="SHOW_DETAIL"><img src="show.gif"/></a></td>
>>          <td>Ed Ross</td>
>>    </tr>
>> </table>
>>
>>
>> The idea behind this component can be summurized as follows: every row
>> in the table can be associated to a detail, which can be visibile or
>> hidden according to the user action. When the user clicks on the show
>> button, the content of the facet is displayed as a new ROW under the
>> current row.
>>
>> Now I'm wondering if something similar exists in Tomahawk or Sandbox.
>> Pheraps, composing the existing components may produce the same result.
>> If  it doesn't exist, I suppose that implementing it could be very useful.
>> Please, tell me your opinions.
>>
>>
>  
>


Re: Resources for org.apache.myfaces.component.html.ext.* classes

Posted by Claudio Tasso <ta...@libero.it>.
Ok, now I'll continue my work with a temporary implementation of the 
MyFacesResourceHandler, waiting for the official patch.
Do you think that I should insert an improvement request in JIRA?


Martin Marinschek ha scritto:

>I think we should modify the current resource-handler to allow for
>serving resources out of the datatable directory as well.
>
>regards,
>
>Martin
>
>On 1/15/06, Claudio Tasso <ta...@libero.it> wrote:
>  
>
>>Hi,
>>I'm trying to develop a new feature for  t:dataTable (Tomahawk HtmlDataTable), in order to add a "detail" for a row.
>>My goal is explained in the message below, which is a discussion posted in the users list between me and Martin Marinschek.
>>During the development of this new feature, I'm facing the following problem.
>>The HtmlDataTable class (or the HtmlTableRenderer) does not belong to the "org.apache.myfaces.custom" package, so MyFacesResourceHandler can't be used for loading images or other resources.
>>But loading images  used by  the HtmlDataTable is what I want to obtain.
>>How do you think I should solve this problem?
>>Should I implement another ResourceHandler?
>>Or the current MyFacesResourceHandler should be modified?
>>
>>Thanks a lot for your help.
>>
>>    
>>

Re: Resources for org.apache.myfaces.component.html.ext.* classes

Posted by Martin Marinschek <ma...@gmail.com>.
I think we should modify the current resource-handler to allow for
serving resources out of the datatable directory as well.

regards,

Martin

On 1/15/06, Claudio Tasso <ta...@libero.it> wrote:
> Hi,
> I'm trying to develop a new feature for  t:dataTable (Tomahawk HtmlDataTable), in order to add a "detail" for a row.
> My goal is explained in the message below, which is a discussion posted in the users list between me and Martin Marinschek.
> During the development of this new feature, I'm facing the following problem.
> The HtmlDataTable class (or the HtmlTableRenderer) does not belong to the "org.apache.myfaces.custom" package, so MyFacesResourceHandler can't be used for loading images or other resources.
> But loading images  used by  the HtmlDataTable is what I want to obtain.
> How do you think I should solve this problem?
> Should I implement another ResourceHandler?
> Or the current MyFacesResourceHandler should be modified?
>
> Thanks a lot for your help.
>
> ---------------------------------------------------------------------
> Sounds interesting.
>
> I've had this problem before, and did solve it in a non-perfect way.
>
> Essentially, I had to get rid of all columns - rendered out one
> column, and made sure the columns of different rows would align by
> using CSS and did the rest by hand.
>
> I like the idea, though! Maybe you should add a feature request or go
> even further and send us a patch?
>
> regards,
>
> Martin
>
> On 12/26/05, Claudio Tasso <ta...@libero.it> wrote:
>
> >> Hi,
> >> I'm starting using Tomahawk components and I find them very useful. My
> >> previuous experience dealt with Oracle ADF components, but they are full
> >> of bugs and not flexible.
> >> But there's one feature of ADF table which is very nice.
> >> Inside a datatable it is possible specifying a facet called
> >> "detailStamp". This is an example:
> >>
> >> <af:table value="#{myManagedBean.allEmployees}"
> >>    var="emp">
> >>        <f:facet name="detailStamp">
> >>                <h:outputText value="#{emp.address}"/>
> >>        </f:facet>
> >>        <h:column>
> >>                <f:facet name="header">
> >>                        <h:outputText value="Name"/>
> >>                </f:facet>
> >>                <h:outputText value="#{emp.address}"/>
> >>        </h:column>
> >> </af:table>
> >>
> >>
> >> The result is this: there's a column called "details" which contains a
> >> button, this button shows/hide the detail. Suppose that there are two
> >> rows. The initial state of the rendered table is this:
> >>
> >> <table>
> >>    <tr>
> >>       <th>details</th>
> >>       <th>Name</th>
> >>    </tr>
> >>    <tr>
> >>          <td><a href="SHOW_DETAIL"><img src="show.gif"/></a></td>
> >>          <td>John Smith</td>
> >>    </tr>
> >>    <tr>
> >>          <td><a href="SHOW_DETAIL"><img src="show.gif"/></a></td>
> >>          <td>Ed Ross</td>
> >>    </tr>
> >> </table>
> >>
> >> When the user clicks  on the detail of the first row, a new row is
> >> displayed below the current row, so this is the result:
> >>
> >> <table>
> >>    <tr>
> >>       <th>details</th>
> >>       <th>Name</th>
> >>    </tr>
> >>    <tr>
> >>          <td><a href="HIDE_DETAIL"><img src="hide.gif"/></a></td>
> >>          <td>John Smith</td>
> >>    </tr>
> >>    <tr>
> >>          <td colspan="2">Washington Avenue, Springfield, USA</td>
> >>    </tr>
> >>    <tr>
> >>          <td><a href="SHOW_DETAIL"><img src="show.gif"/></a></td>
> >>          <td>Ed Ross</td>
> >>    </tr>
> >> </table>
> >>
> >>
> >> The idea behind this component can be summurized as follows: every row
> >> in the table can be associated to a detail, which can be visibile or
> >> hidden according to the user action. When the user clicks on the show
> >> button, the content of the facet is displayed as a new ROW under the
> >> current row.
> >>
> >> Now I'm wondering if something similar exists in Tomahawk or Sandbox.
> >> Pheraps, composing the existing components may produce the same result.
> >> If  it doesn't exist, I suppose that implementing it could be very useful.
> >> Please, tell me your opinions.
> >>
> >>
> >
> >
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces