0

Hey I have a iframe and a command button, I want to only load the iframe by changing the src using a command button in primefaces. But as I press the button the bean itself dosen't gets called. The same works for me when I do something like ajax=false in command button. Here is code sample any help would be highly appreciated.

  <h: form>
  <p:commandButton title="Next-Step" value="Next-Step"
                             styleClass="btn-primary"
                             action="#{bean method to update the content in url}"
                             update="@widgetVar(iframe)"/>


            <p:panel id="iframe" widgetVar="iframe" rendered="#{some rendered condition}" style="display: none;">
                <div class="panel-wrapper">
                    <iframe src="#{bean method to get url}"
                            width="100%"
                            height="15281px"
                            scrolling="no"
                            frameborder="0"></iframe>
                </div>
            </p:panel>
        </h:form>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Yep actually this iframe is initially not visible and I have a postconstruct init method in java which intializes this and then on click of another button I show this iframe. But I want this behavior, after the first time the iframe is rendered I want my next-step button to update the content of url and then using ajax I want to update oinly the iframe. – Ankit Prasad Aug 13 '21 at 13:52
  • Basically whatever I am checking in the rendered condition gets initialised as soon as the page loads with the init function in java – Ankit Prasad Aug 13 '21 at 13:57

0 Answers0