java - Access added values through jQuery UI widget inside ui:repeat in JSF -
- i have added ui:repeat within ul-list produce unordered list
- through jquery tag-it widget list get´s nicely editable (unfortunately primefaces doen't have similar component yet)
- when saving form can't access new created values (only values of other primefaces components)
xhtml
<ul id="keywordlist"> <ui:repeat value="#{bean.selectedobject.keywords}" var="keyword"> <li><h:outputtext value="#{keyword.name}" /></li> </ui:repeat> </ul>
bean
public class bean implements serializable { private myobject selectedobject; }
model
public list<string> getkeywords() { return keywords; } public void setkeywords(list<string> keywords) { this.keywords = keywords; }
any idea, how can access values added ul-list? thanks!
edit: bean session scoped
according documentation , demos jquery tag-it plugin autocreates hidden input element (configureable) name syntax item[tags][]
. should able grab http request parameter values map externalcontext#getrequestparametervaluesmap()
in jsf follows:
string[] tags = facescontext.getcurrentinstance().getexternalcontext() .getrequestparametervaluesmap().get("item[tags][]");
you set managed property, requires bean request scoped.
@managedproperty("#{paramvalues['item[tags][]']}") private string[] tags;
Comments
Post a Comment