Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to forward a response to a JSF page from Backing Bean?
    primarykey
    data
    text
    <p>Im currently working in a JSF project and stuck with an issue. I have a requirement like,</p> <ol> <li><p>I have a button. Clicking on the button should trigger a dojo dialog box where it will be having a "OK" and "Cancel" button along with an info message. Clicking on the cancel button will close the popup.</p></li> <li><p>Clicking on "OK" button will submit the form in javascript by calling document.formname.submit(). </p></li> </ol> <p>The issue is the on submitting, i need to take the user to another page with the response. I mean forward not Redirect. If i use h:commandButton with action attribute, then the pop up appears and it submits the form without waiting for user action in the popup..</p> <p>I want the fisrt button click should trigger javascript function and that "OK" should submit the form and forwards the response to another page.</p> <p>Please suggest me how can i do this with my xhtml,javascript,backing bean and faces-config. If needed i will post some sample code also.</p> <p>As of now i have like this,</p> <p>xhtml</p> <pre><code>&lt;h:commandButton id="viewBtn" type="button" value="submit" onclick="submidt()"/&gt; </code></pre> <p>js:</p> <pre><code>function submidt() { var h = new dijit.Dialog({ title: "Hello" }); var content = "&lt;input type='button' onclick='document.searchSecurityForm.submit();' value='OK' /&gt;&lt;input type='button' onclick='this.hide();' value='Cancel' /&gt;"; h.attr("content",content); h.show(); } </code></pre> <p>faces-config:</p> <pre><code> &lt;navigation-rule&gt; &lt;from-view-id&gt;/viewpage.xhtml&lt;/from-view-id&gt; &lt;navigation-case&gt; &lt;to-view-id&gt;/editpage.xhtml&lt;/to-view-id&gt; &lt;/navigation-case&gt; &lt;/navigation-rule&gt; </code></pre> <p>so these makes me to stay in the same page(View Page) with the response. I want to make the user to take to edit page.</p> <p>Thanks in advance. goG</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload