You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Galen Dunkleberger (JIRA)" <my...@incubator.apache.org> on 2005/04/12 16:28:17 UTC

[jira] Created: (MYFACES-181) onchange attribute for x:inputCalendar

onchange attribute for x:inputCalendar
--------------------------------------

         Key: MYFACES-181
         URL: http://issues.apache.org/jira/browse/MYFACES-181
     Project: MyFaces
        Type: Improvement
 Environment: Fedora Core 3, Weblogic 8.1|JBoss 4
    Reporter: Galen Dunkleberger
    Priority: Trivial


I know this is super trivial but it would be nice to have the onchange attribute available for the calendar component. Both for when the user selected a new date via the popup or if they enter a new date in the input box. I think it's really just a matter of adding the onchange attribute to the tag and adding a small line in the javascript....

function jscalendarCloseCalendar() {
	jscalendarHideCalendar();
	
	if( jscalendarMyFacesCtlType!="x:inputDate" )
	{
		jscalendarCtlToPlaceValue.value = jscalendarConstructDate(jscalendarDateSelected,jscalendarMonthSelected,jscalendarYearSelected)
		var onchange=jscalendarCtlToPlaceValue.getAttribute("onchange");
		if(onchange)
		{
			eval(onchange);
		}
	}
	else
	{
		document.getElementById(jscalendarMyFacesInputDateClientId+".day").value = jscalendarDateSelected;
		document.getElementById(jscalendarMyFacesInputDateClientId+".month").value = jscalendarMonthSelected+1;
		document.getElementById(jscalendarMyFacesInputDateClientId+".year").value = jscalendarYearSelected;
	}
}




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-181) onchange attribute for x:inputCalendar

Posted by "Rob Decker (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-181?page=comments#action_62896 ]
     
Rob Decker commented on MYFACES-181:
------------------------------------

Adding pass-through html attributes shouldn't just be arbitrarily decided by whether or not the component developer thinks it is useful. They should be added becuase they belong to the element used per the html spec. Leaving them off just means limiting what a user can do with the component. It's not an improvement, it's a bug that an input component doesn't have an onchange attribute. 

> onchange attribute for x:inputCalendar
> --------------------------------------
>
>          Key: MYFACES-181
>          URL: http://issues.apache.org/jira/browse/MYFACES-181
>      Project: MyFaces
>         Type: Improvement
>  Environment: Fedora Core 3, Weblogic 8.1|JBoss 4
>     Reporter: Galen Dunkleberger
>     Priority: Trivial

>
> I know this is super trivial but it would be nice to have the onchange attribute available for the calendar component. Both for when the user selected a new date via the popup or if they enter a new date in the input box. I think it's really just a matter of adding the onchange attribute to the tag and adding a small line in the javascript....
> function jscalendarCloseCalendar() {
> 	jscalendarHideCalendar();
> 	
> 	if( jscalendarMyFacesCtlType!="x:inputDate" )
> 	{
> 		jscalendarCtlToPlaceValue.value = jscalendarConstructDate(jscalendarDateSelected,jscalendarMonthSelected,jscalendarYearSelected)
> 		var onchange=jscalendarCtlToPlaceValue.getAttribute("onchange");
> 		if(onchange)
> 		{
> 			eval(onchange);
> 		}
> 	}
> 	else
> 	{
> 		document.getElementById(jscalendarMyFacesInputDateClientId+".day").value = jscalendarDateSelected;
> 		document.getElementById(jscalendarMyFacesInputDateClientId+".month").value = jscalendarMonthSelected+1;
> 		document.getElementById(jscalendarMyFacesInputDateClientId+".year").value = jscalendarYearSelected;
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira