myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Max Starets <max.star...@oracle.com>
Subject Re: [Trinidad] Table range screws JavaScript on all other form elements
Date Mon, 21 Jun 2010 14:09:33 GMT
Dmitry,

The 'event' variable in your test case is not being passed into the 
listener method.
It is a global variable on the window object. I was suggesting that you 
try registering event listeners
in a different way that would ensure that the event object is being 
passed in as a parameter.

Another question - can you reproduce it in other browsers besides IE? 
Does IE8 behave the same way as IE7?

Regards,
Max Starets

Dmitry Barsukov wrote:
> Max,
>
> It was a bit of a misleading bug description initially.
>
> The bug should be described as: "Event object parameter of "onkeyup"
> JavaScript handler is being mistakenly unset when <tr:table> contains more
> than 1 range". This becomes apparent in the rectified example.
>
> However "event" object parameter is correct when there is no ranges
> navigation bar on the table, i.e. there is just one table range.
>
> The JS handlers do get called, but the "event" parameter passed is wrong
> when the table displays ranges navigation bar.
> For our application this is a critical bug because we need to capture
> pressed key code from the event object.
>
> The above could be easily observed with the example jsf form I showed
> earlier.
>
> Regards,
> Dmitry
>
> On 18 June 2010 22:05, Max Starets <max.starets@oracle.com> wrote:
>
>   
>> Dmitry,
>>
>> I guess you are saying that event.type  produces incorrect results if
>> the table navigation bar just happens to be on the page. This is definitely
>> strange.
>> I am not really familiar wit the navigation bar code, but I took a quick
>> look
>> to see if we are doing any event capturing there. I did not find anything.
>>
>> The 'event' javascript variable is global to the entire window. I would try
>> assigning a listener in javascript, so that you get the event passed in as
>> a parameter:
>>
>> function handleKeyUp(evt)
>> {
>>  alert (evt.type);
>> }
>>
>> document.getElementById("myClientId").onkeyup = handleKeyUp;
>>
>> Or (in IE):
>>
>> document.getElementById("myClientId").attachEvent('onkeyup', handleKeyUp);
>>
>> Regards,
>> Max
>>
>>
>>
>> Dmitry Barsukov wrote:
>>
>>     
>>> Rectified form (surely a bug!) :
>>>
>>> <?xml version="1.0" encoding="ISO-8859-1" ?>
>>> <f:view xmlns:f="http://java.sun.com/jsf/core"
>>>        xmlns:tr="http://myfaces.apache.org/trinidad"
>>>        xmlns:trh="http://myfaces.apache.org/trinidad/html">
>>>    <trh:html>
>>>        <trh:head><title>TABLE BUG TEST CASE</title></trh:head>
>>>        <trh:body>
>>>            <tr:form id="frm_main">
>>>                    <tr:inputText id="it_search" onkeyup="alert('onkeyup:
>>> event.type='+event.type);"/>
>>>                    <tr:commandButton text="placebo"/>
>>>                    <tr:table id="tbl_result" rows="50"
>>> value="#{tblBugList}" var="row">
>>>                        <tr:column > <tr:outputText value="#{row}"/>
>>> </tr:column>
>>>                    </tr:table>
>>>            </tr:form>
>>>        </trh:body>
>>>    </trh:html>
>>> </f:view>
>>>
>>> tblBugList bean:
>>>
>>> <managed-bean>
>>>      <managed-bean-name>tblBugList</managed-bean-name>
>>>      <managed-bean-class>java.util.ArrayList</managed-bean-class>
>>>      <managed-bean-scope>session</managed-bean-scope>
>>>      <list-entries>
>>>        <value-class>java.lang.String</value-class>
>>>        <value>LINE ONE</value>
>>>        <value>LINE TWO</value>
>>>        <value>LINE THREE</value>
>>>      </list-entries>
>>>  </managed-bean>
>>>
>>> If <tr:table> attribute "rows" is set to "2" then "event" object passed
to
>>> JavaScript onkeyup event is screwed, i.e. it must point to event.type
>>> "onkeyup" but it shows "hidden" instead of "onkeyup".
>>>
>>> If "rows" attribute is set to > 3, i.e. table does not display ranges bar,
>>> then event object is correct and it points to event.type "onkeyup". There
>>> is
>>> a feeling that all other JS handlers/events are handled similarly.
>>>
>>> This does sound like a bug to me. It is also quite critical to our
>>> application.
>>>
>>> Regards,
>>> Dmitry
>>>
>>>
>>>
>>>       
>>     
>
>
>   


Mime
View raw message