validation problem with JSF h:form and PrimeFaces p:dialog -


i have jsf page create form. form consists of variety of input fields , list of sub-elements.

to add sub-element, click "add element" link pops dialog box using primefaces p:dialog tag. it's similar login panel demo on prime faces page here, complete p:growl validation messages:

http://www.primefaces.org/showcase/ui/dialoglogin.jsf

my problem is, when click "add" in dialog box see growl validation messages fields in dialog box , fields on main form. want see messages dialog box.

is there way this? tried embedding form within form, didn't work. is, tried ...

<h:form>    <p:messages /> <!-- show validation messages create form contents -->    <h:inputtext value .../>    <h:datatable value .../> <!-- list of sub elements -->    <h:commandlink "shows add element dialog" ... />    <p:growl /> <!-- shows validation messages dialog contents -->    <p:dialog>       <h:form>         <h:inputtext value .../>         <p:commandbutton "validate dialog box fields add item list" .../>       </h:form>    </p:dialog>  </h:form> 

... didn't work. appreciated!

first of cannot embed 1 form in another. think not valid html.

p:growl behaves h:messages. shows messages elements of page (not limited 1 form). can limit global messages (messages no id) setting globalonly="true" attribute.

change commandbutton update p:growl , make sure ajax request fired commandbutton (ajax=true). p:commandbutton has ajax=true default behaviour. if didn't change explicitly, ajax request.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -