commandButton's action method not called because of unvisible java script 
exception on field conversion.
--------------------------------------------------------------------------------------------------------

                 Key: TRINIDAD-2149
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2149
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Components
    Affects Versions: 2.0.0-core, 1.2.14-core , 1.2.13-core 
         Environment: WinXP, java 1.6.0_22, JBoss 1.5.0_GA containing Mojarra 
JSF Implementation 1.2_12-b01-FCS,  jsf facelets 1.1.15, Apache Trinidad 1.2.13
            Reporter: Martin Walla


I have a form with several tr:inputText fields and tr:selectBooleanCheckbox 
checkboxes  and some tr:commandButton buttons for "Save" and "Apply".
One inputText's value refer to a java Integer property of a BackingBean.

With the tr:selectBooleanCheckbox (with autoSubmit="true" and immediate="true") 
i control the "disabled" attribute of the tr:inputText (with negated value of 
the checkbox).

When the page is loaded and the initial value of the checkBox is true so that 
the "disabled" of the inputText is false everything is OK.
When the page is loaded and the initial value of the checkBox is false so that 
the "disabled" of the inputText is true then when i select the checkBox (via the
immediate=true) the inputText is enabled. Then i entered an Integer value and 
pressed my commandButton's but the form isn't submitted (action isn't called).

I debugged the javascript and found out following:
In the OK case the javascript object window._locale is defined to "en" after 
the page is loaded.
In the faulty case  the javascript object window._locale is undefined.

This causes a javascript exception ("object doesn't exist") on the first 
statement "var language = _locale;" of the javascript function 
"getUserLanguage" in file adf/jsLibs/Locale.js.


function getUserLanguage()
{
  var language = _locale;

  if (language == null)
  {
    // try this the IE way
    language =  window.navigator.userLanguage;
    
    if (language == null)
    {
      // try this the Netscape way
      language = window.navigator.language;
    }
  }
  
  // return language;
  return language;
}



I fixed that for my purpose with javascript added to my concerned page to set 
the _locale if it isn't set.

<trh:script text="if (window._locale==undefined) window._locale='en';" />





--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to