focus() not working in safari or chrome

I got the answer on my own, it might seem weak, and too simple, but it works. Ready for this awesomeness..? Just add a timer of 0 to the focus…for some reason it just gives it enough time to fully load the input into the DOM. function recipientDivHandler(code, element) { $(“#recipientsDiv”).append(‘<input type=”text” id=”toInput” class=”inlineBlockElement rightSpacer” … Read more

How to implement a dynamic list with a JSF 2.0 Composite Component?

I’d use a <h:dataTable> in a composite component with a backing UIComponent which you can bind by componentType attribute of the <composite:interface>. In the backing UIComponent you can then maintain the DataModel and define the actions. dynamicFieldList.xhtml <ui:composition xmlns:f=”http://java.sun.com/jsf/core” xmlns:h=”http://java.sun.com/jsf/html” xmlns:ui=”http://java.sun.com/jsf/facelets” xmlns:cc=”http://java.sun.com/jsf/composite” > <cc:interface componentType=”dynamicFieldList”> <cc:attribute name=”value” type=”java.util.List” required=”true” /> </cc:interface> <cc:implementation> <h:dataTable id=”table” binding=”#{cc.table}” … Read more

How to dynamically add JSF components

Use an iterating component like <h:dataTable> or <ui:repeat> to display a dynamically sized List of entities. Make the bean @ViewScoped to ensure that the list is remembered across postbacks on the same view instead of recreated over and over. Kickoff example with <h:dataTable> (when using <ui:repeat> simply replace <h:dataTable> by <ui:repeat>, and <h:column> by e.g. … Read more

tech