Note that there are some explanatory texts on larger screens.

plurals
  1. POGrails and AJAX: Grails form validation working using ModalBox or YUI2 Dialog?
    primarykey
    data
    text
    <p>Several Grails applications, like the one I'm writing, require a /user view and /admin view that are 'dashboards', basically the user or admin lands on that page, possibly after a successful login and all the datatables and tabs are there, so they hardly ever need to navigate off that page, providing a more satisfying users experience, like users of Gmail or Mint have become accustomed.</p> <p>In order to allow searches and form posts from the main /user dashboard, I've been using the modalbox plug-in v0.4 <code>grails install modalbox</code>. Modalbox obviously is managing the GET/POST itself and unfortunately is losing 99% of the validations that the typical constraints block gives you.</p> <p>Working around this for now by replacing g:submitButton, putting some basic JavaScript in the submit as shown. (This is a terrible workaround, of course.)</p> <pre><code>&lt;input type="button" name="create" class="save" onclick="if (!(document.getElementById('name').value === '' || document.getElementById('summary').value === '')) { document.forms[0].submit(); }" value="Create" /&gt; </code></pre> <p><em>But there must be a better way!</em> I've been told to use g:remoteForm, but have not seen a complete enough example to work w/ Modalbox. Maybe folks are using a new window which would automatically close a couple of seconds like Gmail's compose window?</p> <p>This is likely a scenario so common as to be ripe for a SiteMesh template, or at the very least a 'render template:' or even a GSP tag like the modalBox:createLink.</p> <p>Source available <a href="http://code.google.com/p/grails-pollster/source/checkout" rel="nofollow noreferrer">here</a> in Gtown project space.</p>
    singulars
    1. This table or related slice is empty.
    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