You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "richard lee (JIRA)" <de...@myfaces.apache.org> on 2008/01/28 10:57:34 UTC

[jira] Created: (TOMAHAWK-1183) inputCalendar setfocus not working

inputCalendar setfocus not working
----------------------------------

                 Key: TOMAHAWK-1183
                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1183
             Project: MyFaces Tomahawk
          Issue Type: Bug
    Affects Versions: 1.1.6
         Environment: windows xp
            Reporter: richard lee


The inputCalendar tag / component is not rendering javascript entered for the setfocus property. I'm attempting to add some custom javascript to the setfocus of an inputcalendar to be run when the user clicks in the input box associated with the calendar, but this is being ignored during the redering of the input box. The only javascript that gets rendered is the "standard" javascript , i.e. onfocus="selectText('null', 'con9n')".

I believe the issue is in HtmlTextHelpRenderer:

if(isSelectText(component))
            {
                HtmlRendererUtils.renderHTMLAttributes(writer, component,
                                                       HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK);
                writer.writeAttribute(HTML.ONFOCUS_ATTR,
                                      HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
                                      getHelpText(component) + "', '" + id +"')", null);
                writer.writeAttribute(HTML.ONCLICK_ATTR,
                                      HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
                                      getHelpText(component) + "', '" + id +"')", null);

            }

when writing out the HTML.ONFOCUS_ATTR is should write out any user specified onfocus attributes as well as the standard ones.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TOMAHAWK-1183) onFocus and some html properties rendered twice or not rendered (inputCalendar setfocus not working)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOMAHAWK-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved TOMAHAWK-1183.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.8-SNAPSHOT
         Assignee: Leonardo Uribe

thanks to Paul Rivera for provide us this patch

> onFocus and some html properties rendered twice or not rendered (inputCalendar setfocus not working)
> ----------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1183
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1183
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: windows xp
>            Reporter: richard lee
>            Assignee: Leonardo Uribe
>             Fix For: 1.1.8-SNAPSHOT
>
>         Attachments: myfaces-shared-2.0.9.patch, myfaces-shared-3.0.4.patch, testcases.rar, testcases2.rar, testExampleOverMyfacesImpl.patch, tomahawk-1.1.7.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The inputCalendar tag / component is not rendering javascript entered for the setfocus property. I'm attempting to add some custom javascript to the setfocus of an inputcalendar to be run when the user clicks in the input box associated with the calendar, but this is being ignored during the redering of the input box. The only javascript that gets rendered is the "standard" javascript , i.e. onfocus="selectText('null', 'con9n')".
> I believe the issue is in HtmlTextHelpRenderer:
> if(isSelectText(component))
>             {
>                 HtmlRendererUtils.renderHTMLAttributes(writer, component,
>                                                        HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK);
>                 writer.writeAttribute(HTML.ONFOCUS_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>                 writer.writeAttribute(HTML.ONCLICK_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>             }
> when writing out the HTML.ONFOCUS_ATTR is should write out any user specified onfocus attributes as well as the standard ones.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1183) inputCalendar setfocus not working

Posted by "Paul Rivera (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627662#action_12627662 ] 

Paul Rivera commented on TOMAHAWK-1183:
---------------------------------------

Hmm...

Looking back at this line:
In HtmlTextHelpRenderer.renderHelpTextAttributes() L123:
HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK); 

It seems strange that in tomahawk12, the INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK array contains 'onfocus'.  Its variable name says that it should not have disabled, onfocus and onclick.

I think the original intent of the code for rendering HtmlInputTextHelp was to have only one handler for onfocus and one handler for onclick.  Any handlers for onfocus and onclick supplied by the user are discarded.  Here's the code block:
                HtmlRendererUtils.renderHTMLAttributes(writer, component,
                                                       HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK);
                writer.writeAttribute(HTML.ONFOCUS_ATTR,
                                      HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
                                      getHelpText(component) + "', '" + id +"')", null);
                writer.writeAttribute(HTML.ONCLICK_ATTR,
                                      HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
                                      getHelpText(component) + "', '" + id +"')", null);
It specifically uses a string array that doesn't contain onfocus and onclick.  This is why both onfocus and onclick do not work in inputCalendar of tomahawk 1.1.6.

