I have a form where some fields should be disabled until the check box is clicked. JSF-Elements are working fine for all the problem is with primhese elements.
Like a dropdown list for a JSF-element, I like it:
& Lt; / H: selectOneMenu & gt;
For more primetime elements, such a calendar:
I have used to enable these elements on an event. Javascript is simple:
function enableLocationUpdateFilter () {document.getElementById ('form : DatePicker '). Disabled = false; }
Calling jQuery on-in-event:
jQuery ('countryCheckBoxId'). Change (function () {enableCountryFilter ();}); By checking the primmass element in firebug, I can see that the id "Date Peaking" only acts as "Spain" ID and the actual ID of the HTML Inputfield is "Date Picture_Input". Therefore, instead of using "datePicker" in JavaScript as an ID, try to use "datePicker_input", this field can be enabled, but the jQuery event that brought the actual calendar does not work. It also seems that the calendar is called through a jquery-event. In this jquery-event you can see that the default disabled is set to true. And I think this is a problem, I can not set that part to the wrong.
Regards
Best I can say that Ajax calls to the server and The calendar has to be re-provided. Can you tell me how this jQuery-Onaning Event is being triggered?
And I think you are using JSF 2.0, right?
Update:
To enable p: calendar
, when the checkbox is clicked, something similar should be done like this:
< Pre> & lt; H: selectBooleanCheckbox id = "countryCheckBoxId" value = "# {bean.countryBoolean}" & gt; & Lt; F: Ajax render = "date picture" /> & Lt; / H: selectBooleanCheckbox & gt; & Lt; P: calendars disabled = "# {! Bean.countryBoolean}" id = "datePicker" value = "dateValue" pattern = "yyyy-MM-dd" startWeekday = "1" timezone = "GMT" & gt; & Lt; / P: Calendar & gt;
Comments
Post a Comment