gsp

Grails richui autocomplete for cloned textbox

此生再无相见时 提交于 2020-01-24 09:44:45
问题 I am using grails richui autocomplete field in my app. It works fine for my static textbox but when I clone the textbox this feature is not working for the cloned textboxes and it shows no error even. Any idea of how to fix this Here is my code: <resource:autoComplete skin="default" /> at top <richui:autoComplete name="filterLocation1" id="filterLocation1" delimChar=";" class="location_txtbox" action="${createLinkTo('dir': 'abc/yyy')}" style="margin-left:5px;"/> This is my autocomplete field

How do I save a composite field value in Grails GSP?

╄→гoц情女王★ 提交于 2020-01-23 17:39:05
问题 I have a composite domain object as follows: class Person { static embedded = ['forSale'] Boolean isSelling House forSale } class House { Integer numBedrooms } I have a select control for the numBedrooms as follows: <tr class="prop"> <td valign="top" class="name"> <label for="numBedrooms"><g:message code="person.numBedrooms.label" default="Num Bedrooms" /></label> </td> <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'forSale.numBedrooms', 'errors')}"> <g:select name=

Grails actions getting called twice. Help!

爷,独闯天下 提交于 2020-01-23 03:20:08
问题 I'm writing a grails app and running into a strange problem. When clicking the submit button on a page, the associated action gets called twice in rapid succession. This causes everything to break horribly. Has anyone else seen this issue before? Below is my code: From the GSP page: <g:form method="post" action="show"> <h2>All items since...</h2> <g:datePicker name="startDate" precision="day" value="${new Date()}" /><br/> <h2>Format</h2> <g:radio name="feedType" value="RSS1" checked="true"/>

How do you pass a JavaScript variable to your Groovy controller?

橙三吉。 提交于 2020-01-14 02:53:31
问题 I have been searching on Google for a really good while, and I cannot find a solution to this problem. I am trying to access a JavaScript variable from my GSP file in my Groovy controller, but I can't find out how to do this. Example: //JavaScript stuff <script> function validateForm(){ var ret = false } </script> //Groovy controller stuff def myAction = { println params.ret } How do I achieve something similar to this? 回答1: Two ways to pass a variable to the controller: Ajax Form submit Ajax

how to debug a gsp page? (no grails, just gsp)

帅比萌擦擦* 提交于 2020-01-13 10:29:12
问题 I've tried with netbeans and eclipse, with no luck... (coudn't try IntelliJ idea) I gave a quick look ant the code http://kickjava.com/src/groovy/servlet/TemplateServlet.java.htm and it gives me the impression that .gsp pages are translated to .groovy servlets (groovlets) in memory (I might be wrong)... so perhaps it's not so easy to debug gsp as I though... so, can anybody tell me how to do it? pd: By debugging I mean things like browsing the code step-by-step, inspecting variables, adding

Grails Render Template Different Controller/Path

泪湿孤枕 提交于 2020-01-13 07:44:26
问题 I have a template that exists under views/dashboard/_myTemplate.gsp and from the DashboardController I can simply call render template:'myTemplate' and all is well. I have a need to render this template from a different controller but the render method doesn't allow you to specify a controller and I can't seem to figure out how to define the path at which the template exists for the render to work correctly. Is this even possible? 回答1: You do it by controller name: render(template:'/dashboard

remove & add select box option if other selection changes

徘徊边缘 提交于 2020-01-11 14:24:47
问题 I have 3 select boxes and all are having same value (clones) & created on change of reference table selection. now i want to manage the selection on the three Constraint dropdown so that it 'Does not show the selected one in other two' and user cant select the same from two. how to do it in jquery? Code is - <tr> <td> Reference Table:</td> <td> <select id="tableCombo" onchange="jQuery.ajax({type:'POST',data:'tableCombo=' + this.value, url:'/GryphonMonitor /load/getColumns',success:function

Grails empty entry into the database

拥有回忆 提交于 2020-01-07 09:24:09
问题 I have been struggling with trying to create/save multiple instances at once in Grails, now I am almost there with the following code but when I hit save an empty row of options is created, can anyone help me with this please see these two questions to see what I want to achieve How to save multiple object from one view using Grails Grails one to many relationship view <g:textField name="question" value="${multipleChoiceQuestionInstance?.question}"/><br/> <div class="fieldcontain ${hasErrors

Grails form creation for many-to-one belongsTo

若如初见. 提交于 2020-01-07 06:38:30
问题 I am a beginner in grails and I have a basic question. I want to display a list of instances of a parent class in the child class form creation. My Domain class are as follows. The Parent class is the Company. class Company { String name static constraints = { name(blank:false) } String toString(){name} } My Child Class is the Location of the company. class Location { String name String address static belongsTo= {companyLocation:Company} static constraints = { name(blank: false) address blank

How to bind Byte array saved in SQL DB to Image tag in GSP in a DataGrid?

北战南征 提交于 2020-01-03 05:15:30
问题 I have domain property of Type Byte[]. byte[] photos byte[] video On GSP Page I am able to upload my files in SQL DB successfully. When I view the page to see list of elements in a row, my action of controller does the job , how do I set the image source to this Byte array retrieved from DB. I hope my question is clear. After following the instructions, here is what I did.. def displayGraph() { //def img = params.id // byte array def classified = Classified.findById(params.id) byte[]