Hi,
How to get portlet preferences in grails for liferay .??
I used :
import javax.portlet.*
def renderEdit = {
PortletPreferences pref = RenderRequest.getPreferences()
println pref
['mykey':'myvalue']
}
but getting issue :
No signature of method: static javax.portlet.RenderRequest.getPreferences() is applicable...
hi,
can we call javascript function from g:paginate tag .
I need to call a javascript function when clicked on next page/number .
I'm using like this but no luck :
g:paginate next="Forward" prev="Back" max="100" maxsteps="15" controller="Links" action="list" total="${Links.count()}" onclick="return show_waiting();"/>
function show_w...
I am currently storing Joda DateTime (Datetime+TimeZone) values into a database.
What I want to do grab 24 hours of records based on the timezone of the user, rather than UTC time. I.E. I want to grab the records between 00:00GMT-24:00GMT for people whose timezone is GMT, and 00:00PST-24:00PST for people whose timezone is PST.
Now I do...
I have a form in a .html files where input/select box looks like this
<input type="text" id="txtName" name="txtName" value="##myName##" />
<select id="cbGender" name="cbGender">
<option>Select</option>
<option selected="selected">Male</option>
<option>Female</option>
</select>
I would need to remove '##' value textbox and also up...
Hi, how can I invoke a service directly from a view ? I'm trying with ${my.domain.service.method} but it complains it can't find the property. And no, I don't want to use a controller because the view is a template.
Thanks
...
I'm using the grails navigation plugin and one of the things i want to do is have the menu item have a dynamic number in it for example
static navigation = [
group:'tabs',
order:7,
title:'Mail',
action:'index',
subItems: [
[action:'pending', order:1, title:"Pending"],
[action:'active', order:1...
i'm trying to learn Grails console and had a problem. It looks like this:
When I start grails console in my project WITHOUT starting the project, I can persist data to my postgreSQL database.
However, when I started the project (after a bunch of error messages from netbeans output), I cannot do what I did anymore from Grails console.
...
I've created a Grails (1.2.1) application in SpringSource Tools Suite 2.3.2 and here is my UrlMappings.groovy:
class UrlMappings {
static mappings = {
"/$controller/$action?/$id?"{
constraints {
// apply constraints here
}
}
"/broadcasters/setInterval" { //cause a 404
controller = "broadcas...
If I have a List in a Grails domain class, is there a way to override the addX() and removeX() accessors to it?
In the following example, I'd expect MyObject.addThing(String) to be called twice. In fact, the output is:
Adding thing: thing 2
class MyObject {
static hasMany = [things: String]
List things = []
void addT...
I'm having some problems getting a many-to-many relationship working in grails. Is there anything obviously wrong with the following:
class Person {
static hasMany = [friends: Person]
static mappedBy = [friends: 'friends']
String name
List friends = []
String toString() {
return this.name
}
}
class Bo...
How can I achieve the following:
I have a boolean stored in my Domain, by default Grails creates a checkbox as a control. I want a select control with values : Active/Inactive.
On selecting Active the value True should be passed
and
On selecting InActive the value False should be passed.
How can I achieve this using
<g:select name=...
I have recently started a new project using the maven grails archetype - at the time, (a few weeks ago), Grails 1.2.0 was the most recent release. Now that there's a newer release, what are the steps to upgrade? I would assume that since Grails dependencies are defined in the POM, that the POM will need to be updated? Are there any instr...
I want a grails service to be able to access Domain static methods, for queries, etc.
For example, in a controller, I can call
IncomingCall.count()
to get the number of records in table "IncomingCall"
but if I try to do this from inside a service, I get the error:
org.springframework.beans.factory.BeanCreationException: Error creat...
"404" (controller: 'error', action: 'pageNotFound')
Any changes to response.status inside the pageNotFound action is reverted back to 404 before the response is sent to the client. Is it possible to work around this some way? I would like to be able to change it to 410 when I detect that the resource has been deleted or 301 when it's m...
I have made an grailsapplication. Now i have to make it complaint with the REST protocol. how do i do this ? can i get any material where i have examples of how to carry out this process ??groovygrails
...
I am starting to write some code for A/B testing in a Grails web application. I want to ensure that requests from the same IP address always see the same variation. Rather than store a map of IP->variant, is it OK to simply turn the IP address into an integer by removing the dots, then use that as the seed for a random number generator...
Hi, I have a collection of checkboxes loaded from a table that are loaded in a gsp (via a controller). Are there any best practices in grails to display them and process them once the form is submitted ? I wouldn't like to use the "manual" approach (i.e, composing the checkboxxes'id with the table row's id).
Thanks
...
I have a problem with the mapping of Oracle Float double precision datatype to Java Double datatype. The hibernate schema validator seems to fail when the Java Double datatype is used.
org.hibernate.HibernateException: Wrong column type in DB.TABLE for column amount. Found: float, expected: double precision
The only way to avoid this ...
Hi, In a controller, I have populated a map that has a string as key and a list as value; in the gsp, I try to show them like this:
<g:each in="${sector}" var="entry" >
<br/>${entry.key}<br/>
<g:each in="${entry.value}" var="item" >
${item.name}<br/>
</g:each>
</g:each>
The problem is that item is considered as string, so I ...
I'm playing around with Google Analytics goals / funnels. I would like to use this to track a checkout process, but the web flow urls are formated in a way that makes this very hard.
Would it be possible to change:
http://localhost:8080/checkout/checkout?execution=e1s2
.. into something more like this:
http://localhost:8080/checkout/ch...