myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shane Petroff <sh...@mayet.ca>
Subject Re: DataTable with filtering option - presentation-wise
Date Mon, 07 May 2007 18:26:57 GMT
Gerald Müllan wrote:
> No, if you are working with the daily builds you got at least the 
> newest one.
>
> The null-reference is really strange since filteringTable itself seems
> to work and it already uses the dojo.widget namespace.
>
> Can you try to have a look into firebug or some other js-debugger, if
> there has any widget
> been created through the dojo environment, maybe with some other
> reference name? It must be located somewhere in the globally js object
> pool (dojo object).
OK, this is the first time I've used FireBug, so I'm not yet sure what 
I'm looking for.
Under inspect/DOM/dojo/, there are dozens of things, none of which I am 
terribly familiar with... If I open the page and navigate to:

dojo/widget

I can see what appears to be a reference to the table. That is,

dojo/widget/widgetIds

has a reference "aForm:filterTbl" which one would think was the 
appropriate object. ('aForm' is just an arbitrary id I assigned to the 
form to see if dojo could find the form - it can't...) Similarly

dojo/widget/widgets[0]

seems like it is pointing to the correct place. Is there something more 
specific which I should be looking for? Are there any issues with either 
tomcat or firefox versions? Thanks for your help.

--
Shane

>
> cheers,
>
> Gerald
>
> On 5/4/07, Shane Petroff <shane@mayet.ca> wrote:
>> Gerald Müllan wrote:
>> > Which version of tomahawk are you using?
>> Same results with 1.1.5 and 1.1.5-SNAPSHOT. Do I need something newer
>> than the daily builds?
>>
>> -- 
>> Shane
>>
>> >
>> > On 5/3/07, Shane Petroff <shane@mayet.ca> wrote:
>> >> Gerald Müllan wrote:
>> >> >
>> >> > have you considered to use s:filterTable from sandbox?
>> >> > ...
>> >> > http://example.irian.at/example-sandbox-20070502/filterTable.jsf
>> >> (derailing the thread slightly)
>> >>
>> >> Thanks for the reference, but I would love some help to get 
>> FilterTable
>> >> working. I've copied/pasted the example code into a page of mine, and
>> >> the java code into the backing bean. Everything renders fine, and the
>> >> table is sortable, but the function dojo.widget.byId returns null, so
>> >> the filter functions do not work. I've tried using 
>> dojo.widget.byId on
>> >> other named components, but it always seems to fail. Is there 
>> something
>> >> that needs to be configured or initialized before byId can work? I'm
>> >> using tomahawk sandbox 1.1.6 snapshot jar alongside the 1.1.5 
>> release.
>> >> The only difference I can see in the page is that I've nested the
>> >> FilterTable inside a form. The page is attached below.
>> >>
>> >>
>> >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>> >>
>> >> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
>> >> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
>> >> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
>> >> <%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s"%>
>> >>
>> >> <f:loadBundle basename="mytResource" var="bundle"/>
>> >>
>> >> <f:view>
>> >> <html>
>> >>   <head>
>> >>
>> >>     <title>
>> >>       <h:outputText value="#{bundle.PickSectionTitle}"/>
>> >>     </title>
>> >>
>> >>     <link rel="stylesheet" type="text/css" href="<%=
>> >> request.getContextPath() %>/stylesheet.css"/>
>> >>
>> >>     <script type="text/javascript">
>> >>       function manufacturerFilter(name){
>> >>         return (name.charAt(0) >= 'M' && name.charAt(0) <=
'Z');
>> >>       }
>> >>     </script>
>> >>   </head>
>> >>
>> >> <body class="page-background">
>> >>
>> >>
>> >> <h:form>
>> >>
>> >>   <h:panelGrid headerClass="page-header" styleClass="panel"
>> >>                columns="1" cellpadding="5">
>> >>
>> >>     <h:panelGrid headerClass="page-header" styleClass="panel"
>> >>                columns="1" cellpadding="5" align="right">
>> >>       <h:commandLink action="#{pickSectionBean.logout}"
>> >> value="#{bundle.Logout}"/>
>> >>     </h:panelGrid>
>> >>
>> >>     <%-- Header --%>
>> >>     <f:facet name="header">
>> >>       <h:outputText value="#{pickSectionBean.headerValue}"/>
>> >>     </f:facet>
>> >>
>> >>     <h:messages globalOnly="true" styleClass="errors"/>
>> >>
>> >>     <h:commandButton id="startActionListener" value="#{bundle.Home}"
>> >> action="#{pickSectionBean.onHome}" styleClass="button"/>
>> >>
>> >>     <f:verbatim>
>> >>         <input type="button" value="Show only manufacturers between M
>> >> and Z" 
>> onclick="dojo.widget.byId('filterTbl').setFilter('manufacturer',
>> >> manufacturerFilter);" />
>> >>         <input type="button" value="Clear Filters"
>> >> 
>> onclick="alert(dojo.widget.byId('filterTbl'));dojo.widget.byId('filterTbl').clearFilters()"

>>
>> >>
>> >> />
>> >>     </f:verbatim>
>> >>     <s:filterTable id="filterTbl" var="car"
>> >> value="#{pickSectionBean.cars}" >
>> >>         <s:sortableColumn field="id" dataType="Number" text="Id">
>> >>             <h:outputText value="#{car.id}" />
>> >>         </s:sortableColumn>
>> >>         <s:sortableColumn field="manufacturer" text="Manufacturer">
>> >>             <h:outputText value="#{car.manufacturer}" />
>> >>         </s:sortableColumn>
>> >>         <s:sortableColumn field="model" text="Model">
>> >>             <h:outputText value="#{car.model}" />
>> >>         </s:sortableColumn>
>> >>     </s:filterTable>
>> >>
>> >>   </h:panelGrid>
>> >>
>> >> </h:form>
>> >> </body>
>> >> </html>
>> >> </f:view>
>> >>
>> >> --
>> >> Shane
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>
>>
>> -- 
>> Shane
>>
>>
>
>


-- 
Shane


Mime
View raw message