0

I am new to JSF, checking related questions did not give me right answer.

I have 2 xhtml files. I specially delete all of items, like style, rendered, beans, etc. All the values displays good, but i cant make it update after pressing button.

1st of them named for example Description is a form with 3 tabs, each of them is a dataTable. Structure is a

<p:tabView id="tabs">
<p:tab id="first">
   <h:form id="one">
       <p:dataTable id="firstTable/>
   </h:form>
</p:tab>
<p:tab id="second">
   <h:form id="two">
       <p:dataTable id="secondTable/>
   </h:form>
</p:tab>
<p:tab id="third">
   <h:form id="three">
       <p:dataTable id="thirdTable/>
   </h:form>
</p:tab>

2nd is a dialog, opened by some button in other component, here i can edit some inputs, and with commandButton "Save"

<h:form id="dialog">
    <p:dataTable id="one">
        <p:column headerText="FirstColumn">
            <p:inputText onfocus="this.select()" id="newInput" 
                value="#{data['rmp']}"/>
        </p:column>
    </p:dataTable>
    <p:commandButton id="save" 
           actionListener="#{dialogView.submit}"/>
</h:form>

After pressing "save" button i want my 2nd tab in first xhtml to update and display new value. It is only updates after i refresh the page manually.

I tried to add update="@([id$=':tabs:second'])" but it doesn't work right. Please help me

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • `update=":tabs:second"` can do the work. Added to ` – Holger Oct 24 '18 at 13:31
  • @Holger The result isError Rendering View[/pages/dialogs/avoProtocol.xhtml] org.primefaces.expression.ComponentNotFoundException: Cannot find component for expression ":tabs:second" referenced from "dialog:save". – Chesnokov Sergei Oct 24 '18 at 13:42
  • Then take a look in your browser, which ids you can find. Possibly there is another id-maker around your tabview. i.e. `update=":maker:tabs:second"` – Holger Oct 24 '18 at 13:55
  • @Holger: https://stackoverflow.com/questions/8634156/how-to-find-out-client-\id-of-component-for-ajax-update-render-cannot-find-compo (form is a namingcontainer..._ – Kukeltje Oct 24 '18 at 14:18
  • @СергейЧесноков: Please always post an [mcve]. Not partial code... – Kukeltje Oct 24 '18 at 14:19
  • Possible duplicate of [How to find out client ID of component for ajax update/render? Cannot find component with expression "foo" referenced from "bar"](https://stackoverflow.com/questions/8634156/how-to-find-out-client-id-of-component-for-ajax-update-render-cannot-find-compo) – Kukeltje Oct 24 '18 at 14:19
  • Yes, the answer tells what I wrote: Look in your browser to get the correct ids. – Holger Oct 24 '18 at 14:30
  • @Kukeltje Sorry, will post full code next time. – Chesnokov Sergei Oct 25 '18 at 07:36
  • @Holger i found it already, but inserting it in "update" didnt help too. The problem is not in this. Also i put ajax with event dialogReturn and update="***" and it didnt help too – Chesnokov Sergei Oct 25 '18 at 07:39
  • Hi, no not **full** code, [mcve], and why _next time_? Did you solve your problem? – Kukeltje Oct 25 '18 at 08:57
  • Have you tried using a tag to handle the dialog return? – ChadNC Nov 21 '18 at 13:08

0 Answers0