Onclick also doesn't work for inputCalendar of tomahawk12.  Although, onfocus does work in inputCalendar of tomahawk12.  This is the inconsistency.

EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK does affect a couple of other components.  I'll have to look into this some more.

> inputCalendar setfocus not working
> ----------------------------------
>
>                 Key: TOMAHAWK-1183
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1183
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: windows xp
>            Reporter: richard lee
>         Attachments: tomahawk-1183.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The inputCalendar tag / component is not rendering javascript entered for the setfocus property. I'm attempting to add some custom javascript to the setfocus of an inputcalendar to be run when the user clicks in the input box associated with the calendar, but this is being ignored during the redering of the input box. The only javascript that gets rendered is the "standard" javascript , i.e. onfocus="selectText('null', 'con9n')".
> I believe the issue is in HtmlTextHelpRenderer:
> if(isSelectText(component))
>             {
>                 HtmlRendererUtils.renderHTMLAttributes(writer, component,
>                                                        HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK);
>                 writer.writeAttribute(HTML.ONFOCUS_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>                 writer.writeAttribute(HTML.ONCLICK_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>             }
> when writing out the HTML.ONFOCUS_ATTR is should write out any user specified onfocus attributes as well as the standard ones.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1183) inputCalendar setfocus not working

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633590#action_12633590 ] 

Leonardo Uribe commented on TOMAHAWK-1183:
------------------------------------------

Hi Paul

Thanks a lot for take a look at this in deep. I have checked the test and the resume and I have some observations to do.

1. The patch it is ok, that task is necessary to make sure the changes introduced are consistent, but for HtmlFormRendererTest, since shale-test 1.1.0 is not released yet, we need the following workaroud:

    //fix for SHALE-468
    public class MockTestViewHandler extends MockViewHandler
    {
        public void writeState(FacesContext context)
        {
            //Do not do anything.
        }
    }
    
    public void setUp()
    {
        super.setUp();

        //fix for SHALE-468
        application.setViewHandler(new MockTestViewHandler());

after apply the patch, no test should fail (the idea is trunk must always compile)

2. Some test has license header like this (the first is preferred):

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

Others this license:

/*
 * Copyright 2006 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

And others do not have anyone. Please update the patch so the new files had just one unique license header.

3. TOMAHAWK-1335 and the problem with HtmlSwapImageRenderer should be solved (with different patches and different issues ) at the same time we solve this.

4. Then it could be good to have this test for sandbox components too.

> inputCalendar setfocus not working
> ----------------------------------
>
>                 Key: TOMAHAWK-1183
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1183
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: windows xp
>            Reporter: richard lee
>         Attachments: myfaces-shared-2.0.9.patch, myfaces-shared-3.0.4.patch, testcases.rar, testExampleOverMyfacesImpl.patch, tomahawk-1.1.7.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The inputCalendar tag / component is not rendering javascript entered for the setfocus property. I'm attempting to add some custom javascript to the setfocus of an inputcalendar to be run when the user clicks in the input box associated with the calendar, but this is being ignored during the redering of the input box. The only javascript that gets rendered is the "standard" javascript , i.e. onfocus="selectText('null', 'con9n')".
> I believe the issue is in HtmlTextHelpRenderer:
> if(isSelectText(component))
>             {
>                 HtmlRendererUtils.renderHTMLAttributes(writer, component,
>                                                        HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK);
>                 writer.writeAttribute(HTML.ONFOCUS_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>                 writer.writeAttribute(HTML.ONCLICK_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>             }
> when writing out the HTML.ONFOCUS_ATTR is should write out any user specified onfocus attributes as well as the standard ones.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1183) inputCalendar setfocus not working

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627550#action_12627550 ] 

Leonardo Uribe commented on TOMAHAWK-1183:
------------------------------------------

comparing shared trunk 2.0.x with 3.0.x it seems that onfocus and onblur where added on 3.0.x Html.EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK array. So, it is necessary to check is some side effects happens when this patch is applied on trunk 2.0.x (remember shared 2.0.x is used by myfaces core and tomahawk)

> inputCalendar setfocus not working
> ----------------------------------
>
>                 Key: TOMAHAWK-1183
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1183
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: windows xp
>            Reporter: richard lee
>         Attachments: tomahawk-1183.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The inputCalendar tag / component is not rendering javascript entered for the setfocus property. I'm attempting to add some custom javascript to the setfocus of an inputcalendar to be run when the user clicks in the input box associated with the calendar, but this is being ignored during the redering of the input box. The only javascript that gets rendered is the "standard" javascript , i.e. onfocus="selectText('null', 'con9n')".
> I believe the issue is in HtmlTextHelpRenderer:
> if(isSelectText(component))
>             {
>                 HtmlRendererUtils.renderHTMLAttributes(writer, component,
>                                                        HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK);
>                 writer.writeAttribute(HTML.ONFOCUS_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>                 writer.writeAttribute(HTML.ONCLICK_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>             }
> when writing out the HTML.ONFOCUS_ATTR is should write out any user specified onfocus attributes as well as the standard ones.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1183) inputCalendar setfocus not working

Posted by "Paul Rivera (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628394#action_12628394 ] 

Paul Rivera commented on TOMAHAWK-1183:
---------------------------------------

I've checked in the svn comments and found out that the addition of ONBLUR_ATTR, ONFOCUS_ATTR to MyFaces Shared 3.0.x Html.EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK was intended to fix MYFACES-1608.  Although, this fix has affected:

- HtmlButtonRendererBase
    This class uses BUTTON_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONCLICK.  After the change made for MYFACES-1608, onfocus appears twice in this string array.  If you have a commandButton in your page that has an onfocus attribute, onfocus will be rendered twice.

- HtmlTextHelpRenderer
    This class uses INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK and expects this array to _not_ contain 'onfocus' and 'onclick' because it has selectText() and resetHelp() functions that need to be called in onfocus and onclick.  After the change made for MYFACES-1608, the 'onfocus' attribute gets added into INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK and causes the onfocus attribute to be rendered twice.

The patch above will:
- rollback changes made by MYFACES-1608.  Instead of modifying EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK, the fix for MYFACES-1608 has been placed in ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_ONCLICK_WITHOUT_STYLE and ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE to reduce the impact.

The array ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_ONCLICK_WITHOUT_STYLE is used by HtmlLinkRendererBase and ToggleLinkRenderer. ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE is used by HtmlLinkRendererBase.  I've already tested the fix on both myfaces shared 2.0.x and 3.0.x and it does solve MYFACES-1608.

HtmlButtonRendererBase will also no longer render onfocus attribute twice.

- fixes HtmlTextHelpRenderer.renderHelpTextAttributes().  We should not have multiple onfocus or onclick attributes rendered.  If the user supplies some onfocus javascript function, we should add it like:
onfocus="selectText('Enter Birthdate Here', 'mainForm:birthdate');someUserFunction()"
This implementation is similar to what ToggleLinkRenderer does in buildOnclickToggleFunction().
I've already tested this and onfocus now works on both tomahawk 1.1.x and tomahawk 1.2.x.

the patch fixes both inputCalendar rendered as popup or inline.

- fixes ToggleLink to be able to process onfocus and onblur events.

It seems like we have a lot of changes here.  But I can't really separate them to be able to solve this issue.

> inputCalendar setfocus not working
> ----------------------------------
>
>                 Key: TOMAHAWK-1183
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1183
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: windows xp
>            Reporter: richard lee
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The inputCalendar tag / component is not rendering javascript entered for the setfocus property. I'm attempting to add some custom javascript to the setfocus of an inputcalendar to be run when the user clicks in the input box associated with the calendar, but this is being ignored during the redering of the input box. The only javascript that gets rendered is the "standard" javascript , i.e. onfocus="selectText('null', 'con9n')".
> I believe the issue is in HtmlTextHelpRenderer:
> if(isSelectText(component))
>             {
>                 HtmlRendererUtils.renderHTMLAttributes(writer, component,
>                                                        HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK);
>                 writer.writeAttribute(HTML.ONFOCUS_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>                 writer.writeAttribute(HTML.ONCLICK_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>             }
> when writing out the HTML.ONFOCUS_ATTR is should write out any user specified onfocus attributes as well as the standard ones.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1183) inputCalendar setfocus not working

Posted by "Paul Rivera (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633063#action_12633063 ] 

Paul Rivera commented on TOMAHAWK-1183:
---------------------------------------

I've attached the test cases and the results in testcases.rar here.

These basically test:

(w/o patch)
myfaces core 1.1
myfaces core 1.2
tomahawk 1.1
tomahawk 1.2

(w/ patch)
myfaces core 1.1
myfaces core 1.2
tomahawk 1.1
tomahawk 1.2

The tests cover both myfaces shared 2.0.x and 3.0.x.

In the spreadsheet included inside the zip file, you can see the test results for all.  In summary:
The patches originally provided (myfaces-shared-2.0.9.patch, myfaces-shared-3.0.4.patch, and tomahawk-1.1.7.patch) have not introduced additional bugs yet still fixes the bug in MYFACES-1608.

There are existing bugs uncovered:
  - SelectOneRowRenderer: Onclick rendered multiple times.
  - HtmlSwapImageRenderer: Onmouseover and onmouseout rendered multiple times.  (I will have to verify his one since onmouseout and onmouseover are not defined in tomahawk.tld for the swapImage tag.)


> inputCalendar setfocus not working
> ----------------------------------
>
>                 Key: TOMAHAWK-1183
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1183
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: windows xp
>            Reporter: richard lee
>         Attachments: myfaces-shared-2.0.9.patch, myfaces-shared-3.0.4.patch, testcases.rar, testExampleOverMyfacesImpl.patch, tomahawk-1.1.7.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The inputCalendar tag / component is not rendering javascript entered for the setfocus property. I'm attempting to add some custom javascript to the setfocus of an inputcalendar to be run when the user clicks in the input box associated with the calendar, but this is being ignored during the redering of the input box. The only javascript that gets rendered is the "standard" javascript , i.e. onfocus="selectText('null', 'con9n')".
> I believe the issue is in HtmlTextHelpRenderer:
> if(isSelectText(component))
>             {
>                 HtmlRendererUtils.renderHTMLAttributes(writer, component,
>                                                        HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK);
>                 writer.writeAttribute(HTML.ONFOCUS_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>                 writer.writeAttribute(HTML.ONCLICK_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>             }
> when writing out the HTML.ONFOCUS_ATTR is should write out any user specified onfocus attributes as well as the standard ones.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1183) inputCalendar setfocus not working

Posted by "Paul Rivera (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634577#action_12634577 ] 

Paul Rivera commented on TOMAHAWK-1183:
---------------------------------------

I've attached the revised set of test cases above as testcases2.rar.

Changes made:
  - the workaround for shale-test
  - consistent license headers
  - new test cases for sandbox 1.1 and sandbox 1.2
  - test results

I've created new issues for uncovered bugs:
MYFACES-1981
TOMAHAWK-1335
TOMAHAWK-1337
TOMAHAWK-1340
TOMAHAWK-1342
TOMAHAWK-1343

All of them already have patches available.

After applying their patches, ALL test cases provided above will succeed.

> inputCalendar setfocus not working
> ----------------------------------
>
>                 Key: TOMAHAWK-1183
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1183
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: windows xp
>            Reporter: richard lee
>         Attachments: myfaces-shared-2.0.9.patch, myfaces-shared-3.0.4.patch, testcases.rar, testcases2.rar, testExampleOverMyfacesImpl.patch, tomahawk-1.1.7.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The inputCalendar tag / component is not rendering javascript entered for the setfocus property. I'm attempting to add some custom javascript to the setfocus of an inputcalendar to be run when the user clicks in the input box associated with the calendar, but this is being ignored during the redering of the input box. The only javascript that gets rendered is the "standard" javascript , i.e. onfocus="selectText('null', 'con9n')".
> I believe the issue is in HtmlTextHelpRenderer:
> if(isSelectText(component))
>             {
>                 HtmlRendererUtils.renderHTMLAttributes(writer, component,
>                                                        HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_ONFOCUS_AND_ONCLICK);
>                 writer.writeAttribute(HTML.ONFOCUS_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>                 writer.writeAttribute(HTML.ONCLICK_ATTR,
>                                       HtmlInputTextHelp.JS_FUNCTION_SELECT_TEXT + "('" +
>                                       getHelpText(component) + "', '" + id +"')", null);
>             }
> when writing out the HTML.ONFOCUS_ATTR is should write out any user specified onfocus attributes as well as the standard ones.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.