Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to launch jquery modal popup in Struts2 tiles?
    primarykey
    data
    text
    <p>I'm developing a shopping cart application. In my application has customer registration form. I'm using Struts2 tiles. When the client clicks Register button, my application pops up a jquery model window. In my <code>NewUser.java</code> action class overridden the <code>validate()</code> method of <code>ActionSupport</code> class. If the email field is empty, How do I popup the register form with field error.</p> <p><strong>My action class:</strong></p> <pre><code>@Override public void validate() { if (customer.getEmail().equals("")) { addFieldError("email", "First Name is Required."); } } </code></pre> <p><hr/><strong>My popup window:</strong></p> <pre><code>&lt;div id="register" class="modal hide fade" tabindex="-1"&gt; &lt;form action="CustomerAdd"&gt; &lt;label class="control-label" for="email"&gt;Email address&lt;/label&gt; &lt;div class="controls"&gt; &lt;s:textfield name="customer.email" cssClass="input-xlarge"/&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;a href="#register" class="btn btn-small" data-toggle="modal"&gt; Register now &amp;nbsp; &lt;i class="icon-chevron-right"&gt;&lt;/i&gt; &lt;/a&gt; </code></pre> <p><hr/><strong>Struts2 action:</strong></p> <pre><code> &lt;action name="CustomerAdd" class="com.shopping.op.customer.CustomerAdd"&gt; &lt;result name="success" type="tiles"&gt;success_customer&lt;/result&gt; &lt;result name="failed" type="tiles"&gt;failed_customer&lt;/result&gt; &lt;result name="not_available" type="tiles"&gt;user_already_added&lt;/result&gt; &lt;result name="input" type="tiles"&gt;validate_customer&lt;/result&gt; &lt;/action&gt; </code></pre> <p><hr/><strong>tiles definition:</strong></p> <pre><code>&lt;definition name="validate_customer" extends="baselayout"&gt; &lt;put-attribute name="opr" value="/customer/customer.jsp"/&gt; &lt;put-attribute name="body" value="/login.jsp"/&gt;&lt;!--This page has the Register button--&gt; &lt;/definition&gt; </code></pre> <p><hr/> Thanks in Advance!</p>
    singulars
    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