0

i am using jsf 2.2 primefaces 5. I have a composite component with an input text field and a dialog. And i have reset button with resetInput. Inside composite component:

<cc:implementation>
    <h:inputText value="#{cc.attrs.inputValue}" id="selectCountry"  size="5" />
    <p:dialog header="Select" modal="true" appendTo="@(body)" dynamic="true" >
        <p:dataGrid var="item" columns="4" ...

And reset button :

<p:commandButton value="Reset" immediate="true">  
     <p:resetInput target="@form" />
</p:commandButton>

The problem is when i press the reset button the form, the composite component, the dialog box and the datagrid inside the dialog are reloaded. But i wish only to reset the input fields inside the form and the input field composite component.

I think i can do by moving dialog outside of the form in the component tree. How can i move it? Or any other solution to this problem?

  • Note : I tried to use parent attribute for dialog(eg. parent="@body"). But everything i write to parent gives exception.
acpuma
  • 479
  • 5
  • 15

1 Answers1

0

Why dont you put your commandButton with inputText into a separate form tag.

Szarpul
  • 1,531
  • 11
  • 21
  • the problem is not about the commandButton, it is about the dialog and datagrid reload. – acpuma Jun 11 '14 at 19:32
  • yes, cant you add form tag with all inputTexts and commandButtons into your impelmentation part, and after that, put a dialog? – Szarpul Jun 12 '14 at 07:43