jsf - rich:Jquery not working when use in a facelet component -
I have created a component that uses postal code with a rich mask: jquery,
The component code here:
& lt; H: inputText id = "# {id} -postal code" value = "# {myBeanPath.postalCode}" size = "7" /> & Lt; Rich: jQuery selector = "# postal code" query = "mask ('A9A 9A9')" timing = "onload" />
This works fine in standard JSF pages, but when it is not in the Facet component
What is the way to enrich: jQuery in the Facet component work? After playing for a while with component component it seems that the jquery code page is directly on the Facet component. Is generated in different ways. The HTML on the standbyte JSF page will look like this:
& lt; Td> & Lt; Script type = "text / javascript" & gt; // & lt ;! [CDATA [jQuery] .ready (function () {var selector = "#clientForm \\: postalCode"} {selector = eval ("# clientForm \\: postalCode");} hold (e) {} jQuery Selector) .Masque ('A9A 9A9');});
But one component contains code
& Lt; Script type = "text / javascript" & gt; // & lt ;! [CDATA [jQuery] .ready (function () {var selector = "#postalCode"} {tryor = eval ("# postalcode");} catcher (e) {} jQuery (selector) .mask ('a9a 9a9 ');});
Add an ID and fix the name of the form directly in the jquery selector so that the last code looks like this:
& Lt; Rich: jQuery selector = "# {form} \\: # {id} -Postal code" query = "mask ('A9A 9A9')" time = "onload" />
should work fine
Comments
Post a Comment